WDT timeout in bootloader for ESP32s2

william.ferguson.au
Posts: 107
Joined: Wed Jan 02, 2019 8:55 am

Re: WDT timeout in bootloader for ESP32s2

Postby william.ferguson.au » Fri Jan 08, 2021 12:14 am

Hi Angus. Some answers.

Yes the apps is definitely running for 1.2 seconds. There is app log showing.

Yes, the log output indicates that it is past the bootloader and into the app. I assumed it had to be to do with the bootloader because the address given only appears to be valid for the bootloader, not the app.

addr2line for the app gives:

Code: Select all

E:\Source\wylas\beamatouch>xtensa-esp32s2-elf-addr2line -pfiaC -e build/beamatouch.elf 0x4004c3ee
0x4004c3ee: ?? ??:0
After printing "boot.esp32s2: WDT reset info: PRO CPU PC=0x4004c3ee" it starts the app, runs for about 1.2s and then resets. Extended log here:

Code: Select all

ESP-ROM:esp32s2-rc4-20191025
Build:Oct 25 2019
rst:0x8 (TG1WDT_SYS_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)
Saved PC:0x40334a6f
SPIWP:0xee
mode:DIO, clock div:2
load:0x3ffe6100,len:0x8
load:0x3ffe6108,len:0x1814
load:0x4004c000,len:0x9d8
load:0x40050000,len:0x2e34
entry 0x4004c1ec
I (51) boot: ESP-IDF v4.3-dev-1904-gbaef16f9f-dirty 2nd stage bootloader
I (51) boot: compile time 10:05:26
I (51) boot: chip revision: 0
I (55) boot.esp32s2: SPI Speed      : 40MHz
I (60) boot.esp32s2: SPI Mode       : DIO
I (64) boot.esp32s2: SPI Flash Size : 4MB
W (69) boot.esp32s2: PRO CPU has been reset by WDT.
W (75) boot.esp32s2: WDT reset info: PRO CPU PC=0x4004c3ee
I (81) boot: Enabling RNG early entropy source...
I (86) boot: Partition Table:
I (90) boot: ## Label            Usage          Type ST Offset   Length
I (97) boot:  0 nvs              WiFi data        01 02 00009000 00005000
I (105) boot:  1 otadata          OTA data         01 00 0000e000 00002000
I (112) boot:  2 app0             OTA app          00 10 00010000 001d0000
I (120) boot:  3 app1             OTA app          00 11 001e0000 001d0000
I (127) boot:  4 eeprom           Unknown data     01 99 003b0000 00001000
I (135) boot:  5 spiffs           Unknown data     01 82 003b1000 0004f000
I (142) boot: End of partition table
I (147) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f000020 size=0x363c4 (222148) map
I (217) esp_image: segment 1: paddr=0x000463ec vaddr=0x3ffc8c00 size=0x03cac ( 15532) load
I (222) esp_image: segment 2: paddr=0x0004a0a0 vaddr=0x40024000 size=0x00404 (  1028) load
0x40024000: _WindowOverflow4 at E:/Dev/Espressif/esp-idf/components/freertos/port/xtensa/xtensa_vectors.S:1730

I (224) esp_image: segment 3: paddr=0x0004a4ac vaddr=0x40024404 size=0x05b6c ( 23404) load
0x40024404: _coredump_iram_start at ??:?

I (241) esp_image: segment 4: paddr=0x00050020 vaddr=0x40080020 size=0xbcc44 (773188) map
0x40080020: _stext at ??:?

I (456) esp_image: segment 5: paddr=0x0010cc6c vaddr=0x40029f70 size=0x0ec88 ( 60552) load
0x40029f70: agc_reg_init at ??:?

I (477) esp_image: segment 6: paddr=0x0011b8fc vaddr=0x40070000 size=0x0002c (    44) load
0x40070000: _rtc_code_start at ??:?

I (489) boot: Loaded app from partition at offset 0x10000
I (489) boot: Disabling RNG early entropy source...
I (500) cache: Instruction cache        : size 8KB, 4Ways, cache line size 32Byte
I (501) cpu_start: Pro cpu up.
D (554) clk: RTC_SLOW_CLK calibration value: 5213434
I (560) cpu_start: Pro cpu start user code
I (560) cpu_start: cpu freq: 160000000
I (560) cpu_start: Application information:
I (564) cpu_start: Project name:     beamatouch
I (569) cpu_start: App version:      6
I (574) cpu_start: Compile time:     Jan  8 2021 10:05:12
I (580) cpu_start: ELF file SHA256:  dd53e6f03cb9a27a...
I (586) cpu_start: ESP-IDF:          v4.3-dev-1904-gbaef16f9f-dirty
V (593) memory_layout: reserved range is 0x3f0363c4 - 0x3f0363e4
D (599) memory_layout: Checking 4 reserved memory ranges:
D (604) memory_layout: Reserved memory range 0x3ff9e000 - 0x3ff9e02c
D (611) memory_layout: Reserved memory range 0x3ffb4000 - 0x3ffc8bf8
D (617) memory_layout: Reserved memory range 0x3ffc8c00 - 0x3ffd5130
D (624) memory_layout: Reserved memory range 0x3ffffa10 - 0x40000000
D (630) memory_layout: Building list of available memory regions:
V (636) memory_layout: Examining memory region 0x3ff9e000 - 0x3ffa0000
V (643) memory_layout: Start of region 0x3ff9e000 - 0x3ffa0000 overlaps reserved 0x3ff9e000 - 0x3ff9e02c
D (652) memory_layout: Available memory region 0x3ff9e02c - 0x3ffa0000
V (659) memory_layout: Examining memory region 0x3ffb4000 - 0x3ffb6000
V (666) memory_layout: Region 0x3ffb4000 - 0x3ffb6000 inside of reserved 0x3ffb4000 - 0x3ffc8bf8
V (674) memory_layout: Examining memory region 0x3ffb6000 - 0x3ffb8000
V (681) memory_layout: Region 0x3ffb6000 - 0x3ffb8000 inside of reserved 0x3ffb4000 - 0x3ffc8bf8
V (690) memory_layout: Examining memory region 0x3ffb8000 - 0x3ffbc000
V (697) memory_layout: Region 0x3ffb8000 - 0x3ffbc000 inside of reserved 0x3ffb4000 - 0x3ffc8bf8
V (705) memory_layout: Examining memory region 0x3ffbc000 - 0x3ffc0000
V (712) memory_layout: Region 0x3ffbc000 - 0x3ffc0000 inside of reserved 0x3ffb4000 - 0x3ffc8bf8
V (721) memory_layout: Examining memory region 0x3ffc0000 - 0x3ffc4000
V (727) memory_layout: Region 0x3ffc0000 - 0x3ffc4000 inside of reserved 0x3ffb4000 - 0x3ffc8bf8
V (736) memory_layout: Examining memory region 0x3ffc4000 - 0x3ffc8000
V (743) memory_layout: Region 0x3ffc4000 - 0x3ffc8000 inside of reserved 0x3ffb4000 - 0x3ffc8bf8
V (752) memory_layout: Examining memory region 0x3ffc8000 - 0x3ffcc000
V (758) memory_layout: Start of region 0x3ffc8000 - 0x3ffcc000 overlaps reserved 0x3ffb4000 - 0x3ffc8bf8
V (768) memory_layout: End of region 0x3ffc8bf8 - 0x3ffcc000 overlaps reserved 0x3ffc8c00 - 0x3ffd5130
V (777) memory_layout: Examining memory region 0x3ffcc000 - 0x3ffd0000
V (784) memory_layout: Region 0x3ffcc000 - 0x3ffd0000 inside of reserved 0x3ffc8c00 - 0x3ffd5130
V (793) memory_layout: Examining memory region 0x3ffd0000 - 0x3ffd4000
V (799) memory_layout: Region 0x3ffd0000 - 0x3ffd4000 inside of reserved 0x3ffc8c00 - 0x3ffd5130
V (808) memory_layout: Examining memory region 0x3ffd4000 - 0x3ffd8000
V (815) memory_layout: Start of region 0x3ffd4000 - 0x3ffd8000 overlaps reserved 0x3ffc8c00 - 0x3ffd5130
D (824) memory_layout: Available memory region 0x3ffd5130 - 0x3ffd8000
V (831) memory_layout: Examining memory region 0x3ffd8000 - 0x3ffdc000
D (838) memory_layout: Available memory region 0x3ffd8000 - 0x3ffdc000
V (844) memory_layout: Examining memory region 0x3ffdc000 - 0x3ffe0000
D (851) memory_layout: Available memory region 0x3ffdc000 - 0x3ffe0000
V (857) memory_layout: Examining memory region 0x3ffe0000 - 0x3ffe4000
D (864) memory_layout: Available memory region 0x3ffe0000 - 0x3ffe4000
V (870) memory_layout: Examining memory region 0x3ffe4000 - 0x3ffe8000
D (877) memory_layout: Available memory region 0x3ffe4000 - 0x3ffe8000
V (884) memory_layout: Examining memory region 0x3ffe8000 - 0x3ffec000
D (890) memory_layout: Available memory region 0x3ffe8000 - 0x3ffec000
V (897) memory_layout: Examining memory region 0x3ffec000 - 0x3fff0000
D (903) memory_layout: Available memory region 0x3ffec000 - 0x3fff0000
V (910) memory_layout: Examining memory region 0x3fff0000 - 0x3fff4000
D (917) memory_layout: Available memory region 0x3fff0000 - 0x3fff4000
V (923) memory_layout: Examining memory region 0x3fff4000 - 0x3fff8000
D (930) memory_layout: Available memory region 0x3fff4000 - 0x3fff8000
V (936) memory_layout: Examining memory region 0x3fff8000 - 0x3fffc000
D (943) memory_layout: Available memory region 0x3fff8000 - 0x3fffc000
V (950) memory_layout: Examining memory region 0x3fffc000 - 0x40000000
V (956) memory_layout: End of region 0x3fffc000 - 0x40000000 overlaps reserved 0x3ffffa10 - 0x40000000
D (966) memory_layout: Available memory region 0x3fffc000 - 0x3ffffa10
I (972) heap_init: Initializing. RAM available for dynamic allocation:
D (980) heap_init: New heap initialised at 0x3ff9e02c
I (985) heap_init: At 3FF9E02C len 00001FD4 (7 KiB): RTCRAM
D (991) heap_init: New heap initialised at 0x3ffd5130
I (996) heap_init: At 3FFD5130 len 00026ED0 (155 KiB): DRAM
I (1002) heap_init: At 3FFFC000 len 00003A10 (14 KiB): DRAM
V (1009) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): checking args
V (1015) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): Args okay. Resulting flags 0xE
D (1023) intr_alloc: Connected src 49 to int 2 (cpu 0)
D (1029) FLASH_HAL: extra_dummy: 0
V (1032) memspi: raw_chip_id: 164020

