ESP32S3 + W5500 - Basic Ethernet Example detects stack overflow

diolupo
Posts: 11
Joined: Sat Nov 19, 2022 12:08 pm

ESP32S3 + W5500 - Basic Ethernet Example detects stack overflow

Postby diolupo » Fri Mar 24, 2023 12:23 pm

Hi,
I have connected as ESP32S3-DevKitC board with a Wiz850io board to test SPI ethernet on ESP32S3 device.
I have configured the Basic Ethernet Example and let it run on the board.
The example runs fine, it is able to initialize the W5500 and connect to the Ethernet, but after a while (10-15secs.) a stack overflow message is reported on the logs and the example crash.

This is the debug log:

Code: Select all

ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x15 (USB_UART_CHIP_RESET),boot:0x8 (SPI_FAST_FLASH_BOOT)
Saved PC:0x4203291a
0x4203291a: esp_pm_impl_waiti at /data/esp/v4.4.4/esp-idf/components/esp_pm/pm_impl.c:839

SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce3808,len:0x1734
load:0x403c9700,len:0xbb8
load:0x403cc700,len:0x2eb4
SHA-256 comparison failed:
Calculated: 28888b19a85be2f3217bdb6ff790acdb4fb354dfe0a9dae5d1098eb5bb1d2243
Expected: f9ee4db2b7ea8eb7ade94d05144548ed7e123d53196041edb50b4722b09fc99b
Attempting to boot anyway...
entry 0x403c9950
I (43) boot: ESP-IDF v4.4.4-dirty 2nd stage bootloader
I (43) boot: compile time 13:01:47
I (43) boot: chip revision: v0.1
I (45) boot_comm: chip revision: 1, min. bootloader chip revision: 0
I (52) boot.esp32s3: Boot SPI Speed : 80MHz
I (57) boot.esp32s3: SPI Mode       : DIO
I (62) boot.esp32s3: SPI Flash Size : 8MB
I (67) boot: Enabling RNG early entropy source...
I (72) boot: Partition Table:
I (76) boot: ## Label            Usage          Type ST Offset   Length
I (83) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (90) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (98) boot:  2 factory          factory app      00 00 00010000 00100000
I (105) boot: End of partition table
I (110) boot_comm: chip revision: 1, min. application chip revision: 0
I (117) esp_image: segment 0: paddr=00010020 vaddr=3c040020 size=11f1ch ( 73500) map
I (138) esp_image: segment 1: paddr=00021f44 vaddr=3fc93780 size=02ec4h ( 11972) load
I (141) esp_image: segment 2: paddr=00024e10 vaddr=40374000 size=0b208h ( 45576) load
I (154) esp_image: segment 3: paddr=00030020 vaddr=42000020 size=349f4h (215540) map
I (193) esp_image: segment 4: paddr=00064a1c vaddr=4037f208 size=0456ch ( 17772) load
I (204) boot: Loaded app from partition at offset 0x10000
I (204) boot: Disabling RNG early entropy source...
I (205) opi psram: vendor id : 0x0d (AP)
I (209) opi psram: dev id    : 0x02 (generation 3)
I (214) opi psram: density   : 0x03 (64 Mbit)
I (219) opi psram: good-die  : 0x01 (Pass)
I (224) opi psram: Latency   : 0x01 (Fixed)
I (229) opi psram: VCC       : 0x01 (3V)
I (233) opi psram: SRF       : 0x01 (Fast Refresh)
I (239) opi psram: BurstType : 0x01 (Hybrid Wrap)
I (244) opi psram: BurstLen  : 0x01 (32 Byte)
I (249) opi psram: Readlatency  : 0x02 (10 cycles@Fixed)
I (255) opi psram: DriveStrength: 0x00 (1/1)
I (260) spiram: Found 64MBit SPI RAM device
I (265) spiram: SPI RAM mode: sram 40m
I (270) spiram: PSRAM initialized, cache is in normal (1-core) mode.
I (277) cpu_start: Pro cpu up.
I (280) cpu_start: Starting app cpu, entry point is 0x40375340
0x40375340: call_start_cpu1 at /data/esp/v4.4.4/esp-idf/components/esp_system/port/cpu_start.c:148

I (0) cpu_start: App cpu up.
I (1018) spiram: SPI SRAM memory test OK
D (1018) efuse: In EFUSE_BLK1__DATA3_REG is used 3 bits starting with 24 bit
D (1019) efuse: In EFUSE_BLK2__DATA4_REG is used 2 bits starting with 0 bit
D (1019) efuse: In EFUSE_BLK1__DATA4_REG is used 7 bits starting with 20 bit
D (1019) efuse: In EFUSE_BLK1__DATA5_REG is used 8 bits starting with 3 bit
D (1020) efuse: In EFUSE_BLK1__DATA5_REG is used 5 bits starting with 11 bit
D (1020) efuse: In EFUSE_BLK1__DATA4_REG is used 7 bits starting with 13 bit
D (1021) efuse: In EFUSE_BLK1__DATA4_REG is used 7 bits starting with 20 bit
D (1021) efuse: In EFUSE_BLK1__DATA4_REG is used 5 bits starting with 27 bit
D (1022) efuse: In EFUSE_BLK1__DATA5_REG is used 3 bits starting with 0 bit
D (1022) efuse: In EFUSE_BLK1__DATA5_REG is used 8 bits starting with 3 bit
D (1022) efuse: In EFUSE_BLK1__DATA4_REG is used 7 bits starting with 13 bit
D (1023) efuse: In EFUSE_BLK1__DATA4_REG is used 7 bits starting with 20 bit
D (1023) efuse: In EFUSE_BLK1__DATA4_REG is used 5 bits starting with 27 bit
D (1024) efuse: In EFUSE_BLK1__DATA5_REG is used 3 bits starting with 0 bit
D (1024) efuse: In EFUSE_BLK1__DATA5_REG is used 8 bits starting with 3 bit
D (1033) clk: RTC_SLOW_CLK calibration value: 3461376
I (1033) cpu_start: Pro cpu start user code
I (1033) cpu_start: cpu freq: 160000000
I (1033) cpu_start: Application information:
I (1034) cpu_start: Project name:     ethernet_basic
I (1034) cpu_start: App version:      1
I (1034) cpu_start: Compile time:     Mar 24 2023 13:01:41
I (1034) cpu_start: ELF file SHA256:  8ee311aaaa30c43e...
I (1035) cpu_start: ESP-IDF:          v4.4.4-dirty
D (1035) memory_layout: Checking 6 reserved memory ranges:
D (1035) memory_layout: Reserved memory range 0x3d000000 - 0x3e000000
D (1035) memory_layout: Reserved memory range 0x3fc84000 - 0x3fc93774
D (1036) memory_layout: Reserved memory range 0x3fc93780 - 0x3fc97ac0
D (1036) memory_layout: Reserved memory range 0x3fceee34 - 0x3fcf0000
D (1036) memory_layout: Reserved memory range 0x40374000 - 0x40383774
0x40374000: _WindowOverflow4 at /data/esp/v4.4.4/esp-idf/components/freertos/port/xtensa/xtensa_vectors.S:1739

