Repository navigation
Core 3.3.12 vs 2.0.17: UDP over W5500 is 2–5x later on ESP32-S3 — is lwIP core locking the cause? #13028
Greenox-ai
started this conversation in
Question - Community Help
Replies: 2 comments
|
Core locking was brought up by many as a safety issue. I cannot comment whether it has any impact, possibly because we did not have a case where someone experienced any issue. You can try disabling it in the lib-builder or pioarduino (hybrid compile) and measure its impact. If you find that to be a cause of slowdown, we can document it for future reference. Keep in mind that between IDF 4.4 and 5.5, many things have changed everywhere. It is impossible to compare them easily. |
0 replies
|
Before blaming lwIP it is worth separating "the packet is late" from "the packet is late because the CPU was busy":
If you can post the |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
We run a motion controller on an ESP32-S3 (LilyGO T-ETH-Lite, W5500 on SPI at 20 MHz). A PC streams 100 Hz UDP points (63 bytes) through
AsyncUDP; each point is acked and executed by FastAccelStepper 2.0.1 (MCPWM/PCNT driver). We compared core 2.0.17 (IDF 4.4.7) with 3.3.12 (IDF 5.5.5) on the same board, bench and day.Conditions:
esp_ethdriver on both: 2.0.17 through a small ETH wrapper callingesp_eth_mac_new_w5500(), 3.3.12 throughETH.h. Both withETH_MAC_DEFAULT_CONFIG()(RX task priority 15, unpinned) and 20 MHz SPI.ETH.setPollPeriod(1)and(2).Results:
Interrupt mode was no better than polling. Under load, the delay is between handing the frame to the stack and the wire (transmit), not on receive.
What differs between the two cores' shipped esp32s3 sdkconfig: only
CONFIG_LWIP_TCPIP_CORE_LOCKING=yandCONFIG_LWIP_CHECK_THREAD_SAFETY=yon 3.3.12. These are the same on both:TCPIP_RECVMBOX32,UDP_RECVMBOX6;FREERTOS_HZ1000,-Os;LWIP_IRAM_OPTIMIZATIONoff.With core locking on,
tcpip_api_call()runs the send, including the W5500 SPI sequence, in the caller's task while it holds the global lock. Under inbound load the sender then waits behindtiT. That fits what we see, but we have not proven it. (Core locking also exposed an AsyncUDP deadlock on bursts, filed as #ISSUE.)Questions:
USE_TCPIP_CORE_LOCK_FOR_THREAD_SAFETYselects it, per Crash with error message: "Required to lock TCPIP core functionality" #10526)? Could an Arduino build without Matter ship with it off, or could a variant of the libs without core locking be offered?custom_sdkconfig) without breaking anything other than Matter?We are staying on 2.0.17 for now and can run any build you suggest on this bench.
All reactions