V (1035) memspi: chip_id: 204016

V (1039) memspi: raw_chip_id: 164020

V (1043) memspi: chip_id: 204016

D (1046) spi_flash: trying chip: issi
D (1050) spi_flash: trying chip: gd
D (1054) spi_flash: trying chip: mxic
D (1057) spi_flash: trying chip: winbond
D (1061) spi_flash: trying chip: generic
I (1065) spi_flash: detected chip: generic
I (1070) spi_flash: flash io: dio
V (1078) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): checking args
V (1080) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): Args okay. Resulting flags 0xE0E
D (1089) intr_alloc: Connected src 73 to int 10 (cpu 0)
D (1094) cpu_start: Setting C++ exception workarounds.
V (1099) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): checking args
V (1106) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): Args okay. Resulting flags 0x40E
D (1114) intr_alloc: Connected src 28 to int 3 (cpu 0)
I (1119) cpu_start: Starting scheduler on PRO CPU.
D (1125) heap_init: New heap initialised at 0x3fffc000
V (1125) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): checking args
V (1125) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): Args okay. Resulting flags 0xE
D (1125) intr_alloc: Connected src 17 to int 9 (cpu 0)
I (1145) beamatouch_main: Logger initialised
V (1145) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): checking args
V (1155) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): Args okay. Resulting flags 0x2
D (1165) intr_alloc: Connected src 23 to int 12 (cpu 0)
I (1165) gpio: GPIO[36]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (1175) gpio: GPIO[34]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (1185) gpio: GPIO[35]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (1195) gpio: GPIO[21]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (1205) gpio: GPIO[33]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (1215) gpio: GPIO[26]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
ESP-ROM:esp32s2-rc4-20191025
Build:Oct 25 2019
rst:0x8 (TG1WDT_SYS_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)
Saved PC:0x40334a71
SPIWP:0xee
mode:DIO, clock div:2
load:0x3ffe6100,len:0x8
load:0x3ffe6108,len:0x1814
load:0x4004c000,len:0x9d8
load:0x40050000,len:0x2e34
entry 0x4004c1ec
I (51) boot: ESP-IDF v4.3-dev-1904-gbaef16f9f-dirty 2nd stage bootloader
I (51) boot: compile time 10:05:26
I (51) boot: chip revision: 0
I (55) boot.esp32s2: SPI Speed      : 40MHz
I (60) boot.esp32s2: SPI Mode       : DIO
I (64) boot.esp32s2: SPI Flash Size : 4MB
W (69) boot.esp32s2: PRO CPU has been reset by WDT.
W (75) boot.esp32s2: WDT reset info: PRO CPU PC=0x4004c3ee
I (81) boot: Enabling RNG early entropy source...
I (86) boot: Partition Table:
I (90) boot: ## Label            Usage          Type ST Offset   Length
I (97) boot:  0 nvs              WiFi data        01 02 00009000 00005000
I (105) boot:  1 otadata          OTA data         01 00 0000e000 00002000
I (112) boot:  2 app0             OTA app          00 10 00010000 001d0000
I (120) boot:  3 app1             OTA app          00 11 001e0000 001d0000
I (127) boot:  4 eeprom           Unknown data     01 99 003b0000 00001000
I (135) boot:  5 spiffs           Unknown data     01 82 003b1000 0004f000
I (142) boot: End of partition table
I (147) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f000020 size=0x363c4 (222148) map
I (217) esp_image: segment 1: paddr=0x000463ec vaddr=0x3ffc8c00 size=0x03cac ( 15532) load
I (222) esp_image: segment 2: paddr=0x0004a0a0 vaddr=0x40024000 size=0x00404 (  1028) load
0x40024000: _WindowOverflow4 at E:/Dev/Espressif/esp-idf/components/freertos/port/xtensa/xtensa_vectors.S:1730

I (224) esp_image: segment 3: paddr=0x0004a4ac vaddr=0x40024404 size=0x05b6c ( 23404) load
0x40024404: _coredump_iram_start at ??:?

I (241) esp_image: segment 4: paddr=0x00050020 vaddr=0x40080020 size=0xbcc44 (773188) map
0x40080020: _stext at ??:?

I (456) esp_image: segment 5: paddr=0x0010cc6c vaddr=0x40029f70 size=0x0ec88 ( 60552) load
0x40029f70: agc_reg_init at ??:?

I (477) esp_image: segment 6: paddr=0x0011b8fc vaddr=0x40070000 size=0x0002c (    44) load
0x40070000: _rtc_code_start at ??:?

