You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i'm currently on idf 3.1.1 but this problem exists with all previous versions as well. I have a lan8720 connected to the esp32. When the lan board is connected everything works fine. When the lan8720 board is not connected and i try to initialize ethernet, a stack overflow will happen in emacT. Increasing the stacksize in components/ethernet/emac_main.c from 2048 to 3072 solves the problem.
The problem does not happen with the ethernet sample. Within my code, this happens at various places. I have added a ps command to find the free stack of each runnig task. After changing the emac stacksize to 3k i get a free stack space of 600 bytes for the emac task. So there is more needed than the 2k currently in emac_main.c:
evse> ps
task name cpu prio min stack free run time count
------------------------------------------------------------------
main 0 1 11120 468527 0.03%
IDLE 1 0 528 703788899 46.72%
IDLE 0 0 456 746745074 49.57%
....
emacT any 20 600 4497798 0.30%
when the board is connected, the needed stacksize is much lower, this is the ps output with 3k emacT stack and a connected lan8720 board
evse> ps
task name cpu prio min stack free run time count
------------------------------------------------------------------
main 0 1 10928 326231 0.40%
...
emacT any 20 2328 14452 0.02%
So, in case the board is not connected, the needed stacksize grew by 1728 bytes. Could this be related to the ESP_LOG* routines called to output errors ? (i have set "Default log verbosity" = Warning)
this is the fix in emac_main.c (esp_eth_init_internal)
1. In original driver, the stack size for emac driver task "emacT" is only 2048 Bytes, which also can not be changed by user.
2. Each time when invoking "emac_start" function, it will reset emac registers, the driver should reconfig some important registers again.
Closes#3025
projectgus
changed the title
[TW#28654] Ethernet emac_main.c stack to small
Ethernet emac_main.c stack to small (IDFGH-608)
Mar 12, 2019
i'm currently on idf 3.1.1 but this problem exists with all previous versions as well. I have a lan8720 connected to the esp32. When the lan board is connected everything works fine. When the lan8720 board is not connected and i try to initialize ethernet, a stack overflow will happen in emacT. Increasing the stacksize in components/ethernet/emac_main.c from 2048 to 3072 solves the problem.
The problem does not happen with the ethernet sample. Within my code, this happens at various places. I have added a ps command to find the free stack of each runnig task. After changing the emac stacksize to 3k i get a free stack space of 600 bytes for the emac task. So there is more needed than the 2k currently in emac_main.c:
when the board is connected, the needed stacksize is much lower, this is the ps output with 3k emacT stack and a connected lan8720 board
So, in case the board is not connected, the needed stacksize grew by 1728 bytes. Could this be related to the ESP_LOG* routines called to output errors ? (i have set "Default log verbosity" = Warning)
this is the fix in emac_main.c (esp_eth_init_internal)
sdkconfig.zip
The text was updated successfully, but these errors were encountered: