Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: ASSERT failure in rwbt.c #137

Open
vortex314 opened this issue Jan 11, 2025 · 14 comments
Open

[Bug]: ASSERT failure in rwbt.c #137

vortex314 opened this issue Jan 11, 2025 · 14 comments
Assignees
Labels
bug Something isn't working

Comments

@vortex314
Copy link

What happened?

Bluepad32 on espidf is working fine for several minutes , no noticeable memory leak. The connection and reception of data with a PS4 controller works fine.
Then it crashes

I 00:08:28.913 |        main.cpp: 184 |  free heap size: 34144
I 00:08:29.921 |        main.cpp: 184 |  free heap size: 34396
I 00:08:30.945 |        main.cpp: 184 |  free heap size: 34380
I 00:08:31.953 |        main.cpp: 184 |  free heap size: 35104
ASSERT_PARAM(8192 0), in rwbt.c at line 360
Guru Meditation Error: Core  0 panic'ed (IllegalInstruction). Exception was unhandled.
Memory dump at 0x4008ebfc: f01d020c 00004136 f01d0000
Core  0 register dump:
PC      : 0x4008ec03  PS      : 0x00060034  A0      : 0x800884da  A1      : 0x3ffc2108  
A2      : 0x00000000  A3      : 0x00002000  A4      : 0x00000000  A5      : 0x3ff9e7d2  
A6      : 0x00000168  A7      : 0xfffffffc  A8      : 0x8000814b  A9      : 0x3ffc2078  
A10     : 0x00000000  A11     : 0x3ffc209b  A12     : 0x3ffc2047  A13     : 0x00000030  
A14     : 0x00000000  A15     : 0x3ffc204c  SAR     : 0x00000004  EXCCAUSE: 0x00000000  
EXCVADDR: 0x00000000  LBEG    : 0x4000c2e0  LEND    : 0x4000c2f6  LCOUNT  : 0x00000000  


Backtrace: 0x4008ec00:0x3ffc2108 |<-CORRUPTED




ELF file SHA256: 77db749cd

Rebooting...
ets Jun  8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:7176
load:0x40078000,len:15564
ho 0 tail 12 room 4
load:0x40080400,len:4
load:0x40080404,len:3904
entry 0x40080638
I (31) boot: ESP-IDF 5.3.0 2nd stage bootloader
I (31) boot: compile time Jan 10 2025 22:41:09

Bluepad32 Version

I don't know

Bluepad32 version custom

The github main branch.

Bluepad32 Platform

ESP-IDF

Platform version

ESP-IDF 5.3.0

Controller

A PS4 clone controller

Microcontroller

ESP32

Microcontroller board

ESP32 Devkit V1
Purpose is to catch PS4 events / commands and send them via Wifi to the Zenoh middleware.

OS

None

Relevant log output

Platformio.ini file

[env:az-delivery-devkit-v4]
platform = espressif32
board = az-delivery-devkit-v4
framework = espidf
monitor_speed = 115200
monitor_filters = esp32_exception_decoder
lib_deps = 
	https://github.com/eclipse-zenoh/zenoh-pico
	https://github.com/bergzand/NanoCBOR
	bblanchon/ArduinoJson@^7.3.0
build_flags = 
	-DWIFI_SSID=${sysenv.WIFI_SSID}
	-DWIFI_PASS=${sysenv.WIFI_PASS}
	-DZENOH_ESPIDF
	-DZ_FEATURE_LINK_UDP_MULTICAST=1
	-DZENOH_DEBUG=1
	-DBATCH_UNICAST_SIZE=1024
	-DBATCH_MULTICAST_SIZE=1024
	-DZ_FEATURE_AUTO_RECONNECT=1
	-DFRAG_MAX_SIZE=1024
	-Wmissing-field-initializers
	-std=gnu++17
	-Wno-error=deprecated-declarations
	-DCONFIG_TCPIP_LWIP=1
	-L/home/lieven/workspace/bluepad32/examples/esp32/build/esp-idf/btstack
	-lbtstack
	-Os
build_unflags = 
	-std=gnu++11

board_upload.flash_size = 2MB
board_upload.maximum_size = 2048000
board_build.partitions = huge_app.csv

Relevant sketch

https://github.com/vortex314/zenoh-projects/tree/main/zenoh-esp32

The main PS4 code is in the ps4_actor.cpp
@vortex314 vortex314 added the bug Something isn't working label Jan 11, 2025
@vortex314
Copy link
Author

vortex314 commented Jan 11, 2025

I'm guessing the cause is somewhere a stack overflow.
Or related to this : espressif/esp-idf#8405
ESP32 using BT and Wifi concurrently

@ricardoquesada
Copy link
Owner

Thanks for reporting the bug.

The best way for me to work on a bug is when I have:

  • the smallest possible sketch that reproduces
  • and of course, which Bluepa32 version you are using

A good starting point would be to use the example provided in the Bluepad32 repo with some minimal changes.

@vortex314
Copy link
Author

Hi Ricardo, thanks for the swift reaction.
The reproduction of this issue will not be simple, the segfault occurs in some code rwbt.c, which is according to my own research part of the espressif library.
The issue can reproduce after a few minutes or even after 44 min, my current guess is that it is coming from the combination of Wifi and BT stack. So the sample Bluepad32 code will not help. My own notes -- https://github.com/vortex314/zenoh-projects/blob/main/zenoh-esp32/issue_rwbt.md
Will update here my findings.
To be continued...

@ricardoquesada
Copy link
Owner

try to get the stacktrace if possible.
Here the info how to get it:

https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-guides/core_dump.html

@vortex314
Copy link
Author

vortex314 commented Jan 12, 2025