I (489) boot: Loaded app from partition at offset 0x10000
I (489) boot: Disabling RNG early entropy source...
I (500) cache: Instruction cache        : size 8KB, 4Ways, cache line size 32Byte
I (501) cpu_start: Pro cpu up.
D (554) clk: RTC_SLOW_CLK calibration value: 5217985
I (560) cpu_start: Pro cpu start user code
I (560) cpu_start: cpu freq: 160000000
I (560) cpu_start: Application information:
I (564) cpu_start: Project name:     beamatouch
I (569) cpu_start: App version:      6
I (574) cpu_start: Compile time:     Jan  8 2021 10:05:12
I (580) cpu_start: ELF file SHA256:  dd53e6f03cb9a27a...
I (586) cpu_start: ESP-IDF:          v4.3-dev-1904-gbaef16f9f-dirty
V (593) memory_layout: reserved range is 0x3f0363c4 - 0x3f0363e4
D (599) memory_layout: Checking 4 reserved memory ranges:
D (604) memory_layout: Reserved memory range 0x3ff9e000 - 0x3ff9e02c
D (611) memory_layout: Reserved memory range 0x3ffb4000 - 0x3ffc8bf8
D (617) memory_layout: Reserved memory range 0x3ffc8c00 - 0x3ffd5130
D (624) memory_layout: Reserved memory range 0x3ffffa10 - 0x40000000
D (630) memory_layout: Building list of available memory regions:
V (636) memory_layout: Examining memory region 0x3ff9e000 - 0x3ffa0000
V (643) memory_layout: Start of region 0x3ff9e000 - 0x3ffa0000 overlaps reserved 0x3ff9e000 - 0x3ff9e02c
D (652) memory_layout: Available memory region 0x3ff9e02c - 0x3ffa0000
V (659) memory_layout: Examining memory region 0x3ffb4000 - 0x3ffb6000
V (666) memory_layout: Region 0x3ffb4000 - 0x3ffb6000 inside of reserved 0x3ffb4000 - 0x3ffc8bf8
V (674) memory_layout: Examining memory region 0x3ffb6000 - 0x3ffb8000
V (681) memory_layout: Region 0x3ffb6000 - 0x3ffb8000 inside of reserved 0x3ffb4000 - 0x3ffc8bf8
V (690) memory_layout: Examining memory region 0x3ffb8000 - 0x3ffbc000
V (697) memory_layout: Region 0x3ffb8000 - 0x3ffbc000 inside of reserved 0x3ffb4000 - 0x3ffc8bf8
V (705) memory_layout: Examining memory region 0x3ffbc000 - 0x3ffc0000
V (712) memory_layout: Region 0x3ffbc000 - 0x3ffc0000 inside of reserved 0x3ffb4000 - 0x3ffc8bf8
V (721) memory_layout: Examining memory region 0x3ffc0000 - 0x3ffc4000
V (727) memory_layout: Region 0x3ffc0000 - 0x3ffc4000 inside of reserved 0x3ffb4000 - 0x3ffc8bf8
V (736) memory_layout: Examining memory region 0x3ffc4000 - 0x3ffc8000
V (743) memory_layout: Region 0x3ffc4000 - 0x3ffc8000 inside of reserved 0x3ffb4000 - 0x3ffc8bf8
V (752) memory_layout: Examining memory region 0x3ffc8000 - 0x3ffcc000
V (758) memory_layout: Start of region 0x3ffc8000 - 0x3ffcc000 overlaps reserved 0x3ffb4000 - 0x3ffc8bf8
V (768) memory_layout: End of region 0x3ffc8bf8 - 0x3ffcc000 overlaps reserved 0x3ffc8c00 - 0x3ffd5130
V (777) memory_layout: Examining memory region 0x3ffcc000 - 0x3ffd0000
V (784) memory_layout: Region 0x3ffcc000 - 0x3ffd0000 inside of reserved 0x3ffc8c00 - 0x3ffd5130
V (793) memory_layout: Examining memory region 0x3ffd0000 - 0x3ffd4000
V (799) memory_layout: Region 0x3ffd0000 - 0x3ffd4000 inside of reserved 0x3ffc8c00 - 0x3ffd5130
V (808) memory_layout: Examining memory region 0x3ffd4000 - 0x3ffd8000
V (815) memory_layout: Start of region 0x3ffd4000 - 0x3ffd8000 overlaps reserved 0x3ffc8c00 - 0x3ffd5130
D (824) memory_layout: Available memory region 0x3ffd5130 - 0x3ffd8000
V (831) memory_layout: Examining memory region 0x3ffd8000 - 0x3ffdc000
D (838) memory_layout: Available memory region 0x3ffd8000 - 0x3ffdc000
V (844) memory_layout: Examining memory region 0x3ffdc000 - 0x3ffe0000
D (851) memory_layout: Available memory region 0x3ffdc000 - 0x3ffe0000
V (857) memory_layout: Examining memory region 0x3ffe0000 - 0x3ffe4000
D (864) memory_layout: Available memory region 0x3ffe0000 - 0x3ffe4000
V (871) memory_layout: Examining memory region 0x3ffe4000 - 0x3ffe8000
D (877) memory_layout: Available memory region 0x3ffe4000 - 0x3ffe8000
V (884) memory_layout: Examining memory region 0x3ffe8000 - 0x3ffec000
D (890) memory_layout: Available memory region 0x3ffe8000 - 0x3ffec000
V (897) memory_layout: Examining memory region 0x3ffec000 - 0x3fff0000
D (903) memory_layout: Available memory region 0x3ffec000 - 0x3fff0000
V (910) memory_layout: Examining memory region 0x3fff0000 - 0x3fff4000
D (917) memory_layout: Available memory region 0x3fff0000 - 0x3fff4000
V (923) memory_layout: Examining memory region 0x3fff4000 - 0x3fff8000
D (930) memory_layout: Available memory region 0x3fff4000 - 0x3fff8000
V (936) memory_layout: Examining memory region 0x3fff8000 - 0x3fffc000
D (943) memory_layout: Available memory region 0x3fff8000 - 0x3fffc000
V (950) memory_layout: Examining memory region 0x3fffc000 - 0x40000000
V (956) memory_layout: End of region 0x3fffc000 - 0x40000000 overlaps reserved 0x3ffffa10 - 0x40000000
D (966) memory_layout: Available memory region 0x3fffc000 - 0x3ffffa10
I (972) heap_init: Initializing. RAM available for dynamic allocation:
D (980) heap_init: New heap initialised at 0x3ff9e02c
I (985) heap_init: At 3FF9E02C len 00001FD4 (7 KiB): RTCRAM
D (991) heap_init: New heap initialised at 0x3ffd5130
I (996) heap_init: At 3FFD5130 len 00026ED0 (155 KiB): DRAM
I (1002) heap_init: At 3FFFC000 len 00003A10 (14 KiB): DRAM
V (1009) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): checking args
V (1015) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): Args okay. Resulting flags 0xE
D (1023) intr_alloc: Connected src 49 to int 2 (cpu 0)
D (1029) FLASH_HAL: extra_dummy: 0
V (1032) memspi: raw_chip_id: 164020

V (1035) memspi: chip_id: 204016

V (1039) memspi: raw_chip_id: 164020

V (1043) memspi: chip_id: 204016

