assert failed: xQueueTakeMutexRecursive queue.c:724 (pxMutex)
Posted: Fri May 05, 2023 2:30 pm
I am using ESP IDF with esp32 WROOM 8 mb kit. I am getting the probelm. when I send the data from phone to esp32 the error comes. with same time i have created one task in which phone data will pass thru function.
- void ble_init(void){
- int rc;
- nimble_port_init();
- /* Initialize the NimBLE host configuration. */
- ble_hs_cfg.reset_cb = bleprph_on_reset;
- ble_hs_cfg.sync_cb = bleprph_on_sync;
- ble_hs_cfg.gatts_register_cb = gatt_svr_register_cb;
- ble_hs_cfg.store_status_cb = ble_store_util_status_rr;
- ble_hs_cfg.sm_io_cap = CONFIG_EXAMPLE_IO_TYPE;
- #ifdef CONFIG_EXAMPLE_BONDING
- ble_hs_cfg.sm_bonding = 1;
- #endif
- #ifdef CONFIG_EXAMPLE_MITM
- ble_hs_cfg.sm_mitm = 1;
- #endif
- #ifdef CONFIG_EXAMPLE_USE_SC
- ble_hs_cfg.sm_sc = 1;
- #else
- ble_hs_cfg.sm_sc = 0;
- #endif
- #ifdef CONFIG_EXAMPLE_BONDING
- ble_hs_cfg.sm_our_key_dist = 1;
- ble_hs_cfg.sm_their_key_dist = 1;
- #endif
- rc = gatt_svr_init();
- assert(rc == 0);
- /* Set the default device name. */
- rc = ble_svc_gap_device_name_set("MiBaio");
- assert(rc == 0);
- /* XXX Need to have template for store */
- ble_store_config_init();
- nimble_port_freertos_init(bleprph_host_task);
- xTaskCreate(&task, "task", 4096, NULL, 5, NULL);
- }
- void bleprph_host_task(void *param)
- {
- ESP_LOGI(tag, "BLE Host Task Started");
- /* This function will return only when nimble_port_stop() is executed */
- nimble_port_run();
- nimble_port_freertos_deinit();
- vTaskDelay(pdMS_TO_TICKS(10));
- }
- void task(void *pvParameter) {
- smartconfig_event_got_ssid_pswd_t *evt2 = (smartconfig_event_got_ssid_pswd_t *)event_data1;
- while(1){
- while(ret1==ESP_ERR_NVS_NOT_FOUND){
- printf("state=1");
- RelayDataMessageHandle(recieve_data[0]);
- ret1=nvs_get_str(mibaio_nvs_handle,"myssid",&evt2->ssid,sizeof(evt2->ssid));
- ret1=nvs_get_str(mibaio_nvs_handle,"mypassword",&evt2->password,sizeof(evt2->password));
- }
- }vTaskDelay(pdMS_TO_TICKS(1000));
- }
- Backtrace: 0x400FE6CA:0x3FFBFBF0 0x400FE876:0x3FFBFC10 0x40082D41:0x3FFBFC30 0x400FD5C0:0x3FFBBBD0 0x400D8733:0x3FFBBC00 0x400D7B45:0x3FFBBC20 0x4017F55B:0x3FFBBC50 0x4009530D:0x3FFBBC80
- 0x400fe6ca: task_wdt_timeout_handling at C:/Espressif/frameworks/esp-idf-v5.0.1/components/esp_system/task_wdt/task_wdt.c:461 (discriminator 3)
- 0x400fe876: task_wdt_isr at C:/Espressif/frameworks/esp-idf-v5.0.1/components/esp_system/task_wdt/task_wdt.c:585
- 0x40082d41: _xt_lowint1 at C:/Espressif/frameworks/esp-idf-v5.0.1/components/freertos/FreeRTOS-Kernel/portable/xtensa/xtensa_vectors.S:1118
- 0x400fd5c0: gpio_ll_get_level at C:/Espressif/frameworks/esp-idf-v5.0.1/components/hal/esp32/include/hal/gpio_ll.h:481
- (inlined by) gpio_get_level at C:/Espressif/frameworks/esp-idf-v5.0.1/components/driver/gpio/gpio.c:239
- 0x400d8733: RelayDataMessageHandle at C:/Espressif/tools/espressif-ide/2.9.0/workspace/bleprph/main/gpio.c:157
- 0x400d7b45: app_main at C:/Espressif/tools/espressif-ide/2.9.0/workspace/bleprph/main/main.c:201
- 0x4017f55b: main_task at C:/Espressif/frameworks/esp-idf-v5.0.1/components/freertos/FreeRTOS-Kernel/portable/port_common.c:131 (discriminator 2)
- 0x4009530d: vPortTaskWrapper at C:/Espressif/frameworks/esp-idf-v5.0.1/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:154
- Data from the client: WuJADHAV
- recievedata =W
- recievedata =u
- recievedata =J
- recievedata =A
- recievedata =D
- recievedata =H
- recievedata =A
- recievedata =V
- assert failed: xQueueTakeMutexRecursive queue.c:724 (pxMutex)
- Backtrace: 0x40081f4e:0x3ffbb7b0 0x40092139:0x3ffbb7d0 0x40098b75:0x3ffbb7f0 0x40093186:0x3ffbb910 0x400fdfd1:0x3ffbb930 0x4008c63c:0x3ffbb950 0x4008c94f:0x3ffbb980 0x400fe02e:0x3ffbb9a0 0x4014c82e:0x3ffbb9c0 0x4014c7ed:0x3ffbb9e0 0x4008d86f:0x3ffbba00 0x4008d49c:0x3ffbba20 0x4014c5bd:0x3ffbba70 0x40100b6f:0x3ffbba90 0x401011dd:0x3ffbbab0 0x40101446:0x3ffbbad0 0x40100559:0x3ffbbb40 0x40100a31:0x3ffbbbb0 0x400ff73c:0x3ffbbbd0 0x400d88aa:0x3ffbbc00 0x400d7b45:0x3ffbbc20 0x4017f55b:0x3ffbbc50 0x400
- 9530d:0x3ffbbc80
- 0x40081f4e: panic_abort at C:/Espressif/frameworks/esp-idf-v5.0.1/components/esp_system/panic.c:423
- 0x40092139: esp_system_abort at C:/Espressif/frameworks/esp-idf-v5.0.1/components/esp_system/esp_system.c:153
- 0x40098b75: __assert_func at C:/Espressif/frameworks/esp-idf-v5.0.1/components/newlib/assert.c:78
- 0x40093186: xQueueTakeMutexRecursive at C:/Espressif/frameworks/esp-idf-v5.0.1/components/freertos/FreeRTOS-Kernel/queue.c:724 (discriminator 1)
- 0x400fdfd1: spi_flash_op_lock at C:/Espressif/frameworks/esp-idf-v5.0.1/components/spi_flash/cache_utils.c:100
- 0x4008c63c: spi_flash_disable_interrupts_caches_and_other_cpu at C:/Espressif/frameworks/esp-idf-v5.0.1/components/spi_flash/cache_utils.c:154
- 0x4008c94f: spi_flash_protected_read_mmu_entry at C:/Espressif/frameworks/esp-idf-v5.0.1/components/spi_flash/flash_mmap.c:323
- 0x400fe02e: spi_flash_cache2phys at C:/Espressif/frameworks/esp-idf-v5.0.1/components/spi_flash/flash_mmap.c:395
- 0x4014c82e: esp_ota_get_running_partition at C:/Espressif/frameworks/esp-idf-v5.0.1/components/app_update/esp_ota_ops.c:558
- 0x4014c7ed: esp_partition_main_flash_region_safe at C:/Espressif/frameworks/esp-idf-v5.0.1/components/esp_partition/partition_target.c:202
- 0x4008d86f: main_flash_region_protected at C:/Espressif/frameworks/esp-idf-v5.0.1/components/spi_flash/spi_flash_os_func_app.c:182 (discriminator 1)
- 0x4008d49c: esp_flash_write at C:/Espressif/frameworks/esp-idf-v5.0.1/components/spi_flash/esp_flash_api.c:850 (discriminator 3)
- 0x4014c5bd: esp_partition_write at C:/Espressif/frameworks/esp-idf-v5.0.1/components/esp_partition/partition_target.c:75
- 0x40100b6f: nvs::NVSPartition::write(unsigned int, void const*, unsigned int) at C:/Espressif/frameworks/esp-idf-v5.0.1/components/nvs_flash/src/nvs_partition.cpp:59
- 0x401011dd: nvs::Page::writeEntry(nvs::Item const&) at C:/Espressif/frameworks/esp-idf-v5.0.1/components/nvs_flash/src/nvs_page.cpp:101
- 0x40101446: nvs::Page::writeItem(unsigned char, nvs::ItemType, char const*, void const*, unsigned int, unsigned char) at C:/Espressif/frameworks/esp-idf-v5.0.1/components/nvs_flash/src/nvs_page.cpp:247
- 0x40100559: nvs::Storage::writeItem(unsigned char, nvs::ItemType, char const*, void const*, unsigned int) at C:/Espressif/frameworks/esp-idf-v5.0.1/components/nvs_flash/src/nvs_storage.cpp:358 (discriminator 4)
- 0x40100a31: nvs::NVSHandleSimple::set_string(char const*, char const*) at C:/Espressif/frameworks/esp-idf-v5.0.1/components/nvs_flash/src/nvs_handle_simple.cpp:44
- 0x400ff73c: nvs_set_str at C:/Espressif/frameworks/esp-idf-v5.0.1/components/nvs_flash/src/nvs_api.cpp:413
- 0x400d88aa: RelayDataMessageHandle at C:/Espressif/tools/espressif-ide/2.9.0/workspace/bleprph/main/gpio.c:211
- 0x400d7b45: app_main at C:/Espressif/tools/espressif-ide/2.9.0/workspace/bleprph/main/main.c:201
- 0x4017f55b: main_task at C:/Espressif/frameworks/esp-idf-v5.0.1/components/freertos/FreeRTOS-Kernel/portable/port_common.c:131 (discriminator 2)
- 0x4009530d: vPortTaskWrapper at C:/Espressif/frameworks/esp-idf-v5.0.1/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:154
- ELF file SHA256: 97ca98d173bbdd6b
- Rebooting...
- ets Jul 29 2019 12:21:46
- rst:0xc (SW_CPU_RESET),boot:0x12 (SPI_FAST_FLASH_BOOT)
- configsip: 0, SPIWP:0xee
- clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
- mode:DIO, clock div:2
- load:0x3fff0030,len:6940
- ho 0 tail 12 room 4
- load:0x40078000,len:15500
- load:0x40080400,len:3844
- 0x40080400: _init at ??:?
- entry 0x4008064c
- I (29) boot: ESP-IDF v5.0.1 2nd stage bootloader
- I (29) boot: compile time 17:17:09
- I (29) boot: chip revision: v3.0
- I (32) boot.esp32: SPI Speed : 40MHz
- I (37) boot.esp32: SPI Mode : DIO
- I (41) boot.esp32: SPI Flash Size : 8MB
- I (46) boot: Enabling RNG early entropy source...
- I (51) boot: Partition Table:
- I (55) boot: ## Label Usage Type ST Offset Length
- I (62) boot: 0 nvs WiFi data 01 02 00009000 00006000
- I (70) boot: 1 phy_init RF data 01 01 0000f000 00001000
- I (77) boot: 2 factory factory app 00 00 00010000 00177000
- I (85) boot: End of partition table
- I (89) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=242e8h (148200) map
- I (151) esp_image: segment 1: paddr=00034310 vaddr=3ffbdb60 size=0530ch ( 21260) load
- I (159) esp_image: segment 2: paddr=00039624 vaddr=40080000 size=069f4h ( 27124) load
- I (171) esp_image: segment 3: paddr=00040020 vaddr=400d0020 size=b1244h (725572) map
- I (433) esp_image: segment 4: paddr=000f126c vaddr=400869f4 size=17f6ch ( 98156) load
- I (489) boot: Loaded app from partition at offset 0x10000
- I (489) boot: Disabling RNG early entropy source...
- I (501) cpu_start: Pro cpu up.
- I (501) cpu_start: Starting app cpu, entry point is 0x4008143c
- 0x4008143c: call_start_cpu1 at C:/Espressif/frameworks/esp-idf-v5.0.1/components/esp_system/port/cpu_start.c:142
- I (487) cpu_start: App cpu up.
- I (517) cpu_start: Pro cpu start user code
- I (517) cpu_start: cpu freq: 160000000 Hz
- I (517) cpu_start: Application information:
- I (522) cpu_start: Project name: bleprph
- I (527) cpu_start: App version: 1
- I (531) cpu_start: Compile time: May 5 2023 08:44:00
- I (538) cpu_start: ELF file SHA256: 97ca98d173bbdd6b...
- I (544) cpu_start: ESP-IDF: v5.0.1
- I (548) cpu_start: Min chip rev: v0.0
- I (553) cpu_start: Max chip rev: v3.99
- I (558) cpu_start: Chip rev: v3.0
- I (563) heap_init: Initializing. RAM available for dynamic allocation:
- I (570) heap_init: At 3FFAFF10 len 000000F0 (0 KiB): DRAM
- I (576) heap_init: At 3FFB6388 len 00001C78 (7 KiB): DRAM
- I (582) heap_init: At 3FFB9A20 len 00004108 (16 KiB): DRAM
- I (588) heap_init: At 3FFC9480 len 00016B80 (90 KiB): DRAM
- I (594) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
- I (601) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
- I (607) heap_init: At 4009E960 len 000016A0 (5 KiB): IRAM
- I (615) spi_flash: detected chip: generic
- I (618) spi_flash: flash io: dio
- W (622) spi_flash: Detected size(16384k) larger than the size in the binary image header(8192k). Using the size in the binary image header.
- I (636) cpu_start: Starting scheduler on PRO CPU.
- I (0) cpu_start: Starting scheduler on APP CPU.
- state=1I (871) wifi:wifi driver task: 3ffce620, prio:23, stack:6656, core=0
- I (871) system_api: Base MAC address is not set