spinlock on esp32s3
Posted: Mon May 16, 2022 8:38 am
Hey
Generally, it looks like to me that the spinlock logic has some issue when the freertos tasks do not have a core affinity specified.
For example, the lwip task can be configured without core affinity and if I do that (CONFIG_LWIP_TCPIP_TASK_AFFINITY_NO_AFFINITY=y), then this happens after a few seconds:
Kind regards
Mikkel
Generally, it looks like to me that the spinlock logic has some issue when the freertos tasks do not have a core affinity specified.
For example, the lwip task can be configured without core affinity and if I do that (CONFIG_LWIP_TCPIP_TASK_AFFINITY_NO_AFFINITY=y), then this happens after a few seconds:
If I change the affinity to be a specific core, for example CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU0=y, then the system returns to being stable.assert failed: spinlock_release spinlock.h:158 (core_id == lock->owner)
Backtrace:0x4037c266:0x3fcc45f00x4038aad5:0x3fcc4610 0x4039341d:0x3fcc4630 0x4038e393:0x3fcc4750 0x4038c2e8:0x3fcc4770 0x403927d5:0x3fcc47b0 0x420c5ea7:0x3fcc47d0 0x40391d48:0x3fcc47f0 0x42035be5:0x3fcc4810 0x4003966f:0x3fcc4830 |<-CORRUPTED
0x4037c266: panic_abort at esp-idf/components/esp_system/panic.c:402
0x4038aad5: esp_system_abort at esp-idf/components/esp_system/esp_system.c:128
0x4039341d: __assert_func at esp-idf/components/newlib/assert.c:85
0x4038e393: spinlock_release at esp-idf/components/esp_hw_support/include/soc/spinlock.h:158
(inlined by) vPortExitCritical at esp-idf/components/freertos/port/xtensa/port.c:310
0x4038c2e8: xQueueSemaphoreTake at esp-idf/components/freertos/queue.c:1612
0x403927d5: sys_mutex_lock at esp-idf/components/lwip/port/esp32/freertos/sys_arch.c:82
0x420c5ea7: sys_arch_protect at esp-idf/components/lwip/port/esp32/freertos/sys_arch.c:480
0x40391d48: pbuf_free at esp-idf/components/lwip/lwip/src/core/pbuf.c:755
(inlined by) pbuf_free at esp-idf/components/lwip/lwip/src/core/pbuf.c:729
0x42035be5: esp_netif_netstack_buf_free at esp-idf/components/esp_netif/lwip/esp_netif_lwip.c:862
Kind regards
Mikkel