D (1046) spi_flash: trying chip: issi
D (1050) spi_flash: trying chip: gd
D (1054) spi_flash: trying chip: mxic
D (1057) spi_flash: trying chip: winbond
D (1061) spi_flash: trying chip: generic
I (1065) spi_flash: detected chip: generic
I (1070) spi_flash: flash io: dio
V (1078) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): checking args
V (1080) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): Args okay. Resulting flags 0xE0E
D (1089) intr_alloc: Connected src 73 to int 10 (cpu 0)
D (1094) cpu_start: Setting C++ exception workarounds.
V (1099) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): checking args
V (1106) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): Args okay. Resulting flags 0x40E
D (1114) intr_alloc: Connected src 28 to int 3 (cpu 0)
I (1119) cpu_start: Starting scheduler on PRO CPU.
D (1125) heap_init: New heap initialised at 0x3fffc000
V (1125) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): checking args
V (1125) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): Args okay. Resulting flags 0xE
D (1125) intr_alloc: Connected src 17 to int 9 (cpu 0)
I (1145) beamatouch_main: Logger initialised
V (1145) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): checking args
V (1155) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): Args okay. Resulting flags 0x2
D (1165) intr_alloc: Connected src 23 to int 12 (cpu 0)
I (1165) gpio: GPIO[36]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (1175) gpio: GPIO[34]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (1185) gpio: GPIO[35]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (1195) gpio: GPIO[21]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (1205) gpio: GPIO[33]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (1215) gpio: GPIO[26]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
ESP-ROM:esp32s2-rc4-20191025
Build:Oct 25 2019
rst:0x8 (TG1WDT_SYS_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)
Saved PC:0x40334a6d
SPIWP:0xee
mode:DIO, clock div:2
load:0x3ffe6100,len:0x8
load:0x3ffe6108,len:0x1814
load:0x4004c000,len:0x9d8
load:0x40050000,len:0x2e34
entry 0x4004c1ec
I (51) boot: ESP-IDF v4.3-dev-1904-gbaef16f9f-dirty 2nd stage bootloader
I (51) boot: compile time 10:05:26
I (51) boot: chip revision: 0
I (55) boot.esp32s2: SPI Speed      : 40MHz
I (60) boot.esp32s2: SPI Mode       : DIO
I (64) boot.esp32s2: SPI Flash Size : 4MB
W (69) boot.esp32s2: PRO CPU has been reset by WDT.
W (75) boot.esp32s2: WDT reset info: PRO CPU PC=0x4004c3ee
I (81) boot: Enabling RNG early entropy source...
I (86) boot: Partition Table:
I (90) boot: ## Label            Usage          Type ST Offset   Length
I (97) boot:  0 nvs              WiFi data        01 02 00009000 00005000
I (105) boot:  1 otadata          OTA data         01 00 0000e000 00002000
I (112) boot:  2 app0             OTA app          00 10 00010000 001d0000
I (120) boot:  3 app1             OTA app          00 11 001e0000 001d0000
I (127) boot:  4 eeprom           Unknown data     01 99 003b0000 00001000
I (135) boot:  5 spiffs           Unknown data     01 82 003b1000 0004f000
I (142) boot: End of partition table
I (147) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f000020 size=0x363c4 (222148) map
I (217) esp_image: segment 1: paddr=0x000463ec vaddr=0x3ffc8c00 size=0x03cac ( 15532) load
I (222) esp_image: segment 2: paddr=0x0004a0a0 vaddr=0x40024000 size=0x00404 (  1028) load
0x40024000: _WindowOverflow4 at E:/Dev/Espressif/esp-idf/components/freertos/port/xtensa/xtensa_vectors.S:1730

I (224) esp_image: segment 3: paddr=0x0004a4ac vaddr=0x40024404 size=0x05b6c ( 23404) load
0x40024404: _coredump_iram_start at ??:?

I (241) esp_image: segment 4: paddr=0x00050020 vaddr=0x40080020 size=0xbcc44 (773188) map
0x40080020: _stext at ??:?

I (456) esp_image: segment 5: paddr=0x0010cc6c vaddr=0x40029f70 size=0x0ec88 ( 60552) load
0x40029f70: agc_reg_init at ??:?

I (477) esp_image: segment 6: paddr=0x0011b8fc vaddr=0x40070000 size=0x0002c (    44) load
0x40070000: _rtc_code_start at ??:?

I (489) boot: Loaded app from partition at offset 0x10000
I (489) boot: Disabling RNG early entropy source...
I (500) cache: Instruction cache        : size 8KB, 4Ways, cache line size 32Byte
I (501) cpu_start: Pro cpu up.
D (554) clk: RTC_SLOW_CLK calibrat^C
E:\Source\wylas\beamatouch>

ESP-IDF version is v4.3-dev-1901-g178b122c1 plus the changes I made for issue 6091 and issue 6316
See https://github.com/william-ferguson-au/ ... 2020-11-18

william.ferguson.au
Posts: 107
Joined: Wed Jan 02, 2019 8:55 am

Re: WDT timeout in bootloader for ESP32s2

Postby william.ferguson.au » Fri Jan 08, 2021 4:19 am

Hi Angus. Some answers.

Yes the apps is definitely running for 1.2 seconds. There is app log showing.

Yes, the log output indicates that it is past the bootloader and into the app. I assumed it had to be to do with the bootloader because the address given only appears to be valid for the bootloader, not the app.

addr2line for the app gives:

Code: Select all

E:\Source\wylas\beamatouch>xtensa-esp32s2-elf-addr2line -pfiaC -e build/beamatouch.elf 0x4004c3ee
0x4004c3ee: ?? ??:0
After printing "boot.esp32s2: WDT reset info: PRO CPU PC=0x4004c3ee" it starts the app, runs for about 1.2s and then resets. Extended log here:

Code: Select all

ESP-ROM:esp32s2-rc4-20191025
Build:Oct 25 2019
rst:0x8 (TG1WDT_SYS_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)
Saved PC:0x40334a6f
SPIWP:0xee
mode:DIO, clock div:2
load:0x3ffe6100,len:0x8
load:0x3ffe6108,len:0x1814
load:0x4004c000,len:0x9d8
load:0x40050000,len:0x2e34
entry 0x4004c1ec
I (51) boot: ESP-IDF v4.3-dev-1904-gbaef16f9f-dirty 2nd stage bootloader
I (51) boot: compile time 10:05:26
I (51) boot: chip revision: 0
I (55) boot.esp32s2: SPI Speed      : 40MHz
I (60) boot.esp32s2: SPI Mode       : DIO
I (64) boot.esp32s2: SPI Flash Size : 4MB
W (69) boot.esp32s2: PRO CPU has been reset by WDT.
W (75) boot.esp32s2: WDT reset info: PRO CPU PC=0x4004c3ee
I (81) boot: Enabling RNG early entropy source...
I (86) boot: Partition Table:
I (90) boot: ## Label            Usage          Type ST Offset   Length
I (97) boot:  0 nvs              WiFi data        01 02 00009000 00005000
I (105) boot:  1 otadata          OTA data         01 00 0000e000 00002000
I (112) boot:  2 app0             OTA app          00 10 00010000 001d0000
I (120) boot:  3 app1             OTA app          00 11 001e0000 001d0000
I (127) boot:  4 eeprom           Unknown data     01 99 003b0000 00001000
I (135) boot:  5 spiffs           Unknown data     01 82 003b1000 0004f000
I (142) boot: End of partition table
I (147) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f000020 size=0x363c4 (222148) map
I (217) esp_image: segment 1: paddr=0x000463ec vaddr=0x3ffc8c00 size=0x03cac ( 15532) load
I (222) esp_image: segment 2: paddr=0x0004a0a0 vaddr=0x40024000 size=0x00404 (  1028) load
0x40024000: _WindowOverflow4 at E:/Dev/Espressif/esp-idf/components/freertos/port/xtensa/xtensa_vectors.S:1730

I (224) esp_image: segment 3: paddr=0x0004a4ac vaddr=0x40024404 size=0x05b6c ( 23404) load
0x40024404: _coredump_iram_start at ??:?

I (241) esp_image: segment 4: paddr=0x00050020 vaddr=0x40080020 size=0xbcc44 (773188) map
0x40080020: _stext at ??:?

