[GH-ISSUE #322] Yellow AP - C6 Flash troubleshooting #1845

Closed
opened 2026-03-20 20:06:42 +01:00 by sascha_hemi · 8 comments
Owner

Originally created by @benv666 on GitHub (May 19, 2024).
Original GitHub issue: https://github.com/OpenEPaperLink/OpenEPaperLink/issues/322

Hej folks,

I've ordered components + PCB for the Yellow AP and put one together today.

Installed firmware through https://install.openepaperlink.de/, which went fine.
Booted, connected to wifi, and tried to flash the ESP32 C6 on the module.
LEDs light up, but shortly after it states Connection to the C6 failed.
flash-c6-failed
IMG20240519163147

I've measured connectivity on the RX/TX pins and that seems ok, so not sure what the issue is.
Next step is probably to read the serial from the C6 directly, but not sure what the easiest way of doing that is -- grabbing yet another ESP32? Or is there a serial debug option somewhere in the current firmware?

Thanks for thinking along!

Originally created by @benv666 on GitHub (May 19, 2024). Original GitHub issue: https://github.com/OpenEPaperLink/OpenEPaperLink/issues/322 Hej folks, I've ordered components + PCB for the Yellow AP and put one together today. Installed firmware through https://install.openepaperlink.de/, which went fine. Booted, connected to wifi, and tried to flash the ESP32 C6 on the module. LEDs light up, but shortly after it states `Connection to the C6 failed`. ![flash-c6-failed](https://github.com/jjwbruijn/OpenEPaperLink/assets/165034/becd09e5-8f3b-4784-8ab7-af673c44fd9d) ![IMG20240519163147](https://github.com/jjwbruijn/OpenEPaperLink/assets/165034/4ad7da04-d82f-48bd-a8cc-541f16e7f125) I've measured connectivity on the RX/TX pins and that seems ok, so not sure what the issue is. Next step is probably to read the serial from the C6 directly, but not sure what the easiest way of doing that is -- grabbing yet another ESP32? Or is there a serial debug option somewhere in the current firmware? Thanks for thinking along!
Author
Owner

@benv666 commented on GitHub (May 20, 2024):

Update:
Grabbed a FTDI USB dongle and hooked it up to the C6 board:
ftdi

Hooked up to a serial monitor I can see a constant restart loop with seemingly empty firmware:

invalid header: 0xffffffff
invalid header: 0xffffffffESP-ROM:esp32c6-20220919
Build:Sep 19 2022
rst:0x0 (SW_CLR),boot:0x9 (SPI_FAST_FLASH_BOOT)
invalid reset
ESP-ROM:esp32c6-20220919
Build:Sep 19 2022
rst:0x3 (LP_SW_HPSYS),boot:0x9 (SPI_FAST_FLASH_BOOT)
Saved PC:0x4001974a
invalid header: 0xffffffff
invalid header: 0xffffffff
invalid header: 0xffffffff

Using some shoddy handholding of the FTDI pins I booted the bord attached to the yellow mainboard and this is what happens when the "update C6" button is pressed:

invalid header: 0xffffffff
invalid header: 0xffffffff
invalid he▒ESP-ROM:esp32c6-20220919
Build:Sep 19 2022
rst:0x1 (POWERON),boot:0x41 (SDIO_REI_FEO_V1_BOOT)
wait sdio download

after which the web interface states the now familiar

Flashing ESP32-C6...
Stopping AP service
C6 flash starting
Connection to the C6 failed
C6 flash end
Flashing failed. :-(

Not sure what it's expecting.

<!-- gh-comment-id:2120208687 --> @benv666 commented on GitHub (May 20, 2024): Update: Grabbed a FTDI USB dongle and hooked it up to the C6 board: ![ftdi](https://github.com/jjwbruijn/OpenEPaperLink/assets/165034/03a1940e-a61e-4258-873e-d12fac866fd6) Hooked up to a serial monitor I can see a constant restart loop with seemingly empty firmware: ``` invalid header: 0xffffffff invalid header: 0xffffffffESP-ROM:esp32c6-20220919 Build:Sep 19 2022 rst:0x0 (SW_CLR),boot:0x9 (SPI_FAST_FLASH_BOOT) invalid reset ESP-ROM:esp32c6-20220919 Build:Sep 19 2022 rst:0x3 (LP_SW_HPSYS),boot:0x9 (SPI_FAST_FLASH_BOOT) Saved PC:0x4001974a invalid header: 0xffffffff invalid header: 0xffffffff invalid header: 0xffffffff ``` Using some shoddy handholding of the FTDI pins I booted the bord attached to the yellow mainboard and this is what happens when the "update C6" button is pressed: ``` invalid header: 0xffffffff invalid header: 0xffffffff invalid he▒ESP-ROM:esp32c6-20220919 Build:Sep 19 2022 rst:0x1 (POWERON),boot:0x41 (SDIO_REI_FEO_V1_BOOT) wait sdio download ``` after which the web interface states the now familiar ``` Flashing ESP32-C6... Stopping AP service C6 flash starting Connection to the C6 failed C6 flash end Flashing failed. :-( ``` Not sure what it's expecting.
Author
Owner

@benv666 commented on GitHub (May 20, 2024):

And another update, some form of success at last, documenting this so that someone else in the same boat might find it useful.
Adding a dupont wire on GPIO9 (next to the 5V and GND pins of the C6 board) and holding it to ground (the metal tin of the C6) allowed me to boot the C6 in bootloader mode.

gpio9-boot

ESP-ROM:esp32c6-20220919
Build:Sep 19 2022
rst:0x1 (POWERON),boot:0x4 (DOWNLOAD(USB/UART0/SDIO_FEI_FEO))
waiting for download

(both LEDs at the bottom of the board also went on)

Next, I could use esptool to upload the firmware. Took a few tries to get it to work, but having worked with these barebone boards before I knew this timing can be finicky to get right.
E.g. a failed attempt would look like:

esptool --port COM5 --chip esp32c6 write_flash --flash_mode dio --flash_size 4MB 0x0 bootloader.bin 0x8000 partition-table.bin 0x10000 OpenEPaperLink_esp32_C6.bin
esptool.py v4.7.0
Serial port COM5
Connecting......................................

A fatal error occurred: Failed to connect to ESP32-C6: No serial data received.
For troubleshooting steps visit: https://docs.espressif.com/projects/esptool/en/latest/troubleshooting.html

I got lucky at some point when I first started the upload command and then added 5V (while holding GPIO9 to GND):

esptool --port COM5 --chip esp32c6 write_flash --flash_mode dio --flash_size 4MB 0x0 bootloader.bin 0x8000 partition-table.bin 0x10000 OpenEPaperLink_esp32_C6.bin
esptool.py v4.7.0
Serial port COM5
Connecting.............................
Chip is ESP32-C6 (QFN40) (revision v0.0)
Features: WiFi 6, BT 5, IEEE802.15.4
Crystal is 40MHz
MAC: 40:4c:ca:ff:fe:55:b5:9c
BASE MAC: 40:4c:ca:55:b5:9c
MAC_EXT: ff:fe
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Flash will be erased from 0x00000000 to 0x00005fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x00010000 to 0x00049fff...
Compressed 22272 bytes to 13437...
Wrote 22272 bytes (13437 compressed) at 0x00000000 in 1.4 seconds (effective 131.4 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 104...
Wrote 3072 bytes (104 compressed) at 0x00008000 in 0.0 seconds (effective 526.9 kbit/s)...
Hash of data verified.
Compressed 235328 bytes to 124901...
Wrote 235328 bytes (124901 compressed) at 0x00010000 in 11.2 seconds (effective 167.4 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...

It complains about the checksum, probably because of missing flags in the upload procedure, but it boots:

ESP-ROM:esp32c6-20220919
Build:Sep 19 2022
rst:0x1 (POWERON),boot:0x8 (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:2
load:0x4086c410,len:0xec8
load:0x4086e610,len:0x2ebc
load:0x40875728,len:0x1940
SHA-256 comparison failed:
Calculated: 8bb43836d0bd4a3b86bfbe09db2ec22b5d50360b10bcb10ade6e4300e0fb4f70
Expected: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
Attempting to boot anyway...
entry 0x4086c410
I (42) boot: ESP-IDF v5.1.1 2nd stage bootloader
I (42) boot: compile time Oct  1 2023 20:23:29
I (43) boot: chip revision: v0.0
I (45) qio_mode: Enabling default flash chip QIO
I (50) boot.esp32c6: SPI Speed      : 80MHz
I (55) boot.esp32c6: SPI Mode       : QIO
I (60) boot.esp32c6: SPI Flash Size : 4MB
I (64) boot: Enabling RNG early entropy source...
I (70) boot: Partition Table:
I (73) boot: ## Label            Usage          Type ST Offset   Length
I (81) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (88) boot:  1 factory          factory app      00 00 00010000 00100000
I (96) boot:  2 littlefs         Unknown data     01 82 00110000 002f0000
I (103) boot: End of partition table
I (107) esp_image: segment 0: paddr=00010020 vaddr=42020020 size=0b150h ( 45392) map
I (120) esp_image: segment 1: paddr=0001b178 vaddr=40800000 size=04ea0h ( 20128) load
I (127) esp_image: segment 2: paddr=00020020 vaddr=42000020 size=1f2e0h (127712) map
I (145) esp_image: segment 3: paddr=0003f308 vaddr=40804ea0 size=0a430h ( 42032) load
I (153) boot: Loaded app from partition at offset 0x10000
I (154) boot: Disabling RNG early entropy source...
I (165) cpu_start: Unicore app
I (165) cpu_start: Pro cpu up.
W (174) clk: esp_perip_clk_init() has not been implemented yet
I (181) cpu_start: Pro cpu start user code
I (181) cpu_start: cpu freq: 160000000 Hz
I (181) cpu_start: Application information:
I (184) cpu_start: Project name:     OpenEPaperLink_esp32_C6
I (190) cpu_start: App version:      2.01-3-g5b9f8b32-dirty
I (196) cpu_start: Compile time:     Oct  1 2023 20:23:12
I (202) cpu_start: ELF file SHA256:  b3a448128d4d784d...
I (208) cpu_start: ESP-IDF:          v5.1.1
I (213) cpu_start: Min chip rev:     v0.0
I (218) cpu_start: Max chip rev:     v0.99
I (223) cpu_start: Chip rev:         v0.0
I (228) heap_init: Initializing. RAM available for dynamic allocation:
I (235) heap_init: At 40815D00 len 00066910 (410 KiB): D/IRAM
I (241) heap_init: At 4087C610 len 00002F54 (11 KiB): STACK/DIRAM
I (248) heap_init: At 50000000 len 00003FE8 (15 KiB): RTCRAM
I (255) spi_flash: detected chip: generic
I (259) spi_flash: flash io: qio
I (263) sleep: Configure to isolate all GPIO pins in sleep state
I (270) sleep: Enable automatic switching of GPIO sleep configuration
I (277) coexist: coex firmware version: 80b0d89
I (282) coexist: coexist rom version 5b8dcfa
I (287) app_start: Starting scheduler on CPU0
I (292) main_task: Started on CPU0
I (292) main_task: Calling app_main()
I (302) gpio: GPIO[22]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (302) gpio: GPIO[23]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (312) uart: queue free spaces: 20
I (322) phy_init: phy_version 202,b4b3263,May 17 2023,20:14:14
W (322) phy_init: failed to load RF calibration data (0x1102), falling back to full calibration
I (372) phy: libbtbb version: b684fcb, May 17 2023, 20:14:35
I (672) RADIO: Receiver ready, panId=0x4447, channel=25, long=9c:b5:55:fe:ff:ca:4c:40, short=fffe
I (672) MAIN: C6 ready!

Which results in it being accepted by the AP:
IMG20240520135623

Feedback still welcome as to why this isn't working through the "normal" method for me, but for now my next goal is to see if I can get any tags to work.

<!-- gh-comment-id:2120345368 --> @benv666 commented on GitHub (May 20, 2024): And another update, some form of success at last, documenting this so that someone else in the same boat might find it useful. Adding a dupont wire on GPIO9 (next to the 5V and GND pins of the C6 board) and holding it to ground (the metal tin of the C6) allowed me to boot the C6 in bootloader mode. ![gpio9-boot](https://github.com/jjwbruijn/OpenEPaperLink/assets/165034/8b1b8190-874d-4105-8aa7-9261786be3ee) ``` ESP-ROM:esp32c6-20220919 Build:Sep 19 2022 rst:0x1 (POWERON),boot:0x4 (DOWNLOAD(USB/UART0/SDIO_FEI_FEO)) waiting for download ``` (both LEDs at the bottom of the board also went on) Next, I could use `esptool` to upload the firmware. Took a few tries to get it to work, but having worked with these barebone boards before I knew this timing can be finicky to get right. E.g. a failed attempt would look like: ``` esptool --port COM5 --chip esp32c6 write_flash --flash_mode dio --flash_size 4MB 0x0 bootloader.bin 0x8000 partition-table.bin 0x10000 OpenEPaperLink_esp32_C6.bin esptool.py v4.7.0 Serial port COM5 Connecting...................................... A fatal error occurred: Failed to connect to ESP32-C6: No serial data received. For troubleshooting steps visit: https://docs.espressif.com/projects/esptool/en/latest/troubleshooting.html ``` I got lucky at some point when I first started the upload command and then added 5V (while holding GPIO9 to GND): ``` esptool --port COM5 --chip esp32c6 write_flash --flash_mode dio --flash_size 4MB 0x0 bootloader.bin 0x8000 partition-table.bin 0x10000 OpenEPaperLink_esp32_C6.bin esptool.py v4.7.0 Serial port COM5 Connecting............................. Chip is ESP32-C6 (QFN40) (revision v0.0) Features: WiFi 6, BT 5, IEEE802.15.4 Crystal is 40MHz MAC: 40:4c:ca:ff:fe:55:b5:9c BASE MAC: 40:4c:ca:55:b5:9c MAC_EXT: ff:fe Uploading stub... Running stub... Stub running... Configuring flash size... Flash will be erased from 0x00000000 to 0x00005fff... Flash will be erased from 0x00008000 to 0x00008fff... Flash will be erased from 0x00010000 to 0x00049fff... Compressed 22272 bytes to 13437... Wrote 22272 bytes (13437 compressed) at 0x00000000 in 1.4 seconds (effective 131.4 kbit/s)... Hash of data verified. Compressed 3072 bytes to 104... Wrote 3072 bytes (104 compressed) at 0x00008000 in 0.0 seconds (effective 526.9 kbit/s)... Hash of data verified. Compressed 235328 bytes to 124901... Wrote 235328 bytes (124901 compressed) at 0x00010000 in 11.2 seconds (effective 167.4 kbit/s)... Hash of data verified. Leaving... Hard resetting via RTS pin... ``` It complains about the checksum, probably because of missing flags in the upload procedure, but it boots: ``` ESP-ROM:esp32c6-20220919 Build:Sep 19 2022 rst:0x1 (POWERON),boot:0x8 (SPI_FAST_FLASH_BOOT) SPIWP:0xee mode:DIO, clock div:2 load:0x4086c410,len:0xec8 load:0x4086e610,len:0x2ebc load:0x40875728,len:0x1940 SHA-256 comparison failed: Calculated: 8bb43836d0bd4a3b86bfbe09db2ec22b5d50360b10bcb10ade6e4300e0fb4f70 Expected: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff Attempting to boot anyway... entry 0x4086c410 I (42) boot: ESP-IDF v5.1.1 2nd stage bootloader I (42) boot: compile time Oct 1 2023 20:23:29 I (43) boot: chip revision: v0.0 I (45) qio_mode: Enabling default flash chip QIO I (50) boot.esp32c6: SPI Speed : 80MHz I (55) boot.esp32c6: SPI Mode : QIO I (60) boot.esp32c6: SPI Flash Size : 4MB I (64) boot: Enabling RNG early entropy source... I (70) boot: Partition Table: I (73) boot: ## Label Usage Type ST Offset Length I (81) boot: 0 nvs WiFi data 01 02 00009000 00006000 I (88) boot: 1 factory factory app 00 00 00010000 00100000 I (96) boot: 2 littlefs Unknown data 01 82 00110000 002f0000 I (103) boot: End of partition table I (107) esp_image: segment 0: paddr=00010020 vaddr=42020020 size=0b150h ( 45392) map I (120) esp_image: segment 1: paddr=0001b178 vaddr=40800000 size=04ea0h ( 20128) load I (127) esp_image: segment 2: paddr=00020020 vaddr=42000020 size=1f2e0h (127712) map I (145) esp_image: segment 3: paddr=0003f308 vaddr=40804ea0 size=0a430h ( 42032) load I (153) boot: Loaded app from partition at offset 0x10000 I (154) boot: Disabling RNG early entropy source... I (165) cpu_start: Unicore app I (165) cpu_start: Pro cpu up. W (174) clk: esp_perip_clk_init() has not been implemented yet I (181) cpu_start: Pro cpu start user code I (181) cpu_start: cpu freq: 160000000 Hz I (181) cpu_start: Application information: I (184) cpu_start: Project name: OpenEPaperLink_esp32_C6 I (190) cpu_start: App version: 2.01-3-g5b9f8b32-dirty I (196) cpu_start: Compile time: Oct 1 2023 20:23:12 I (202) cpu_start: ELF file SHA256: b3a448128d4d784d... I (208) cpu_start: ESP-IDF: v5.1.1 I (213) cpu_start: Min chip rev: v0.0 I (218) cpu_start: Max chip rev: v0.99 I (223) cpu_start: Chip rev: v0.0 I (228) heap_init: Initializing. RAM available for dynamic allocation: I (235) heap_init: At 40815D00 len 00066910 (410 KiB): D/IRAM I (241) heap_init: At 4087C610 len 00002F54 (11 KiB): STACK/DIRAM I (248) heap_init: At 50000000 len 00003FE8 (15 KiB): RTCRAM I (255) spi_flash: detected chip: generic I (259) spi_flash: flash io: qio I (263) sleep: Configure to isolate all GPIO pins in sleep state I (270) sleep: Enable automatic switching of GPIO sleep configuration I (277) coexist: coex firmware version: 80b0d89 I (282) coexist: coexist rom version 5b8dcfa I (287) app_start: Starting scheduler on CPU0 I (292) main_task: Started on CPU0 I (292) main_task: Calling app_main() I (302) gpio: GPIO[22]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 I (302) gpio: GPIO[23]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 I (312) uart: queue free spaces: 20 I (322) phy_init: phy_version 202,b4b3263,May 17 2023,20:14:14 W (322) phy_init: failed to load RF calibration data (0x1102), falling back to full calibration I (372) phy: libbtbb version: b684fcb, May 17 2023, 20:14:35 I (672) RADIO: Receiver ready, panId=0x4447, channel=25, long=9c:b5:55:fe:ff:ca:4c:40, short=fffe I (672) MAIN: C6 ready! ``` Which results in it being accepted by the AP: ![IMG20240520135623](https://github.com/jjwbruijn/OpenEPaperLink/assets/165034/281ae882-3cbd-4c45-a52e-dba31c337972) Feedback still welcome as to why this isn't working through the "normal" method for me, but for now my next goal is to see if I can get any tags to work.
Author
Owner

@nlimper commented on GitHub (May 20, 2024):

I'm not sure if that's part of the cause, but it seems you didn't place the resistor to pull GPIO8 high (footprint just next to the silkscreen 'ATC1441' text), which is needed to properly boot the C6.
Other than that, I cannot help you with the yellow pcb. If all is well, both gpio9 and the enable pin are controlled by the esp32-s3 during flashing of the c6. But anyway, if it works, it works :-)

<!-- gh-comment-id:2120366767 --> @nlimper commented on GitHub (May 20, 2024): I'm not sure if that's part of the cause, but it seems you didn't place the resistor to pull GPIO8 high (footprint just next to the silkscreen 'ATC1441' text), which is needed to properly boot the C6. Other than that, I cannot help you with the yellow pcb. If all is well, both gpio9 and the enable pin are controlled by the esp32-s3 during flashing of the c6. But anyway, if it works, it works :-)
Author
Owner

@benv666 commented on GitHub (May 20, 2024):

Thanks for that! I wasn't sure what the pad was for so I left it empty, thinking it was optional. (some more detailed build instructions would have been welcome I suppose, did some guesswork but apparently failed this one)
I'll add a 10k and see if that helps, thanks!

<!-- gh-comment-id:2120426560 --> @benv666 commented on GitHub (May 20, 2024): Thanks for that! I wasn't sure what the pad was for so I left it empty, thinking it was optional. (some more detailed build instructions would have been welcome I suppose, did some guesswork but apparently failed this one) I'll add a 10k and see if that helps, thanks!
Author
Owner

@benv666 commented on GitHub (May 20, 2024):

Well, the resistor made no difference, still getting the same error when trying to flash the C6.
Other suggestions welcome. (or a different method of troubleshooting, I'm not sure why it's failing. Could it be a timing issue like my manual upload had?)

That said, my manually uploaded firmware works fine, now with 3 tags :D
epaper-e-price

<!-- gh-comment-id:2120789267 --> @benv666 commented on GitHub (May 20, 2024): Well, the resistor made no difference, still getting the same error when trying to flash the C6. Other suggestions welcome. (or a different method of troubleshooting, I'm not sure why it's failing. Could it be a timing issue like my manual upload had?) That said, my manually uploaded firmware works fine, now with 3 tags :D ![epaper-e-price](https://github.com/jjwbruijn/OpenEPaperLink/assets/165034/03c9edce-52c7-4ca4-916f-1334b53f6304)
Author
Owner

@krikkirk commented on GitHub (Aug 1, 2024):

I think you probably flipped the leds and the resistors in bottom. I see two small triangles in the drawing so likely leds should be placed in between the resistors
nvm it is serial connection

<!-- gh-comment-id:2261753884 --> @krikkirk commented on GitHub (Aug 1, 2024): I think you probably flipped the leds and the resistors in bottom. I see two small triangles in the drawing so likely leds should be placed in between the resistors nvm it is serial connection
Author
Owner

@oywino commented on GitHub (Sep 30, 2024):

Just a stupid question - what is a yellow AP and where can it be found/bought? (I googled "yellow AP" but to no avail)

<!-- gh-comment-id:2384120144 --> @oywino commented on GitHub (Sep 30, 2024): Just a stupid question - what is a yellow AP and where can it be found/bought? (I googled "yellow AP" but to no avail)
Author
Owner

@nlimper commented on GitHub (Oct 28, 2024):

Just a stupid question - what is a yellow AP and where can it be found/bought? (I googled "yellow AP" but to no avail)

See https://github.com/OpenEPaperLink/OpenEPaperLink/wiki/Building-an-Access-Point

Closing this one as completed

<!-- gh-comment-id:2441093933 --> @nlimper commented on GitHub (Oct 28, 2024): > Just a stupid question - what is a yellow AP and where can it be found/bought? (I googled "yellow AP" but to no avail) See https://github.com/OpenEPaperLink/OpenEPaperLink/wiki/Building-an-Access-Point Closing this one as completed
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/OpenEPaperLink#1845