D (1037) memory_layout: Reserved memory range 0x600fe000 - 0x600fe000
D (1037) memory_layout: Building list of available memory regions:
D (1037) memory_layout: Available memory region 0x3fc97ac0 - 0x3fca0000
D (1038) memory_layout: Available memory region 0x3fca0000 - 0x3fcb0000
D (1038) memory_layout: Available memory region 0x3fcb0000 - 0x3fcc0000
D (1038) memory_layout: Available memory region 0x3fcc0000 - 0x3fcd0000
D (1039) memory_layout: Available memory region 0x3fcd0000 - 0x3fce0000
D (1039) memory_layout: Available memory region 0x3fce0000 - 0x3fce9710
D (1039) memory_layout: Available memory region 0x3fce9710 - 0x3fceee34
D (1040) memory_layout: Available memory region 0x3fcf0000 - 0x3fcf8000
D (1040) memory_layout: Available memory region 0x600fe000 - 0x60100000
I (1040) heap_init: Initializing. RAM available for dynamic allocation:
D (1041) heap_init: New heap initialised at 0x3fc97ac0
I (1041) heap_init: At 3FC97AC0 len 00051C50 (327 KiB): D/IRAM
I (1041) heap_init: At 3FCE9710 len 00005724 (21 KiB): STACK/DRAM
D (1042) heap_init: New heap initialised at 0x3fcf0000
I (1042) heap_init: At 3FCF0000 len 00008000 (32 KiB): DRAM
D (1042) heap_init: New heap initialised at 0x600fe000
I (1042) heap_init: At 600FE000 len 00002000 (8 KiB): RTCRAM
I (1043) spiram: Adding pool of 8192K of external SPI memory to heap allocator
D (1044) FLASH_HAL: extra_dummy: 0
D (1044) spi_flash: trying chip: issi
D (1044) spi_flash: trying chip: gd
D (1044) spi_flash: trying chip: mxic
D (1044) spi_flash: trying chip: winbond
D (1045) spi_flash: trying chip: boya
D (1045) spi_flash: trying chip: th
D (1045) spi_flash: trying chip: mxic (opi)
D (1045) spi_flash: trying chip: generic
I (1045) spi_flash: detected chip: generic
I (1045) spi_flash: flash io: dio
D (1045) cpu_start: calling init function: 0x42024500
0x42024500: _GLOBAL__sub_I___cxa_get_globals_fast at /builds/idf/crosstool-NG/.build/xtensa-esp32s3-elf/src/gcc/libstdc++-v3/libsupc++/eh_globals.cc:145

D (1046) cpu_start: calling init function: 0x4201108c
0x4201108c: s_set_default_wifi_log_level at /data/esp/v4.4.4/esp-idf/components/esp_wifi/src/wifi_init.c:63

D (1046) cpu_start: calling init function: 0x42006efc
0x42006efc: esp_ipc_init at /data/esp/v4.4.4/esp-idf/components/esp_ipc/src/esp_ipc.c:105

D (1046) cpu_start: calling init function: 0x42002348
0x42002348: esp_ota_init_app_elf_sha256 at /data/esp/v4.4.4/esp-idf/components/app_update/esp_app_desc.c:68

D (1047) intr_alloc: Connected src 59 to int 2 (cpu 0)
I (1047) sleep: Configure to isolate all GPIO pins in sleep state
I (1047) sleep: Enable automatic switching of GPIO sleep configuration
D (1048) intr_alloc: Connected src 79 to int 3 (cpu 0)
I (1048) cpu_start: Starting scheduler on PRO CPU.
D (1049) intr_alloc: Connected src 57 to int 9 (cpu 0)
D (1049) intr_alloc: Connected src 80 to int 2 (cpu 1)
I (1049) cpu_start: Starting scheduler on APP CPU.
D (1049) intr_alloc: Connected src 58 to int 3 (cpu 1)
D (1049) heap_init: New heap initialised at 0x3fce9710
I (1049) spiram: Reserving pool of 32K of internal memory for DMA/internal allocations
D (1049) spiram: Allocating block of size 32768 bytes
D (1049) intr_alloc: Connected src 52 to int 12 (cpu 0)
D (1049) esp_netif_lwip: LwIP stack has been initialized
D (1049) esp_netif_lwip: esp-netif has been successfully initialized
D (1049) event: running task for loop 0x3fceada8
D (1049) event: created task for loop 0x3fceada8
D (1049) event: created event loop 0x3fceada8
D (1049) esp_netif_objects: esp_netif_add_to_list 0x3fcebcd4
D (1049) esp_netif_objects: esp_netif_add_to_list netif added successfully (total netifs: 1)
D (1049) intr_alloc: Connected src 16 to int 13 (cpu 0)
D (1049) gdma: new group (0) at 0x3d800930
D (1049) gdma: new pair (0,0) at 0x3d80096c
D (1059) gdma: new tx channel (0,0) at 0x3d800900
D (1059) gdma: new rx channel (0,0) at 0x3d80098c
D (1059) spi: SPI2 use iomux pins.
D (1059) intr_alloc: Connected src 21 to int 17 (cpu 0)
D (1059) spi_hal: eff: 40000, limit: 80000k(/0), 0 dummy, -1 delay
D (1059) spi_master: SPI2: New device added to CS0, effective clock: 40000kHz
I (1059) w5500.mac: version=0
D (1069) esp_eth: new ethernet driver @0x3fcecfe8
I (1069) esp_eth.netif.netif_glue: 02:00:00:12:34:56
I (1069) esp_eth.netif.netif_glue: ethernet attached to netif
D (1069) event: running post ETH_EVENT:0 with handler 0x4200d898 and context 0x3fced0b4 on loop 0x3fceada8
0x4200d898: eth_action_start at /data/esp/v4.4.4/esp-idf/components/esp_eth/src/esp_eth_netif_glue.c:125