I (456) esp_image: segment 5: paddr=0x0010cc6c vaddr=0x40029f70 size=0x0ec88 ( 60552) load
0x40029f70: agc_reg_init at ??:?

I (477) esp_image: segment 6: paddr=0x0011b8fc vaddr=0x40070000 size=0x0002c (    44) load
0x40070000: _rtc_code_start at ??:?

I (489) boot: Loaded app from partition at offset 0x10000
I (489) boot: Disabling RNG early entropy source...
I (500) cache: Instruction cache        : size 8KB, 4Ways, cache line size 32Byte
I (501) cpu_start: Pro cpu up.
D (554) clk: RTC_SLOW_CLK calibration value: 5213434
I (560) cpu_start: Pro cpu start user code
I (560) cpu_start: cpu freq: 160000000
I (560) cpu_start: Application information:
I (564) cpu_start: Project name:     beamatouch
I (569) cpu_start: App version:      6
I (574) cpu_start: Compile time:     Jan  8 2021 10:05:12
I (580) cpu_start: ELF file SHA256:  dd53e6f03cb9a27a...
I (586) cpu_start: ESP-IDF:          v4.3-dev-1904-gbaef16f9f-dirty
V (593) memory_layout: reserved range is 0x3f0363c4 - 0x3f0363e4
D (599) memory_layout: Checking 4 reserved memory ranges:
D (604) memory_layout: Reserved memory range 0x3ff9e000 - 0x3ff9e02c
D (611) memory_layout: Reserved memory range 0x3ffb4000 - 0x3ffc8bf8
D (617) memory_layout: Reserved memory range 0x3ffc8c00 - 0x3ffd5130
D (624) memory_layout: Reserved memory range 0x3ffffa10 - 0x40000000
D (630) memory_layout: Building list of available memory regions:
V (636) memory_layout: Examining memory region 0x3ff9e000 - 0x3ffa0000
V (643) memory_layout: Start of region 0x3ff9e000 - 0x3ffa0000 overlaps reserved 0x3ff9e000 - 0x3ff9e02c
D (652) memory_layout: Available memory region 0x3ff9e02c - 0x3ffa0000
V (659) memory_layout: Examining memory region 0x3ffb4000 - 0x3ffb6000
V (666) memory_layout: Region 0x3ffb4000 - 0x3ffb6000 inside of reserved 0x3ffb4000 - 0x3ffc8bf8
V (674) memory_layout: Examining memory region 0x3ffb6000 - 0x3ffb8000
V (681) memory_layout: Region 0x3ffb6000 - 0x3ffb8000 inside of reserved 0x3ffb4000 - 0x3ffc8bf8
V (690) memory_layout: Examining memory region 0x3ffb8000 - 0x3ffbc000
V (697) memory_layout: Region 0x3ffb8000 - 0x3ffbc000 inside of reserved 0x3ffb4000 - 0x3ffc8bf8
V (705) memory_layout: Examining memory region 0x3ffbc000 - 0x3ffc0000
V (712) memory_layout: Region 0x3ffbc000 - 0x3ffc0000 inside of reserved 0x3ffb4000 - 0x3ffc8bf8
V (721) memory_layout: Examining memory region 0x3ffc0000 - 0x3ffc4000
V (727) memory_layout: Region 0x3ffc0000 - 0x3ffc4000 inside of reserved 0x3ffb4000 - 0x3ffc8bf8
V (736) memory_layout: Examining memory region 0x3ffc4000 - 0x3ffc8000
V (743) memory_layout: Region 0x3ffc4000 - 0x3ffc8000 inside of reserved 0x3ffb4000 - 0x3ffc8bf8
V (752) memory_layout: Examining memory region 0x3ffc8000 - 0x3ffcc000
V (758) memory_layout: Start of region 0x3ffc8000 - 0x3ffcc000 overlaps reserved 0x3ffb4000 - 0x3ffc8bf8
V (768) memory_layout: End of region 0x3ffc8bf8 - 0x3ffcc000 overlaps reserved 0x3ffc8c00 - 0x3ffd5130
V (777) memory_layout: Examining memory region 0x3ffcc000 - 0x3ffd0000
V (784) memory_layout: Region 0x3ffcc000 - 0x3ffd0000 inside of reserved 0x3ffc8c00 - 0x3ffd5130
V (793) memory_layout: Examining memory region 0x3ffd0000 - 0x3ffd4000
V (799) memory_layout: Region 0x3ffd0000 - 0x3ffd4000 inside of reserved 0x3ffc8c00 - 0x3ffd5130
V (808) memory_layout: Examining memory region 0x3ffd4000 - 0x3ffd8000
V (815) memory_layout: Start of region 0x3ffd4000 - 0x3ffd8000 overlaps reserved 0x3ffc8c00 - 0x3ffd5130
D (824) memory_layout: Available memory region 0x3ffd5130 - 0x3ffd8000
V (831) memory_layout: Examining memory region 0x3ffd8000 - 0x3ffdc000
D (838) memory_layout: Available memory region 0x3ffd8000 - 0x3ffdc000
V (844) memory_layout: Examining memory region 0x3ffdc000 - 0x3ffe0000
D (851) memory_layout: Available memory region 0x3ffdc000 - 0x3ffe0000
V (857) memory_layout: Examining memory region 0x3ffe0000 - 0x3ffe4000
D (864) memory_layout: Available memory region 0x3ffe0000 - 0x3ffe4000
V (870) memory_layout: Examining memory region 0x3ffe4000 - 0x3ffe8000
D (877) memory_layout: Available memory region 0x3ffe4000 - 0x3ffe8000
V (884) memory_layout: Examining memory region 0x3ffe8000 - 0x3ffec000
D (890) memory_layout: Available memory region 0x3ffe8000 - 0x3ffec000
V (897) memory_layout: Examining memory region 0x3ffec000 - 0x3fff0000
D (903) memory_layout: Available memory region 0x3ffec000 - 0x3fff0000
V (910) memory_layout: Examining memory region 0x3fff0000 - 0x3fff4000
D (917) memory_layout: Available memory region 0x3fff0000 - 0x3fff4000
V (923) memory_layout: Examining memory region 0x3fff4000 - 0x3fff8000
D (930) memory_layout: Available memory region 0x3fff4000 - 0x3fff8000
V (936) memory_layout: Examining memory region 0x3fff8000 - 0x3fffc000
D (943) memory_layout: Available memory region 0x3fff8000 - 0x3fffc000
V (950) memory_layout: Examining memory region 0x3fffc000 - 0x40000000
V (956) memory_layout: End of region 0x3fffc000 - 0x40000000 overlaps reserved 0x3ffffa10 - 0x40000000
D (966) memory_layout: Available memory region 0x3fffc000 - 0x3ffffa10
I (972) heap_init: Initializing. RAM available for dynamic allocation:
D (980) heap_init: New heap initialised at 0x3ff9e02c
I (985) heap_init: At 3FF9E02C len 00001FD4 (7 KiB): RTCRAM
D (991) heap_init: New heap initialised at 0x3ffd5130
I (996) heap_init: At 3FFD5130 len 00026ED0 (155 KiB): DRAM
I (1002) heap_init: At 3FFFC000 len 00003A10 (14 KiB): DRAM
V (1009) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): checking args
V (1015) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): Args okay. Resulting flags 0xE
D (1023) intr_alloc: Connected src 49 to int 2 (cpu 0)
D (1029) FLASH_HAL: extra_dummy: 0
V (1032) memspi: raw_chip_id: 164020

V (1035) memspi: chip_id: 204016

V (1039) memspi: raw_chip_id: 164020

V (1043) memspi: chip_id: 204016

