tasmota-webserial-esptool 6.0.2 → 6.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.devcontainer/devcontainer.json +13 -13
- package/.github/workflows/build_upload.yml +6 -7
- package/.github/workflows/ci.yml +2 -1
- package/README.md +1 -5
- package/css/dark.css +6 -4
- package/css/light.css +5 -2
- package/dist/const.d.ts +35 -1
- package/dist/const.js +82 -1
- package/dist/esp_loader.js +17 -5
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/stubs/esp32.json +7 -1
- package/dist/stubs/esp32c2.json +7 -0
- package/dist/stubs/esp32c3.json +7 -1
- package/dist/stubs/esp32c6.json +7 -0
- package/dist/stubs/esp32h2.json +7 -0
- package/dist/stubs/esp32s2.json +7 -1
- package/dist/stubs/esp32s3.json +7 -1
- package/dist/stubs/esp8266.json +7 -1
- package/dist/stubs/index.js +10 -1
- package/dist/web/esp32-165a50ff.js +1 -0
- package/dist/web/esp32c2-895e50a1.js +1 -0
- package/dist/web/esp32c3-dc0915b5.js +1 -0
- package/dist/web/esp32c6-2dda1f55.js +1 -0
- package/dist/web/esp32h2-064ce7cf.js +1 -0
- package/dist/web/esp32s2-ffc43e14.js +1 -0
- package/dist/web/esp32s3-857df8a8.js +1 -0
- package/dist/web/esp8266-a8241797.js +1 -0
- package/dist/web/index.js +1 -1
- package/index.html +1 -1
- package/js/modules/esp32-165a50ff.js +1 -0
- package/js/modules/esp32c2-895e50a1.js +1 -0
- package/js/modules/esp32c3-dc0915b5.js +1 -0
- package/js/modules/esp32c6-2dda1f55.js +1 -0
- package/js/modules/esp32h2-064ce7cf.js +1 -0
- package/js/modules/esp32s2-ffc43e14.js +1 -0
- package/js/modules/esp32s3-857df8a8.js +1 -0
- package/js/modules/esp8266-a8241797.js +1 -0
- package/js/modules/esptool.js +1 -1
- package/js/script.js +3 -3
- package/js/utilities.js +132 -98
- package/license.md +0 -1
- package/package.json +9 -9
- package/rollup.config.js +1 -1
- package/script/build +4 -0
- package/src/const.ts +88 -3
- package/src/esp_loader.ts +68 -53
- package/src/index.ts +1 -0
- package/src/stubs/esp32.json +7 -1
- package/src/stubs/esp32c2.json +7 -1
- package/src/stubs/esp32c3.json +7 -1
- package/src/stubs/esp32c6.json +7 -0
- package/src/stubs/esp32h2.json +7 -1
- package/src/stubs/esp32s2.json +7 -1
- package/src/stubs/esp32s3.json +7 -1
- package/src/stubs/esp8266.json +7 -1
- package/src/stubs/index.ts +10 -1
- package/dist/web/esp32-a2dcbc2e.js +0 -1
- package/dist/web/esp32c3-18e9678b.js +0 -1
- package/dist/web/esp32s2-3109ccc6.js +0 -1
- package/dist/web/esp32s3-c1dbd867.js +0 -1
- package/dist/web/esp8266-144419c0.js +0 -1
- package/js/esptool.js +0 -1292
- package/js/modules/esp32-a2dcbc2e.js +0 -1
- package/js/modules/esp32c3-18e9678b.js +0 -1
- package/js/modules/esp32s2-3109ccc6.js +0 -1
- package/js/modules/esp32s3-c1dbd867.js +0 -1
- package/js/modules/esp8266-144419c0.js +0 -1
- package/script/stubgen.py +0 -47
- package/stubs/esp32.json +0 -7
- package/stubs/esp32c2.json +0 -1
- package/stubs/esp32c3.json +0 -7
- package/stubs/esp32c6.json +0 -7
- package/stubs/esp32h2.json +0 -1
- package/stubs/esp32s2.json +0 -7
- package/stubs/esp32s3.json +0 -7
- package/stubs/esp8266.json +0 -7
package/js/utilities.js
CHANGED
|
@@ -6,7 +6,7 @@ function toByteArray(str) {
|
|
|
6
6
|
let byteArray = [];
|
|
7
7
|
for (let i = 0; i < str.length; i++) {
|
|
8
8
|
let charcode = str.charCodeAt(i);
|
|
9
|
-
if (charcode <=
|
|
9
|
+
if (charcode <= 0xff) {
|
|
10
10
|
byteArray.push(charcode);
|
|
11
11
|
}
|
|
12
12
|
}
|
|
@@ -17,132 +17,166 @@ function fromByteArray(byteArray) {
|
|
|
17
17
|
return String.fromCharCode.apply(String, byteArray);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
function crc32(data, value=0) {
|
|
20
|
+
function crc32(data, value = 0) {
|
|
21
21
|
if (data instanceof Array) {
|
|
22
22
|
data = fromByteArray(data);
|
|
23
23
|
}
|
|
24
24
|
let table = [];
|
|
25
|
-
for(let entry, c = 0; c < 256; c++) {
|
|
25
|
+
for (let entry, c = 0; c < 256; c++) {
|
|
26
26
|
entry = c;
|
|
27
|
-
for(let k = 0; k < 8; k++) {
|
|
28
|
-
entry = 1 & entry ? 3988292384^entry >>> 1 : entry >>> 1;
|
|
27
|
+
for (let k = 0; k < 8; k++) {
|
|
28
|
+
entry = 1 & entry ? 3988292384 ^ (entry >>> 1) : entry >>> 1;
|
|
29
29
|
}
|
|
30
30
|
table[c] = entry;
|
|
31
31
|
}
|
|
32
32
|
let n = -1 - value;
|
|
33
|
-
for(let t = 0; t < data.length; t++) {
|
|
34
|
-
n = n >>> 8^table[255 & (n^data.charCodeAt(t))];
|
|
33
|
+
for (let t = 0; t < data.length; t++) {
|
|
34
|
+
n = (n >>> 8) ^ table[255 & (n ^ data.charCodeAt(t))];
|
|
35
35
|
}
|
|
36
36
|
return (-1 ^ n) >>> 0;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
function zipLongest() {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
var args = [].slice.call(arguments);
|
|
41
|
+
var longest = args.reduce(function (a, b) {
|
|
42
|
+
return a.length > b.length ? a : b;
|
|
43
|
+
}, []);
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
return longest.map(function (_, i) {
|
|
46
|
+
return args.map(function (array) {
|
|
47
|
+
return array[i];
|
|
47
48
|
});
|
|
49
|
+
});
|
|
48
50
|
}
|
|
49
51
|
|
|
50
52
|
class struct {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
53
|
+
static lut = {
|
|
54
|
+
b: {
|
|
55
|
+
u: DataView.prototype.getInt8,
|
|
56
|
+
p: DataView.prototype.setInt8,
|
|
57
|
+
bytes: 1,
|
|
58
|
+
},
|
|
59
|
+
B: {
|
|
60
|
+
u: DataView.prototype.getUint8,
|
|
61
|
+
p: DataView.prototype.setUint8,
|
|
62
|
+
bytes: 1,
|
|
63
|
+
},
|
|
64
|
+
h: {
|
|
65
|
+
u: DataView.prototype.getInt16,
|
|
66
|
+
p: DataView.prototype.setInt16,
|
|
67
|
+
bytes: 2,
|
|
68
|
+
},
|
|
69
|
+
H: {
|
|
70
|
+
u: DataView.prototype.getUint16,
|
|
71
|
+
p: DataView.prototype.setUint16,
|
|
72
|
+
bytes: 2,
|
|
73
|
+
},
|
|
74
|
+
i: {
|
|
75
|
+
u: DataView.prototype.getInt32,
|
|
76
|
+
p: DataView.prototype.setInt32,
|
|
77
|
+
bytes: 4,
|
|
78
|
+
},
|
|
79
|
+
I: {
|
|
80
|
+
u: DataView.prototype.getUint32,
|
|
81
|
+
p: DataView.prototype.setUint32,
|
|
82
|
+
bytes: 4,
|
|
83
|
+
},
|
|
84
|
+
q: {
|
|
85
|
+
u: DataView.prototype.getInt64,
|
|
86
|
+
p: DataView.prototype.setInt64,
|
|
87
|
+
bytes: 8,
|
|
88
|
+
},
|
|
89
|
+
Q: {
|
|
90
|
+
u: DataView.prototype.getUint64,
|
|
91
|
+
p: DataView.prototype.setUint64,
|
|
92
|
+
bytes: 8,
|
|
93
|
+
},
|
|
94
|
+
};
|
|
82
95
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
96
|
+
static pack(...args) {
|
|
97
|
+
let format = args[0];
|
|
98
|
+
let pointer = 0;
|
|
99
|
+
let data = args.slice(1);
|
|
100
|
+
if (format.replace(/[<>]/, "").length != data.length) {
|
|
101
|
+
throw "Pack format to Argument count mismatch";
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
let bytes = [];
|
|
105
|
+
let littleEndian = true;
|
|
106
|
+
for (let i = 0; i < format.length; i++) {
|
|
107
|
+
if (format[i] == "<") {
|
|
108
|
+
littleEndian = true;
|
|
109
|
+
} else if (format[i] == ">") {
|
|
110
|
+
littleEndian = false;
|
|
111
|
+
} else {
|
|
112
|
+
pushBytes(format[i], data[pointer]);
|
|
113
|
+
pointer++;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
95
116
|
|
|
96
|
-
|
|
97
|
-
|
|
117
|
+
function pushBytes(formatChar, value) {
|
|
118
|
+
if (!(formatChar in struct.lut)) {
|
|
119
|
+
throw "Unhandled character '" + formatChar + "' in pack format";
|
|
120
|
+
}
|
|
121
|
+
let dataSize = struct.lut[formatChar].bytes;
|
|
122
|
+
let view = new DataView(new ArrayBuffer(dataSize));
|
|
123
|
+
let dataViewFn = struct.lut[formatChar].p.bind(view);
|
|
124
|
+
dataViewFn(0, value, littleEndian);
|
|
125
|
+
for (let i = 0; i < dataSize; i++) {
|
|
126
|
+
bytes.push(view.getUint8(i));
|
|
127
|
+
}
|
|
128
|
+
}
|
|
98
129
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
let data = [];
|
|
102
|
-
let littleEndian = true;
|
|
130
|
+
return bytes;
|
|
131
|
+
}
|
|
103
132
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
littleEndian = false;
|
|
109
|
-
} else {
|
|
110
|
-
pushData(c);
|
|
111
|
-
}
|
|
112
|
-
}
|
|
133
|
+
static unpack(format, bytes) {
|
|
134
|
+
let pointer = 0;
|
|
135
|
+
let data = [];
|
|
136
|
+
let littleEndian = true;
|
|
113
137
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
let dataViewFn = struct.lut[formatChar].u.bind(view);
|
|
124
|
-
data.push(dataViewFn(0, littleEndian));
|
|
125
|
-
pointer += dataSize;
|
|
126
|
-
}
|
|
138
|
+
for (let c of format) {
|
|
139
|
+
if (c == "<") {
|
|
140
|
+
littleEndian = true;
|
|
141
|
+
} else if (c == ">") {
|
|
142
|
+
littleEndian = false;
|
|
143
|
+
} else {
|
|
144
|
+
pushData(c);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
127
147
|
|
|
128
|
-
|
|
129
|
-
|
|
148
|
+
function pushData(formatChar) {
|
|
149
|
+
if (!(formatChar in struct.lut)) {
|
|
150
|
+
throw "Unhandled character '" + formatChar + "' in unpack format";
|
|
151
|
+
}
|
|
152
|
+
let dataSize = struct.lut[formatChar].bytes;
|
|
153
|
+
let view = new DataView(new ArrayBuffer(dataSize));
|
|
154
|
+
for (let i = 0; i < dataSize; i++) {
|
|
155
|
+
view.setUint8(i, bytes[pointer + i] & 0xff);
|
|
156
|
+
}
|
|
157
|
+
let dataViewFn = struct.lut[formatChar].u.bind(view);
|
|
158
|
+
data.push(dataViewFn(0, littleEndian));
|
|
159
|
+
pointer += dataSize;
|
|
160
|
+
}
|
|
130
161
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
for (let i = 0; i < format.length; i++) {
|
|
134
|
-
if (format[i] != "<" && format[i] != ">") {
|
|
135
|
-
size += struct.lut[format[i]].bytes;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
162
|
+
return data;
|
|
163
|
+
}
|
|
138
164
|
|
|
139
|
-
|
|
165
|
+
static calcsize(format) {
|
|
166
|
+
let size = 0;
|
|
167
|
+
for (let i = 0; i < format.length; i++) {
|
|
168
|
+
if (format[i] != "<" && format[i] != ">") {
|
|
169
|
+
size += struct.lut[format[i]].bytes;
|
|
170
|
+
}
|
|
140
171
|
}
|
|
172
|
+
|
|
173
|
+
return size;
|
|
174
|
+
}
|
|
141
175
|
}
|
|
142
176
|
|
|
143
177
|
function* makeFileIterator(content) {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
178
|
+
for (let line of content.split(/\r?\n/)) {
|
|
179
|
+
yield line.trim();
|
|
180
|
+
}
|
|
181
|
+
return "";
|
|
148
182
|
}
|
package/license.md
CHANGED
|
@@ -9,4 +9,3 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
|
9
9
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
10
10
|
|
|
11
11
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
12
|
-
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tasmota-webserial-esptool",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.1.1",
|
|
4
4
|
"description": "Flash ESP devices using WebSerial",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"repository": {
|
|
@@ -18,19 +18,19 @@
|
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"@rollup/plugin-json": "^6.0.0",
|
|
21
|
-
"@rollup/plugin-node-resolve": "^15.
|
|
21
|
+
"@rollup/plugin-node-resolve": "^15.2.1",
|
|
22
22
|
"@rollup/plugin-terser": "^0.4.3",
|
|
23
|
-
"@rollup/plugin-typescript": "^11.1.
|
|
23
|
+
"@rollup/plugin-typescript": "^11.1.3",
|
|
24
24
|
"@types/pako": "^2.0.0",
|
|
25
25
|
"@types/w3c-web-serial": "^1.0.3",
|
|
26
|
-
"prettier": "^
|
|
27
|
-
"rollup": "^3.
|
|
28
|
-
"serve": "^14.2.
|
|
29
|
-
"typescript": "^5.
|
|
26
|
+
"prettier": "^3.0.3",
|
|
27
|
+
"rollup": "^3.29.2",
|
|
28
|
+
"serve": "^14.2.1",
|
|
29
|
+
"typescript": "^5.2.2"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@types/node": "^20.2
|
|
32
|
+
"@types/node": "^20.6.2",
|
|
33
33
|
"pako": "^2.1.0",
|
|
34
|
-
"tslib": "^2.
|
|
34
|
+
"tslib": "^2.6.2"
|
|
35
35
|
}
|
|
36
36
|
}
|
package/rollup.config.js
CHANGED
package/script/build
CHANGED
package/src/const.ts
CHANGED
|
@@ -102,6 +102,18 @@ export const ESP32S3_SPI_W0_OFFS = 0x58;
|
|
|
102
102
|
export const ESP32S3_UART_DATE_REG_ADDR = 0x60000080;
|
|
103
103
|
export const ESP32S3_BOOTLOADER_FLASH_OFFSET = 0x0;
|
|
104
104
|
|
|
105
|
+
export const ESP32C2_SPI_REG_BASE = 0x60002000;
|
|
106
|
+
export const ESP32C2_BASEFUSEADDR = 0x60008800;
|
|
107
|
+
export const ESP32C2_MACFUSEADDR = 0x60008800 + 0x044;
|
|
108
|
+
export const ESP32C2_SPI_USR_OFFS = 0x18;
|
|
109
|
+
export const ESP32C2_SPI_USR1_OFFS = 0x1c;
|
|
110
|
+
export const ESP32C2_SPI_USR2_OFFS = 0x20;
|
|
111
|
+
export const ESP32C2_SPI_MOSI_DLEN_OFFS = 0x24;
|
|
112
|
+
export const ESP32C2_SPI_MISO_DLEN_OFFS = 0x28;
|
|
113
|
+
export const ESP32C2_SPI_W0_OFFS = 0x58;
|
|
114
|
+
export const ESP32C2_UART_DATE_REG_ADDR = 0x6000007c;
|
|
115
|
+
export const ESP32C2_BOOTLOADER_FLASH_OFFSET = 0x0;
|
|
116
|
+
|
|
105
117
|
export const ESP32C3_SPI_REG_BASE = 0x60002000;
|
|
106
118
|
export const ESP32C3_BASEFUSEADDR = 0x60008800;
|
|
107
119
|
export const ESP32C3_MACFUSEADDR = 0x60008800 + 0x044;
|
|
@@ -114,6 +126,30 @@ export const ESP32C3_SPI_W0_OFFS = 0x58;
|
|
|
114
126
|
export const ESP32C3_UART_DATE_REG_ADDR = 0x6000007c;
|
|
115
127
|
export const ESP32C3_BOOTLOADER_FLASH_OFFSET = 0x0;
|
|
116
128
|
|
|
129
|
+
export const ESP32C6_SPI_REG_BASE = 0x60003000;
|
|
130
|
+
export const ESP32C6_BASEFUSEADDR = 0x600b0800;
|
|
131
|
+
export const ESP32C6_MACFUSEADDR = 0x600b0800 + 0x044;
|
|
132
|
+
export const ESP32C6_SPI_USR_OFFS = 0x18;
|
|
133
|
+
export const ESP32C6_SPI_USR1_OFFS = 0x1c;
|
|
134
|
+
export const ESP32C6_SPI_USR2_OFFS = 0x20;
|
|
135
|
+
export const ESP32C6_SPI_MOSI_DLEN_OFFS = 0x24;
|
|
136
|
+
export const ESP32C6_SPI_MISO_DLEN_OFFS = 0x28;
|
|
137
|
+
export const ESP32C6_SPI_W0_OFFS = 0x58;
|
|
138
|
+
export const ESP32C6_UART_DATE_REG_ADDR = 0x6000007c;
|
|
139
|
+
export const ESP32C6_BOOTLOADER_FLASH_OFFSET = 0x0;
|
|
140
|
+
|
|
141
|
+
export const ESP32H2_SPI_REG_BASE = 0x60002000;
|
|
142
|
+
export const ESP32H2_BASEFUSEADDR = 0x6001a000;
|
|
143
|
+
export const ESP32H2_MACFUSEADDR = 0x6001a000 + 0x044;
|
|
144
|
+
export const ESP32H2_SPI_USR_OFFS = 0x18;
|
|
145
|
+
export const ESP32H2_SPI_USR1_OFFS = 0x1c;
|
|
146
|
+
export const ESP32H2_SPI_USR2_OFFS = 0x20;
|
|
147
|
+
export const ESP32H2_SPI_MOSI_DLEN_OFFS = 0x24;
|
|
148
|
+
export const ESP32H2_SPI_MISO_DLEN_OFFS = 0x28;
|
|
149
|
+
export const ESP32H2_SPI_W0_OFFS = 0x58;
|
|
150
|
+
export const ESP32H2_UART_DATE_REG_ADDR = 0x6000007c;
|
|
151
|
+
export const ESP32H2_BOOTLOADER_FLASH_OFFSET = 0x0;
|
|
152
|
+
|
|
117
153
|
export interface SpiFlashAddresses {
|
|
118
154
|
regBase: number;
|
|
119
155
|
baseFuse: number;
|
|
@@ -129,7 +165,7 @@ export interface SpiFlashAddresses {
|
|
|
129
165
|
}
|
|
130
166
|
|
|
131
167
|
export const SYNC_PACKET = toByteArray(
|
|
132
|
-
"\x07\x07\x12 UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU"
|
|
168
|
+
"\x07\x07\x12 UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU",
|
|
133
169
|
);
|
|
134
170
|
export const CHIP_DETECT_MAGIC_REG_ADDR = 0x40001000;
|
|
135
171
|
// These values for the families are made up; nothing that esptool uses.
|
|
@@ -137,6 +173,7 @@ export const CHIP_FAMILY_ESP8266 = 0x8266;
|
|
|
137
173
|
export const CHIP_FAMILY_ESP32 = 0x32;
|
|
138
174
|
export const CHIP_FAMILY_ESP32S2 = 0x3252;
|
|
139
175
|
export const CHIP_FAMILY_ESP32S3 = 0x3253;
|
|
176
|
+
export const CHIP_FAMILY_ESP32C2 = 0x32c2;
|
|
140
177
|
export const CHIP_FAMILY_ESP32C3 = 0x32c3;
|
|
141
178
|
export const CHIP_FAMILY_ESP32C6 = 0x32c6;
|
|
142
179
|
export const CHIP_FAMILY_ESP32H2 = 0x3272;
|
|
@@ -145,6 +182,7 @@ export type ChipFamily =
|
|
|
145
182
|
| typeof CHIP_FAMILY_ESP32
|
|
146
183
|
| typeof CHIP_FAMILY_ESP32S2
|
|
147
184
|
| typeof CHIP_FAMILY_ESP32S3
|
|
185
|
+
| typeof CHIP_FAMILY_ESP32C2
|
|
148
186
|
| typeof CHIP_FAMILY_ESP32C3
|
|
149
187
|
| typeof CHIP_FAMILY_ESP32C6
|
|
150
188
|
| typeof CHIP_FAMILY_ESP32H2;
|
|
@@ -162,10 +200,15 @@ export const CHIP_DETECT_MAGIC_VALUES: ChipInfo = {
|
|
|
162
200
|
0x000007c6: { name: "ESP32-S2", family: CHIP_FAMILY_ESP32S2 },
|
|
163
201
|
0x9: { name: "ESP32-S3", family: CHIP_FAMILY_ESP32S3 },
|
|
164
202
|
0xeb004136: { name: "ESP32-S3(beta2)", family: CHIP_FAMILY_ESP32S3 },
|
|
203
|
+
0x6f51306f: { name: "ESP32-C2", family: CHIP_FAMILY_ESP32C2 },
|
|
204
|
+
0x7c41a06f: { name: "ESP32-C2", family: CHIP_FAMILY_ESP32C2 },
|
|
165
205
|
0x6921506f: { name: "ESP32-C3", family: CHIP_FAMILY_ESP32C3 },
|
|
166
206
|
0x1b31506f: { name: "ESP32-C3", family: CHIP_FAMILY_ESP32C3 },
|
|
167
|
-
|
|
207
|
+
0x4881606f: { name: "ESP32-C3", family: CHIP_FAMILY_ESP32C3 },
|
|
208
|
+
0x4361606f: { name: "ESP32-C3", family: CHIP_FAMILY_ESP32C3 },
|
|
209
|
+
0xd7b73e80: { name: "ESP32-H2", family: CHIP_FAMILY_ESP32H2 },
|
|
168
210
|
0x0da1806f: { name: "ESP32-C6(beta)", family: CHIP_FAMILY_ESP32C6 },
|
|
211
|
+
0x2ce0806f: { name: "ESP32-C6", family: CHIP_FAMILY_ESP32C6 },
|
|
169
212
|
};
|
|
170
213
|
|
|
171
214
|
// Commands supported by ESP8266 ROM bootloader
|
|
@@ -217,7 +260,7 @@ export const timeoutPerMb = (secondsPerMb: number, sizeBytes: number) => {
|
|
|
217
260
|
};
|
|
218
261
|
|
|
219
262
|
export const getSpiFlashAddresses = (
|
|
220
|
-
chipFamily: ChipFamily
|
|
263
|
+
chipFamily: ChipFamily,
|
|
221
264
|
): SpiFlashAddresses => {
|
|
222
265
|
switch (chipFamily) {
|
|
223
266
|
case CHIP_FAMILY_ESP32:
|
|
@@ -276,6 +319,20 @@ export const getSpiFlashAddresses = (
|
|
|
276
319
|
uartDateReg: ESP8266_UART_DATE_REG_ADDR,
|
|
277
320
|
flashOffs: ESP8266_BOOTLOADER_FLASH_OFFSET,
|
|
278
321
|
};
|
|
322
|
+
case CHIP_FAMILY_ESP32C2:
|
|
323
|
+
return {
|
|
324
|
+
regBase: ESP32C2_SPI_REG_BASE,
|
|
325
|
+
baseFuse: ESP32C2_BASEFUSEADDR,
|
|
326
|
+
macFuse: ESP32C2_MACFUSEADDR,
|
|
327
|
+
usrOffs: ESP32C2_SPI_USR_OFFS,
|
|
328
|
+
usr1Offs: ESP32C2_SPI_USR1_OFFS,
|
|
329
|
+
usr2Offs: ESP32C2_SPI_USR2_OFFS,
|
|
330
|
+
mosiDlenOffs: ESP32C2_SPI_MOSI_DLEN_OFFS,
|
|
331
|
+
misoDlenOffs: ESP32C2_SPI_MISO_DLEN_OFFS,
|
|
332
|
+
w0Offs: ESP32C2_SPI_W0_OFFS,
|
|
333
|
+
uartDateReg: ESP32C2_UART_DATE_REG_ADDR,
|
|
334
|
+
flashOffs: ESP32C2_BOOTLOADER_FLASH_OFFSET,
|
|
335
|
+
};
|
|
279
336
|
case CHIP_FAMILY_ESP32C3:
|
|
280
337
|
return {
|
|
281
338
|
regBase: ESP32C3_SPI_REG_BASE,
|
|
@@ -290,6 +347,34 @@ export const getSpiFlashAddresses = (
|
|
|
290
347
|
uartDateReg: ESP32C3_UART_DATE_REG_ADDR,
|
|
291
348
|
flashOffs: ESP32C3_BOOTLOADER_FLASH_OFFSET,
|
|
292
349
|
};
|
|
350
|
+
case CHIP_FAMILY_ESP32C6:
|
|
351
|
+
return {
|
|
352
|
+
regBase: ESP32C6_SPI_REG_BASE,
|
|
353
|
+
baseFuse: ESP32C6_BASEFUSEADDR,
|
|
354
|
+
macFuse: ESP32C6_MACFUSEADDR,
|
|
355
|
+
usrOffs: ESP32C6_SPI_USR_OFFS,
|
|
356
|
+
usr1Offs: ESP32C6_SPI_USR1_OFFS,
|
|
357
|
+
usr2Offs: ESP32C6_SPI_USR2_OFFS,
|
|
358
|
+
mosiDlenOffs: ESP32C6_SPI_MOSI_DLEN_OFFS,
|
|
359
|
+
misoDlenOffs: ESP32C6_SPI_MISO_DLEN_OFFS,
|
|
360
|
+
w0Offs: ESP32C6_SPI_W0_OFFS,
|
|
361
|
+
uartDateReg: ESP32C6_UART_DATE_REG_ADDR,
|
|
362
|
+
flashOffs: ESP32C6_BOOTLOADER_FLASH_OFFSET,
|
|
363
|
+
};
|
|
364
|
+
case CHIP_FAMILY_ESP32H2:
|
|
365
|
+
return {
|
|
366
|
+
regBase: ESP32H2_SPI_REG_BASE,
|
|
367
|
+
baseFuse: ESP32H2_BASEFUSEADDR,
|
|
368
|
+
macFuse: ESP32H2_MACFUSEADDR,
|
|
369
|
+
usrOffs: ESP32H2_SPI_USR_OFFS,
|
|
370
|
+
usr1Offs: ESP32H2_SPI_USR1_OFFS,
|
|
371
|
+
usr2Offs: ESP32H2_SPI_USR2_OFFS,
|
|
372
|
+
mosiDlenOffs: ESP32H2_SPI_MOSI_DLEN_OFFS,
|
|
373
|
+
misoDlenOffs: ESP32H2_SPI_MISO_DLEN_OFFS,
|
|
374
|
+
w0Offs: ESP32H2_SPI_W0_OFFS,
|
|
375
|
+
uartDateReg: ESP32H2_UART_DATE_REG_ADDR,
|
|
376
|
+
flashOffs: ESP32H2_BOOTLOADER_FLASH_OFFSET,
|
|
377
|
+
};
|
|
293
378
|
default:
|
|
294
379
|
return {
|
|
295
380
|
regBase: -1,
|