lieven@pcpro:~/workspace/zenoh-projects/zenoh-esp32$ idf.py coredump-info
/home/lieven/esp/esp-idf/tools/check_python_dependencies.py:12: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  import pkg_resources
Executing action: coredump-info
Serial port /dev/ttyUSB1
Connecting....
Detecting chip type... Unsupported detection protocol, switching and trying again...
Connecting....
Detecting chip type... ESP32
Path to core dump file is not provided. Core dump can't be read from flash since this option is not enabled in menuconfig
lieven@pcpro:~/workspace/zenoh-projects/zenoh-esp32$ 
```
Suggestions ? It core deumped after 50 min runnning.
Config settings 
```
#
# Core dump
#
CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH=y
# CONFIG_ESP_COREDUMP_ENABLE_TO_UART is not set
# CONFIG_ESP_COREDUMP_ENABLE_TO_NONE is not set
# CONFIG_ESP_COREDUMP_DATA_FORMAT_BIN is not set
CONFIG_ESP_COREDUMP_DATA_FORMAT_ELF=y
CONFIG_ESP_COREDUMP_CHECKSUM_CRC32=y
# CONFIG_ESP_COREDUMP_CHECKSUM_SHA256 is not set
# CONFIG_ESP_COREDUMP_CAPTURE_DRAM is not set
CONFIG_ESP_COREDUMP_CHECK_BOOT=y
CONFIG_ESP_COREDUMP_ENABLE=y
CONFIG_ESP_COREDUMP_LOGS=y
CONFIG_ESP_COREDUMP_MAX_TASKS_NUM=64
# CONFIG_ESP_COREDUMP_FLASH_NO_OVERWRITE is not set
CONFIG_ESP_COREDUMP_STACK_SIZE=0
# end of Core dump
```
======================= UART output , confirming coredump
```
I 00:55:06.215 |        main.cpp: 189 |  free heap size: 24400
I 00:55:07.224 |        main.cpp: 189 |  free heap size: 22356
ASSERT_PARAM(8192 0), in rwbt.c at line 360
Guru Meditation Error: Core  0 panic'ed (IllegalInstruction). Exception was unhandled.
Memory dump at 0x4008eeac: f01d020c 00004136 f01d0000
Core  0 register dump:
PC      : 0x4008eeb3  PS      : 0x00060934  A0      : 0x80088662  A1      : 0x3ffc2670  
A2      : 0x00000000  A3      : 0x00002000  A4      : 0x00000000  A5      : 0x3ff9e7d2  
A6      : 0x00000168  A7      : 0xfffffffc  A8      : 0x8000814b  A9      : 0x3ffc25e0  
A10     : 0x00000000  A11     : 0x3ffc2603  A12     : 0x3ffc25af  A13     : 0x00000030  
A14     : 0x00000000  A15     : 0x3ffc25b4  SAR     : 0x00000004  EXCCAUSE: 0x00000000  
EXCVADDR: 0x00000000  LBEG    : 0x4000c2e0  LEND    : 0x4000c2f6  LCOUNT  : 0x00000000  


Backtrace: 0x4008eeb0:0x3ffc2670 0x4008865f:0x3ffc2690 0x40055749:0x3ffc26b0 0x40088d5f:0x3ffc26d0 0x40081255:0x3ffc26f0 0x400811c1:0x3ffc2710 0x400811a3:0x00000000 |<-CORRUPTED




ELF file SHA256: d9cfb4e1a