D (1046) spi_flash: trying chip: issi
D (1050) spi_flash: trying chip: gd
D (1054) spi_flash: trying chip: mxic
D (1057) spi_flash: trying chip: winbond
D (1061) spi_flash: trying chip: generic
I (1065) spi_flash: detected chip: generic
I (1070) spi_flash: flash io: dio
V (1078) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): checking args
V (1080) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): Args okay. Resulting flags 0xE0E
D (1089) intr_alloc: Connected src 73 to int 10 (cpu 0)
D (1094) cpu_start: Setting C++ exception workarounds.
V (1099) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): checking args
V (1106) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): Args okay. Resulting flags 0x40E
D (1114) intr_alloc: Connected src 28 to int 3 (cpu 0)
I (1119) cpu_start: Starting scheduler on PRO CPU.
D (1125) heap_init: New heap initialised at 0x3fffc000
V (1125) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): checking args
V (1125) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): Args okay. Resulting flags 0xE
D (1125) intr_alloc: Connected src 17 to int 9 (cpu 0)
I (1145) beamatouch_main: Logger initialised
V (1145) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): checking args
V (1155) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): Args okay. Resulting flags 0x2
D (1165) intr_alloc: Connected src 23 to int 12 (cpu 0)
I (1165) gpio: GPIO[36]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (1175) gpio: GPIO[34]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (1185) gpio: GPIO[35]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (1195) gpio: GPIO[21]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (1205) gpio: GPIO[33]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (1215) gpio: GPIO[26]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
ESP-ROM:esp32s2-rc4-20191025
Build:Oct 25 2019
rst:0x8 (TG1WDT_SYS_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)
Saved PC:0x40334a71
SPIWP:0xee
mode:DIO, clock div:2
load:0x3ffe6100,len:0x8
load:0x3ffe6108,len:0x1814
load:0x4004c000,len:0x9d8
load:0x40050000,len:0x2e34
entry 0x4004c1ec
I (51) boot: ESP-IDF v4.3-dev-1904-gbaef16f9f-dirty 2nd stage bootloader
I (51) boot: compile time 10:05:26
I (51) boot: chip revision: 0
I (55) boot.esp32s2: SPI Speed      : 40MHz
I (60) boot.esp32s2: SPI Mode       : DIO
I (64) boot.esp32s2: SPI Flash Size : 4MB
W (69) boot.esp32s2: PRO CPU has been reset by WDT.
W (75) boot.esp32s2: WDT reset info: PRO CPU PC=0x4004c3ee
I (81) boot: Enabling RNG early entropy source...
I (86) boot: Partition Table:
I (90) boot: ## Label            Usage          Type ST Offset   Length
I (97) boot:  0 nvs              WiFi data        01 02 00009000 00005000
I (105) boot:  1 otadata          OTA data         01 00 0000e000 00002000
I (112) boot:  2 app0             OTA app          00 10 00010000 001d0000
I (120) boot:  3 app1             OTA app          00 11 001e0000 001d0000
I (127) boot:  4 eeprom           Unknown data     01 99 003b0000 00001000
I (135) boot:  5 spiffs           Unknown data     01 82 003b1000 0004f000
I (142) boot: End of partition table
I (147) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f000020 size=0x363c4 (222148) map
I (217) esp_image: segment 1: paddr=0x000463ec vaddr=0x3ffc8c00 size=0x03cac ( 15532) load
I (222) esp_image: segment 2: paddr=0x0004a0a0 vaddr=0x40024000 size=0x00404 (  1028) load
0x40024000: _WindowOverflow4 at E:/Dev/Espressif/esp-idf/components/freertos/port/xtensa/xtensa_vectors.S:1730

I (224) esp_image: segment 3: paddr=0x0004a4ac vaddr=0x40024404 size=0x05b6c ( 23404) load
0x40024404: _coredump_iram_start at ??:?

I (241) esp_image: segment 4: paddr=0x00050020 vaddr=0x40080020 size=0xbcc44 (773188) map
0x40080020: _stext at ??:?

I (456) esp_image: segment 5: paddr=0x0010cc6c vaddr=0x40029f70 size=0x0ec88 ( 60552) load
0x40029f70: agc_reg_init at ??:?

I (477) esp_image: segment 6: paddr=0x0011b8fc vaddr=0x40070000 size=0x0002c (    44) load
0x40070000: _rtc_code_start at ??:?

