Skip to content

Conversation

@mikee47
Copy link
Contributor

@mikee47 mikee47 commented Sep 17, 2025

Limit sming task processing to only those messages waiting in the queue. When heavily stressed, loop never exits and tcpip messages don't get serviced.

See #2971 (comment)

@mikee47 mikee47 changed the title Fix esp32 tcpip message starvation Fix esp32 tcpip message starvation when task queue stressed Sep 17, 2025
@slaff slaff added this to the 6.2.0 milestone Sep 17, 2025
Limit sming task processing to only those messages waiting in the queue.
When heavily stressed, loop never exits and tcpip messages don't get serviced.
@mikee47 mikee47 force-pushed the fix/esp32-task-starvation branch from dc76fa2 to e2eee2f Compare September 17, 2025 08:36
@SmingHub SmingHub deleted a comment from what-the-diff bot Sep 17, 2025
@pljakobs
Copy link
Contributor

this works on the esp32 proper, but on the 32c3, I still get a stuck bootloader with Basic_Tasks

rst:0x15 (USB_UART_CHIP_RESET),boot:0xd (SPI_FAST_FLASH_BOOT)
Saved PC:0x42020d2a
SPIWP:0xee
mode:DIO, clock div:2
load:0x3fcd5820,len:0x1738
load:0x403cc710,len:0xb9c
load:0x403ce710,len:0x2e40
entry 0x403cc71a
I (24) boot: ESP-IDF v5.2.1-sming-1 2nd stage bootloader
I (24) boot: compile time Sep 17 2025 09:01:36
I (25) boot: chip revision: v0.4
I (28) boot.esp32c3: SPI Speed      : 40MHz
I (33) boot.esp32c3: SPI Mode       : DIO
I (38) boot.esp32c3: SPI Flash Size : 4MB
I (42) boot: Enabling RNG early entropy source...
I (48) boot: Partition Table:
I (51) boot: ## Label            Usage          Type ST Offset   Length
I (59) boot:  0 spiFlash         unknown          02 01 00000000 00400000
I (66) boot:  1 nvs              WiFi data        01 02 00009000 00006000
I (73) boot:  2 phy_init         RF data          01 01 0000f000 00001000
I (81) boot:  3 factory          factory app      00 00 00010000 000f0000
I (88) boot: End of partition table
I (93) esp_image: segment 0: paddr=00010020 vaddr=3c070020 size=163e0h ( 91104) map
I (121) esp_image: segment 1: paddr=00026408 vaddr=3fc90000 size=028c8h ( 10440) load
I (124) esp_image: segment 2: paddr=00028cd8 vaddr=40380000 size=07340h ( 29504) load
I (134) esp_image: segment 3: paddr=00030020 vaddr=42000020 size=6ac30h (437296) map
I (229) esp_image: segment 4: paddr=0009ac58 vaddr=40387340 size=08ad8h ( 35544) load
I (238) esp_image: segment 5: paddr=000a3738 vaddr=50000010 size=00004h (     4) load
I (244) boot: Loaded app from partition at offset 0x10000
I (244) boot: Disabling RNG early entropy source...
I (258) cpu_start: Unicore app
I (267) cpu_start: Pro cpu start user code
I (267) cpu_start: cpu freq: 160000000 Hz
I (268) cpu_start: Application information:
I (270) cpu_start: Project name:     Sming
I (275) cpu_start: App version:      6.0.x-dev-55-g98e9f4db-dirty
I (282) cpu_start: Compile time:     Sep 17 2025 09:01:31
I (288) cpu_start: ELF file SHA256:  7f57c2679...
I (293) cpu_start: ESP-IDF:          v5.2.1-sming-1
I (299) cpu_start: Min chip rev:     v0.3
I (304) cpu_start: Max chip rev:     v1.99 
I (308) cpu_start: Chip rev:         v0.4
I (313) heap_init: Initializing. RAM available for dynamic allocation:
I (321) heap_init: At 3FC98C90 len 00027370 (156 KiB): RAM
I (327) heap_init: At 3FCC0000 len 0001C710 (113 KiB): Retention RAM
I (334) heap_init: At 3FCDC710 len 00002950 (10 KiB): Retention RAM
I (341) heap_init: At 50000014 len 00001FD4 (7 KiB): RTCRAM
I (348) spi_flash: detected chip: generic
I (351) spi_flash: flash io: dio
I (356) sleep: Configure to isolate all GPIO pins in sleep state
I (362) sleep: Enable automatic switching of GPIO sleep configuration

is that just on my systems?

@pljakobs
Copy link
Contributor

okay, my firmware builds and starts with this fix, not sure what the problem is with the Basic_Tasks app on the 32c3

@slaff slaff merged commit 3da1acd into SmingHub:develop Sep 17, 2025
35 checks passed
@mikee47 mikee47 deleted the fix/esp32-task-starvation branch September 17, 2025 14:26
@slaff slaff mentioned this pull request Dec 16, 2025
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants