You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+13-17
Original file line number
Diff line number
Diff line change
@@ -1,19 +1,15 @@
1
1
# esp32-serprog
2
-
a minimal flashrom/serprog SPI programmer implementation for esp32 family, inspired by [pico-serprog](https://github.com/stacksmashing/pico-serprog) and [stm32-verprog](https://github.com/dword1511/stm32-vserprog)
2
+
a minimal flashrom/serprog SPI programmer implementation for esp32 family, inspired by [pico-serprog](https://github.com/stacksmashing/pico-serprog) and [stm32-vserprog](https://github.com/dword1511/stm32-vserprog)
3
3
4
4
## Features
5
5
6
6
Use your ESP32 board as a [flashrom](https://flashrom.org/) compatible SPI flash programmer
7
7
8
8
* Should be compatible with all ESP32 family MCUs
9
9
* Uses ESP32 HW SPI peripheral capable of up to 80 MHz clock rate
* Multiple connection options: USB Serial/JTAG, HW UART, TCP (Wi-Fi)<sup>1</sup>
11
11
12
-
<sup>1</sup> - works unreliably, see USB Serial/JTAG section
13
-
14
-
<sup>2</sup> - not implemented yet
15
-
16
-
<sup>3</sup> - flashrom serprog TCP capability is working only on latest dev build
12
+
<sup>1</sup> - flashrom serprog TCP capability is limited to non-windows OSes and requires flashrom version 1.4.0 or later
17
13
18
14
## Configuration
19
15
@@ -28,17 +24,15 @@ serial interface to use options are (MCU dependent):
28
24
29
25
### USB Serial/JTAG
30
26
31
-
since i have only ESP32S3 i decided to target built-in serial/JTAG first, and it kind of works but there are issues most likely with the serial peripheral itself:
32
-
33
-
found [a similar issue on the esp32 forum](https://www.esp32.com/viewtopic.php?f=13&t=32209) and some other [ongoing development](https://github.com/espressif/esp-idf/pull/12291) regarding serial buffers
27
+
older versions of esp-idf had issues with USB Serial/JTAG reliability,
28
+
but as of esp-idf 5.4.0 everything appears to work as intended
34
29
35
-
* using flashrom MINGW build on windows: it works reliably for some speed combinations e.g. 1M baud rate 4M SPI rate, except i had to flush the bootloader junk before using the flashrom (e.g. open&close COM port using putty / idf.py monitor)
36
-
* using same version flashrom ubuntu WSL2 build and usbipd to forward the usb device: there is no bootloader junk issue, but i always encounter data loss at random point when reading 4MByte flash (takes tens of seconds), so flashrom just hangs waiting for the data
37
-
* haven't tested on real linux or macOS
30
+
this is the default option for USB-capable chips (ESP32-S3, ESP32-C3, ESP32-C6 etc.)
38
31
39
32
### HW UART
40
33
41
-
after the serial/JTAG failure i decided to implement the real UART support, since i'm using a devkit board with CH343 USB-UART converter wired to UART0:
34
+
if USB Serial/JTAG is not supported by your MCU or works unreliably,
35
+
HW UART can be used:
42
36
43
37
* works perfectly as expected
44
38
* bottlenecked by UART baud rate
@@ -48,13 +42,15 @@ after the serial/JTAG failure i decided to implement the real UART support, sinc
48
42
49
43
### USB-CDC
50
44
51
-
not implemented - haven't touched this one yet - enabling USB-CDC on esp32s3 requires burning an eFuse to disconnect the USB serial/JTAG PHY permanently
45
+
in theory tinyUSB can be used instead of built-in USB Serial/JTAG peripheral,
46
+
but it is supported only by a subset of USB Serial/JTAG-capable chips (e.g. ESP32-S3 but not ESP32-C3/C6)
47
+
and since USB Serial/JTAG no longer misbehaves, i don't see any benefit in implementing USB-CDC
52
48
53
49
### TCP over Wi-Fi
54
50
55
51
*serprog TCP support is available only in non-windows builds e.g. linux, wsl2 etc.*
56
52
57
-
***warning**: flashrom serprog TCP support is working reliably only on latest dev build, please pull latest version and build from sources*
53
+
***warning**: flashrom serprog TCP support is working reliably only on flashrom version >= 1.4.0*
58
54
59
55
to enable TCP over Wi-Fi, before building run `idf.py menuconfig` and go to `esp32-serprog`,
60
56
select `Wi-Fi enabled` and set up your (existing) Wi-Fi credentials
@@ -79,7 +75,7 @@ even the cheapest BSS138-based one will do the job although the SPI speed will b
79
75
80
76
*i have successfully reflashed my Steam Deck 1.8V 16MByte BIOS chip using the cheapest aliexpress MOSFET levelshifter and 1.8V LDO at spispeed=250K, although it took like 20 minutes*
81
77
82
-
SPI speed selection is up to you, depends on the flash chip, wiring etc. - ESP32 should support up to 80MHz in theory
78
+
SPI speed selection is up to you, depends on the flash chip, wiring etc. - ESP32 should support up to 80MHz in theory. If no spispeed parameter is provided default value of 8M is used
83
79
84
80
UART baud rate matters only when using HW UART, at least serial/JTAG will always transmit as fast as USB allows
0 commit comments