I (489) boot: Loaded app from partition at offset 0x10000
I (489) boot: Disabling RNG early entropy source...
I (500) cache: Instruction cache        : size 8KB, 4Ways, cache line size 32Byte
I (501) cpu_start: Pro cpu up.
D (554) clk: RTC_SLOW_CLK calibration value: 5217985
I (560) cpu_start: Pro cpu start user code
I (560) cpu_start: cpu freq: 160000000
I (560) cpu_start: Application information:
I (564) cpu_start: Project name:     beamatouch
I (569) cpu_start: App version:      6
I (574) cpu_start: Compile time:     Jan  8 2021 10:05:12
I (580) cpu_start: ELF file SHA256:  dd53e6f03cb9a27a...
I (586) cpu_start: ESP-IDF:          v4.3-dev-1904-gbaef16f9f-dirty
V (593) memory_layout: reserved range is 0x3f0363c4 - 0x3f0363e4
D (599) memory_layout: Checking 4 reserved memory ranges:
D (604) memory_layout: Reserved memory range 0x3ff9e000 - 0x3ff9e02c
D (611) memory_layout: Reserved memory range 0x3ffb4000 - 0x3ffc8bf8
D (617) memory_layout: Reserved memory range 0x3ffc8c00 - 0x3ffd5130
D (624) memory_layout: Reserved memory range 0x3ffffa10 - 0x40000000
D (630) memory_layout: Building list of available memory regions:
V (636) memory_layout: Examining memory region 0x3ff9e000 - 0x3ffa0000
V (643) memory_layout: Start of region 0x3ff9e000 - 0x3ffa0000 overlaps reserved 0x3ff9e000 - 0x3ff9e02c
D (652) memory_layout: Available memory region 0x3ff9e02c - 0x3ffa0000
V (659) memory_layout: Examining memory region 0x3ffb4000 - 0x3ffb6000
V (666) memory_layout: Region 0x3ffb4000 - 0x3ffb6000 inside of reserved 0x3ffb4000 - 0x3ffc8bf8
V (674) memory_layout: Examining memory region 0x3ffb6000 - 0x3ffb8000
V (681) memory_layout: Region 0x3ffb6000 - 0x3ffb8000 inside of reserved 0x3ffb4000 - 0x3ffc8bf8
V (690) memory_layout: Examining memory region 0x3ffb8000 - 0x3ffbc000
V (697) memory_layout: Region 0x3ffb8000 - 0x3ffbc000 inside of reserved 0x3ffb4000 - 0x3ffc8bf8
V (705) memory_layout: Examining memory region 0x3ffbc000 - 0x3ffc0000
V (712) memory_layout: Region 0x3ffbc000 - 0x3ffc0000 inside of reserved 0x3ffb4000 - 0x3ffc8bf8
V (721) memory_layout: Examining memory region 0x3ffc0000 - 0x3ffc4000
V (727) memory_layout: Region 0x3ffc0000 - 0x3ffc4000 inside of reserved 0x3ffb4000 - 0x3ffc8bf8
V (736) memory_layout: Examining memory region 0x3ffc4000 - 0x3ffc8000
V (743) memory_layout: Region 0x3ffc4000 - 0x3ffc8000 inside of reserved 0x3ffb4000 - 0x3ffc8bf8
V (752) memory_layout: Examining memory region 0x3ffc8000 - 0x3ffcc000
V (758) memory_layout: Start of region 0x3ffc8000 - 0x3ffcc000 overlaps reserved 0x3ffb4000 - 0x3ffc8bf8
V (768) memory_layout: End of region 0x3ffc8bf8 - 0x3ffcc000 overlaps reserved 0x3ffc8c00 - 0x3ffd5130
V (777) memory_layout: Examining memory region 0x3ffcc000 - 0x3ffd0000
V (784) memory_layout: Region 0x3ffcc000 - 0x3ffd0000 inside of reserved 0x3ffc8c00 - 0x3ffd5130
V (793) memory_layout: Examining memory region 0x3ffd0000 - 0x3ffd4000
V (799) memory_layout: Region 0x3ffd0000 - 0x3ffd4000 inside of reserved 0x3ffc8c00 - 0x3ffd5130
V (808) memory_layout: Examining memory region 0x3ffd4000 - 0x3ffd8000
V (815) memory_layout: Start of region 0x3ffd4000 - 0x3ffd8000 overlaps reserved 0x3ffc8c00 - 0x3ffd5130
D (824) memory_layout: Available memory region 0x3ffd5130 - 0x3ffd8000
V (831) memory_layout: Examining memory region 0x3ffd8000 - 0x3ffdc000
D (838) memory_layout: Available memory region 0x3ffd8000 - 0x3ffdc000
V (844) memory_layout: Examining memory region 0x3ffdc000 - 0x3ffe0000
D (851) memory_layout: Available memory region 0x3ffdc000 - 0x3ffe0000
V (857) memory_layout: Examining memory region 0x3ffe0000 - 0x3ffe4000
D (864) memory_layout: Available memory region 0x3ffe0000 - 0x3ffe4000
V (871) memory_layout: Examining memory region 0x3ffe4000 - 0x3ffe8000
D (877) memory_layout: Available memory region 0x3ffe4000 - 0x3ffe8000
V (884) memory_layout: Examining memory region 0x3ffe8000 - 0x3ffec000
D (890) memory_layout: Available memory region 0x3ffe8000 - 0x3ffec000
V (897) memory_layout: Examining memory region 0x3ffec000 - 0x3fff0000
D (903) memory_layout: Available memory region 0x3ffec000 - 0x3fff0000
V (910) memory_layout: Examining memory region 0x3fff0000 - 0x3fff4000
D (917) memory_layout: Available memory region 0x3fff0000 - 0x3fff4000
V (923) memory_layout: Examining memory region 0x3fff4000 - 0x3fff8000
D (930) memory_layout: Available memory region 0x3fff4000 - 0x3fff8000
V (936) memory_layout: Examining memory region 0x3fff8000 - 0x3fffc000
D (943) memory_layout: Available memory region 0x3fff8000 - 0x3fffc000
V (950) memory_layout: Examining memory region 0x3fffc000 - 0x40000000
V (956) memory_layout: End of region 0x3fffc000 - 0x40000000 overlaps reserved 0x3ffffa10 - 0x40000000
D (966) memory_layout: Available memory region 0x3fffc000 - 0x3ffffa10
I (972) heap_init: Initializing. RAM available for dynamic allocation:
D (980) heap_init: New heap initialised at 0x3ff9e02c
I (985) heap_init: At 3FF9E02C len 00001FD4 (7 KiB): RTCRAM
D (991) heap_init: New heap initialised at 0x3ffd5130
I (996) heap_init: At 3FFD5130 len 00026ED0 (155 KiB): DRAM
I (1002) heap_init: At 3FFFC000 len 00003A10 (14 KiB): DRAM
V (1009) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): checking args
V (1015) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): Args okay. Resulting flags 0xE
D (1023) intr_alloc: Connected src 49 to int 2 (cpu 0)
D (1029) FLASH_HAL: extra_dummy: 0
V (1032) memspi: raw_chip_id: 164020

V (1035) memspi: chip_id: 204016

V (1039) memspi: raw_chip_id: 164020

V (1043) memspi: chip_id: 204016

D (1046) spi_flash: trying chip: issi
D (1050) spi_flash: trying chip: gd
D (1054) spi_flash: trying chip: mxic
D (1057) spi_flash: trying chip: winbond
D (1061) spi_flash: trying chip: generic
I (1065) spi_flash: detected chip: generic
I (1070) spi_flash: flash io: dio
V (1078) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): checking args
V (1080) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): Args okay. Resulting flags 0xE0E
D (1089) intr_alloc: Connected src 73 to int 10 (cpu 0)
D (1094) cpu_start: Setting C++ exception workarounds.
V (1099) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): checking args
V (1106) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): Args okay. Resulting flags 0x40E
D (1114) intr_alloc: Connected src 28 to int 3 (cpu 0)
I (1119) cpu_start: Starting scheduler on PRO CPU.
D (1125) heap_init: New heap initialised at 0x3fffc000
V (1125) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): checking args
V (1125) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): Args okay. Resulting flags 0xE
D (1125) intr_alloc: Connected src 17 to int 9 (cpu 0)
I (1145) beamatouch_main: Logger initialised
V (1145) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): checking args
V (1155) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): Args okay. Resulting flags 0x2
D (1165) intr_alloc: Connected src 23 to int 12 (cpu 0)
I (1165) gpio: GPIO[36]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (1175) gpio: GPIO[34]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (1185) gpio: GPIO[35]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (1195) gpio: GPIO[21]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (1205) gpio: GPIO[33]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (1215) gpio: GPIO[26]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
ESP-ROM:esp32s2-rc4-20191025
Build:Oct 25 2019
rst:0x8 (TG1WDT_SYS_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)
Saved PC:0x40334a6d
SPIWP:0xee
mode:DIO, clock div:2
load:0x3ffe6100,len:0x8
load:0x3ffe6108,len:0x1814
load:0x4004c000,len:0x9d8
load:0x40050000,len:0x2e34
entry 0x4004c1ec
I (51) boot: ESP-IDF v4.3-dev-1904-gbaef16f9f-dirty 2nd stage bootloader
I (51) boot: compile time 10:05:26
I (51) boot: chip revision: 0
I (55) boot.esp32s2: SPI Speed      : 40MHz
I (60) boot.esp32s2: SPI Mode       : DIO
I (64) boot.esp32s2: SPI Flash Size : 4MB
W (69) boot.esp32s2: PRO CPU has been reset by WDT.
W (75) boot.esp32s2: WDT reset info: PRO CPU PC=0x4004c3ee
I (81) boot: Enabling RNG early entropy source...
I (86) boot: Partition Table:
I (90) boot: ## Label            Usage          Type ST Offset   Length
I (97) boot:  0 nvs              WiFi data        01 02 00009000 00005000
I (105) boot:  1 otadata          OTA data         01 00 0000e000 00002000
I (112) boot:  2 app0             OTA app          00 10 00010000 001d0000
I (120) boot:  3 app1             OTA app          00 11 001e0000 001d0000
I (127) boot:  4 eeprom           Unknown data     01 99 003b0000 00001000
I (135) boot:  5 spiffs           Unknown data     01 82 003b1000 0004f000
I (142) boot: End of partition table
I (147) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f000020 size=0x363c4 (222148) map
I (217) esp_image: segment 1: paddr=0x000463ec vaddr=0x3ffc8c00 size=0x03cac ( 15532) load
I (222) esp_image: segment 2: paddr=0x0004a0a0 vaddr=0x40024000 size=0x00404 (  1028) load
0x40024000: _WindowOverflow4 at E:/Dev/Espressif/esp-idf/components/freertos/port/xtensa/xtensa_vectors.S:1730

I (224) esp_image: segment 3: paddr=0x0004a4ac vaddr=0x40024404 size=0x05b6c ( 23404) load
0x40024404: _coredump_iram_start at ??:?

I (241) esp_image: segment 4: paddr=0x00050020 vaddr=0x40080020 size=0xbcc44 (773188) map
0x40080020: _stext at ??:?