I (7002) esp_core_dump_flash: Save core dump to flash...
I (7009) esp_core_dump_flash: Erase flash 28672 bytes @ 0x180000
I (7214) esp_core_dump_flash: Write end offset 0x6e04, check sum length 4
I (7214) esp_core_dump_flash: Core dump has been saved to flash.
Rebooting...
ets Jun  8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:7176
load:0x40078000,len:15564
ho 0 tail 12 room 4
load:0x40080400,len:4
load:0x40080404,len:3904
```

@vortex314
Copy link
Author

AT reboot

I (799) esp_core_dump_flash: Init core dump to flash
I (805) esp_core_dump_flash: Found partition 'coredump' @ 180000 131072 bytes
I (851) esp_core_dump_flash: Core dump data checksum is correct
I (851) esp_core_dump_flash: Found core dump 28132 bytes in flash @ 0x180000
I (855) coexist: coex firmware version: 4482466
I (861) main_task: Started on CPU0
I (864) main_task: Calling app_main()

@vortex314
Copy link
Author

Ok, it seems that my use of platformio makes also use of another sdkconfig file, when copying this pio file to the sdkconfig , I got a step further

lieven@pcpro:~/workspace/zenoh-projects/zenoh-esp32$ idf.py coredump-info
/home/lieven/esp/esp-idf/tools/check_python_dependencies.py:12: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  import pkg_resources
Executing action: coredump-info
Serial port /dev/ttyUSB1
Connecting.........
Detecting chip type... Unsupported detection protocol, switching and trying again...
Connecting.....
Detecting chip type... ESP32
WARNING:root:The core dump image offset is not specified. Use partition offset: 0x180000.
Failed to load core dump: Invalid application image for coredump: coredump SHA256(17d4c9f2a) != app SHA256().
lieven@pcpro:~/workspace/zenoh-projects/zenoh-esp32$ 

@vortex314
Copy link
Author

Finally, found something that works. I guess the tools don´t take into account the platformio locations

lieven@pcpro:~/workspace/zenoh-projects/zenoh-esp32$ espcoredump.py info_corefile  -t raw  .pio/build/az-delivery-devkit-v4/firmware.elf
INFO: Invoke esptool to read image.
INFO: Retrieving core dump partition offset and size...
INFO: Core dump partition offset=1572864, size=131072
WARNING: The core dump image offset is not specified. Use partition offset: 0x180000.
INFO: esptool.py v4.7.0
Found 33 serial ports
Serial port /dev/ttyUSB1
Connecting....
Detecting chip type... Unsupported detection protocol, switching and trying again...
Connecting....
Detecting chip type... ESP32
Chip is ESP32-D0WDQ6 (revision v0.0)
Features: WiFi, BT, Dual Core, Coding Scheme None
Crystal is 40MHz
MAC: 30:ae:a4:03:ec:98
Uploading stub...
Running stub...
Stub running...
16 (100 %)
16 (100 %)
Read 16 bytes at 0x00180000 in 0.0 seconds (12.5 kbit/s)...
Hard resetting via RTS pin...

INFO: esptool.py v4.7.0
Found 33 serial ports
Serial port /dev/ttyUSB1
Connecting......
Detecting chip type... Unsupported detection protocol, switching and trying again...
Connecting..........
Detecting chip type... ESP32
Chip is ESP32-D0WDQ6 (revision v0.0)
Features: WiFi, BT, Dual Core, Coding Scheme None
Crystal is 40MHz
MAC: 30:ae:a4:03:ec:98
Uploading stub...
Running stub...
Stub running...
28132 (100 %)
28132 (100 %)
Read 28132 bytes at 0x00180000 in 2.5 seconds (88.9 kbit/s)...
Hard resetting via RTS pin...

===============================================================
==================== ESP32 CORE DUMP START ====================

Crashed task handle: 0x3ffe2a4c, name: 'wifi', GDB name: 'process 1073621580'
Crashed task is not in the interrupt context

================== CURRENT THREAD REGISTERS ===================
exccause       0xffff (InvalidCauseRegister)
excvaddr       0x0
pc             0x20000000          0x20000000
lbeg           0x4000c2e0          1073791712
lend           0x4000c2f6          1073791734
lcount         0xffffffff          4294967295
sar            0x17                23
ps             0x30                48
threadptr      <unavailable>
br             <unavailable>
scompare1      <unavailable>
acclo          <unavailable>
acchi          <unavailable>
m0             <unavailable>
m1             <unavailable>
m2             <unavailable>
m3             <unavailable>
expstate       <unavailable>
f64r_lo        <unavailable>
f64r_hi        <unavailable>
f64s           <unavailable>
fcr            <unavailable>
fsr            <unavailable>
a0             0x20000070          536871024
a1             0x0                 0
a2             0x0                 0
a3             0x0                 0
a4             0x60c20             396320
a5             0x60c23             396323
a6             0x4d7fc             317436
a7             0x0                 0
a8             0x3ff000dc          1072693468
a9             0x1                 1
a10            0x3ffbde68          1073471080
a11            0xffffffff          -1
a12            0x3fff6ff0          1073704944
a13            0x60c23             396323
a14            0x1                 1
a15            0xcdcd              52685

==================== CURRENT THREAD STACK =====================
#0  0x20000000 in ?? ()

======================== THREADS INFO =========================
  Id   Target Id          Frame 
* 1    process 1073621580 0x20000000 in ?? ()
  2    process 1073461856 0x4000bff0 in _xtos_set_intlevel ()
  3    process 1073464720 0x4008f086 in esp_cpu_wait_for_intr () at /home/lieven/.platformio/packages/framework-espidf/components/esp_hw_support/cpu.c:64
  4    process 1073466860 0x4008f086 in esp_cpu_wait_for_intr () at /home/lieven/.platformio/packages/framework-espidf/components/esp_hw_support/cpu.c:64
  5    process 1073469084 0x4000bff0 in _xtos_set_intlevel ()
  6    process 1073462580 0x40081d4c in esp_crosscore_int_send_yield (core_id=0) at /home/lieven/.platformio/packages/framework-espidf/components/esp_system/crosscore_int.c:121
  7    process 1073596664 0x4000bff0 in _xtos_set_intlevel ()
  8    process 1073610212 0x4000bff0 in _xtos_set_intlevel ()
  9    process 1073601012 0x4000bff0 in _xtos_set_intlevel ()
  10   process 1073710408 vTaskDelay (xTicksToDelay=3333) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/tasks.c:1592
  11   process 1073619104 0x4000bff0 in _xtos_set_intlevel ()
  12   process 1073626024 0x4000bff0 in _xtos_set_intlevel ()
  13   process 1073648276 0x4000bff0 in _xtos_set_intlevel ()
  14   process 1073443608 0x4000bff0 in _xtos_set_intlevel ()
  15   process 1073605768 0x4000bff0 in _xtos_set_intlevel ()
  16   process 1073445456 0x4000bff0 in _xtos_set_intlevel ()
  17   process 1073704940 0x4000bff0 in _xtos_set_intlevel ()
  18   process 1073669656 0x4000bff0 in _xtos_set_intlevel ()


       TCB             NAME PRIO C/B  STACK USED/FREE
---------- ---------------- -------- ----------------
0x3ffe2a4c             wifi    23/23        1184/5460
0x3ffbba60        esp_timer    22/22         688/6812
0x3ffbc590            IDLE0      0/0         416/1364
0x3ffbcdec            IDLE1      0/0         416/1368
0x3ffbd69c             wifi      5/5         528/3552
0x3ffbbd34             main      1/1         576/6924
0x3ffdc8f8              tiT    18/18         560/3020
0x3ffdfde4              sys      5/5         528/3552
0x3ffdd9f4            zenoh      5/5         528/3456
0x3fff8548                     12/12         448/4668
0x3ffe20a0              ps4      5/5         608/5500
0x3ffe3ba8              led      5/5         528/3564
0x3ffe9294    btstack_stdio    12/12         480/1552
0x3ffb7318             ipc0      5/5         432/1064
0x3ffdec88          sys_evt    20/20         544/3084
0x3ffb7a50             ipc1    24/24         432/1056
0x3fff6fec                     18/12        1136/3976
0x3ffee618     btController    23/23         512/3580

==================== THREAD 1 (TCB: 0x3ffe2a4c, name: 'wifi') =====================
#0  0x20000000 in ?? ()

==================== THREAD 2 (TCB: 0x3ffbba60, name: 'esp_timer') =====================
#0  0x4000bff0 in _xtos_set_intlevel ()
#1  0x40090a1e in vPortClearInterruptMaskFromISR (prev_level=<optimized out>) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/portmacro.h:560
#2  vPortExitCritical (mux=0x3ffe23a8) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:505
#3  0x401bf23a in xQueueGenericSend (xQueue=0x3ffe235c, pvItemToQueue=0x3ffbb8f0 <rwip_heap_env+196>, xTicksToWait=<optimized out>, xCopyPosition=<optimized out>) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/queue.c:1056
#4  0x401be1a7 in queue_send_wrapper (queue=0x3ffe235c, item=0x3ffbb8f0 <rwip_heap_env+196>, block_time_tick=10) at /home/lieven/.platformio/packages/framework-espidf/components/esp_wifi/esp32/esp_adapter.c:301
#5  0x4008583c in pp_post ()
#6  0x40166d67 in ieee80211_timer_process ()
#7  0x4016f936 in pp_timer_process ()
#8  0x4016cfb8 in ?? ()
#9  0x4019f1d5 in timer_process_alarm (dispatch_method=ESP_TIMER_TASK) at /home/lieven/.platformio/packages/framework-espidf/components/esp_timer/src/esp_timer.c:456
#10 0x4019f224 in timer_task (arg=0x0) at /home/lieven/.platformio/packages/framework-espidf/components/esp_timer/src/esp_timer.c:482
#11 0x400907f9 in vPortTaskWrapper (pxCode=0x4019f210 <timer_task>, pvParameters=0x0) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:134

==================== THREAD 3 (TCB: 0x3ffbc590, name: 'IDLE0') =====================
#0  0x4008f086 in esp_cpu_wait_for_intr () at /home/lieven/.platformio/packages/framework-espidf/components/esp_hw_support/cpu.c:64
#1  0x4010a09d in esp_vApplicationIdleHook () at /home/lieven/.platformio/packages/framework-espidf/components/esp_system/freertos_hooks.c:58
#2  0x401bfb34 in prvIdleTask (pvParameters=0x0) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/tasks.c:4344
#3  0x400907f9 in vPortTaskWrapper (pxCode=0x401bfb28 <prvIdleTask>, pvParameters=0x0) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:134

==================== THREAD 4 (TCB: 0x3ffbcdec, name: 'IDLE1') =====================
#0  0x4008f086 in esp_cpu_wait_for_intr () at /home/lieven/.platformio/packages/framework-espidf/components/esp_hw_support/cpu.c:64
#1  0x4010a09d in esp_vApplicationIdleHook () at /home/lieven/.platformio/packages/framework-espidf/components/esp_system/freertos_hooks.c:58
#2  0x401bfb34 in prvIdleTask (pvParameters=0x0) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/tasks.c:4344
#3  0x400907f9 in vPortTaskWrapper (pxCode=0x401bfb28 <prvIdleTask>, pvParameters=0x0) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:134

==================== THREAD 5 (TCB: 0x3ffbd69c, name: 'wifi') =====================
#0  0x4000bff0 in _xtos_set_intlevel ()
#1  0x40090a1e in vPortClearInterruptMaskFromISR (prev_level=<optimized out>) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/portmacro.h:560
#2  vPortExitCritical (mux=0x3ffb7bf4) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:505
#3  0x401bf58d in xQueueReceive (xQueue=0x3ffb7ba8, pvBuffer=0x3ffdba0c, xTicksToWait=<optimized out>) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/queue.c:1632
#4  0x400d69d5 in Channel<WifiCmd*>::receive (timeout=<optimized out>, message=0x3ffdba0c, this=0x3ffc4318 <wifi_actor+16>) at src/actor.h:33
#5  Actor<WifiEvent, WifiCmd>::loop (this=0x3ffc4308 <wifi_actor>) at src/actor.h:294
#6  0x400d6a80 in Actor<WifiEvent, WifiCmd>::start()::{lambda(void*)#1}::operator()(void*) const (arg=0x3ffc4308 <wifi_actor>, __closure=0x0) at src/actor.h:279
#7  Actor<WifiEvent, WifiCmd>::start()::{lambda(void*)#1}::_FUN(void*) () at src/actor.h:279
#8  0x400907f9 in vPortTaskWrapper (pxCode=0x400d6a78 <Actor<WifiEvent, WifiCmd>::start()::{lambda(void*)#1}::_FUN(void*)>, pvParameters=0x3ffc4308 <wifi_actor>) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:134

==================== THREAD 6 (TCB: 0x3ffbbd34, name: 'main') =====================
#0  0x40081d4c in esp_crosscore_int_send_yield (core_id=0) at /home/lieven/.platformio/packages/framework-espidf/components/esp_system/crosscore_int.c:121
#1  0x401bfecd in vTaskDelay (xTicksToDelay=1000) at /home/lieven/.platformio/packages/framework-espidf/components/xtensa/include/xt_utils.h:41
#2  0x400d7d19 in app_main () at src/main.cpp:178
#3  0x401be521 in main_task (args=0x0) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/app_startup.c:208
#4  0x400907f9 in vPortTaskWrapper (pxCode=0x401be458 <main_task>, pvParameters=0x0) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:134

==================== THREAD 7 (TCB: 0x3ffdc8f8, name: 'tiT') =====================
#0  0x4000bff0 in _xtos_set_intlevel ()
#1  0x40090a1e in vPortClearInterruptMaskFromISR (prev_level=<optimized out>) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/portmacro.h:560
#2  vPortExitCritical (mux=0x3ffbda58 <rwip_heap_env+8748>) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:505
#3  0x401bf58d in xQueueReceive (xQueue=0x3ffbda0c <rwip_heap_env+8672>, pvBuffer=0x3ffdc848, xTicksToWait=<optimized out>) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/queue.c:1632
#4  0x401241f8 in sys_arch_mbox_fetch (mbox=<optimized out>, msg=0x3ffdc848, timeout=187) at /home/lieven/.platformio/packages/framework-espidf/components/lwip/port/freertos/sys_arch.c:317
#5  0x40112863 in tcpip_timeouts_mbox_fetch (mbox=0x3ffd33c4 <tcpip_mbox>, msg=0x3ffdc848) at /home/lieven/.platformio/packages/framework-espidf/components/lwip/lwip/src/api/tcpip.c:104
#6  0x40112931 in tcpip_thread (arg=0x0) at /home/lieven/.platformio/packages/framework-espidf/components/lwip/lwip/src/api/tcpip.c:142
#7  0x400907f9 in vPortTaskWrapper (pxCode=0x40112904 <tcpip_thread>, pvParameters=0x0) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:134

==================== THREAD 8 (TCB: 0x3ffdfde4, name: 'sys') =====================
#0  0x4000bff0 in _xtos_set_intlevel ()
#1  0x40090a1e in vPortClearInterruptMaskFromISR (prev_level=<optimized out>) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/portmacro.h:560
#2  vPortExitCritical (mux=0x3ffb7d50) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:505
#3  0x401bf58d in xQueueReceive (xQueue=0x3ffb7d04, pvBuffer=0x3ffdfcfc, xTicksToWait=<optimized out>) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/queue.c:1632
#4  0x400d6bdd in Channel<SysCmd*>::receive (timeout=<optimized out>, message=0x3ffdfcfc, this=0x3ffc3ef0 <sys_actor+16>) at src/actor.h:33
#5  Actor<SysEvent, SysCmd>::loop (this=0x3ffc3ee0 <sys_actor>) at src/actor.h:294
#6  0x400d6c88 in Actor<SysEvent, SysCmd>::start()::{lambda(void*)#1}::operator()(void*) const (arg=0x3ffc3ee0 <sys_actor>, __closure=0x0) at src/actor.h:279
#7  Actor<SysEvent, SysCmd>::start()::{lambda(void*)#1}::_FUN(void*) () at src/actor.h:279
#8  0x400907f9 in vPortTaskWrapper (pxCode=0x400d6c80 <Actor<SysEvent, SysCmd>::start()::{lambda(void*)#1}::_FUN(void*)>, pvParameters=0x3ffc3ee0 <sys_actor>) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:134

==================== THREAD 9 (TCB: 0x3ffdd9f4, name: 'zenoh') =====================
#0  0x4000bff0 in _xtos_set_intlevel ()
#1  0x40090a1e in vPortClearInterruptMaskFromISR (prev_level=<optimized out>) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/portmacro.h:560
#2  vPortExitCritical (mux=0x3ffb7cbc) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:505
#3  0x401bf58d in xQueueReceive (xQueue=0x3ffb7c70, pvBuffer=0x3ffdd90c, xTicksToWait=<optimized out>) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/queue.c:1632
#4  0x400d6ad9 in Channel<ZenohCmd*>::receive (timeout=<optimized out>, message=0x3ffdd90c, this=0x3ffc4190 <zenoh_actor+16>) at src/actor.h:33
#5  Actor<ZenohEvent, ZenohCmd>::loop (this=0x3ffc4180 <zenoh_actor>) at src/actor.h:294
#6  0x400d6b84 in Actor<ZenohEvent, ZenohCmd>::start()::{lambda(void*)#1}::operator()(void*) const (arg=0x3ffc4180 <zenoh_actor>, __closure=0x0) at src/actor.h:279
#7  Actor<ZenohEvent, ZenohCmd>::start()::{lambda(void*)#1}::_FUN(void*) () at src/actor.h:279
#8  0x400907f9 in vPortTaskWrapper (pxCode=0x400d6b7c <Actor<ZenohEvent, ZenohCmd>::start()::{lambda(void*)#1}::_FUN(void*)>, pvParameters=0x3ffc4180 <zenoh_actor>) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:134

==================== THREAD 10 (TCB: 0x3fff8548, name: '') =====================
#0  vTaskDelay (xTicksToDelay=3333) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/tasks.c:1592
#1  0x400e2ca0 in z_sleep_ms (time=<optimized out>) at .pio/libdeps/az-delivery-devkit-v4/zenoh-pico/src/system/espidf/system.c:179
#2  0x400e451f in _zp_unicast_lease_task (ztu_arg=0x3fff3c04) at .pio/libdeps/az-delivery-devkit-v4/zenoh-pico/src/transport/unicast/lease.c:110
#3  0x400e2b36 in z_task_wrapper (arg=0x3fff3e80) at .pio/libdeps/az-delivery-devkit-v4/zenoh-pico/src/system/espidf/system.c:61
#4  0x400907f9 in vPortTaskWrapper (pxCode=0x400e2b2c <z_task_wrapper>, pvParameters=0x3fff3e80) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:134

==================== THREAD 11 (TCB: 0x3ffe20a0, name: 'ps4') =====================
#0  0x4000bff0 in _xtos_set_intlevel ()
#1  0x40090a1e in vPortClearInterruptMaskFromISR (prev_level=<optimized out>) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/portmacro.h:560
#2  vPortExitCritical (mux=0x3ffbe118 <rwip_heap_non_ret+1468>) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:505
#3  0x401c0c29 in xTaskGenericNotifyWait (uxIndexToWait=0, ulBitsToClearOnEntry=<optimized out>, ulBitsToClearOnExit=4294967295, pulNotificationValue=0x0, xTicksToWait=<optimized out>) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/tasks.c:5841
#4  0x400f51b8 in btstack_run_loop_freertos_execute () at /home/lieven/esp/esp-idf/components/btstack/platform/freertos/btstack_run_loop_freertos.c:202
#5  0x400ec852 in btstack_run_loop_execute () at /home/lieven/esp/esp-idf/components/btstack/src/btstack_run_loop.c:310
#6  0x400d8a3b in Ps4Actor::on_start (this=0x3ffc3e24 <ps4_actor>) at src/ps4_actor.cpp:37
#7  0x400d6cc8 in Actor<Ps4Event, Ps4Cmd>::loop (this=0x3ffc3e24 <ps4_actor>) at src/actor.h:290
#8  0x400d6d90 in Actor<Ps4Event, Ps4Cmd>::start()::{lambda(void*)#1}::operator()(void*) const (arg=0x3ffc3e24 <ps4_actor>, __closure=0x0) at src/actor.h:279
#9  Actor<Ps4Event, Ps4Cmd>::start()::{lambda(void*)#1}::_FUN(void*) () at src/actor.h:279
#10 0x400907f9 in vPortTaskWrapper (pxCode=0x400d6d88 <Actor<Ps4Event, Ps4Cmd>::start()::{lambda(void*)#1}::_FUN(void*)>, pvParameters=0x3ffc3e24 <ps4_actor>) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:134

==================== THREAD 12 (TCB: 0x3ffe3ba8, name: 'led') =====================
#0  0x4000bff0 in _xtos_set_intlevel ()
#1  0x40090a1e in vPortClearInterruptMaskFromISR (prev_level=<optimized out>) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/portmacro.h:560
#2  vPortExitCritical (mux=0x3ffb7e98) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:505
#3  0x401bf58d in xQueueReceive (xQueue=0x3ffb7e4c, pvBuffer=0x3ffe3acc, xTicksToWait=<optimized out>) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/queue.c:1632
#4  0x400d6de9 in Channel<LedCmd*>::receive (timeout=<optimized out>, message=0x3ffe3acc, this=0x3ffc3df0 <led_actor+16>) at src/actor.h:33
#5  Actor<LedEvent, LedCmd>::loop (this=0x3ffc3de0 <led_actor>) at src/actor.h:294
#6  0x400d6e88 in Actor<LedEvent, LedCmd>::start()::{lambda(void*)#1}::operator()(void*) const (arg=0x3ffc3de0 <led_actor>, __closure=0x0) at src/actor.h:279
#7  Actor<LedEvent, LedCmd>::start()::{lambda(void*)#1}::_FUN(void*) () at src/actor.h:279
#8  0x400907f9 in vPortTaskWrapper (pxCode=0x400d6e80 <Actor<LedEvent, LedCmd>::start()::{lambda(void*)#1}::_FUN(void*)>, pvParameters=0x3ffc3de0 <led_actor>) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:134

==================== THREAD 13 (TCB: 0x3ffe9294, name: 'btstack_stdio') =====================
#0  0x4000bff0 in _xtos_set_intlevel ()
#1  0x40090a1e in vPortClearInterruptMaskFromISR (prev_level=<optimized out>) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/portmacro.h:560
#2  vPortExitCritical (mux=0x3ffe3eac) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:505
#3  0x401bf449 in xQueuePeek (xQueue=0x3ffe3e60, pvBuffer=0x3ffe91d0, xTicksToWait=<optimized out>) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/queue.c:2084
#4  0x400ed1d3 in btstack_stdio_task (arg=0x0) at /home/lieven/esp/esp-idf/components/btstack/btstack_stdio_esp32.c:141
#5  0x400907f9 in vPortTaskWrapper (pxCode=0x400ed1b0 <btstack_stdio_task>, pvParameters=0x0) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:134

==================== THREAD 14 (TCB: 0x3ffb7318, name: 'ipc0') =====================
#0  0x4000bff0 in _xtos_set_intlevel ()
#1  0x40090a1e in vPortClearInterruptMaskFromISR (prev_level=<optimized out>) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/portmacro.h:560
#2  vPortExitCritical (mux=0x3ffbe118 <rwip_heap_non_ret+1468>) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:505
#3  0x401bfd90 in ulTaskGenericNotifyTake (uxIndexToWait=0, xClearCountOnExit=1, xTicksToWait=<optimized out>) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/tasks.c:5756
#4  0x40081da0 in ipc_task (arg=0x0) at /home/lieven/.platformio/packages/framework-espidf/components/esp_system/esp_ipc.c:62
#5  0x400907f9 in vPortTaskWrapper (pxCode=0x40081d70 <ipc_task>, pvParameters=0x0) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:134

==================== THREAD 15 (TCB: 0x3ffdec88, name: 'sys_evt') =====================
#0  0x4000bff0 in _xtos_set_intlevel ()
#1  0x40090a1e in vPortClearInterruptMaskFromISR (prev_level=<optimized out>) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/portmacro.h:560
#2  vPortExitCritical (mux=0x3ffddbf0) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:505
#3  0x401bf58d in xQueueReceive (xQueue=0x3ffddba4, pvBuffer=0x3ffdebac, xTicksToWait=<optimized out>) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/queue.c:1632
#4  0x401bba50 in esp_event_loop_run (event_loop=0x3ffbdae4 <rwip_heap_env+8888>, ticks_to_run=4294967295) at /home/lieven/.platformio/packages/framework-espidf/components/esp_event/esp_event.c:560
#5  0x401bba7c in esp_event_loop_run_task (args=0x3ffbdae4 <rwip_heap_env+8888>) at /home/lieven/.platformio/packages/framework-espidf/components/esp_event/esp_event.c:105
#6  0x400907f9 in vPortTaskWrapper (pxCode=0x401bba70 <esp_event_loop_run_task>, pvParameters=0x3ffbdae4 <rwip_heap_env+8888>) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:134

==================== THREAD 16 (TCB: 0x3ffb7a50, name: 'ipc1') =====================
#0  0x4000bff0 in _xtos_set_intlevel ()
#1  0x40090a1e in vPortClearInterruptMaskFromISR (prev_level=<optimized out>) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/portmacro.h:560
#2  vPortExitCritical (mux=0x3ffbe118 <rwip_heap_non_ret+1468>) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:505
#3  0x401bfd90 in ulTaskGenericNotifyTake (uxIndexToWait=0, xClearCountOnExit=1, xTicksToWait=<optimized out>) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/tasks.c:5756
#4  0x40081da0 in ipc_task (arg=0x1) at /home/lieven/.platformio/packages/framework-espidf/components/esp_system/esp_ipc.c:62
#5  0x400907f9 in vPortTaskWrapper (pxCode=0x40081d70 <ipc_task>, pvParameters=0x1) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:134

==================== THREAD 17 (TCB: 0x3fff6fec, name: '') =====================
#0  0x4000bff0 in _xtos_set_intlevel ()
#1  0x40090a1e in vPortClearInterruptMaskFromISR (prev_level=<optimized out>) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/portmacro.h:560
#2  vPortExitCritical (mux=0x3fff3fc8) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:505
#3  0x401bf58d in xQueueReceive (xQueue=0x3fff3f7c, pvBuffer=0x3fff6cd8, xTicksToWait=<optimized out>) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/queue.c:1632
#4  0x401241d5 in sys_arch_mbox_fetch (mbox=<optimized out>, msg=0x3fff6cd8, timeout=0) at /home/lieven/.platformio/packages/framework-espidf/components/lwip/port/freertos/sys_arch.c:313
#5  0x401257aa in netconn_recv_data (conn=0x3fff3f34, new_buf=0x3fff6d88, apiflags=8 '\b') at /home/lieven/.platformio/packages/framework-espidf/components/lwip/lwip/src/api/api_lib.c:615
#6  0x401258e1 in netconn_recv_data_tcp (conn=0x3fff3f34, new_buf=0x3fff6d88, apiflags=8 '\b') at /home/lieven/.platformio/packages/framework-espidf/components/lwip/lwip/src/api/api_lib.c:727
#7  0x4012598c in netconn_recv_tcp_pbuf_flags (conn=0x3fff3f34, new_buf=0x3fff6d88, apiflags=8 '\b') at /home/lieven/.platformio/packages/framework-espidf/components/lwip/lwip/src/api/api_lib.c:808
#8  0x40110f38 in lwip_recv_tcp (sock=0x3ffd316c <sockets>, mem=0x3fff4d6f, len=<optimized out>, flags=0) at /home/lieven/.platformio/packages/framework-espidf/components/lwip/lwip/src/api/sockets.c:951
#9  0x40111dd3 in lwip_recvfrom (s=54, mem=0x3fff4d6f, len=1673, flags=0, from=0x0, fromlen=0x0) at /home/lieven/.platformio/packages/framework-espidf/components/lwip/lwip/src/api/sockets.c:1218
#10 0x40111ebd in lwip_recv (s=54, mem=0x3fff4d6f, len=1673, flags=0) at /home/lieven/.platformio/packages/framework-espidf/components/lwip/lwip/src/api/sockets.c:1283
#11 0x400ea06d in recv (flags=0, len=1673, mem=0x3fff4d6f, s=54) at /home/lieven/.platformio/packages/framework-espidf/components/lwip/include/lwip/sockets.h:38
#12 _z_read_tcp (sock=..., ptr=0x3fff4d6f <error: Cannot access memory at address 0x3fff4d6f>, len=1673) at .pio/libdeps/az-delivery-devkit-v4/zenoh-pico/src/system/espidf/network.c:120
#13 0x400e60f4 in _z_f_link_read_tcp (zl=0x3fff3c08, ptr=0x3fff4d6f <error: Cannot access memory at address 0x3fff4d6f>, len=1673, addr=0x0) at .pio/libdeps/az-delivery-devkit-v4/zenoh-pico/src/link/unicast/tcp.c:150
#14 0x400e5bf4 in _z_link_recv_zbuf (link=0x3fff3c08, zbf=0x3fff3c88, addr=0x0) at .pio/libdeps/az-delivery-devkit-v4/zenoh-pico/src/link/link.c:138
#15 0x400e45f1 in _zp_unicast_read_task (ztu_arg=0x3fff3c04) at .pio/libdeps/az-delivery-devkit-v4/zenoh-pico/src/transport/unicast/read.c:67
#16 0x400e2b36 in z_task_wrapper (arg=0x3fff3e38) at .pio/libdeps/az-delivery-devkit-v4/zenoh-pico/src/system/espidf/system.c:61
#17 0x400907f9 in vPortTaskWrapper (pxCode=0x400e2b2c <z_task_wrapper>, pvParameters=0x3fff3e38) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:134

==================== THREAD 18 (TCB: 0x3ffee618, name: 'btController') =====================
#0  0x4000bff0 in _xtos_set_intlevel ()
#1  0x40090a1e in vPortClearInterruptMaskFromISR (prev_level=<optimized out>) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/portmacro.h:560
#2  vPortExitCritical (mux=0x3ffed46c) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:505
#3  0x401bf58d in xQueueReceive (xQueue=0x3ffed420, pvBuffer=0x3ffee560, xTicksToWait=<optimized out>) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/queue.c:1632
#4  0x40188cd8 in queue_recv_hlevel_wrapper (queue=0x3ffb6a98, item=0x3ffee560, block_time_ms=4294967295) at /home/lieven/.platformio/packages/framework-espidf/components/bt/controller/esp32/bt.c:781
#5  0x4017c3d2 in btdm_controller_task ()
#6  0x400907f9 in vPortTaskWrapper (pxCode=0x4017c3ac <btdm_controller_task>, pvParameters=0x0) at /home/lieven/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:134


======================= ALL MEMORY REGIONS ========================
Name   Address   Size   Attrs
.rtc.text 0x400c0000 0x0 RW  
.rtc.dummy 0x3ff80000 0x0 RW  
.rtc.force_fast 0x3ff80000 0x0 RW  
.rtc_noinit 0x50000000 0x0 RW  
.rtc.force_slow 0x50000000 0x0 RW  
.rtc_fast_reserved 0x3ff82000 0x0 RW  
.iram0.vectors 0x40080000 0x403 R XA
.iram0.text 0x40080404 0x1c83f R XA
.dram0.data 0x3ffbdb60 0x6274 RW A
.ext_ram_noinit 0x3f800000 0x0 RW  
.ext_ram.bss 0x3f800000 0x0 RW  
.flash.appdesc 0x3f400020 0x100 R  A
.flash.rodata 0x3f400120 0x339d8 RW A
.flash.text 0x400d0020 0xf31e6 R XA
.iram0.data 0x4009cc44 0x0 RW  
.iram0.bss 0x4009cc44 0x0 RW  
.dram0.heap_start 0x3ffd8ab0 0x0 RW  
.coredump.tasks.data 0x3ffe2a4c 0x154 RW 
.coredump.tasks.data 0x20000000 0x70 RW 
.coredump.tasks.data 0x3ffbba60 0x154 RW 
.coredump.tasks.data 0x3ffbb7a0 0x2b0 RW 
.coredump.tasks.data 0x3ffbc590 0x154 RW 
.coredump.tasks.data 0x3ffbc3e0 0x1a0 RW 
.coredump.tasks.data 0x3ffbcdec 0x154 RW 
.coredump.tasks.data 0x3ffbcc40 0x1a0 RW 
.coredump.tasks.data 0x3ffbd69c 0x154 RW 
.coredump.tasks.data 0x3ffdb8d0 0x210 RW 
.coredump.tasks.data 0x3ffbbd34 0x154 RW 
.coredump.tasks.data 0x3ffda8a0 0x240 RW 
.coredump.tasks.data 0x3ffdc8f8 0x154 RW 
.coredump.tasks.data 0x3ffdc6c0 0x230 RW 
.coredump.tasks.data 0x3ffdfde4 0x154 RW 
.coredump.tasks.data 0x3ffdfbc0 0x210 RW 
.coredump.tasks.data 0x3ffdd9f4 0x154 RW 
.coredump.tasks.data 0x3ffdd7d0 0x210 RW 
.coredump.tasks.data 0x3fff8548 0x154 RW 
.coredump.tasks.data 0x3fff8380 0x1c0 RW 
.coredump.tasks.data 0x3ffe20a0 0x154 RW 
.coredump.tasks.data 0x3ffe1e30 0x260 RW 
.coredump.tasks.data 0x3ffe3ba8 0x154 RW 
.coredump.tasks.data 0x3ffe3990 0x210 RW 
.coredump.tasks.data 0x3ffe9294 0x154 RW 
.coredump.tasks.data 0x3ffe90a0 0x1e0 RW 
.coredump.tasks.data 0x3ffb7318 0x154 RW 
.coredump.tasks.data 0x3ffb7160 0x1b0 RW 
.coredump.tasks.data 0x3ffdec88 0x154 RW 
.coredump.tasks.data 0x3ffdea60 0x220 RW 
.coredump.tasks.data 0x3ffb7a50 0x154 RW 
.coredump.tasks.data 0x3ffb7890 0x1b0 RW 
.coredump.tasks.data 0x3fff6fec 0x154 RW 
.coredump.tasks.data 0x3fff6b70 0x470 RW 
.coredump.tasks.data 0x3ffee618 0x154 RW 
.coredump.tasks.data 0x3ffee410 0x200 RW 

===================== ESP32 CORE DUMP END =====================
===============================================================
Done!
lieven@pcpro:~/workspace/zenoh-projects/zenoh-esp32$ 

@vortex314
Copy link
Author

vortex314 commented Jan 12, 2025

I got additional coredumps, but it seems that the task that crashes hasn 't any stack trace. In all different cases.
I start to suspect that there are huge peaks of memory usage , that make it run out of memory.
See below another message that indicates an OoM issur.
So the ASSERT ( 8192 0 ) could be that it tries to allocate 8KB at once anc ombined with other events, there is not enough left.
So I reduces the stack sizes of some tasks and test further.

I 00:15:22.139 |        main.cpp: 189 |  free heap size: 26276
I 00:15:23.159 |        main.cpp: 189 |  free heap size: 26276
I 00:15:24.181 |        main.cpp: 189 |  free heap size: 6040
W (926417) wifi:m f null

I 00:15:25.732 |        main.cpp: 189 |  free heap size: 3540
I 00:15:26.878 |        main.cpp: 189 |  free heap size: 11604
I 00:15:27.908 |        main.cpp: 189 |  free heap size: 24480
I 00:15:28.925 |        main.cpp: 189 |  free heap size: 24480
I 00:15:29.944 |        main.cpp: 189 |  free heap size: 24480
I 00:15:30.966 |        main.cpp: 189 |  free heap size: 24480
I 00:15:31.985 |        main.cpp: 189 |  free heap size: 26276
I 00:15:33.006 |        main.cpp: 189 |  free heap size: 26276
ASSERT_PARAM(2097152 0), in rwbt.c at line 360
Guru Meditation Error: Core  0 panic'ed (IllegalInstruction). Exception was unhandled.
Memory dump at 0x4008ec54: f01d020c 00004136 f01d0000

@vortex314
Copy link
Author

See also : espressif/esp-idf#15190

@ricardoquesada
Copy link
Owner

so rwbt.c (If I have to guess it might be related with "Read Write Bluetooth") seems to be a blob.. no source code for that, and I wouldn't know why it is crashing.

yeah, better to keep the discussion on the Espressif bug.

VERY IMPORTANT: ONLY call Bluepad32 / btstack from thread "thread 11" (ps4). NEVER call it from another thread.

If you need to use this tip:
https://bluepad32.readthedocs.io/en/latest/programmers_guide_raw/#multithreading

@vortex314
Copy link
Author

Thanks for your assistance, I close the issue here.
I suspect the explanation needs to come from the code of espressif.
I have not much knowledge on BT connectivity, but it looks to consume a lot of memory with high peaks. Squeezing the code of Wifi and BT together in IRAM is a challenge already.

@vortex314 vortex314 reopened this Jan 13, 2025
@vortex314
Copy link
Author

@ricardoquesada seen the feedback from Espressif on the version, I start to suspect a version issue.

The bluepad32 doc : https://bluepad32.readthedocs.io/en/latest/plat_esp32/ specifies to execute a script from 'btstack' which replaces the btstack of espressif with another one . https://github.com/bluekitchen/btstack/blob/5d4d8cc7b1d35a90bbd6d5ffd2d3050b2bfc861c/port/esp32/integrate_btstack.py -- 3 years old.
Is this still necessary ? And also to apply patches.

@ricardoquesada
Copy link
Owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants