text:
Guru Meditation Error: Core  0 panic'ed (IllegalInstruction). (IDFGH-11102)

Answers checklist.

[X] I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
[X] I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
[X] I have searched the issue tracker for a similar issue and not found a similar issue.

IDF version.
v5.1.1
Operating System used.
Linux
How did you build your project?
Command line with idf.py
If you are using Windows, please specify command line type.
None
Development Kit.
Olimex ESP32-POE-ISO Wroom 32E
Power Supply used.
USB
What is the expected behavior?
No core panic
What is the actual behavior?
I am using ESP32 in gattc mode, and it sometimes panics, when BLE signal is on the edge of disconnect. I recently updated esp-idf version from 4.4.5 to 5.1.1, but this issue still persists.
Steps to reproduce.

Setup BLE Gattc.
Put server device in near-out-of-range location.

Debug Logs.
ASSERT_PARAM(0 0), in lld_evt.c at line 1487
Guru Meditation Error: Core  0 panic'ed (IllegalInstruction). Exception was unhandled.
Memory dump at 0x4008fc94: f01d020c 00004136 f01d0000
0x4008fc94: btdm_sleep_check_duration at /home/matas/esp/esp-idf/components/bt/controller/esp32/bt.c:909

Core  0 register dump:
PC      : 0x4008fc9b  PS      : 0x00060c34  A0      : 0x80083baa  A1      : 0x3ffc1be0
0x4008fc9b: r_assert at /home/matas/esp/esp-idf/components/bt/controller/esp32/bt.c:1849

A2      : 0x00000000  A3      : 0x00000000  A4      : 0x00000000  A5      : 0x3f410046
A6      : 0x000005cf  A7      : 0xfffffffb  A8      : 0x8000814b  A9      : 0x3ffc1b50
A10     : 0x00000000  A11     : 0x3ffc1b74  A12     : 0x3ffc1b1f  A13     : 0x00000037
A14     : 0x00000000  A15     : 0x3ffc1b25  SAR     : 0x00000004  EXCCAUSE: 0x00000000
EXCVADDR: 0x00000000  LBEG    : 0x400012c5  LEND    : 0x400012d5  LCOUNT  : 0xfffffffe
0x400012c5: strcmp in ROM

0x400012d5: strcmp in ROM

Backtrace: 0x4008fc98:0x3ffc1be0 0x40083ba7:0x3ffc1c00 0x4008778f:0x3ffc1c20 0x4008416e:0x3ffc1c60 0x4008a0de:0x3ffc1c80 0x4008ad3f:0x3ffc1ca0 0x40083479:0x3ffc1cc0 0x400833e5:0x3ffc1ce0 0x400833c7:0x00000000 |<-CORRUPTED
0x4008fc98: r_assert at /home/matas/esp/esp-idf/components/bt/controller/esp32/bt.c:1848

0x40083ba7: r_assert_param at ??:?

0x4008778f: r_lld_evt_schedule at ??:?

0x4008416e: r_ea_finetimer_isr at ??:?

0x4008a0de: r_rwbt_isr at ??:?

0x4008ad3f: r_rwbtdm_isr_wrapper at intc.c:?

0x40083479: hli_c_handler at /home/matas/esp/esp-idf/components/bt/controller/esp32/hli_api.c:92

0x400833e5: _highint4_stack_switch at /home/matas/esp/esp-idf/components/bt/controller/esp32/hli_vectors.S:177

0x400833c7: xt_highint4 at /home/matas/esp/esp-idf/components/bt/controller/esp32/hli_vectors.S:161

More Information.
No response

I had similar issue already closed, but I'm seeing a bit different stack trace on this one.

@matislovas
yes,thanks for report the issue.
could you please provide  complete logs and elf file(or code better ) to help me reproduce the problem?

@matislovas
sure,You can send it to me via email and let me know the reproduction process. My email is [zhanghaipeng@espressif.com].

Sent!

@matislovas
thanks,Has the message been sent successfully on your end? I haven't received it here. Could you please tell me your email address?

@matislovas
Due to some filtering policies, the email didn't get sent. Could you please try sending the file again after packaging it? Thank you.

@matislovas
received，I will check it ...

@matislovas
We have located the issue based on the information you provided. In order to ensure your continued use, I can offer you a workaround. It involves replacing the "components/bt/controller/lib_esp32/esp32/libbtdm_app.a" file with the one I will send you.
esp32c3.zip
However, please note that this is not a permanent solution.
Could you please provide some details about when the issue generally occurs（Does the issue generally occur when the signal is weak?）? Additionally, could you explain how I can reproduce this problem?
Furthermore, if we are unable to reproduce the issue on our end, we may need to add some logs for analysis purposes. We will require your assistance in testing to help us further investigate.

Generally this occurs in random intervals (have 1 device connected), 2-3 times a day, and mostly, when device is far from ESP (5-7 meters) and RSSI is less than ~95dBm (reported by ESP).
Yeah, I can add additional logs for the debugging purposes.

@zhp0406
So with your provided lib, there's a linker error, any ideas?
[3/5] Linking CXX executable Olimex_BT_GW.elfFAILED: Olimex_BT_GW.elf
: && /home/matas/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-g++ -mlongcalls -Wno-frame-address -Wl,--cref -Wl,--defsym=IDF_TARGET_ESP32=0 -Wl,--Map=/home/matas/Devel/softdent/esp32/build/Olimex_BT_GW.map -Wl,--no-warn-rwx-segments -fno-rtti -fno-lto -Wl,--gc-sections -Wl,--warn-common -T esp32.peripherals.ld -T esp32.rom.ld -T esp32.rom.api.ld -T esp32.rom.libgcc.ld -T esp32.rom.newlib-data.ld -T esp32.rom.syscalls.ld -T esp32.rom.newlib-funcs.ld -T memory.ld -T sections.ld CMakeFiles/Olimex_BT_GW.elf.dir/project_elf_src_esp32.c.obj -o Olimex_BT_GW.elf -L/home/matas/esp/esp-idf/components/soc/esp32/ld   -L/home/matas/esp/esp-idf/components/esp_rom/esp32/ld   -L/home/matas/Devel/softdent/esp32/build/esp-idf/esp_system/ld   -L/home/matas/esp/esp-idf/components/esp_phy/lib/esp32   -L/home/matas/esp/esp-idf/components/esp_coex/lib/esp32   -L/home/matas/esp/esp-idf/components/esp_wifi/lib/esp32   -L/home/matas/esp/esp-idf/components/bt/controller/lib_esp32/esp32 esp-idf/xtensa/libxtensa.a  esp-idf/esp_ringbuf/libesp_ringbuf.a  esp-idf/efuse/libefuse.a  esp-idf/driver/libdriver.a  esp-idf/esp_pm/libesp_pm.a  esp-idf/mbedtls/libmbedtls.a  esp-idf/esp_app_format/libesp_app_format.a  esp-idf/bootloader_support/libbootloader_support.a  esp-idf/esp_partition/libesp_partition.a  esp-idf/app_update/libapp_update.a  esp-idf/esp_mm/libesp_mm.a  esp-idf/spi_flash/libspi_flash.a  esp-idf/pthread/libpthread.a  esp-idf/esp_system/libesp_system.a  esp-idf/esp_rom/libesp_rom.a  esp-idf/hal/libhal.a  esp-idf/log/liblog.a  esp-idf/heap/libheap.a  esp-idf/soc/libsoc.a  esp-idf/esp_hw_support/libesp_hw_support.a  esp-idf/freertos/libfreertos.a  esp-idf/newlib/libnewlib.a  esp-idf/cxx/libcxx.a  esp-idf/esp_common/libesp_common.a  esp-idf/esp_timer/libesp_timer.a  esp-idf/app_trace/libapp_trace.a  esp-idf/esp_event/libesp_event.a  esp-idf/nvs_flash/libnvs_flash.a  esp-idf/esp_phy/libesp_phy.a  esp-idf/vfs/libvfs.a  esp-idf/lwip/liblwip.a  esp-idf/esp_netif/libesp_netif.a  esp-idf/wpa_supplicant/libwpa_supplicant.a  esp-idf/esp_coex/libesp_coex.a  esp-idf/esp_wifi/libesp_wifi.a  esp-idf/bt/libbt.a  esp-idf/unity/libunity.a  esp-idf/cmock/libcmock.a  esp-idf/console/libconsole.a  esp-idf/http_parser/libhttp_parser.a  esp-idf/esp-tls/libesp-tls.a  esp-idf/esp_adc/libesp_adc.a  esp-idf/esp_eth/libesp_eth.a  esp-idf/esp_gdbstub/libesp_gdbstub.a  esp-idf/esp_hid/libesp_hid.a  esp-idf/tcp_transport/libtcp_transport.a  esp-idf/esp_http_client/libesp_http_client.a  esp-idf/esp_http_server/libesp_http_server.a  esp-idf/esp_https_ota/libesp_https_ota.a  esp-idf/esp_lcd/libesp_lcd.a  esp-idf/protobuf-c/libprotobuf-c.a  esp-idf/protocomm/libprotocomm.a  esp-idf/esp_local_ctrl/libesp_local_ctrl.a  esp-idf/espcoredump/libespcoredump.a  esp-idf/wear_levelling/libwear_levelling.a  esp-idf/sdmmc/libsdmmc.a  esp-idf/fatfs/libfatfs.a  esp-idf/json/libjson.a  esp-idf/mqtt/libmqtt.a  esp-idf/perfmon/libperfmon.a  esp-idf/spiffs/libspiffs.a  esp-idf/wifi_provisioning/libwifi_provisioning.a  esp-idf/main/libmain.a  esp-idf/app_trace/libapp_trace.a  esp-idf/app_trace/libapp_trace.a  esp-idf/cmock/libcmock.a  esp-idf/unity/libunity.a  esp-idf/esp_hid/libesp_hid.a  esp-idf/esp_lcd/libesp_lcd.a  esp-idf/esp_local_ctrl/libesp_local_ctrl.a  esp-idf/espcoredump/libespcoredump.a  esp-idf/fatfs/libfatfs.a  esp-idf/wear_levelling/libwear_levelling.a  esp-idf/sdmmc/libsdmmc.a  esp-idf/mqtt/libmqtt.a  esp-idf/perfmon/libperfmon.a  esp-idf/spiffs/libspiffs.a  esp-idf/wifi_provisioning/libwifi_provisioning.a  esp-idf/protocomm/libprotocomm.a  esp-idf/bt/libbt.a  -lbtdm_app  -u ld_include_hli_vectors_bt  esp-idf/console/libconsole.a  esp-idf/protobuf-c/libprotobuf-c.a  esp-idf/json/libjson.a  esp-idf/xtensa/libxtensa.a  esp-idf/esp_ringbuf/libesp_ringbuf.a  esp-idf/efuse/libefuse.a  esp-idf/driver/libdriver.a  esp-idf/esp_pm/libesp_pm.a  esp-idf/mbedtls/libmbedtls.a  esp-idf/esp_app_format/libesp_app_format.a  esp-idf/bootloader_support/libbootloader_support.a  esp-idf/esp_partition/libesp_partition.a  esp-idf/app_update/libapp_update.a  esp-idf/esp_mm/libesp_mm.a  esp-idf/spi_flash/libspi_flash.a  esp-idf/pthread/libpthread.a  esp-idf/esp_system/libesp_system.a  esp-idf/esp_rom/libesp_rom.a  esp-idf/hal/libhal.a  esp-idf/log/liblog.a  esp-idf/heap/libheap.a  esp-idf/soc/libsoc.a  esp-idf/esp_hw_support/libesp_hw_support.a  esp-idf/freertos/libfreertos.a  esp-idf/newlib/libnewlib.a  esp-idf/cxx/libcxx.a  esp-idf/esp_common/libesp_common.a  esp-idf/esp_timer/libesp_timer.a  esp-idf/esp_event/libesp_event.a  esp-idf/nvs_flash/libnvs_flash.a  esp-idf/esp_phy/libesp_phy.a  esp-idf/vfs/libvfs.a  esp-idf/lwip/liblwip.a  esp-idf/esp_netif/libesp_netif.a  esp-idf/wpa_supplicant/libwpa_supplicant.a  esp-idf/esp_coex/libesp_coex.a  esp-idf/esp_wifi/libesp_wifi.a  esp-idf/http_parser/libhttp_parser.a  esp-idf/esp-tls/libesp-tls.a  esp-idf/esp_adc/libesp_adc.a  esp-idf/esp_eth/libesp_eth.a  esp-idf/esp_gdbstub/libesp_gdbstub.a  esp-idf/tcp_transport/libtcp_transport.a  esp-idf/esp_http_client/libesp_http_client.a  esp-idf/esp_http_server/libesp_http_server.a  esp-idf/esp_https_ota/libesp_https_ota.a  esp-idf/mbedtls/mbedtls/library/libmbedtls.a  esp-idf/mbedtls/mbedtls/library/libmbedcrypto.a  esp-idf/mbedtls/mbedtls/library/libmbedx509.a  /home/matas/esp/esp-idf/components/esp_coex/lib/esp32/libcoexist.a  /home/matas/esp/esp-idf/components/esp_wifi/lib/esp32/libcore.a  /home/matas/esp/esp-idf/components/esp_wifi/lib/esp32/libespnow.a  /home/matas/esp/esp-idf/components/esp_wifi/lib/esp32/libmesh.a  /home/matas/esp/esp-idf/components/esp_wifi/lib/esp32/libnet80211.a  /home/matas/esp/esp-idf/components/esp_wifi/lib/esp32/libpp.a  /home/matas/esp/esp-idf/components/esp_wifi/lib/esp32/libsmartconfig.a  /home/matas/esp/esp-idf/components/esp_wifi/lib/esp32/libwapi.a  esp-idf/xtensa/libxtensa.a  esp-idf/esp_ringbuf/libesp_ringbuf.a  esp-idf/efuse/libefuse.a  esp-idf/driver/libdriver.a  esp-idf/esp_pm/libesp_pm.a  esp-idf/mbedtls/libmbedtls.a  esp-idf/esp_app_format/libesp_app_format.a  esp-idf/bootloader_support/libbootloader_support.a  esp-idf/esp_partition/libesp_partition.a  esp-idf/app_update/libapp_update.a  esp-idf/esp_mm/libesp_mm.a  esp-idf/spi_flash/libspi_flash.a  esp-idf/pthread/libpthread.a  esp-idf/esp_system/libesp_system.a  esp-idf/esp_rom/libesp_rom.a  esp-idf/hal/libhal.a  esp-idf/log/liblog.a  esp-idf/heap/libheap.a  esp-idf/soc/libsoc.a  esp-idf/esp_hw_support/libesp_hw_support.a  esp-idf/freertos/libfreertos.a  esp-idf/newlib/libnewlib.a  esp-idf/cxx/libcxx.a  esp-idf/esp_common/libesp_common.a  esp-idf/esp_timer/libesp_timer.a  esp-idf/esp_event/libesp_event.a  esp-idf/nvs_flash/libnvs_flash.a  esp-idf/esp_phy/libesp_phy.a  esp-idf/vfs/libvfs.a  esp-idf/lwip/liblwip.a  esp-idf/esp_netif/libesp_netif.a  esp-idf/wpa_supplicant/libwpa_supplicant.a  esp-idf/esp_coex/libesp_coex.a  esp-idf/esp_wifi/libesp_wifi.a  esp-idf/http_parser/libhttp_parser.a  esp-idf/esp-tls/libesp-tls.a  esp-idf/esp_adc/libesp_adc.a  esp-idf/esp_eth/libesp_eth.a  esp-idf/esp_gdbstub/libesp_gdbstub.a  esp-idf/tcp_transport/libtcp_transport.a  esp-idf/esp_http_client/libesp_http_client.a  esp-idf/esp_http_server/libesp_http_server.a  esp-idf/esp_https_ota/libesp_https_ota.a  esp-idf/mbedtls/mbedtls/library/libmbedtls.a  esp-idf/mbedtls/mbedtls/library/libmbedcrypto.a  esp-idf/mbedtls/mbedtls/library/libmbedx509.a  /home/matas/esp/esp-idf/components/esp_coex/lib/esp32/libcoexist.a  /home/matas/esp/esp-idf/components/esp_wifi/lib/esp32/libcore.a  /home/matas/esp/esp-idf/components/esp_wifi/lib/esp32/libespnow.a  /home/matas/esp/esp-idf/components/esp_wifi/lib/esp32/libmesh.a  /home/matas/esp/esp-idf/components/esp_wifi/lib/esp32/libnet80211.a  /home/matas/esp/esp-idf/components/esp_wifi/lib/esp32/libpp.a  /home/matas/esp/esp-idf/components/esp_wifi/lib/esp32/libsmartconfig.a  /home/matas/esp/esp-idf/components/esp_wifi/lib/esp32/libwapi.a  esp-idf/xtensa/libxtensa.a  esp-idf/esp_ringbuf/libesp_ringbuf.a  esp-idf/efuse/libefuse.a  esp-idf/driver/libdriver.a  esp-idf/esp_pm/libesp_pm.a  esp-idf/mbedtls/libmbedtls.a  esp-idf/esp_app_format/libesp_app_format.a  esp-idf/bootloader_support/libbootloader_support.a  esp-idf/esp_partition/libesp_partition.a  esp-idf/app_update/libapp_update.a  esp-idf/esp_mm/libesp_mm.a  esp-idf/spi_flash/libspi_flash.a  esp-idf/pthread/libpthread.a  esp-idf/esp_system/libesp_system.a  esp-idf/esp_rom/libesp_rom.a  esp-idf/hal/libhal.a  esp-idf/log/liblog.a  esp-idf/heap/libheap.a  esp-idf/soc/libsoc.a  esp-idf/esp_hw_support/libesp_hw_support.a  esp-idf/freertos/libfreertos.a  esp-idf/newlib/libnewlib.a  esp-idf/cxx/libcxx.a  esp-idf/esp_common/libesp_common.a  esp-idf/esp_timer/libesp_timer.a  esp-idf/esp_event/libesp_event.a  esp-idf/nvs_flash/libnvs_flash.a  esp-idf/esp_phy/libesp_phy.a  esp-idf/vfs/libvfs.a  esp-idf/lwip/liblwip.a  esp-idf/esp_netif/libesp_netif.a  esp-idf/wpa_supplicant/libwpa_supplicant.a  esp-idf/esp_coex/libesp_coex.a  esp-idf/esp_wifi/libesp_wifi.a  esp-idf/http_parser/libhttp_parser.a  esp-idf/esp-tls/libesp-tls.a  esp-idf/esp_adc/libesp_adc.a  esp-idf/esp_eth/libesp_eth.a  esp-idf/esp_gdbstub/libesp_gdbstub.a  esp-idf/tcp_transport/libtcp_transport.a  esp-idf/esp_http_client/libesp_http_client.a  esp-idf/esp_http_server/libesp_http_server.a  esp-idf/esp_https_ota/libesp_https_ota.a  esp-idf/mbedtls/mbedtls/library/libmbedtls.a  esp-idf/mbedtls/mbedtls/library/libmbedcrypto.a  esp-idf/mbedtls/mbedtls/library/libmbedx509.a  /home/matas/esp/esp-idf/components/esp_coex/lib/esp32/libcoexist.a  /home/matas/esp/esp-idf/components/esp_wifi/lib/esp32/libcore.a  /home/matas/esp/esp-idf/components/esp_wifi/lib/esp32/libespnow.a  /home/matas/esp/esp-idf/components/esp_wifi/lib/esp32/libmesh.a  /home/matas/esp/esp-idf/components/esp_wifi/lib/esp32/libnet80211.a  /home/matas/esp/esp-idf/components/esp_wifi/lib/esp32/libpp.a  /home/matas/esp/esp-idf/components/esp_wifi/lib/esp32/libsmartconfig.a  /home/matas/esp/esp-idf/components/esp_wifi/lib/esp32/libwapi.a  esp-idf/xtensa/libxtensa.a  esp-idf/esp_ringbuf/libesp_ringbuf.a  esp-idf/efuse/libefuse.a  esp-idf/driver/libdriver.a  esp-idf/esp_pm/libesp_pm.a  esp-idf/mbedtls/libmbedtls.a  esp-idf/esp_app_format/libesp_app_format.a  esp-idf/bootloader_support/libbootloader_support.a  esp-idf/esp_partition/libesp_partition.a  esp-idf/app_update/libapp_update.a  esp-idf/esp_mm/libesp_mm.a  esp-idf/spi_flash/libspi_flash.a  esp-idf/pthread/libpthread.a  esp-idf/esp_system/libesp_system.a  esp-idf/esp_rom/libesp_rom.a  esp-idf/hal/libhal.a  esp-idf/log/liblog.a  esp-idf/heap/libheap.a  esp-idf/soc/libsoc.a  esp-idf/esp_hw_support/libesp_hw_support.a  esp-idf/freertos/libfreertos.a  esp-idf/newlib/libnewlib.a  esp-idf/cxx/libcxx.a  esp-idf/esp_common/libesp_common.a  esp-idf/esp_timer/libesp_timer.a  esp-idf/esp_event/libesp_event.a  esp-idf/nvs_flash/libnvs_flash.a  esp-idf/esp_phy/libesp_phy.a  esp-idf/vfs/libvfs.a  esp-idf/lwip/liblwip.a  esp-idf/esp_netif/libesp_netif.a  esp-idf/wpa_supplicant/libwpa_supplicant.a  esp-idf/esp_coex/libesp_coex.a  esp-idf/esp_wifi/libesp_wifi.a  esp-idf/http_parser/libhttp_parser.a  esp-idf/esp-tls/libesp-tls.a  esp-idf/esp_adc/libesp_adc.a  esp-idf/esp_eth/libesp_eth.a  esp-idf/esp_gdbstub/libesp_gdbstub.a  esp-idf/tcp_transport/libtcp_transport.a  esp-idf/esp_http_client/libesp_http_client.a  esp-idf/esp_http_server/libesp_http_server.a  esp-idf/esp_https_ota/libesp_https_ota.a  esp-idf/mbedtls/mbedtls/library/libmbedtls.a  esp-idf/mbedtls/mbedtls/library/libmbedcrypto.a  esp-idf/mbedtls/mbedtls/library/libmbedx509.a  /home/matas/esp/esp-idf/components/esp_coex/lib/esp32/libcoexist.a  /home/matas/esp/esp-idf/components/esp_wifi/lib/esp32/libcore.a  /home/matas/esp/esp-idf/components/esp_wifi/lib/esp32/libespnow.a  /home/matas/esp/esp-idf/components/esp_wifi/lib/esp32/libmesh.a  /home/matas/esp/esp-idf/components/esp_wifi/lib/esp32/libnet80211.a  /home/matas/esp/esp-idf/components/esp_wifi/lib/esp32/libpp.a  /home/matas/esp/esp-idf/components/esp_wifi/lib/esp32/libsmartconfig.a  /home/matas/esp/esp-idf/components/esp_wifi/lib/esp32/libwapi.a  esp-idf/xtensa/libxtensa.a  esp-idf/esp_ringbuf/libesp_ringbuf.a  esp-idf/efuse/libefuse.a  esp-idf/driver/libdriver.a  esp-idf/esp_pm/libesp_pm.a  esp-idf/mbedtls/libmbedtls.a  esp-idf/esp_app_format/libesp_app_format.a  esp-idf/bootloader_support/libbootloader_support.a  esp-idf/esp_partition/libesp_partition.a  esp-idf/app_update/libapp_update.a  esp-idf/esp_mm/libesp_mm.a  esp-idf/spi_flash/libspi_flash.a  esp-idf/pthread/libpthread.a  esp-idf/esp_system/libesp_system.a  esp-idf/esp_rom/libesp_rom.a  esp-idf/hal/libhal.a  esp-idf/log/liblog.a  esp-idf/heap/libheap.a  esp-idf/soc/libsoc.a  esp-idf/esp_hw_support/libesp_hw_support.a  esp-idf/freertos/libfreertos.a  esp-idf/newlib/libnewlib.a  esp-idf/cxx/libcxx.a  esp-idf/esp_common/libesp_common.a  esp-idf/esp_timer/libesp_timer.a  esp-idf/esp_event/libesp_event.a  esp-idf/nvs_flash/libnvs_flash.a  esp-idf/esp_phy/libesp_phy.a  esp-idf/vfs/libvfs.a  esp-idf/lwip/liblwip.a  esp-idf/esp_netif/libesp_netif.a  esp-idf/wpa_supplicant/libwpa_supplicant.a  esp-idf/esp_coex/libesp_coex.a  esp-idf/esp_wifi/libesp_wifi.a  esp-idf/http_parser/libhttp_parser.a  esp-idf/esp-tls/libesp-tls.a  esp-idf/esp_adc/libesp_adc.a  esp-idf/esp_eth/libesp_eth.a  esp-idf/esp_gdbstub/libesp_gdbstub.a  esp-idf/tcp_transport/libtcp_transport.a  esp-idf/esp_http_client/libesp_http_client.a  esp-idf/esp_http_server/libesp_http_server.a  esp-idf/esp_https_ota/libesp_https_ota.a  esp-idf/mbedtls/mbedtls/library/libmbedtls.a  esp-idf/mbedtls/mbedtls/library/libmbedcrypto.a  esp-idf/mbedtls/mbedtls/library/libmbedx509.a  /home/matas/esp/esp-idf/components/esp_coex/lib/esp32/libcoexist.a  /home/matas/esp/esp-idf/components/esp_wifi/lib/esp32/libcore.a  /home/matas/esp/esp-idf/components/esp_wifi/lib/esp32/libespnow.a  /home/matas/esp/esp-idf/components/esp_wifi/lib/esp32/libmesh.a  /home/matas/esp/esp-idf/components/esp_wifi/lib/esp32/libnet80211.a  /home/matas/esp/esp-idf/components/esp_wifi/lib/esp32/libpp.a  /home/matas/esp/esp-idf/components/esp_wifi/lib/esp32/libsmartconfig.a  /home/matas/esp/esp-idf/components/esp_wifi/lib/esp32/libwapi.a  /home/matas/esp/esp-idf/components/xtensa/esp32/libxt_hal.a  -Wl,--wrap=mbedtls_ssl_write_client_hello  -Wl,--wrap=mbedtls_ssl_handshake_client_step  -Wl,--wrap=mbedtls_ssl_handshake_server_step  -Wl,--wrap=mbedtls_ssl_read  -Wl,--wrap=mbedtls_ssl_write  -Wl,--wrap=mbedtls_ssl_session_reset  -Wl,--wrap=mbedtls_ssl_free  -Wl,--wrap=mbedtls_ssl_setup  -Wl,--wrap=mbedtls_ssl_send_alert_message  -Wl,--wrap=mbedtls_ssl_close_notify  -u esp_app_desc  -u pthread_include_pthread_impl  -u pthread_include_pthread_cond_impl  -u pthread_include_pthread_local_storage_impl  -u pthread_include_pthread_rwlock_impl  -u pthread_include_pthread_semaphore_impl  -u ld_include_highint_hdl  -u start_app  -u start_app_other_cores  -u __ubsan_include  -Wl,--wrap=longjmp  -u abort  -u esp_dport_access_reg_read  -Wl,--undefined=uxTopUsedPriority  -Wl,--undefined=FreeRTOS_openocd_params  -u app_main  -lc  -lm  esp-idf/newlib/libnewlib.a  -u newlib_include_heap_impl  -u newlib_include_syscalls_impl  -u newlib_include_pthread_impl  -u newlib_include_assert_impl  -Wl,--wrap=_Unwind_SetEnableExceptionFdeSorting  -Wl,--wrap=__register_frame_info_bases  -Wl,--wrap=__register_frame_info  -Wl,--wrap=__register_frame  -Wl,--wrap=__register_frame_info_table_bases  -Wl,--wrap=__register_frame_info_table  -Wl,--wrap=__register_frame_table  -Wl,--wrap=__deregister_frame_info_bases  -Wl,--wrap=__deregister_frame_info  -Wl,--wrap=_Unwind_Find_FDE  -Wl,--wrap=_Unwind_GetGR  -Wl,--wrap=_Unwind_GetCFA  -Wl,--wrap=_Unwind_GetIP  -Wl,--wrap=_Unwind_GetIPInfo  -Wl,--wrap=_Unwind_GetRegionStart  -Wl,--wrap=_Unwind_GetDataRelBase  -Wl,--wrap=_Unwind_GetTextRelBase  -Wl,--wrap=_Unwind_SetIP  -Wl,--wrap=_Unwind_SetGR  -Wl,--wrap=_Unwind_GetLanguageSpecificData  -Wl,--wrap=_Unwind_FindEnclosingFunction  -Wl,--wrap=_Unwind_Resume  -Wl,--wrap=_Unwind_RaiseException  -Wl,--wrap=_Unwind_DeleteException  -Wl,--wrap=_Unwind_ForcedUnwind  -Wl,--wrap=_Unwind_Resume_or_Rethrow  -Wl,--wrap=_Unwind_Backtrace  -Wl,--wrap=__cxa_call_unexpected  -Wl,--wrap=__gxx_personality_v0  -u __cxa_guard_dummy  -lstdc++  esp-idf/pthread/libpthread.a  -lgcc  esp-idf/cxx/libcxx.a  -u __cxx_fatal_exception  -u include_esp_phy_override  -lphy  -lrtc  esp-idf/esp_phy/libesp_phy.a  -lphy  -lrtc  esp-idf/esp_phy/libesp_phy.a  -lphy  -lrtc  -u vfs_include_syscalls_impl && :
/home/matas/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/12.2.0/../../../../xtensa-esp32-elf/bin/ld: /home/matas/esp/esp-idf/components/bt/controller/lib_esp32/esp32/libbtdm_app.a(llc_hci.o): in function `hci_rd_tx_pwr_lvl_cmd_handler':
llc_hci.c:(.text+0x72c): undefined reference to `btdm_gpio_set_level'
/home/matas/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/12.2.0/../../../../xtensa-esp32-elf/bin/ld: llc_hci.c:(.text+0x737): undefined reference to `btdm_gpio_set_level'
/home/matas/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/12.2.0/../../../../xtensa-esp32-elf/bin/ld: /home/matas/esp/esp-idf/components/bt/controller/lib_esp32/esp32/libbtdm_app.a(llc_hci.o): in function `hci_disconnect_cmd_handler':
llc_hci.c:(.text+0x83a): undefined reference to `btdm_gpio_set_level'

It works fine with stock libbtdm_app.a.

@matislovas
sorry for that,I seem to have made some mistakes,I will check ...

Yeah, now it builds! Will try for couple days and will get back with results.

After couple days of work, ESP didn't throw me that error. So I can carefully say  the workaround works. Should I expect any side effects from using yours provided libbtdm_app.a?

@matislovas
There are no any side effects , but because it's difficult to reproduce, we haven't yet identified the root cause of the issue.

ASSERT_PARAM(0 0), in lld_evt.c at line 1487
Guru Meditation Error: Core  0 panic'ed (IllegalInstruction). Exception was unhandled.
Memory dump at 0x40090518: 00f01d00 00004136 f01d0000
Core  0 register dump:
PC      : 0x4009051f  PS      : 0x00060234  A0      : 0x80085d31  A1      : 0x3ffc2f94
A2      : 0x00000000  A3      : 0x00000000  A4      : 0x00000000  A5      : 0x3f41614e
A6      : 0x000005cf  A7      : 0xfffffffb  A8      : 0x8000814b  A9      : 0x3ffc2f04
A10     : 0x00000000  A11     : 0x3ffc2f28  A12     : 0x3ffc2ed3  A13     : 0x00000037
A14     : 0x00000000  A15     : 0x3ffc2ed9  SAR     : 0x00000004  EXCCAUSE: 0x00000000
EXCVADDR: 0x00000000  LBEG    : 0x40085c39  LEND    : 0x40085c41  LCOUNT  : 0x00000000

Backtrace: 0x4009051c:0x3ffc2f94 |<-CORRUPTED

I am getting the same error with this https://github.com/espressif/esp-idf/issues/12182 update, I doubt it helps but wanted to let you it happened only only for the issue creator.

@mjaneczek
Does the updated lib（libbtdm_app.zip） work for you?

@zhp0406 I am using your update now, today I got:
ASSERT_PARAM(0 0), in lld_pdu.c at line 883
Guru Meditation Error: Core  0 panic'ed (IllegalInstruction). Exception was unhandled.
Memory dump at 0x400905c0: 00f01d00 00004136 f01d0000
Core  0 register dump:
PC      : 0x400905c7  PS      : 0x00060234  A0      : 0x80085c02  A1      : 0x3ffc2f70
A2      : 0x00000000  A3      : 0x00000000  A4      : 0x00000000  A5      : 0x3f4163a2
A6      : 0x00000373  A7      : 0xfffffffc  A8      : 0x8000814b  A9      : 0x3ffc2ee0
A10     : 0x00000000  A11     : 0x3ffc2f03  A12     : 0x3ffc2eaf  A13     : 0x00000033
A14     : 0x00000000  A15     : 0x3ffc2eb4  SAR     : 0x00000004  EXCCAUSE: 0x00000000
EXCVADDR: 0x00000000  LBEG    : 0x400920a5  LEND    : 0x400920b5  LCOUNT  : 0xfffffffe

Backtrace: 0x400905c4:0x3ffc2f70 0x40085bff:0x3ffc2f90 0x4008b0be:0x3ffc2fb0 0x4008b299:0x3ffc2ff0 0x40089801:0x3ffc3030 0x400861c2:0x3ffc3070 0x4008c0f6:0x3ffc3090 0x4008cd57:0x3ffc30b0 0x40085582:0x3ffc30d0 0x400858a1:0x3ffc30f0 0x40085883:0x00000000 |<-CORRUPTED

The line is different: ASSERT_PARAM(0 0), in lld_pdu.c at line 883 might be more related to https://github.com/espressif/esp-idf/issues/11635

Hey @zhp0406 , any progress on this? We want to launch our product in the beginning of next year based on esp32 and this is a blocker for us. This bug appears, when there's a big and long data transfers taking place between esp and ble server device.

@matislovas
Hi，
The MR has been submitted and will be merged into all branches. Currently, it is in the testing process, and this process will likely take around 10 days. After the MR is completed, we will inform you of the commit.

ASSERT_PARAM(0 0), in lld_pdu.c at line 883
Guru Meditation Error: Core  0 panic'ed (IllegalInstruction). Exception was unhandled.
Memory dump at 0x400905c0: 00f01d00 00004136 f01d0000
Core  0 register dump:
PC      : 0x400905c7  PS      : 0x00060e34  A0      : 0x80085c02  A1      : 0x3ffc2f70
A2      : 0x00000000  A3      : 0x00000000  A4      : 0x00000000  A5      : 0x3f4163a2
A6      : 0x00000373  A7      : 0xfffffffc  A8      : 0x8000814b  A9      : 0x3ffc2ee0
A10     : 0x00000000  A11     : 0x3ffc2f03  A12     : 0x3ffc2eaf  A13     : 0x00000033
A14     : 0x00000000  A15     : 0x3ffc2eb4  SAR     : 0x00000004  EXCCAUSE: 0x00000000
EXCVADDR: 0x00000000  LBEG    : 0x400920a5  LEND    : 0x400920b5  LCOUNT  : 0xfffffffe

Backtrace: 0x400905c4:0x3ffc2f70 0x40085bff:0x3ffc2f90 0x4008b0be:0x3ffc2fb0 0x4008b299:0x3ffc2ff0 0x40089801:0x3ffc3030 0x400861c2:0x3ffc3070 0x4008c0f6:0x3ffc3090 0x4008cd57:0x3ffc30b0 0x40085582:0x3ffc30d0 0x400858a1:0x3ffc30f0 0x40085883:0x00000000 |<-CORRUPTED

I have downloaded a lib from your commit and it happened after a few hours of working. @zhp0406

@mjaneczek
Your library probably didn't update successfully; the new library shouldn't assert at line 883 anymore.
Moreover, in the latest release v5.1, our modifications have already taken effect, and you can also make use of the latest release/v5.1.
commit 5f2c8edd27e60d5c98f16a2f107133de86fd3ec1
Author: chenjianhua chenjianhua@espressif.com
Date:   Fri Nov 24 20:16:03 2023 +0800
fix(bt): Update bt lib for ESP32(fa43201)

- Fixed assert for instant passed workaround
- Fixed scan evt timeout
- Fixed random address setting when scanning

@zhp0406  I tried new release of 5.1 (through the provided Docker image), but it still fails with those errors:
ASSERT_PARAM(10 0), in lld_pdu.c at line 672
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Memory dump at 0x40090234: f01d020c 00004136 f01d0000
0x40090234: btdm_sleep_check_duration at /opt/esp/idf/components/bt/controller/esp32/bt.c:911

Core  1 register dump:
PC      : 0x4009023b  PS      : 0x00060334  A0      : 0x80083be6  A1      : 0x3ffc1c30
0x4009023b: r_assert at /opt/esp/idf/components/bt/controller/esp32/bt.c:1848

A2      : 0x00000000  A3      : 0x0000000a  A4      : 0x00000000  A5      : 0x3f41113a
A6      : 0x000002a0  A7      : 0xfffffffc  A8      : 0x8000814b  A9      : 0x3ffc1ba0
A10     : 0x00000000  A11     : 0x3ffc1bc3  A12     : 0x3ffc1b6f  A13     : 0x00000032
A14     : 0x00000000  A15     : 0x3ffc1b74  SAR     : 0x00000004  EXCCAUSE: 0x00000000
EXCVADDR: 0x00000000  LBEG    : 0x400012c5  LEND    : 0x400012d5  LCOUNT  : 0xfffffffe
0x400012c5: strcmp in ROM

0x400012d5: strcmp in ROM

Backtrace: 0x40090238:0x3ffc1c30 0x40083be3:0x3ffc1c50 0x40088b5d:0x3ffc1c70 0x40087281:0x3ffc1cb0 0x40086ece:0x3ffc1cd0 0x40087b55:0x3ffc1cf0 0x400895e0:0x3ffc1d10 0x40089d99:0x3ffc1d30 0x4008ae0f:0x3ffc1d50 0x40083475:0x3ffc1d70 0x400833e1:0x3ffc1d90 0x400833c3:0x00000000 |<-CORRUPTED
0x40090238: r_assert at /opt/esp/idf/components/bt/controller/esp32/bt.c:1847

0x40083be3: r_assert_param at ??:?

0x40088b5d: r_lld_pdu_rx_handler at ??:?

0x40087281: r_lld_evt_end at ??:?

0x40086ece: r_lld_evt_end_isr at ??:?

0x40087b55: lld_adjust_after_reset at ??:?

0x400895e0: ble_master_soft_rst at ??:?

0x40089d99: r_rwble_isr at ??:?

0x4008ae0f: r_rwbtdm_isr_wrapper at intc.c:?

0x40083475: hli_c_handler at /opt/esp/idf/components/bt/controller/esp32/hli_api.c:92

0x400833e1: _highint4_stack_switch at /opt/esp/idf/components/bt/controller/esp32/hli_vectors.S:177

0x400833c3: xt_highint4 at /opt/esp/idf/components/bt/controller/esp32/hli_vectors.S:161

@matislovas
I will check

Sorry for adding more mess to the situation, you are right I was still using the old one, I tried to get new lib from here:
https://github.com/espressif/esp32-bt-lib/blob/master/esp32/libbtdm_app.a
But getting: skipping incompatible libbtdm_app.a when searching for -lbtdm_app
Double checked that I was able to compile with the lib u provided in this thread in zip, not sure what I am doing wrong, is this some dev built or something, if you could give me a tip on how to make this work I will be happy to test and help with the issue.
Once again, I am sorry about the wrong information.

@zhp0406  sent you via wetransfer

@matislovas
We have fixed the issue across all branches. If there are any additional problems after the fix, please create a new issue and provide a complete log. We will respond to you as soon as possible. Please test again using the patched release version.
Thank you.
Below are the specific commits for the fix：
master 74f99d267939674b7e67813aa12199d14ed1aa28
v5.2 6139b362a061fc6ed39522aaa7b8b9d50652299e
v5.1 5f2c8edd27e60d5c98f16a2f107133de86fd3ec1
v5.0 51ba771176e1a16560d86fd87cf8d1506f4e54af
v4.4 4e518185c557048179a25bf8b527f71cfa910e9f
v4.3 79e80d913432026b809aa5e16e318dde080136dd

@mjaneczek
Which specific commit are you currently using? I have made a patched fix based on the latest release/v5.1 (BT controller compile version [664bcc7]). Please directly replace the file at esp-idf/components/bt/controller/lib_esp32/esp32/libbtdm_app.a
esp32.zip

@mjaneczek
If you need to create a lib based on a specific commit, please tell me the IDF commit you are using, or provide me with the complete boot log.

base on commit f5e484fc79e38e668768735b4b63dd976cb4266b
445f19e.zip

@matislovas We have fixed the issue across all branches.

Then this issue should be closed.

authors: AxelLin matislovas mjaneczek zhp0406


text:
SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY depends on SPIRAM_USE_MALLOC (IDFGH-11604)

Answers checklist.

[X] I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
[X] I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
[X] I have searched the issue tracker for a similar issue and not found a similar issue.

General issue report
Reporting as per https://github.com/espressif/esp-idf/issues/9011#issuecomment-1837046892
See https://github.com/espressif/esp-idf/blob/master/components/esp_psram/esp32/Kconfig.spiram#L265
I cannot enable task stack in SPIRAM without also enabling SPIRAM allocation by malloc() (instead of only through heap_caps_malloc). However, enabling SPIRAM allocation by malloc() causes all sorts of other things to prefer internal RAM instead of SPIRAM as I want, and my internal RAM is exhausted before I finish booting.
@igrr is it as simple as just changing that line to depends on SPIRAM?

@ftab Which chip and version of ESP-IDF are you using?
And what do you mean by

However, enabling SPIRAM allocation by malloc() causes all sorts of other things to prefer internal RAM instead of SPIRAM as I want,...

Without SPIRAM_USE_MALLOC disabled, malloc() should only allocate internal memory. When enabled, malloc() should allocate memory above a certain size on SPIRAM.

@0xjakob thanks for the quick response!

@ftab Which chip and version of ESP-IDF are you using?

ESP32, 5.1.2

And what do you mean by the following?

However, enabling SPIRAM allocation by malloc() causes all sorts of other things to prefer internal RAM instead of SPIRAM as I want,...

Without SPIRAM_USE_MALLOC disabled, malloc() should only allocate internal memory. When enabled, malloc() should allocate memory above a certain size on SPIRAM.

When I enable SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY on the default ESP-IDF 5.1.2, I have to set SPIRAM_USE to SPIRAM_USE_MALLOC and my application fails to boot because it runs out of internal RAM. I don't know exactly why yet. I have checked that BT_ALLOCATION_FROM_SPIRAM_FIRST is true, SPIRAM_TRY_ALLOCATE_WIFI_LWIP is true, and all other similar options are set to true. I haven't fully investigated, there's a lot going on in my application (ESP-ADF, WiFi, Bluetooth A2DP/AVRCP/SPP, Bluetooth LE, esp console, esp rainmaker/insights, audio DSP, etc.). My application only successfully boots when SPIRAM_USE is set to SPIRAM_USE_CAPS_MALLOC, but then that disables SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY.

Edit: Note that this behavior for allocating FreeRTOS objects changed in version 5.1. Hence your IDF version is of interest, too.

Yes, I saw this and this is the reason I wanted to upgrade to this version of ESP-IDF, so I could use task stack in external memory and free up some internal memory. But in the default esp-idf 5.1.2 it is not possible to use task stack in external memory when SPIRAM_USE method is SPIRAM_USE_CAPS_ALLOC
I have made a fork of 5.1.2 that changes SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY to depend on SPIRAM instead of SPIRAM_USE_MALLOC, and the application seems to work, but I don't know enough to know whether this is safe.

The only issue I have had so far with this arrangement is that esp-idf/components/spi_flash/cache_utils.c is still blissfully unaware of SPIRAM being a valid location for task stack:
static inline bool esp_task_stack_is_sane_cache_disabled(void)
{
    const void *sp = (const void *)esp_cpu_get_sp();

    return esp_ptr_in_dram(sp)
#if CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP
        || esp_ptr_in_rtc_dram_fast(sp)
#endif
    ;
}

Thus anything calling spi_flash_disable_interrupts_caches_and_other_cpu() which includes

marking an OTA partition as valid
seemingly any NVS access?

causes an assert failure and I have to move that task back to internal RAM, meaning I'm almost out again.

Came upon this in a google search and I think I see something related.  I am using the esp-adf and created my own element that uses himem.  By default, adf wants to put element task stacks in SPIRAM as long as it is enabled.  The problem is spi_flash_disable_interrupts_caches_and_other_cpu() fails as soon as I try to map himem with the task stack in SPIRAM.  I had to specify this particular task stack to be in internal memory and then things work as they should

@ftab We just merged https://github.com/espressif/esp-idf/commit/4c492cc85fec216dc9f20607411fc9d991996882, which allows SPIRAM task stack for statically allocated tasks.

@ftab We just merged https://github.com/espressif/esp-idf/commit/4c492cc85fec216dc9f20607411fc9d991996882, which allows SPIRAM task stack for statically allocated tasks.

Thanks! You're my hero

source: gharchive/issue

repo: espressif/esp-idf

license_type: permissive

license_source: github-api


text:
ASSERT_PARAM(5 13), in llm_util.c at line 215 (IDFGH-12506)

Answers checklist.

[X] I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
[X] I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
[X] I have searched the issue tracker for a similar issue and not found a similar issue.

IDF version.
v5.1.3
Operating System used.
Windows
How did you build your project?
VS Code IDE
If you are using Windows, please specify command line type.
CMD
What is the expected behavior?
不会出现此错误。
What is the actual behavior?
运行一段时间后出现此错误。
Steps to reproduce.
我的项目上整合了BLE GATTS、BLE MESH、BT A2DP SINK、WIFI、MQTT这几项功能。我用手机连接BT播放音乐，过几个小时就会出现此错误。
Build or installation Logs.
ASSERT_PARAM(5 13), in llm_util.c at line 215
Guru Meditation Error: Core  0 panic'ed (IllegalInstruction). Exception was unhandled.
Memory dump at 0x40091d50: f01d020c 00004136 f01d0000
0x40091d50: btdm_sleep_check_duration at C:/Users/HJYVM10/.espressif/frameworks/v5.1.3/esp-idf/components/bt/controller/esp32/bt.c:911

Core  0 register dump:
PC      : 0x40091d57  PS      : 0x00060b30  A0      : 0x8008531a  A1      : 0x3ffced30
0x40091d57: r_assert at C:/Users/HJYVM10/.espressif/frameworks/v5.1.3/esp-idf/components/bt/controller/esp32/bt.c:1848

A2      : 0x00000000  A3      : 0x00000005  A4      : 0x0000000d  A5      : 0x3f43def9
A6      : 0x000000d7  A7      : 0xfffffffc  A8      : 0x8000814b  A9      : 0x3ffceca0
A10     : 0x00000000  A11     : 0x3ffcecc3  A12     : 0x3ffcec6f  A13     : 0x00000035
A14     : 0x00000000  A15     : 0x3ffcec74  SAR     : 0x00000004  EXCCAUSE: 0x00000000
EXCVADDR: 0x00000000  LBEG    : 0x400012c5  LEND    : 0x400012d5  LCOUNT  : 0xfffffffe
0x400012c5: strcmp in ROM
0x400012d5: strcmp in ROM

Backtrace: 0x40091d54:0x3ffced30 0x40085317:0x3ffced50 0x4019aa99:0x3ffced70 0x401977d3:0x3ffcedc0 0x401947ae:0x3ffcee10 0x40019d11:0x3ffcee50 0x40055b4d:0x3ffcee70 0x40189147:0x3ffcee90 0x401897d2:0x3ffceeb0 0x4009518a:0x3ffceee0
0x40091d54: r_assert at C:/Users/HJYVM10/.espressif/frameworks/v5.1.3/esp-idf/components/bt/controller/esp32/bt.c:1847
0x40085317: r_assert_param at ??:?
0x4019aa99: r_llm_pdu_defer at ??:?
0x401977d3: r_lld_pdu_check at ??:?
0x401947ae: r_lld_evt_deffered_elt_handler at ??:?
0x40019d11: r_ke_event_schedule in ROM
0x40055b4d: r_rwip_schedule in ROM
0x40189147: r_rw_schedule at ??:?
0x401897d2: btdm_controller_task at ??:?
0x4009518a: vPortTaskWrapper at C:/Users/HJYVM10/.espressif/frameworks/v5.1.3/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:162

ELF file SHA256: f86599902c1deb5d

More Information.
Uploading sdkconfig.txt…

Hi @aboyuanna Thanks for reporting. May I know which Espressif chip do your use in your project? Thanks.

Hi @aboyuanna Thanks for reporting. May I know which Espressif chip do your use in your project? Thanks.

Thank you for your reply.My code runs on the development board ESP32_LyraT v4.3, which is equipped with an ESP32-WROWER-E N8R8 module.

We have fixed this issue, but it hasn't been synchronized to GitHub yet. Could you provide me with the controller commit? I'll give you a patch for the fix. The controller commit can be found in the startup logs. Could you please provide me with the complete startup log? Thank you.

We have fixed this issue, but it hasn't been synchronized to GitHub yet. Could you provide me with the controller commit? I'll give you a patch for the fix. The controller commit can be found in the startup logs. Could you please provide me with the complete startup log? Thank you.

ets Jul 29 2019 12:21:46
rst:0x1 (POWERON_RESET),boot:0x1f (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:1
load:0x3fff0030,len:10228
load:0x40078000,len:17548
load:0x40080400,len:4
0x40080400: _init at ??:?
load:0x40080404,len:4624
entry 0x40080694
I (29) boot: ESP-IDF v5.1.3-dirty 2nd stage bootloader
I (29) boot: compile time Mar 29 2024 09:18:12
W (30) boot: Unicore bootloader
D (34) bootloader_flash: non-XMC chip detected by SFDP Read (68), skip.
D (41) bootloader_flash: mmu set block paddr=0x00000000 (was 0xffffffff)
I (47) boot: chip revision: v3.1
D (51) qio_mode: Probing for QIO mode enable...
D (56) qio_mode: Raw SPI flash chip id 0x684017
D (60) qio_mode: Manufacturer ID 0x68 chip ID 0x4017
I (65) qio_mode: Enabling default flash chip QIO
D (71) qio_mode: Initial flash chip status 0x2
D (75) qio_mode: QIO mode already enabled in flash
D (80) qio_mode: Enabling QIO mode...
D (84) boot.esp32: magic e9
D (87) boot.esp32: segments 04
D (90) boot.esp32: spi_mode 02
D (93) boot.esp32: spi_speed 0f
D (96) boot.esp32: spi_size 03
I (99) boot.esp32: SPI Speed      : 80MHz
I (104) boot.esp32: SPI Mode       : QIO
I (109) boot.esp32: SPI Flash Size : 8MB
D (113) boot: Enabling RTCWDT(9000 ms)
I (117) boot: Enabling RNG early entropy source...
D (123) bootloader_flash: rodata starts from paddr=0x0000f000, size=0xc00, will be mapped to vaddr=0x3f400000
D (132) boot: mapped partition table 0xf000 at 0x3f40f000
D (138) flash_parts: partition table verified, 9 entries
I (143) boot: Partition Table:
I (147) boot: ## Label            Usage          Type ST Offset   Length
D (154) boot: load partition table entry 0x3f40f000
D (159) boot: type=0 subtype=10
I (163) boot:  0 ota_0            OTA app          00 10 00010000 002b0000
D (170) boot: load partition table entry 0x3f40f020
D (175) boot: type=0 subtype=11
I (178) boot:  1 ota_1            OTA app          00 11 002c0000 002b0000
D (186) boot: load partition table entry 0x3f40f040
D (191) boot: type=1 subtype=2
I (194) boot:  2 nvs              WiFi data        01 02 00570000 00080000
D (201) boot: load partition table entry 0x3f40f060
D (206) boot: type=1 subtype=2
I (210) boot:  3 factory_nvs      WiFi data        01 02 005f0000 0000c000
D (217) boot: load partition table entry 0x3f40f080
D (222) boot: type=1 subtype=4
I (225) boot:  4 nvs_keys         NVS keys         01 04 005fc000 00001000
D (233) boot: load partition table entry 0x3f40f0a0
D (238) boot: type=1 subtype=0
I (241) boot:  5 otadata          OTA data         01 00 005fd000 00002000
D (248) boot: load partition table entry 0x3f40f0c0
D (253) boot: type=1 subtype=1
I (256) boot:  6 phy_init         RF data          01 01 005ff000 00001000
D (264) boot: load partition table entry 0x3f40f0e0
D (269) boot: type=1 subtype=81
I (272) boot:  7 storage          Unknown data     01 81 00600000 00200000
I (280) boot: End of partition table
D (284) boot: OTA data offset 0x5fd000
D (288) bootloader_flash: rodata starts from paddr=0x005fd000, size=0x2000, will be mapped to vaddr=0x3f400000
D (298) boot: otadata[0]: sequence values 0x00000001
D (303) boot: otadata[1]: sequence values 0xffffffff
D (308) boot_comm: Only otadata[0] is valid
D (312) boot: Active otadata[0]
D (315) boot: Mapping seq 0 -> OTA slot 0
D (319) boot: Trying partition index 0 offs 0x10000 size 0x2b0000
D (326) esp_image: reading image header @ 0x10000
D (330) bootloader_flash: mmu set block paddr=0x00010000 (was 0xffffffff)
D (337) esp_image: image header: 0xe9 0x05 0x02 0x03 40081604
I (343) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=6f21ch (455196) map
D (351) esp_image: free data page_count 0x00000032
D (356) bootloader_flash: rodata starts from paddr=0x00010020, size=0x6f21c, will be mapped to vaddr=0x3f400000
D (493) bootloader_flash: mmu set block paddr=0x00070000 (was 0xffffffff)
I (493) esp_image: segment 1: paddr=0007f244 vaddr=3ffbdb60 size=00dd4h (  3540) load
D (497) esp_image: free data page_count 0x00000032
D (502) bootloader_flash: rodata starts from paddr=0x0007f244, size=0xdd4, will be mapped to vaddr=0x3f400000
D (513) bootloader_flash: mmu set block paddr=0x00080000 (was 0xffffffff)
I (519) esp_image: segment 2: paddr=00080020 vaddr=400d0020 size=1a7d2ch (1735980) map
D (528) esp_image: free data page_count 0x00000032
D (532) bootloader_flash: rodata starts from paddr=0x00080020, size=0x1a7d2c, will be mapped to vaddr=0x3f400000
D (1025) bootloader_flash: mmu set block paddr=0x00220000 (was 0xffffffff)
I (1025) esp_image: segment 3: paddr=00227d54 vaddr=3ffbe934 size=06194h ( 24980) load
D (1029) esp_image: free data page_count 0x00000032
D (1034) bootloader_flash: rodata starts from paddr=0x00227d54, size=0x6194, will be mapped to vaddr=0x3f400000
D (1052) bootloader_flash: mmu set block paddr=0x00220000 (was 0xffffffff)
I (1052) esp_image: segment 4: paddr=0022def0 vaddr=40080000 size=1bca0h (113824) load
D (1060) esp_image: free data page_count 0x00000032
D (1065) bootloader_flash: rodata starts from paddr=0x0022def0, size=0x1bca0, will be mapped to vaddr=0x3f400000
D (1113) bootloader_flash: mmu set block paddr=0x00240000 (was 0xffffffff)
D (1113) boot: Calculated hash: bde2a64b5343470fe9c04782ee009b5b61dee1c0ada6c91ac4f79080ccddfacf
I (1132) boot: Loaded app from partition at offset 0x10000
I (1132) boot: Disabling RNG early entropy source...
D (1132) boot: Mapping segment 0 as DROM
D (1136) boot: Mapping segment 2 as IROM
D (1140) boot: calling set_cache_and_start_app
D (1145) boot: configure drom and irom and start
D (1150) boot: start: 0x40081604
0x40081604: call_start_cpu0 at C:/Users/HJYVM10/.espressif/frameworks/v5.1.3/esp-idf/components/esp_system/port/cpu_start.c:299
I (1164) cpu_start: Unicore app
I (1164) quad_psram: This chip is ESP32-D0WD
I (1165) esp_psram: Found 8MB PSRAM device
I (1166) esp_psram: Speed: 80MHz
I (1170) esp_psram: PSRAM initialized, cache is in normal (1-core) mode.
W (1178) esp_psram: Virtual address not enough for PSRAM, map as much as we can. 4MB is mapped
I (1187) cpu_start: Pro cpu up.
I (1191) cpu_start: Single core mode
I (1727) esp_psram: SPI SRAM memory test OK
I (1740) cpu_start: Pro cpu start user code
I (1740) cpu_start: cpu freq: 240000000 Hz
I (1740) cpu_start: Application information:
I (1743) cpu_start: Project name:     Lincogn-ESP32-YO105
I (1749) cpu_start: App version:      Dev11.0
I (1754) cpu_start: Compile time:     Mar 29 2024 11:38:38
I (1760) cpu_start: ELF file SHA256:  469e57352fa584cb...
I (1766) cpu_start: ESP-IDF:          v5.1.3-dirty
I (1772) cpu_start: Min chip rev:     v3.0
I (1777) cpu_start: Max chip rev:     v3.99
I (1782) cpu_start: Chip rev:         v3.1
I (1787) heap_init: Initializing. RAM available for dynamic allocation:
I (1794) heap_init: At 3FFAFF10 len 000000F0 (0 KiB): DRAM
I (1800) heap_init: At 3FFB6BF8 len 00001408 (5 KiB): DRAM
I (1806) heap_init: At 3FFB9A20 len 00004108 (16 KiB): DRAM
I (1812) heap_init: At 3FFC8AD0 len 00017530 (93 KiB): DRAM
I (1819) heap_init: At 3FFE0440 len 0001FBC0 (126 KiB): D/IRAM
I (1825) heap_init: At 40078000 len 00008000 (32 KiB): IRAM
I (1831) heap_init: At 4009BCA0 len 00004360 (16 KiB): IRAM
I (1838) heap_init: At 3FF80000 len 00002000 (8 KiB): RTCRAM
I (1844) esp_psram: Adding pool of 4021K of PSRAM memory to heap allocator
I (1852) spi_flash: detected chip: generic
I (1856) spi_flash: flash io: qio
I (1861) coexist: coex firmware version: 77cd7f8
I (1866) app_start: Starting scheduler on CPU0
I (00:00:00.131) main_task: Started on CPU0
I (1880) esp_psram: Reserving pool of 64K of internal memory for DMA/internal allocations
I (00:00:00.145) main_task: Calling app_main()
I (00:00:00.150) main: internal Free memory: 284179 bytes   psram Free memory: 4115812 bytes
I (00:00:00.297) nvs: factory nvs verification successful
I (00:00:00.397) nvs: esp reset reason: 1
I (00:00:00.397) nvs: app version: v11.021E
I (00:00:00.399) nvs: Device macAddress   a0:a3:b3:85:f9:6a
I (00:00:00.402) time: timer ble_log create!
I (00:00:00.407) time: timer ota_rollback create!
I (00:00:00.412) time: timer ota_rollback once start!
I (00:00:00.419) time: timer check_ram create!
I (00:00:00.423) time: timer check_ram periodic start!
I (00:00:00.429) time: timer action delay create!
I (00:00:00.434) time: timer action delay create!
I (00:00:00.439) time: timer action delay create!
I (00:00:00.445) time: timer action delay create!
I (00:00:00.450) time: timer action delay create!
I (00:00:00.456) time: timer action delay create!
I (00:00:00.461) time: timer action delay create!
I (00:00:00.466) time: timer action delay create!
I (00:00:00.472) time: timer action delay create!
I (00:00:00.477) time: timer action delay create!
I (00:00:00.482) time: timer action delay create!
I (00:00:00.488) time: timer action delay create!
I (00:00:00.493) time: timer action delay create!
I (00:00:00.499) time: timer action delay create!
I (00:00:00.504) time: timer action delay create!
I (00:00:00.509) time: timer action delay create!
I (00:00:00.515) time: timer action delay create!
I (00:00:00.520) time: timer action delay create!
I (00:00:00.525) time: timer action delay create!
I (00:00:00.531) time: timer action delay create!
I (00:00:00.536) time: timer action delay create!
I (00:00:00.542) time: timer action delay create!
I (00:00:00.547) time: timer action delay create!
I (00:00:00.552) time: timer action delay create!
I (00:00:00.558) time: timer action delay create!
I (00:00:00.563) time: timer action delay create!
I (00:00:00.569) time: timer action delay create!
I (00:00:00.574) time: timer action delay create!
I (00:00:00.579) time: timer action delay create!
I (00:00:00.585) time: timer action delay create!
I (00:00:00.590) time: timer action delay create!
I (00:00:00.595) time: timer action delay create!
I (00:00:00.602) time: timer scene create!
I (00:00:00.606) time: timer scene periodic start!
I (00:00:00.611) scene: scene initialization is complete
I (08:00:00.618) lincogn_mesh: read head macAddress 00:00:00:00:00:00
I (08:00:00.625) lincogn_mesh: read tail macAddress 00:00:00:00:00:00
I (08:00:00.631) lincogn_mesh: lincogn mesh initialization is complete
I (08:00:00.639) ble_slave: Starting BLE Slave
I (08:00:00.644) BTDM_INIT: BT controller compile version [a38dc5c]
I (08:00:00.651) BTDM_INIT: Bluetooth MAC: a0:a3:b3:85:f9:6a
I (08:00:00.658) phy_init: phy_version 4791,2c4672b,Dec 20 2023,16:06:06
I (08:00:01.073) ble_slave: REGISTER_APP_EVT, status 0, app_id 0, gatts_if 3
I (08:00:01.076) ble_slave: create attribute table successfully, the number handle = 7
I (08:00:01.081) ble_slave: create attribute table successfully, the number handle = 19
I (08:00:01.088) node: Sig mesh initializing...
I (08:00:01.093) node: Starting BLE MASTER application...
W (2959) BLE_MESH: bt_mesh_proxy_server_prov_disable, Already
I (08:00:01.223) node: ESP_BLE_MESH_NODE_PROV_COMPLETE_EVT
I (08:00:01.223) node: net_idx 0x000, addr 0x0004
I (08:00:01.223) node: flags 0x00, iv_index 0x00000000
I (08:00:01.230) node: ESP_BLE_MESH_PROV_REGISTER_COMP_EVT, err_code 0
W (2981) BLE_MESH: bt_mesh_prov_enable, Already
I (08:00:01.242) node: ESP_BLE_MESH_NODE_PROV_ENABLE_COMP_EVT, err_code -120
I (08:00:01.249) node: BLE Mesh Node initialized
I (08:00:01.256) node: ESP_BLE_MESH_NODE_SET_UNPROV_DEV_NAME_COMP_EVT, err_code 0
I (08:00:01.868) node: send cmd. srcAddr 0x0004, dstAddr 0xffff
I (08:00:01.916) node: 10 04 00 6a f9 85 b3 a3 a0 61 30 61 33 62 33 38
I (08:00:01.917) node: 35 66 39 36 61 12 03 48 1d 05 42 47 30 30 30 07
I (08:00:01.921) node: 31 31 2e 30 2e 32 31 00 00
I (08:00:01.926) time: timer keepalive create!
I (08:00:01.932) time: timer keepalive periodic start!
W (3683) BLE_MESH: Already stopped, index 0
W (3687) BLE_MESH: Already stopped, index 1
W (3692) BLE_MESH: Already stopped, index 2
I (08:00:01.953) time: timer slave Auth create!
I (08:00:01.957) ble_slave: Advertising Started
I (08:00:01.998) I2S_IF: channel mode 0 bits:16/16 channel:2 mask:3
I (08:00:01.999) I2S_IF: STD Mode 1 bits:16/16 channel:2 sample_rate:44100 mask:3
I (08:00:02.010) ES8388: Start on mode:2
I (08:00:02.010) gpio: GPIO[21]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (08:00:02.019) Adev_Codec: Open codec device OK
I (08:00:02.023) RC_TG: Volume is set locally to: 100%
I (08:00:02.030) BT_APP_CORE: ringbuffer data empty! mode changed: RINGBUFFER_MODE_PREFETCHING
W (3786) BT_BTC: A2DP Enable with AVRC
I (08:00:02.047) app: event: 10
I (08:00:02.047) app: event: 10
I (08:00:02.050) app: event: 10
I (08:00:02.057) BT_AV: Get delay report value: delay_value: 1200 * 1/10 ms
I (08:00:02.062) BT_AV: Set delay report value: success, delay_value: 1250 * 1/10 ms
I (08:00:02.070) app: Mounting FAT filesystem
I (08:00:02.077) time: timer notify_download_progress create!
I (3830) wifi:wifi driver task: 3ffe8f98, prio:23, stack:6656, core=0
I (3857) wifi:wifi firmware version: 0016c4d
I (3857) wifi:wifi certification version: v7.0
I (3857) wifi:config NVS flash: enabled
I (3858) wifi:config nano formating: disabled
I (3862) wifi:Init data frame dynamic rx buffer num: 12
I (3867) wifi:Init static rx mgmt buffer num: 5
I (3871) wifi:Init management short buffer num: 32
I (3876) wifi:Init static tx buffer num: 16
I (3880) wifi:Init tx cache buffer num: 32
I (3883) wifi:Init static rx buffer size: 1600
I (3887) wifi:Init static rx buffer num: 6
I (3891) wifi:Init dynamic rx buffer num: 12
I (08:00:02.157) wifi_init: rx ba win: 6
I (08:00:02.157) wifi_init: tcpip mbox: 32
I (08:00:02.160) wifi_init: udp mbox: 10
I (08:00:02.164) wifi_init: tcp mbox: 6
I (08:00:02.169) wifi_init: tcp tx win: 5744
I (08:00:02.174) wifi_init: tcp rx win: 5744
I (08:00:02.179) wifi_init: tcp mss: 1440
I (08:00:02.184) wifi_init: WiFi/LWIP prefer SPIRAM
I (3936) wifi:mode : sta (a0:a3:b3:85:f9:68)
I (3938) wifi:enable tsf
I (08:00:02.196) ip: Wifi Started
I (08:00:02.204) time: timer timer_reconnect create!
I (3970) wifi:new:<9,0>, old:<1,0>, ap:<255,255>, sta:<9,0>, prof:1
I (3971) wifi:state: init -> auth (b0)
I (4002) wifi:state: auth -> assoc (0)
I (4053) wifi:state: assoc -> run (10)
I (4083) wifi:connected with 2413, aid = 9, channel 9, BW20, bssid = a4:39:b3:d7:37:2a
I (4084) wifi:security: WPA2-PSK, phy: bgn, rssi: -31
I (4086) wifi:pm start, type: 1
I (4088) wifi:dp: 1, bi: 102400, li: 3, scale listen interval from 307200 us to 307200 us
I (4096) wifi:AP's beacon interval = 102400 us, DTIM period = 1
I (08:00:02.363) ip: Wifi Connected
I (4120) wifi:idx:0 (ifx:0, a4:39:b3:d7:37:2a), tid:6, ssn:2, winSize:64
I (08:00:03.865) esp_netif_handlers: sta ip: 192.168.31.21, mask: 255.255.255.0, gw: 192.168.31.1
I (08:00:03.865) ip: Connected with IPv4 Address:192.168.31.21
I (08:00:03.909) ip: ip init finish!!!
I (08:00:03.910) http_server: Starting server on port: '80'
I (08:00:03.912) http_server: Registering URI handlers
I (08:00:03.915) time: Initializing SNTP
I (08:00:04.083) ip: Connected with IPv6 Address:fe80:0000:0000:0000:a2a3:b3ff:fe85:f968
I (08:00:04.088) ble_slave: notify to ff82:
I (08:00:04.089) ble_slave: 93 29 00 00 b8 7b 22 6d 61 63 41 64 64 72 65 73
I (08:00:04.094) ble_slave: 73 22 3a 22 61 30 3a 61 33 3a 62 33 3a 38 35 3a
I (08:00:04.101) ble_slave: 66 39 3a 36 38 22 2c 22 73 73 69 64 22 3a 22 32
I (08:00:04.109) ble_slave: 34 31 33 22 2c 22 70 61 73 73 77 6f 72 64 22 3a
I (08:00:04.117) ble_slave: 22 31 33 31 32 39 32 31 37 34 37 30 22 2c 22 69
I (08:00:04.125) ble_slave: 70 76 34 22 3a 22 31 39 32 2e 31 36 38 2e 33 31
I (08:00:04.132) ble_slave: 2e 32 31 22 2c 22 69 70 76 36 22 3a 22 66 65 38
I (08:00:04.140) ble_slave: 30 3a 30 30 30 30 3a 30 30 30 30 3a 30 30 30 30
I (08:00:04.148) ble_slave: 3a 61 32 61 33 3a 62 33 66 66 3a 66 65 38 35 3a
I (08:00:04.156) ble_slave: 66 39 36 38 22 2c 22 62 73 73 69 64 22 3a 22 61
I (08:00:04.163) ble_slave: 34 3a 33 39 3a 62 33 3a 64 37 3a 33 37 3a 32 61
I (08:00:04.171) ble_slave: 22 2c 22 72 73 73 69 22 3a 2d 33 35 7d
I (9013) wifi:idx:1 (ifx:0, a4:39:b3:d7:37:2a), tid:0, ssn:0, winSize:64
I (16:50:40.721) time: time synchronization: 2024-04-01 16:50:40
W (24268) BLE_MESH: Already stopped, index 1
W (24268) BLE_MESH: Already stopped, index 2
I (16:50:40.734) node: send cmd. srcAddr 0x0004, dstAddr 0xffff
I (16:50:40.742) node: 84 00 01 28 32 10 01 03 e8 07 01
I (16:50:42.120) mqtt: mqtt server:mqtt://msg.mob-mob.com  port:32777
I (16:50:42.121) mqtt: user:975567252@qq.com
I (16:50:42.122) mqtt: bb0a32a000c42dd783df950f5b8de77e
I (16:50:42.129) mqtt: Other event id:7
I (16:50:42.134) time: timer mqtt_msginr create!
I (16:50:42.137) time: timer pubinr_min create!
I (16:50:42.143) time: timer mqtt_reconnect create!
I (16:50:42.148) main: internal Free memory: 97451 bytes   psram Free memory: 3808844 bytes
I (16:50:42.158) main_task: Returned from app_main()
I (16:50:42.309) mqtt: MQTT_EVENT_CONNECTED
I (16:50:42.312) mqtt: sent publish successful, msg_id=37371
I (16:50:42.313) mqtt: sent subscribe successful, msg_id=52501
I (16:51:18.622) eventLoop: internal Free memory: 102063 bytes   psram Free memory: 3808484 bytes   internal Min memory: 97379 bytes
I (16:52:18.622) eventLoop: internal Free memory: 102063 bytes   psram Free memory: 3808484 bytes   internal Min memory: 97379 bytes
I (16:53:18.622) eventLoop: internal Free memory: 102063 bytes   psram Free memory: 3808484 bytes   internal Min memory: 97379 bytes

please replace controller lib file in esp-idf/components/bt/controller/lib_esp32/esp32/libbtdm_app.a with the following lib:
60f4bc1.zip

We have fixed this issue, but it hasn't been synchronized to GitHub yet.

@zhp0406 Is this fixed now? Which commit fixed it?

After a period of testing, this error did not occur again.Thank you for your help.@zhp0406

master:9c6869fbf8fffe13bc9aa794fdc12c24c867cf50
Backports: v5.2 51f7ddc223db977eeea014d6327d2502c62cc554
Backports: v5.1 will coming soon...
Backports: v5.0 c9c946811c079d302a2df234976519c34ddfccb8
Backports: v4.4 fe1299e5dafc48c651f6044d9c534f9edf6e45a1

authors: AxelLin aboyuanna weiyuhannnn zhp0406


text:
[TW#19301] SPI MISO on input only pins (GPIO34-35-36-39) not working

Hi all,
I am working on a design that uses an external SPI device (SX1278) with the MISO pin assigned to GPIO35. This is an input only pin so it means the MISO (Master Input Slave Output) should work if the ESP32 is the SPI master but it is not the case.
I am getting the following error in the boot sequence:
E (449) gpio: io_num=35 can only be input.
This is my init sequence:
#define PIN_NUM_MISO 35
#define PIN_NUM_MOSI 32
#define PIN_NUM_CLK  33
#define PIN_NUM_CS   5

esp_err_t ret;
spi_device_handle_t spi;

spi_bus_config_t buscfg={
    .miso_io_num=PIN_NUM_MISO,
    .mosi_io_num=PIN_NUM_MOSI,
    .sclk_io_num=PIN_NUM_CLK,
    .quadwp_io_num=-1,
    .quadhd_io_num=-1
};

spi_device_interface_config_t devcfg={
    .clock_speed_hz=1*1000*1000,               //Clock out at 1 MHz
    .mode=0,                                //SPI mode 0
    .spics_io_num=PIN_NUM_CS,               //CS pin
    .queue_size=7,                          //We want to be able to queue 7 transactions at a time
};

I see this in the driver (spi_common.c, line 271)
if (bus_config->miso_io_num >= 0) {
    PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[bus_config->miso_io_num], PIN_FUNC_GPIO);
    gpio_set_direction(bus_config->miso_io_num, GPIO_MODE_INPUT_OUTPUT);
    gpio_matrix_out(bus_config->miso_io_num, io_signal[host].spiq_out, false, false);
    gpio_matrix_in(bus_config->miso_io_num, io_signal[host].spiq_in, false);
}

The issue comes from the fact we assign an input only pin in an INPUT_OUTPUT.
So I think the piece of code above should be this instead:
if (bus_config->miso_io_num >= 0) {
   PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[bus_config->miso_io_num], PIN_FUNC_GPIO);
   if ( GPIO_IS_VALID_OUTPUT_GPIO(bus_config->miso_io_num) ) {
      // All pins except the input only are handled here!
       gpio_set_direction(bus_config->miso_io_num, GPIO_MODE_INPUT_OUTPUT);
       gpio_matrix_out(bus_config->miso_io_num, io_signal[host].spiq_out, false, false);
       gpio_matrix_in(bus_config->miso_io_num, io_signal[host].spiq_in, false);
    } else {
       // The input only Pins are handled here!
       gpio_set_direction(bus_config->miso_io_num, GPIO_MODE_INPUT);
       gpio_matrix_in(bus_config->miso_io_num, io_signal[host].spiq_in, false);
    }
}

What are your thoughts?

Yes it looks correct, but miso needs to be output in dual/quad mode or slave mode so it should return an error in those cases.

@gdefoest, I ran into this same issue and I was able to dig through the source and apply a quick hack to make things work on my set up. Diff provided below.
diff --git a/components/driver/spi_common.c b/components/driver/spi_common.c
index bd78e935..fbef2f1c 100644
--- a/components/driver/spi_common.c
+++ b/components/driver/spi_common.c
@@ -270,7 +270,7 @@ esp_err_t spicommon_bus_initialize_io(spi_host_device_t host, const spi_bus_conf
         }
         if (bus_config->miso_io_num >= 0) {
             PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[bus_config->miso_io_num], PIN_FUNC_GPIO);
-            gpio_set_direction(bus_config->miso_io_num, GPIO_MODE_INPUT_OUTPUT);
+            gpio_set_direction(bus_config->miso_io_num, GPIO_MODE_INPUT);
             gpio_matrix_out(bus_config->miso_io_num, io_signal[host].spiq_out, false, false);
             gpio_matrix_in(bus_config->miso_io_num, io_signal[host].spiq_in, false);
         }

It seems unfortunate to prevent this pin from being used due to the possible dual/quad mode supported by the library, especially since from what I've been able to gather, those both require half duplex mode which is currently in a broken state within the software. Would be preferable in my humble opinion to error out on spi_bus_add_device() where the spi_device_interface_config_t is specified, configuring for normal, dual, or quad IO, rather than on spi_bus_initialize().

It looks like in issue https://github.com/espressif/esp-idf/issues/598 that half duplex is not even functioning, and isn't likely to be fixed any time soon. Given that having half duplex supported is precondition to being able to do quad/dual IO on SPI, it seems rather unfortunate to further reduce the capabilities of the SPI interface. Would be preferable in my humble opinion to error out on spi_bus_add_device() where the spi_device_interface_config_t is specified, configuring for normal, dual, or quad IO, rather than on spi_bus_initialize().

@mreutman this idea is good, we'll add this.

@gdefoest we fixed this, please check whether it works.

I tested it again on be81d2c16d7f4caeea9ceb29fece01510664caf3.
No issue anymore.
Thanks a lot for the fix!

authors: gdefoest ginkgm mreutman negativekelvin


text:
Can not get ap list when calling esp_wifi_get_ap_list()

Seems like the type of second parameter of esp_wifi_get_ap_list should be (wifi_ap_list_t **)

not sure perhabs helps
esp_err_t esp_wifi_get_ap_list(uint16_t *number, wifi_ap_list_t *ap_list);
typedef enum {
WIFI_PS_NONE,    /< No power save */
WIFI_PS_MODEM,   /< Modem power save */
WIFI_PS_LIGHT,   /< Light power save */
WIFI_PS_MAC,     /< MAC power save */
} wifi_ps_type_t;

not sure perhabs helps:
`typedef struct {
uint8_t bssid[6];                     /< MAC address of AP */
uint8_t ssid[32];                     /< SSID of AP */
uint8_t primary;                      /< channel of AP */
wifi_second_chan_t second;            /< second channel of AP */
int8_t  rssi;                         /< signal strength of AP */
wifi_auth_mode_t authmode;            /< authmode of AP */
} wifi_ap_list_t;
**

@brief     Get AP list found in last scan

@param     uint16_t *number : as input param, it stores max AP number ap_list can hold, as output param, it store
the actual AP number this API returns
@param     wifi_ap_list_t *ap_list : a list to hold the found APs

@return    ESP_OK : succeed
@return    others : fail
*/
esp_err_t esp_wifi_get_ap_list(uint16_t *number, wifi_ap_list_t *ap_list);

`

'wifi_ap_list_t *' should not get the returned pointer of array in C

I would imagine that to use the API called esp_wifi_get_ap_list() one allocates enough storage to hold the maximum number of access point structures you are willing to retrieve ...  for example ... 10.  You then call esp_wifi_get_ap_list() passing in 10 (the number of elements you have allocated storage for) and a pointer to a contiguous chunk of storage that is large enough for 10 elements.  On return, you are told the number of elements that have been filled in.  The storage pointed to by the pointer you passed in has thus been updated to hold that many ap entries.

Well you can get the number of results before you call esp_wifi_get_station_list with esp_wifi_get_ap_num.  But I wonder are the results returned by esp_wifi_get_station_list sorted by rssi?  So if you only request 5 wifi_ap_list_t results they will have the highest rssi.

My guess would be that someone indeed forgot an extra * somewhere. We will look into this after the weekend.

Actually, seems to work okay here.
Here's example code, we will add it to the examples directory soon:
void scan_done_handler(void)
{
    uint16_t sta_number;
    esp_wifi_get_ap_num(&sta_number); // get the number of scanned APs
    wifi_ap_list_t* ap_list_buffer = malloc(sta_number * sizeof(wifi_ap_list_t));
    if (ap_list_buffer == NULL){
        return;
    }

    if (esp_wifi_get_ap_list(&sta_number, ap_list_buffer) == ESP_OK) {
        for(int i=0; i<sta_number; i++) {
              // do something with ap_list_buffer[i]
        }
    }
    free(ap_list_buffer);
}

It's OK. Thx.

authors: ESP32DE Spritetm comcat igrr negativekelvin nkolban


text:
bluetooth interface get affected and couldn't advertise again after stopping WIFI  (IDFGH-402)

Hi,
I enable both Bluetooth and WIFI interface at the same time and attempt to disable the WIFI interface as it did not need to use, however, when I successfully  disable the WIFI interface, the Bluetooth interface seems not work again, below is part of the log from UART, is there anyone happened to this issue?

I (349573) wifi: state: run -> init (0)
I (349583) wifi: pm stop, total sleep time: 0 us / 56480465 us
I (349593) wifi: n:3 0, o:3 0, ap:255 255, sta:3 0, prof:1
I (349613) wifi: flush txq
I (349613) wifi: stop sw txq
I (349613) wifi: lmac stop hw txq
I (349623) WIFI_IF: SYSTEM_EVENT_STA_DISCONNECTED
I (349623) WIFI_IF: esp_wifi_stop() succ
I (349633) wifi: Deinit lldesc rx mblock:10
I (349643) WIFI_IF: esp_wifi_deinit() succ
I (349653) GATTS_DEMO: ESP_GATTS_CONF_EVT, status 0
W (353553) BT_APPL: bta_gattc_conn_cback() - cif=3 connected=0 conn_id=3 reason=0x0008
W (353553) BT_APPL: bta_gattc_conn_cback() - cif=4 connected=0 conn_id=4 reason=0x0008
W (353553) BT_APPL: bta_gattc_conn_cback() - cif=5 connected=0 conn_id=5 reason=0x0008
W (353563) BT_APPL: bta_gattc_conn_cback() - cif=6 connected=0 conn_id=6 reason=0x0008
I (353573) GATTS_DEMO: ESP_GATTS_DISCONNECT_EVT
I (371433) event: station ip lost

@NOA-Vernon , I'm sorry for this problem.  We will debug it. BTW, could you provide IDF version and the bt/wifi library version printed in logs? It may be helpful.

@TianHao-Espressif could you please provide the API of getting the IDF version and the bt/wifi lib version? thank you.

IDF version with git show
bt/wifi you can find when you restart esp32:
I (83) wifi: wifi driver task: 3ffbd8cc, prio:23, stack:3072, core=1
I (83) wifi: wifi firmware version: 75aab56

@chegewara , please see the following log that contains the bt/wifi version. and IDF is v3.1
[0;32mI (322) BTDM_INIT: BT controller compile version [44d04c1]

I (322) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (642) phy: phy_version: 3910, c0c45a3, May 21 2018, 18:07:06, 0, 0
I (42732) wifi: wifi driver task: 3ffea4b0, prio:23, stack:4096, core=0
I (42742) wifi: wifi firmware version: a7a46e9
I (42742) wifi: config NVS flash: enabled
I (42752) wifi: config nano formating: disabled
I (42752) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (42762) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (42792) wifi: Init dynamic tx buffer num: 32
I (42792) wifi: Init data frame dynamic rx buffer num: 32
I (42792) wifi: Init management frame dynamic rx buffer num: 32
I (42792) wifi: Init static tx buffer num: 16
I (42802) wifi: Init static rx buffer size: 1600
I (42802) wifi: Init static rx buffer num: 10
I (42802) wifi: Init dynamic rx buffer num: 32
I (42832) wifi: mode : sta (24:0a:c4:95:07:ac)
I (42842) wifi: Set ps type: 0

@NOA-Vernon Please get the latest IDF and have a try, thanks.

Thanks for reporting, feel free to reopen.

authors: Alvin1Zhang NOA-Vernon TianHao-Espressif Wth-Esp chegewara


text:
EXTRA_CFLAGS not working (IDFGH-3663)

Development Kit: ESP32-DevKitC
Kit version: DevKitC v4
Module or chip used: ESP32-WROOM-32D
IDF version: ESP-IDF v4.2-dev-1905-g625bd5eb1-dirty
Build System: ?
Compiler version: xtensa-esp32-elf-gcc.exe
Operating System: Windows
(Windows only) environment type: ?
Using an IDE?: Yes, vscode
Power Supply: USB

If you need add an extra argument for ESP8266, you need just to do this:
make app ESPPORT="MyPortNumber" EXTRA_CFLAGS="-DMyDefine=123456 -Wno-unused-variable"
hello_world_main.c
void app_main(void){
   printf( MyDefine "\n" );
   ...
}

But this it's not working for ESP32 (IDF), I tried apply this documentation but it's seem the argument done at linking stage not compiling stage.

@hassance3 Thanks for reporting. Would you please help provide more details as suggested in the issue template? Information like elf, sdk configuration, backtrace, log outputs, commit ID, hardware and etc. would help us debug further. Thanks.

First, I don't know if IDF support this or not, but ESP8266_RTOS_SDK dose.

1: Take the hello world example.
2: Add printf( MyDefine "\n" ); into app_main(void).
3: build with this command make app EXTRA_CFLAGS="-DMyDefine=123456"
4: Flash & Run.

Basically we give the compiler an extra arguments, it's like #define MyDefine "123456".
So, this work fine for ESP8266_RTOS_SDK but not for IDF.

For IDF this is the result:
Build
idf.py build EXTRA_CFLAGS="-Dfoo=123456"
Log
Executing action: all (aliases: build)
Running ninja in directory e:\code\sdk\esp_idf_master\examples\get-started\hello_world\build
Executing "ninja all"...
[1/8] Performing build step for 'bootloader'
ninja: no work to do.
[2/6] Building C object esp-idf/main/CMakeFiles/__idf_main.dir/hello_world_main.c.obj
FAILED: esp-idf/main/CMakeFiles/__idf_main.dir/hello_world_main.c.obj
ccache e:\code\SDK\ESP_IDF_Tools\.espressif\tools\xtensa-esp32-elf\esp-2020r2-8.2.0\xtensa-esp32-elf\bin\xtensa-esp32-elf-gcc.exe -DHAVE_CONFIG_H -DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\" -DUNITY_INCLUDE_CONFIG_H -DWITH_POSIX -Iconfig -I../../../../components/newlib/platform_include -I../../../../components/freertos/include -I../../../../components/freertos/xtensa/include -I../../../../components/heap/include -I../../../../components/log/include -I../../../../components/lwip/include/apps -I../../../../components/lwip/include/apps/sntp -I../../../../components/lwip/lwip/src/include -I../../../../components/lwip/port/esp32/include -I../../../../components/lwip/port/esp32/include/arch -I../../../../components/soc/src/esp32/. -I../../../../components/soc/src/esp32/include -I../../../../components/soc/include -I../../../../components/esp_rom/include -I../../../../components/esp_common/include -I../../../../components/esp_system/include -I../../../../components/xtensa/include -I../../../../components/xtensa/esp32/include -I../../../../components/esp32/include -I../../../../components/driver/include -I../../../../components/driver/esp32/include -I../../../../components/esp_ringbuf/include -I../../../../components/efuse/include -I../../../../components/efuse/esp32/include -I../../../../components/espcoredump/include -I../../../../components/esp_timer/include -I../../../../components/esp_ipc/include -I../../../../components/soc/soc/esp32/. -I../../../../components/soc/soc/esp32/include -I../../../../components/soc/soc/esp32/../include -I../../../../components/vfs/include -I../../../../components/esp_wifi/include -I../../../../components/esp_wifi/esp32/include -I../../../../components/esp_event/include -I../../../../components/esp_netif/include -I../../../../components/esp_eth/include -I../../../../components/tcpip_adapter/include -I../../../../components/app_trace/include -I../../../../components/mbedtls/port/include -I../../../../components/mbedtls/mbedtls/include -I../../../../components/mbedtls/esp_crt_bundle/include -I../../../../components/bootloader_support/include -I../../../../components/app_update/include -I../../../../components/spi_flash/include -I../../../../components/wpa_supplicant/include -I../../../../components/wpa_supplicant/port/include -I../../../../components/wpa_supplicant/include/esp_supplicant -I../../../../components/nvs_flash/include -I../../../../components/pthread/include -I../../../../components/perfmon/include -I../../../../components/asio/asio/asio/include -I../../../../components/asio/port/include -I../../../../components/cbor/port/include -I../../../../components/coap/port/include -I../../../../components/coap/port/include/coap -I../../../../components/coap/libcoap/include -I../../../../components/coap/libcoap/include/coap2 -I../../../../components/console -I../../../../components/nghttp/port/include -I../../../../components/nghttp/nghttp2/lib/includes -I../../../../components/esp-tls -I../../../../components/esp_adc_cal/include -I../../../../components/esp_gdbstub/include -I../../../../components/esp_hid/include -I../../../../components/tcp_transport/include -I../../../../components/esp_http_client/include -I../../../../components/esp_http_server/include -I../../../../components/esp_https_ota/include -I../../../../components/protobuf-c/protobuf-c -I../../../../components/protocomm/include/common -I../../../../components/protocomm/include/security -I../../../../components/protocomm/include/transports -I../../../../components/mdns/include -I../../../../components/esp_local_ctrl/include -I../../../../components/sdmmc/include -I../../../../components/esp_serial_slave_link/include -I../../../../components/esp_websocket_client/include -I../../../../components/expat/expat/expat/lib -I../../../../components/expat/port/include -I../../../../components/wear_levelling/include -I../../../../components/fatfs/diskio -I../../../../components/fatfs/vfs -I../../../../components/fatfs/src -I../../../../components/freemodbus/common/include -I../../../../components/idf_test/include -I../../../../components/idf_test/include/esp32 -I../../../../components/jsmn/include -I../../../../components/json/cJSON -I../../../../components/libsodium/libsodium/src/libsodium/include -I../../../../components/libsodium/port_include -I../../../../components/mqtt/esp-mqtt/include -I../../../../components/openssl/include -I../../../../components/spiffs/include -I../../../../components/ulp/include -I../../../../components/unity/include -I../../../../components/unity/unity/src -I../../../../components/wifi_provisioning/include -mlongcalls -Wno-frame-address   -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -Wall -Werror=all -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wextra -Wno-unused-parameter -Wno-sign-compare -ggdb -Og -std=gnu99 -Wno-old-style-declaration -D_GNU_SOURCE -DIDF_VER=\"v4.2-dev-1905-g625bd5eb1-dirty\" -DESP_PLATFORM -MD -MT esp-idf/main/CMakeFiles/__idf_main.dir/hello_world_main.c.obj -MF esp-idf\main\CMakeFiles\__idf_main.dir\hello_world_main.c.obj.d -o esp-idf/main/CMakeFiles/__idf_main.dir/hello_world_main.c.obj   -c ../main/hello_world_main.c

../main/hello_world_main.c: In function 'app_main':
../main/hello_world_main.c:21:9: error: 'foo' undeclared (first use in this function); did you mean 'feof'?
  printf(foo "\n");
         ^~~
         feof

../main/hello_world_main.c:21:9: note: each undeclared identifier is reported only once for each function it appears in
../main/hello_world_main.c:21:12: error: expected ')' before string constant
  printf(foo "\n");
            ^~~~~
            )

ninja: build stopped: subcommand failed.
ninja failed with exit code 1

whats strange is when you add #define foo "123456" to hello_world_main.c basically it's compile because foo is defined, but the builder (idf.py) add this argument (EXTRA_CFLAGS="-Dfoo=123456") at linking stage!.

1: Add #define foo "123456" to hello_world_main.c
2: Build idf.py build

Log
Executing action: all (aliases: build)
Running ninja in directory e:\code\sdk\esp_idf_master\examples\get-started\hello_world\build
Executing "ninja all"...
[1/8] Performing build step for 'bootloader'
ninja: no work to do.
[6/6] Generating binary image from built executable
esptool.py v3.0-dev
Generated E:/Code/SDK/ESP_IDF_Master/examples/get-started/hello_world/build/hello-world.bin
Executing action: EXTRA_CFLAGS=-Dfoo=123456
ninja: error: unknown target 'EXTRA_CFLAGS=-Dfoo=123456'
command "EXTRA_CFLAGS=-Dfoo=123456" is not known to idf.py and is not a Ninja target

I don't report this as a bug, but probably idf.py have a different way to add extras arguments for compiling stage.

Taking environment variables from arguments is supported in GNU Make. With idf.py, you need to set the variable in the environment:
export EXTRA_CFLAGS="-Dfoo=123456"
idf.py build

Or EXTRA_CFLAGS="-Dfoo=123456" idf.py build which is a shell syntax for setting environment variables for a single command.

@igrr Thank you for your replay, right now I'm on a Windows PC., it's seem not working!
> Set "EXTRA_CFLAGS=-Dfoo=123456"
> Set EXTRA_CFLAGS=-Dfoo=123456
> echo %EXTRA_CFLAGS%
-Dfoo=123456
> idf.py build
...
../main/hello_world_main.c:21:9: error: 'foo' undeclared (first use in this function); did you mean 'feof'?
...

I don't see the defined foo in the log.
.....................xtensa-esp32-elf-gcc.exe -DHAVE_CONFIG_H -DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\" -DUNITY_INCLUDE_CONFIG_H -DWITH_POSIX -Iconfig -I../../../../components/newlib/platform_include -I../../../../components/freertos/include -I../../../../components/freertos/xtensa/include -I../../../../components/heap/include -I../../../../components/log/include -I../../../../components/lwip/include/apps -I../../../../components/lwip/include/apps/sntp -I../../../../components/lwip/lwip/src/include -I../../../../components/lwip/port/esp32/include -I../../../../components/lwip/port/esp32/include/arch -I../../../../components/soc/src/esp32/. -I../../../../components/soc/src/esp32/include -I../../../../components/soc/include -I../../../../components/esp_rom/include -I../../../../components/esp_common/include -I../../../../components/esp_system/include -I../../../../components/xtensa/include -I../../../../components/xtensa/esp32/include -I../../../../components/esp32/include -I../../../../components/driver/include -I../../../../components/driver/esp32/include -I../../../../components/esp_ringbuf/include -I../../../../components/efuse/include -I../../../../components/efuse/esp32/include -I../../../../components/espcoredump/include -I../../../../components/esp_timer/include -I../../../../components/esp_ipc/include -I../../../../components/soc/soc/esp32/. -I../../../../components/soc/soc/esp32/include -I../../../../components/soc/soc/esp32/../include -I../../../../components/vfs/include -I../../../../components/esp_wifi/include -I../../../../components/esp_wifi/esp32/include -I../../../../components/esp_event/include -I../../../../components/esp_netif/include -I../../../../components/esp_eth/include -I../../../../components/tcpip_adapter/include -I../../../../components/app_trace/include -I../../../../components/mbedtls/port/include -I../../../../components/mbedtls/mbedtls/include -I../../../../components/mbedtls/esp_crt_bundle/include -I../../../../components/bootloader_support/include -I../../../../components/app_update/include -I../../../../components/spi_flash/include -I../../../../components/wpa_supplicant/include -I../../../../components/wpa_supplicant/port/include -I../../../../components/wpa_supplicant/include/esp_supplicant -I../../../../components/nvs_flash/include -I../../../../components/pthread/include -I../../../../components/perfmon/include -I../../../../components/asio/asio/asio/include -I../../../../components/asio/port/include -I../../../../components/cbor/port/include -I../../../../components/coap/port/include -I../../../../components/coap/port/include/coap -I../../../../components/coap/libcoap/include -I../../../../components/coap/libcoap/include/coap2 -I../../../../components/console -I../../../../components/nghttp/port/include -I../../../../components/nghttp/nghttp2/lib/includes -I../../../../components/esp-tls -I../../../../components/esp_adc_cal/include -I../../../../components/esp_gdbstub/include -I../../../../components/esp_hid/include -I../../../../components/tcp_transport/include -I../../../../components/esp_http_client/include -I../../../../components/esp_http_server/include -I../../../../components/esp_https_ota/include -I../../../../components/protobuf-c/protobuf-c -I../../../../components/protocomm/include/common -I../../../../components/protocomm/include/security -I../../../../components/protocomm/include/transports -I../../../../components/mdns/include -I../../../../components/esp_local_ctrl/include -I../../../../components/sdmmc/include -I../../../../components/esp_serial_slave_link/include -I../../../../components/esp_websocket_client/include -I../../../../components/expat/expat/expat/lib -I../../../../components/expat/port/include -I../../../../components/wear_levelling/include -I../../../../components/fatfs/diskio -I../../../../components/fatfs/vfs -I../../../../components/fatfs/src -I../../../../components/freemodbus/common/include -I../../../../components/idf_test/include -I../../../../components/idf_test/include/esp32 -I../../../../components/jsmn/include -I../../../../components/json/cJSON -I../../../../components/libsodium/libsodium/src/libsodium/include -I../../../../components/libsodium/port_include -I../../../../components/mqtt/esp-mqtt/include -I../../../../components/openssl/include -I../../../../components/spiffs/include -I../../../../components/ulp/include -I../../../../components/unity/include -I../../../../components/unity/unity/src -I../../../../components/wifi_provisioning/include -mlongcalls -Wno-frame-address   -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -Wall -Werror=all -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wextra -Wno-unused-parameter -Wno-sign-compare -ggdb -Og -std=gnu99 -Wno-old-style-declaration -D_GNU_SOURCE -DIDF_VER=\"v4.2-dev-1905-g625bd5eb1-dirty\" -DESP_PLATFORM -MD -MT esp-idf/main/CMakeFiles/__idf_main.dir/hello_world_main.c.obj -MF esp-idf\main\CMakeFiles\__idf_main.dir\hello_world_main.c.obj.d -o esp-idf/main/CMakeFiles/__idf_main.dir/hello_world_main.c.obj   -c ../main/hello_world_main.c

maybe something else than EXTRA_CFLAGS? or idf.py don't take the environment value correctly ?

Can you try running idf.py reconfigure and then idf.py build, after setting the environment variable?

@igrr  Yes! that it, work fine.
> Set EXTRA_CFLAGS=-Dfoo=123456
> echo %EXTRA_CFLAGS%
-Dfoo=123456
> idf.py reconfigure
> idf.py build

Thank you.


text:
Store multiple SSID/password combinations in NVS (IDFGH-4868)

Store multiple SSID/password combinations in NVS
today it handle 1 SSID in STA Mode, and cannot be used as a mobile device travelling from WIFI-to-WIFI and automatically connect to one of the known Wifis.
This Feature Request is a pro for all mobile and Vehicle applications.

Thanks for raising this feature request.

Hi @franz-ms-muc thanks for request this feature.
It's a big breaking changes for WiFi libs, we need more time to evaluate this feature, thanks.
In additon, this features can be realized in application according to existing IDF apis, such as you can save some ssid and password into NVS, and before connect, scan for the best rssi ssid and then using NVS saved password to connect, all can be done in applications.

@MaxwellAlan it's true that it can be implemented in the app, but that means it gets reimplemented (badly) many times over. I'd also love to see IDF support for multiple WiFi credentials (and reconnect).

Hi @willmoffat @franz-ms-muc , this feature will break the NVS design for our other customer, we will not support this feature. Thanks for your request.

Thanks for reporting.

authors: Alvin1Zhang MaxwellAlan franz-ms-muc willmoffat


text:
Connection error with Windows Server WPA2-Enterprise MS-CHAPv2 (IDFGH-7327)

Environment

Development Kit: none
Module or chip used:  ESP32-WROOM-32
IDF version: v4.4.1
Build System: CMake
Compiler version: xtensa-esp32-elf-gcc.exe (crosstool-NG esp-2021r2-patch3) 8.4.0
Operating System: Windows
(Windows only) environment type: PowerShell
Using an IDE?: VS Code with Espressif IDF v.1.4.0
Power Supply: USB

Problem Description
I have been trying to implement WPA2-Enterprise functionality on my ESP32. For that i have created a testing environment with an Ubuntu/FreeRADIUS. This environment works great with TTLS/PEAP MS-CHAPv2 with and without a certificate. Then i created a testing environment with Windows Server 2019/2022 with an AD/NPS which is configured to use Protected EAP (PEAP) or Secured Password (EAP-MSCHAP v2). I assume that the second option (EAP-MSCHAP v2) is equivalent to PEAP MS-CHAPv2 on FreeRADIUS. Sadly this setup does not work because i get an wpa: Method private structure allocated failure error.
I have searched the internet for answers and found some discussion like here and here which talk about fixed problems. Because of that i updated to v4.4.1 but the error is still present.
There is also this discussion which recommends to disable Use MbedTLS crypto APIs but this does not help in my case. But it also does not change the debug output, so does it get ignored in my setup?
After that i started digging in the ESP-IDF code and found that if i comment the check for stage 2 in line 101 and 102 it starts working. This is strange because the rest of the method assumes the second stage and i think it should not work if this method would be called while in the first stage. Or this introduces a security bug as i do not understand the whole code..
NOTE: Strangely i have to set the identity to the same value as the username for Windows. Otherwise i get an error in the Windows log that an unknown user wants to connect with an username that i set in the identity (e.g. 'anonymous'). But if i set identity and username to the same value, FreeRADIUS flags it as an unsecure configuration which is understandable because i tell everyone the username not only in the second stage but in the first stage too.
Code to reproduce this issue
...
if (strlen(ssid) <= MAX_WIFI_SSID_LENGTH)
    strcpy((char*)config->sta.ssid, ssid);
const char* identity = "anonymous";
// esp_wifi_sta_wpa2_ent_set_identity((uint8_t*)identity, strlen(identity));
esp_wifi_sta_wpa2_ent_set_identity((uint8_t*)username, strlen(username));
if (strlen(username) <= MAX_WIFI_WPA2_ENTERPRISE_USERNAME_LENGTH)
    esp_wifi_sta_wpa2_ent_set_username((uint8_t*)username, strlen(username));
if (strlen(password) <= MAX_WIFI_PASSWORD_LENGTH)
    esp_wifi_sta_wpa2_ent_set_password((uint8_t*)password, strlen(password));
esp_wifi_sta_wpa2_ent_enable();
...

Debug Logs
Line 101 and 102 commented and MbedTLS enabled
Line 101 and 102 commented and MbedTLS disabled
Line 101 and 102 uncommented and MbedTLS enabled
Line 101 and 102 uncommented and MbedTLS disabled

@vdm97 can you also paste the error msg from the windows server...
Also can you paste the commit ID of the IDF you are using

It is working now. I created the Windows Server testing environment after testing v4.3.1 on a production Windows Server and did not look at the specific error code the production environment was giving me. So after creating the testing environment and updating to v4.4.1 i had the above errors because the testing environment was configured wrong (and giving me a different error code as the production environment). The testing environment was configured to use Secured Password (EAP-MSCHAP v2) which seems to be just MS-CHAPv2 which the ESP32 rightfully did not like. With the changes i made (commenting 2 lines) i have probably shot a hole in the security logic of the ESP32 which is why it started working. After creating a self-signed certificate in my testing environment and configuring it to use Protected EAP (PEAP) with Secured Password (EAP-MSCHAP v2) inside it (the real equivalent to PEAP MS-CHAPv2 on FreeRADIUS) it started working with and without the public key of the self-signed certificate. If i do not report back, it is also working on the production environment. Thank you for your time.
NOTE: Strangely i still have to set the identity to the same value as the username. But i can live with that even if FreeRADIUS reports it as a security breach because the outer and inner identities are the same.. Setting the username to the string anonymous and the identity to the username does not work even though the Windows logs show the correct username but still give a credentials error. Probably a Windows feature i do not fully understand...
PS: It works with MbedTLS enabled 👍


text:
Enable support for armv6l

Used in Raspberry Pi Zero

 Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.You have signed the CLA already but the status is still pending? Let us recheck it.

I'm sorry for taking so long to get back to you. We have difficulties to properly test all of our executables in every relevant scenarios for this architecture. Therefore, we are not able to accept it as supported. We would like to focus our resources more on recent architectures.
Thank you for your contribution and I'm sorry that I have to reject it.

source: gharchive/pull-request

authors: CLAassistant dobairoland resetnow


text:
Seccomp integration test(s)

Add integration tests for seccomp. The test_container could get an additional command that explicitly does an violation.

Fixed by #408

repo: esrlabs/northstar


text:
FunctionExecutor: use WasmEdge in place of wasmtime.

In this PR, we want to use WasmEdge instead of wasmtime to implement Function Executor. For the particular situation that essa will face, we would like to provide special support from the WasmEdge core.
If the version of rust used is less than v1.63, then the following code needs to be added to the file function-executor/src/main.rs: #![feature(explicit_generic_args_with_impl_trait)].

Thanks a lot for the PR! I wonder if it would be possible to support both wasmtime and WasmEdge? We could e.g. use cargo features to let the user decide which runtime they want to use.

If the version of rust used is less than v1.63, then the following code needs to be added to the file function-executor/src/main.rs: #![feature(explicit_generic_args_with_impl_trait)].

This project is still experimental, so targeting the latest stable version of Rust is fine. I think the Rust v1.63 is scheduled for this Thursday, so we should not need any unstable features.

I would echo @phil-opp 's proposal, let's study if we could support both WasmEdge and Wasmtime runtimes thru cargo features

Thank you very much for your suggestions! I will revise the pr and finish the relevant work as soon as possible.

Thanks a lot! Let me know if you have any questions.

With this update, we use WasmEdge as the default executor. By opening the feature wasmtime_executor, we can use wasmtime as the executor.
Due to the release of Rust v1.63, we no longer need any unstable features.

Hi, I have updated the CI test and it now passes.

authors: EmisonLu heyong4725 phil-opp

repo: essa-project/essa-rs


text:
License clarification

I came across this project randomly and it looks fantastic! I'm thinking about implementing a SWD-based sampling profiler, and this codebase seems like a great place to start. I wanted to get a clarification on the license of the code -- I see the MIT license at the top level, but a few of the files (e.g. https://github.com/essele/pico_debug/blob/7ca57da198614f3ce952db187457681a2c89fcbf/modules/lerp_task/task.c#L1-L11 ) have what I hope is just leftover stub license. To confirm -- the entire repo is MIT licensed? (I plan on doing my work under MIT as well, but wanted to make sure there were no issues!)

Hi,Yes you are correct, the whole thing is meant to be unencumbered and hence the MIT license.When i get a chance I’ll fix anything left around.Cheers,Lee.On 3 Jun 2024, at 15:54, Vladimir Vukicevic @.***> wrote:
I came across this project randomly and it looks fantastic! I'm thinking about implementing a SWD-based sampling profiler, and this codebase seems like a great place to start. I wanted to get a clarification on the license of the code -- I see the MIT license at the top level, but a few of the files (e.g. https://github.com/essele/pico_debug/blob/7ca57da198614f3ce952db187457681a2c89fcbf/modules/lerp_task/task.c#L1-L11 ) have what I hope is just leftover stub license. To confirm -- the entire repo is MIT licensed? (I plan on doing my work under MIT as well, but wanted to make sure there were no issues!)
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>

authors: essele vvuk

license: MIT


text:
Conditionals filter error with BOOST_VERSION

As there is a minor issue with different boost versions and BOOST_GLOBAL_FIXTURE we needed to add a check like this:
#if BOOST_VERSION >= 105900
    BOOST_GLOBAL_FIXTURE(TestSetup);
#else
    // Boost < 1.59 got the semicolon inside the macro causing an "extra ;" warning
    BOOST_GLOBAL_FIXTURE(TestSetup)
#endif

However this makes the parser throw this error:

The conditionals filter encountered error: Unable to evaluate expression "BOOST_VERSION >= 105900" whilst processing line number 58 of source file "C:\Users\Alex\Documents\s25client\src\test\main.cpp". The source file will not be filtered for conditionals

At least the boost version check should work IMO

Hi @Flamefire,
We are currently trying to move away from parsing source code directly and will be focusing on making use of --list_contet=DOT output. We can add a dummy value to the macro just to get things running. What I would recommend is to try the current (in-development v1.0.7) version (available via the appveyor badge). This makes use of a new discovery technique which should, hopefully, address your issue.

authors: Flamefire netspiri

repo: etas/vs-boost-unit-test-adapter


text:
Request has no 'params' key

Any thoughts? :)
2015/11/23 07:10:26 Panic recovery -> ERR-CONDUIT-CORE: Request has no 'params' key. This may mean that an extension like Suhosin has dropped data from the request. Check the PHP configuration on your server. If you are developing a Conduit client, you MUST provide a 'params' parameter when making a Conduit request, even if the value is empty (e.g., provide '{}').
/usr/local/Cellar/go/1.5.1/libexec/src/runtime/panic.go:423 (0x42a9e9)
/Users/etcinit/go/src/github.com/etcinit/phabulous/app/controllers/feed.go:34 (0x5110dc)
/Users/etcinit/go/src/github.com/etcinit/phabulous/app/controllers/feed.go:26 (0x51265a)
/Users/etcinit/go/src/github.com/gin-gonic/gin/context.go:95 (0x512b2a)
/Users/etcinit/go/src/github.com/gin-gonic/gin/logger.go:56 (0x523fd1)
/Users/etcinit/go/src/github.com/gin-gonic/gin/context.go:95 (0x512b2a)
/Users/etcinit/go/src/github.com/gin-gonic/gin/recovery.go:43 (0x524b31)
/Users/etcinit/go/src/github.com/gin-gonic/gin/context.go:95 (0x512b2a)
/Users/etcinit/go/src/github.com/gin-gonic/gin/gin.go:294 (0x519582)
/Users/etcinit/go/src/github.com/gin-gonic/gin/gin.go:275 (0x5191b7)
/usr/local/Cellar/go/1.5.1/libexec/src/net/http/server.go:1862 (0x5d05be)
/usr/local/Cellar/go/1.5.1/libexec/src/net/http/server.go:1361 (0x5cdbfe)
/usr/local/Cellar/go/1.5.1/libexec/src/runtime/asm_amd64.s:1696 (0x45bf01)

Versions:

phabulous: 2.1.0-alpha1
phabricator: not sure which version but it's kinda old, it was a clone from a year ago

It looks like the issue is the Phabricator version:

The message was added on this commit (from 2012): https://secure.phabricator.com/rP0b9c54a6bb780425a49af9a91bffe695be0a8908
The current version does not contain that check: https://github.com/phacility/phabricator/blob/master/src/applications/conduit/controller/PhabricatorConduitAPIController.php

A possible fix could be to always pass in an empty params object on the requests. Right now, gonduit (the Conduit library that phabulous uses) only passes params if the request body is not empty: https://github.com/etcinit/gonduit/blob/master/core/request.go#L45

Thanks @etcinit! I think I'm going to update phabricator :)
Thanks a lot

repo: etcinit/phabulous

license: mit

license_source: bigquery


text:
[BUG] Conductor

Description
Conductor is really weird, you can edit it from the Hurt Style Bonuses menu, but executing it in-game displays the default Conductor bonus. Said bonus appears in the Unknown Styles tab, changing that doesn't fix the issue and the style bonus will still appear as default
Reproduction

Step 1: Change Conductor Style Bonus
Step 2: Trigger Conductor
Step 3: It's not displaying as intended

Plugins Used

Ultrakill Style Editor: 1.0.2
Plugin Configurator: 1.8.4

I have found the issue, an update will be released when styles from violence are added, alongside some other qol changes.

thanks eu

Fixed as of v1.0.3

authors: UntotenTheo eternalUnion

repo: eternalUnion/UltrakillStyleEditor


text:
Parallel efficiency on a single KNL node drops dramatically

56% with TBB backend
40% with the Cthreads
Half or more of the runtime spent in other
As thread count decreases, efficiency increases.

I am closing this, since it's not a real efficiency issue, but rather that the profile counts also the setup phase.

repo: eth-cscs/nestmc-proto


text:
Write down formula and parameters for LIF cell [2]

Formulate the equations that describe the LIF cell and associated state/dynamics.

try to follow the interface/parameters used by NEST  http://www.nest-simulator.org/cc/iaf_neuron/
think about which parameters the user should be allowed to specify
specify the units of each variable

The complete formulation of the LIF neuron model and its parameters is given at the following link:
https://www.overleaf.com/9974817gghfyqxqdytx#/36645046/

authors: bcumming kabicm