boot loop and can't load
Posted: Thu Oct 24, 2019 5:10 pm
hello,
I'm very beginner with ESP32 and to learn in deep I downloaded all the PDF datasheets + bought 3xTTGO (ESP32-WROOM+OLED+CP2102+BMS) on Aliexpress (https://www.aliexpress.com/item/3295686 ... 4c4dN31Vn3 (poor quality).
I started to play with one of them with "get-started/hello_world" project included in espressif git repo. All work fine, I just must remember to push "Boot" button when I start
and
ok I know it's a mistake, internal LED it isn't on GPIO 1 or 2
I tried to flash these codes without any modification in sdkconfig file :
I tried all possible combinaison with EN and BOOT button, like EN pushed then in same time BOOT, and release EN to select flash mode...
In serial monitor when I plug the board and turn on, I've this message in loop very quickly :
Pushing EN+BOOT then release EN give (stopping loop) :
I tried to flash at this moment, with same result Failed to connect to Espressif device: Invalid head of packet (0x34)
left side: bad board - right side: normal behavior
I make a small UART reader with Arduino NANO, pluggeg on TX/RX (U0TX/U0RX) on TTGO board to observe what's happen when esp is waiting download and I try to flash :
I don't know what to do now...
I suspect maybe the CP2102 who don't send anything ? How I can bypass this chip and test with my external UART-USB ? Can I flash without CP2120? I also buy a cheap logic analyze on ebay which will arrive in 1 week to try to understand what happen with my ESP32.
If someone have any idea, I gladly take it !
(my apologize for my horrible english)
I'm very beginner with ESP32 and to learn in deep I downloaded all the PDF datasheets + bought 3xTTGO (ESP32-WROOM+OLED+CP2102+BMS) on Aliexpress (https://www.aliexpress.com/item/3295686 ... 4c4dN31Vn3 (poor quality).
I started to play with one of them with "get-started/hello_world" project included in espressif git repo. All work fine, I just must remember to push "Boot" button when I start
command, to enter un flash mode. I tested to flash another small projects 3/4 times without any problem until when I tried to flash this two codes :idf.py flash
- #include <stdio.h>
- #include "freertos/FreeRTOS.h"
- #include "freertos/task.h"
- #include "driver/gpio.h"
- #include "esp_system.h"
- #include "esp_spi_flash.h"
- #define BLINK_GPIO CONFIG_BLINK_GPIO
- #define INTERNAL_LED GPIO_SEL_2
- void app_main(void)
- {
- gpio_config_t gpconfg;
- gpconfg.pin_bit_mask = INTERNAL_LED;
- gpconfg.mode = GPIO_MODE_OUTPUT;
- gpio_config(&gpconfg);
- gpio_set_level(INTERNAL_LED, 1);
- for(;;){}
- }
- #include <stdio.h>
- #include "freertos/FreeRTOS.h"
- #include "freertos/task.h"
- #include "driver/gpio.h"
- #include "esp_system.h"
- #include "esp_spi_flash.h"
- #define BLINK_GPIO CONFIG_BLINK_GPIO
- #define INTERNAL_LED GPIO_SEL_1
- void app_main(void)
- {
- gpio_config_t gpconfg;
- gpconfg.pin_bit_mask = INTERNAL_LED;
- gpconfg.mode = GPIO_MODE_OUTPUT;
- gpio_config(&gpconfg);
- gpio_set_level(INTERNAL_LED, 1);
- for(;;){}
- }
I tried to flash these codes without any modification in sdkconfig file :
- first try, load stopped at 40% with a communication error
- second try, load stopped at 10%, also with a communication error
- third try, no response :
Code: Select all
esptool.py v2.8-dev
Serial port /dev/ttyUSB0
Connecting........_____....._____....._____....._____....._____....._____....._____
A fatal error occurred: Failed to connect to Espressif device: Invalid head of packet (0x34)
esptool.py failed with exit code 2
In serial monitor when I plug the board and turn on, I've this message in loop very quickly :
Code: Select all
ets Jun 8 2016 00:22:57
rst:0x3 (SW_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:6992
ho 0 tail 12 room 4
load:0x40078000,len:14228
load:0x40080400,len:4296
entry 0x400806e4
I (119) boot: Chip Revision: 1
I (138) boot_comm: chip revision: 1, min. bootloader chip revision: 0
I (82) boot: ESP-IDF v4.1-dev-474-g2e6398aff 2nd stage bootloader
I (82) boot: compile time 23:28:58
I (82) boot: Enabling RNG early entropy source...
I (88) boot: SPI Speed : 40MHz
I (93) boot: SPI Mode : DIO
I (97) boot: SPI Flash Size : 2MB
I (101) boot: Partition Table:
I (104) boot: ## Label Usage Type ST Offset Length
I (112) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (119) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (127) boot: 2 factory factory app 00 00 00010000 00100000
I (134) boot: End of partition table
I (139) boot_comm: chip revision: 1, min. application chip revision: 0
I (146) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x06c44 ( 27716) map
I (165) esp_image: segment 1: paddr=0x00016c6c vaddr=0x3ffb0000 size=0x020cc ( 8396) load
I (169) esp_image: segment 2: paddr=0x00018d40 vaddr=0x40080000 size=0x00400 ( 1024) load
0x40080000: _WindowOverflow4 at /*MASKED*/esp32/esp-idf/components/freertos/xtensa_vectors.S:1778
I (173) esp_image: segment 3: paddr=0x00019148 vaddr=0x40080400 size=0x06ec8 ( 28360) load
E (194) esp_image: invalid segment length 0xffffffff
E (194) boot: Factory app partition is not bootable
E (195) boot: No bootable app partitions in the partition table
ets Jun 8 2016 00:22:57
rst:0x3 (SW_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:6992
ho 0 tail 12 room 4
load:0x40078000,len:14228
load:0x40080400,len:4296
entry 0x400806e4
I (119) boot: Chip Revision: 1
I (138) boot_comm: chip revision: 1, min. bootloader chip revision: 0
I (82) boot: ESP-IDF v4.1-dev-474-g2e6398aff 2nd stage bootloader
I (82) boot: compile time 23:28:58
I (82) boot: Enabling RNG early entropy source...
I (88) boot: SPI Speed : 40MHz
I (93) boot: SPI Mode : DIO
I (97) boot: SPI Flash Size : 2MB
I (101) boot: Partition Table:
I (104) boot: ## Label Usage Type ST Offset Length
I (112) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (119) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (127) boot: 2 factory factory app 00 00 00010000 00100000
I (134) boot: End of partition table
I (139) boot_comm: chip revision: 1, min. application chip revision: 0
I (146) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x06c44 ( 27716) map
I (165) esp_image: segment 1: paddr=0x00016c6c vaddr=0x3ffb0000 size=0x020cc ( 8396) load
I (169) esp_image: segment 2: paddr=0x00018d40 vaddr=0x40080000 size=0x00400 ( 1024) load
0x40080000: _WindowOverflow4 at /*MASKED*/esp32/esp-idf/components/freertos/xtensa_vectors.S:1778
I (173) esp_image: segment 3: paddr=0x00019148 vaddr=0x40080400 size=0x06ec8 ( 28360) load
E (194) esp_image: invalid segment length 0xffffffff
E (194) boot: Factory app partition is not bootable
E (195) boot: No bootable app partitions in the partition table
... ETC ...
Code: Select all
ets Jun 8 2016 00:22:57
rst:0x1 (POWERON_RESET),boot:0x7 (DOWNLOAD_BOOT(UART0/UART1/SDIO_REI_REO_V2))
waiting for download
- To check my USB cable, I plugged another TTGO board (same model) which run/flash gracefully.
- I tried to use another computer on Windows 10 (my main computer is on Ubuntu) with Espressif tool and Serial Sniffer : same result.
- All commands with esptool.py doesn't works... failed to connect to Espressif device: Invalid head blabla....
- checked the voltage, it is at 3.3V
left side: bad board - right side: normal behavior
I make a small UART reader with Arduino NANO, pluggeg on TX/RX (U0TX/U0RX) on TTGO board to observe what's happen when esp is waiting download and I try to flash :
Code: Select all
rst:0x1 (POWERON_RESET),boot:0x7 (DOWNLOAD_BOOT(UART0/UART1/SDIO_REI_REO_V2))
waiting for download
<--- START idf.py flash --->
ets Jun 8 2016 00:22:57
rst:0x1 (POWERON_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:6992
ho 0 tail 12 room 4
load:0x40078000,len:14228
load:0x40080400,len:4296
entry 0x400806e4
I (75) boot: Chip Revision: 1
I (75) boot_comm: chip revision: 1, min. bootloader chip revision: 0
I (41) boot: ESP-IDF v4.1-dev-474-g2e6398aff 2nd stage bootloader
I (41) boot: compile time 23:28:58
I (41) boot: Enabling RNG early entropy source...
I (47) boot: SPI Speed : 40MHz
I (52) boot: SPI Mode : DIO
I (56) boot: SPI Flash Size : 2MB
I (60) boot: Partition Table:
I (63) boot: ## Label Usage Type ST Offset Length
I (70) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (78) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (85) boot: 2 factory factory app 00 00 00010000 00100000
I (93) boot: End of partition table
I (97) boot_comm: chip revision: 1, min. application chip revision: 0
I (104) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x06c44 ( 27716) map
I (123) esp_image: segment 1: paddr=0x00016c6c vaddr=0x3ffb0000 size=0x020cc ( 8396) load
I (127) esp_image: segment 2: paddr=0x00018d40 vaddr=0x40080000 size=0x00400 ( 1024) load
I (131) esp_image: segment 3: paddr=0x00019148 vaddr=0x40080400 size=0x06ec8 ( 28360) load
E (152) esp_image: invalid segment length 0xffffffff
E (152) boot: Factory app partition is not bootable
E (153) boot: No bootable app partitions in the partition table
ets Jun 8 2016 00:22:57
rst:0x3 (SW_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:6992
ho 0 tail 12 room 4
load:0x40078000,len:14228
load:0x40080400,len:4296
entry 0x400806e4
I (119) boot: Chip Revision: 1
I (138) boot_comm: chip revision: 1, min. bootloader chip revision: 0
I (82) boot: ESP-IDF v4.1-dev-474-g2e6398aff 2nd stage bootloader
I (82) boot: compile time 23:28:58
I (82) boot: Enabling RNG early entropy source...
I (88) boot: SPI Speed : 40MHz
I (93) boot: SPI Mode : DIO
I (97) boot: SPI Flash Size : 2MB
I (101) boot: Partition Table:
I (104) boot: ## Label Usage Type ST Offset Length
I (112) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (119) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (127) boot: 2 factory factory app 00 00 00010000 00100000
I (134) boot: End of partition table
I (139) boot_comm: chip revision: 1, min. application chip revision: 0
I (146) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x06c44 ( 27716) map
I (165) esp_image: segment 1: paddr=0x00016c6c vaddr=0x3ffb0000 size=0x020cc ( 8396) load
I (169) esp_image: segment 2: paddr=0x00018d40 v�ets Jun 8 2016 00:22:57
rst:0x1 (POWERON_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:6992
ho 0 tail 12 room 4
load:0x40078000,len:14228
load:0x40080400,len:4296
entry 0x400806e4
I (75) boot: Chip Revision: 1
I (75) boot_comm: chip revision: 1, min. bootloader chip revision: 0
I (41) boot: ESP-IDF v4.1-dev-474-g2e6398aff 2nd stage bootloader
I (41) boot: compile time 23:28:58
I (42) boot: Enabling RNG early entropy source...
I (47) boot: SPI Speed : 40MHz
I (52) boot: SPI Mode : DIO
I (56) boot: SPI Flash Size : 2MB
I (60) boot: Partition Table:
I (63) boot: ## Label Usage Type ST Offset Length
I (71) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (78) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (85) boot: 2 factory factory app 00 00 00010000 00100000
I (93) boot: End of partition table
I (97) boot_comm: chip revision: 1, min. application chip revision: 0
I (104) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x06c44 ( 27716) map
I (123) esp_image: segment 1: paddr=0x00016c6c vaddr=0x3ffb0000 size=0x020cc ( 8396) load
I (127) esp_image: segment 2: paddr=0x00018d40 vaddr=0x40080000 size=0x00400 ( 1024) load
I (131) esp_image: segment 3: paddr=0x00019148 vaddr=0x40080400 size=0x06ec8 ( 28360) load
E (152) esp_image: invalid segment length 0xffffffff
E (152) boot: Factory app partition is not bootable
E (153) boot: No bootable app partitions in the partition table
... LOOPING WITH THIS SAME MESSAGE...
I suspect maybe the CP2102 who don't send anything ? How I can bypass this chip and test with my external UART-USB ? Can I flash without CP2120? I also buy a cheap logic analyze on ebay which will arrive in 1 week to try to understand what happen with my ESP32.
If someone have any idea, I gladly take it !
(my apologize for my horrible english)