I (456) esp_image: segment 5: paddr=0x0010cc6c vaddr=0x40029f70 size=0x0ec88 ( 60552) load
0x40029f70: agc_reg_init at ??:?

I (477) esp_image: segment 6: paddr=0x0011b8fc vaddr=0x40070000 size=0x0002c (    44) load
0x40070000: _rtc_code_start at ??:?

I (489) boot: Loaded app from partition at offset 0x10000
I (489) boot: Disabling RNG early entropy source...
I (500) cache: Instruction cache        : size 8KB, 4Ways, cache line size 32Byte
I (501) cpu_start: Pro cpu up.
D (554) clk: RTC_SLOW_CLK calibrat^C
E:\Source\wylas\beamatouch>
ESP-IDF version is v4.3-dev-1901-g178b122c1 plus the changes I made for issue 6091 and issue 6316
See https://github.com/william-ferguson-au/ ... 2020-11-18

william.ferguson.au
Posts: 107
Joined: Wed Jan 02, 2019 8:55 am

Re: WDT timeout in bootloader for ESP32s2

Postby william.ferguson.au » Fri Jan 08, 2021 4:24 am

To put this in context.

This code works

Code: Select all

    // All My setup code  is above here.

    ESP_LOGI(TAG, "Finished setup");

    // NB this line was added just to stop the app from aborting during startup. It is a hack.
    // See https://www.esp32.com/viewtopic.php?f=2&t=18842
    ESP_LOGI(TAG, "Finished setup2"); //

    while (true) {
        vTaskDelay(LOOP_DELAY_MILLIS / portTICK_PERIOD_MS);
    }
This code causes it to abort as per the logs above. And it aborts before never gets anywhere near the 2 lines of logs shown.

Code: Select all

    // All My setup code  is above here.

    ESP_LOGI(TAG, "Finished setup");

    // NB this line was added just to stop the app from aborting during startup. It is a hack.
    // See https://www.esp32.com/viewtopic.php?f=2&t=18842
    // ESP_LOGI(TAG, "Finished setup2"); //

    while (true) {
        vTaskDelay(LOOP_DELAY_MILLIS / portTICK_PERIOD_MS);
    }

william.ferguson.au
Posts: 107
Joined: Wed Jan 02, 2019 8:55 am

Re: WDT timeout in bootloader for ESP32s2

Postby william.ferguson.au » Fri Jan 08, 2021 4:27 am

@ESP_Angus we realise this might be intractable without the source code.
How can we share that with you privately?

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: WDT timeout in bootloader for ESP32s2

Postby ESP_Angus » Fri Jan 08, 2021 4:40 am

Hi william,

In the standard ESP-IDF config, TG1WDT_SYS_RST is from the "INT WDT timer". Normally an interrupt WDT will trigger an interrupt first to run the panic handler, but if the interrupt can't be handled (for example if it's triggered while running in a high priority ISR with interrupts masked) then the hardware WDT will step through to forcing a reset.

(The WDT mentioned in the bootloader config is the RTC WDT, which has a different associated reset cause.)

It's possible there is some code in the app which is disabling interrupts (or running in an ISR) for a period of time very close to the configured INT WDT timer period. Because changes in binary layout can cause changes in the flash cache access pattern and therefore small changes in the timing of the app, it's possible that one particular .bin file layout is marginally slower than the others and is causing the time with exceptions disabled to nudge over the WDT threshold.

It seems like there may be also be an ESP-IDF bug that in the case of TG1WDT_SYS_RST, the "watchdog" address printed by the bootloader is wrong. Will check this.

If you look up the "Saved PC" address printed by the ROM earlier in the boot, do you get anything meaningful? In the log it seems like there are a few slightly different addresses being logged, so this may help give you some clue of where the CPU is running when it triggers.

If it is a long-running ISR that's triggering the INT WDT then the solution may be as simple as increasing the INT WDT timeout in menuconfig, if you're happy for interrupts to be held up for that period of time.

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: WDT timeout in bootloader for ESP32s2

Postby ESP_Angus » Fri Jan 08, 2021 4:41 am

william.ferguson.au wrote:
Fri Jan 08, 2021 4:27 am
@ESP_Angus we realise this might be intractable without the source code.
How can we share that with you privately?
If you try the things mentioned above and still are not able to progress, then I'll PM you a way to share the source.

william.ferguson.au
Posts: 107
Joined: Wed Jan 02, 2019 8:55 am

Re: WDT timeout in bootloader for ESP32s2

Postby william.ferguson.au » Fri Jan 08, 2021 5:42 am

Angus, none of those Saved PC addresses look valid:

Code: Select all

E:\Source\wylas\beamatouch>xtensa-esp32s2-elf-addr2line -pfiaC -e build/beamatouch.elf 0x40334a6f
0x40334a6f: ?? ??:0

E:\Source\wylas\beamatouch>xtensa-esp32s2-elf-addr2line -pfiaC -e build/beamatouch.elf 0x40334a71
0x40334a71: ?? ??:0

E:\Source\wylas\beamatouch>xtensa-esp32s2-elf-addr2line -pfiaC -e build/beamatouch.elf 0x40334a6d
0x40334a6d: ?? ??:0
We only have 3 interrupts. All short lived:

Code: Select all

static void IRAM_ATTR bananaplug_isr_handler(void*) {
    // Check for and set a circuitClosed here and then notify main loop to handle it.
    if (!circuit_closed) {
        circuit_closed = true;
        uint64_t received_at_millis = millis();
        xQueueSendFromISR(bananaplug_evt_queue, &received_at_millis, NULL);
    }
}

void IRAM_ATTR beamatouch_power_isr_handler(void*) {
    xQueueSendFromISR(power_evt_queue, nullptr, NULL);
}

static void IRAM_ATTR button_isr_handler(void*) {
    uint32_t ignored = 0;
    xQueueSendFromISR(button_evt_queue, &ignored, NULL);
}

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: WDT timeout in bootloader for ESP32s2

Postby ESP_Angus » Fri Jan 08, 2021 7:19 am

PM sent. :)

william.ferguson.au
Posts: 107
Joined: Wed Jan 02, 2019 8:55 am

Re: WDT timeout in bootloader for ESP32s2

Postby william.ferguson.au » Fri Jan 15, 2021 3:47 am

OK, much thanks to Angus for help on this one.

Turns out it was a conflict between flash and PSRAM brought on by our erroneous use of GPIO26 on the ESP32S2 Wrover.

William

marclee
Posts: 51
Joined: Fri Apr 09, 2021 1:09 pm

Re: WDT timeout in bootloader for ESP32s2

Postby marclee » Wed May 19, 2021 10:06 am

Turns out it was a conflict between flash and PSRAM brought on by our erroneous use of GPIO26 on the ESP32S2 Wrover.

What exactly does "erroneous use" mean?

It seems that I have a similar problem with EPS32S2 Wrover.

Code: Select all

I (24) boot: ESP-IDF v4.4-dev-1254-g639e7ad49 2nd stage bootloader
I (24) boot: compile time 10:55:01
I (24) boot: chip revision: 0
I (28) boot.esp32s2: SPI Speed      : 80MHz
I (32) boot.esp32s2: SPI Mode       : DIO
I (37) boot.esp32s2: SPI Flash Size : 2MB
W (42) boot.esp32s2: PRO CPU has been reset by WDT.
W (47) boot.esp32s2: WDT reset info: PRO CPU PC=0x4004c3f6
The crash (timeout) occurs after calling the function:

Code: Select all

i2c_master_cmd_begin(i2c_num, cmd, 1000 / portTICK_RATE_MS);
I2C SDA pin is assigned to GPIO26.

Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot] and 87 guests