D (1069) esp_eth.netif.netif_glue: eth_action_start: 0x3fced05c, 0x3c047bf0, 0, 0x3fced1fc, 0x3fcecfe8
D (1069) esp_netif_handlers: esp_netif action has started with netif0x3fcebcd4 from event_id=0
D (1069) esp_netif_lwip: check: remote, if=0x3fcebcd4 fn=0x4201012c
0x4201012c: esp_netif_start_api at /data/esp/v4.4.4/esp-idf/components/esp_netif/lwip/esp_netif_lwip.c:700


D (1069) esp_netif_lwip: esp_netif_start_api 0x3fcebcd4
D (1069) esp_netif_lwip: esp_netif_get_hostname esp_netif:0x3fcebcd4
D (1069) esp_netif_lwip: check: local, if=0x3fcebcd4 fn=0x42010ab4
0x42010ab4: esp_netif_update_default_netif_lwip at /data/esp/v4.4.4/esp-idf/components/esp_netif/lwip/esp_netif_lwip.c:188


D (1069) esp_netif_lwip: esp_netif_update_default_netif_lwip 0x3fcebcd4
D (1069) esp_netif_lwip: call api in lwip: ret=0x0, give sem
D (1069) event: running post ETH_EVENT:0 with handler 0x420066d8 and context 0x3fced1bc on loop 0x3fceada8
0x420066d8: eth_event_handler at /data/VSCodeProjects/eth_basic/main/ethernet_example_main.c:45

I (1069) eth_example: Ethernet Started
D (3069) w5500.mac: working in 100Mbps
D (3069) w5500.mac: working in full duplex
D (3069) w5500.mac: link is up
D (3069) event: running post ETH_EVENT:2 with handler 0x4200d910 and context 0x3fced114 on loop 0x3fceada8
0x4200d910: eth_action_connected at /data/esp/v4.4.4/esp-idf/components/esp_eth/src/esp_eth_netif_glue.c:145

D (3069) esp_eth.netif.netif_glue: eth_action_connected: 0x3fced05c, 0x3c047bf0, 2, 0x3fced1fc, 0x3fcecfe8
D (3069) esp_netif_handlers: esp_netif action connected with netif0x3fcebcd4 from event_id=2
D (3069) esp_netif_lwip: check: remote, if=0x3fcebcd4 fn=0x42010338
0x42010338: esp_netif_up_api at /data/esp/v4.4.4/esp-idf/components/esp_netif/lwip/esp_netif_lwip.c:1256


D (3069) esp_netif_lwip: esp_netif_up_api esp_netif:0x3fcebcd4
D (3069) esp_netif_lwip: check: local, if=0x3fcebcd4 fn=0x42010ab4
0x42010ab4: esp_netif_update_default_netif_lwip at /data/esp/v4.4.4/esp-idf/components/esp_netif/lwip/esp_netif_lwip.c:188


D (3069) esp_netif_lwip: esp_netif_update_default_netif_lwip 0x3fcebcd4
D (3069) esp_netif_lwip: call api in lwip: ret=0x0, give sem
D (3069) esp_netif_lwip: check: remote, if=0x3fcebcd4 fn=0x4200ff50
0x4200ff50: esp_netif_dhcpc_start_api at /data/esp/v4.4.4/esp-idf/components/esp_netif/lwip/esp_netif_lwip.c:1049


D (3069) esp_netif_lwip: esp_netif_dhcpc_start_api esp_netif:0x3fcebcd4
D (3069) esp_netif_lwip: esp_netif_start_ip_lost_timer esp_netif:0x3fcebcd4
D (3069) esp_netif_lwip: if0x3fcebcd4 start ip lost tmr: no need start because netif=0x3fcebd54 interval=120 ip=0
D (3069) esp_netif_lwip: starting dhcp client
D (3069) esp_netif_lwip: call api in lwip: ret=0x0, give sem
D (3069) event: running post ETH_EVENT:2 with handler 0x420066d8 and context 0x3fced1bc on loop 0x3fceada8
0x420066d8: eth_event_handler at /data/VSCodeProjects/eth_basic/main/ethernet_example_main.c:45

I (3069) eth_example: Ethernet Link Up
I (3069) eth_example: Ethernet HW Addr 02:00:00:12:34:56
D (4069) esp_netif_lwip: esp_netif_dhcpc_cb lwip-netif:0x3fcebd54
D (4069) esp_netif_lwip: if0x3fcebcd4 ip changed=1
D (4069) event: running post IP_EVENT:4 with handler 0x4200d988 and context 0x3fced188 on loop 0x3fceada8
0x4200d988: eth_action_got_ip at /data/esp/v4.4.4/esp-idf/components/esp_eth/src/esp_eth_netif_glue.c:165

D (4069) esp_eth.netif.netif_glue: eth_action_got_ip: 0x3fced05c, 0x3c049568, 4, 0x3fced2d0, 0xffffffff
D (4069) esp_netif_handlers: esp_netif action got_ip with netif0x3fcebcd4 from event_id=4
I (4069) esp_netif_handlers: eth0 ip: 192.168.1.190, mask: 255.255.255.0, gw: 192.168.1.1
D (4069) event: running post IP_EVENT:4 with handler 0x42006608 and context 0x3fced1dc on loop 0x3fceada8
0x42006608: got_ip_event_handler at /data/VSCodeProjects/eth_basic/main/ethernet_example_main.c:74

I (4069) eth_example: Ethernet Got IP Address
I (4069) eth_example: ~~~~~~~~~~~
I (4069) eth_example: ETHIP:192.168.1.190
I (4069) eth_example: ETHMASK:255.255.255.0
I (4069) eth_example: ETHGW:192.168.1.1
I (4069) eth_example: ~~~~~~~~~~~
D (13669) spi_master: Allocate RX buffer for DMA

***ERROR*** A stack overflow in task w5500_tsk has been detected.


Backtrace: 0x40375ca2:0x3fcec9a0 0x4037a771:0x3fcec9c0 0x4037d992:0x3fcec9e0 0x4037c473:0x3fceca60 0x4037a828:0x3fceca80 0x4037a81e:0x00000000 |<-CORRUPTED
0x40375ca2: panic_abort at /data/esp/v4.4.4/esp-idf/components/esp_system/panic.c:408

0x4037a771: esp_system_abort at /data/esp/v4.4.4/esp-idf/components/esp_system/esp_system.c:137

0x4037d992: vApplicationStackOverflowHook at /data/esp/v4.4.4/esp-idf/components/freertos/port/xtensa/port.c:407

0x4037c473: vTaskSwitchContext at /data/esp/v4.4.4/esp-idf/components/freertos/tasks.c:3505

0x4037a828: _frxt_dispatch at /data/esp/v4.4.4/esp-idf/components/freertos/port/xtensa/portasm.S:436

0x4037a81e: _frxt_int_exit at /data/esp/v4.4.4/esp-idf/components/freertos/port/xtensa/portasm.S:231
Am I missing something or should I configure something to avoid this stack overflow error?

diolupo
Posts: 11
Joined: Sat Nov 19, 2022 12:08 pm

Re: ESP32S3 + W5500 - Basic Ethernet Example detects stack overflow

Postby diolupo » Fri Mar 24, 2023 2:34 pm

The problem seems to be related to the debug log verbosity.
Decreasing log level to "Info", solves the problem.

Who is online

Users browsing this forum: No registered users and 56 guests