espressif / esp-mdf

Espressif Mesh Development Framework, limited maintain, recommend to use https://github.com/espressif/esp-mesh-lite
Other
773 stars 253 forks source link

mconfig with mwifi on already #187

Open nagyation opened 3 years ago

nagyation commented 3 years ago

I'm trying to keep mconfig running to get configuration, even after mwifi is connected, so I first start the mwifi then on the app task I start mconfig and wait for queue, but it seems it is not possible to run mconfig:blufi while mwifi has started, maybe it's because of memory limitations?

I'm only using blufi not the mconfig-chain, I can see from the logs that bluif was initialized, so it seems the error relates to mconfig queue: MDF_ERROR_ASSERT(mconfig_queue_read(&mconfig_data, portMAX_DELAY));

ps: I'm using the stable version.

Logs/Backtrace:

(1909) BTDM_INIT: BT controller compile version [e989f20]
I (1910) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (2182) [mconfig_blufi, 539]: BLUFI init finish, set ble advertising data
I (2182) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (2193) [mconfig_blufi, 882]: start ble advertising
Guru Meditation Error: Core  0 panic'ed (LoadProhibited). Exception was unhandled.
Core 0 register dump:
PC      : 0x40090fdb  PS      : 0x00060533  A0      : 0x8009045d  A1      : 0x3ffd56c0  
0x40090fdb: uxListRemove at /home/nagy/esp/esp-mdf/esp-idf/components/freertos/list.c:212

A2      : 0x0000001f  A3      : 0x3ffd5854  A4      : 0x000000b4  A5      : 0x3ffda60c  
A6      : 0x00000000  A7      : 0x00000000  A8      : 0x00000002  A9      : 0x00060523  
A10     : 0x3ffd5960  A11     : 0x00000001  A12     : 0x3ffcc4ac  A13     : 0x00000000  
A14     : 0x00000000  A15     : 0x3ffbb510  SAR     : 0x00000000  EXCCAUSE: 0x0000001c  
EXCVADDR: 0x0000002f  LBEG    : 0x4000c2e0  LEND    : 0x4000c2f6  LCOUNT  : 0x00000000  

ELF file SHA256: d65e586665bd9fe22c009ddbd99ac4e49b945652b6c763d7f35396847143f8cf

Backtrace: 0x40090fdb:0x3ffd56c0 0x4009045a:0x3ffd56e0 0x4008ede1:0x3ffd5700 0x400d0ec6:0x3ffd5740 0x400f2b4e:0x3ffd5760 0x400f45a2:0x3ffd5790 0x400f4cac:0x3ffd5880 0x4008e706:0x3ffd58d0
0x40090fdb: uxListRemove at /home/nagy/esp/esp-mdf/esp-idf/components/freertos/list.c:212

0x4009045a: xTaskRemoveFromEventList at /home/nagy/esp/esp-mdf/esp-idf/components/freertos/tasks.c:5063

0x4008ede1: xQueueGenericSend at /home/nagy/esp/esp-mdf/esp-idf/components/freertos/queue.c:2038

0x400d0ec6: queue_send_to_back_wrapper at /home/nagy/esp/esp-mdf/esp-idf/components/esp32/esp_adapter.c:329

0x400f2b4e: esp_mesh_push_to_nwk_queue at ??:?

0x400f45a2: mesh_wifi_event_cb at ??:?

0x400f4cac: mesh_wifi_event_main at ??:?

0x4008e706: vPortTaskWrapper at /home/nagy/esp/esp-mdf/esp-idf/components/freertos/port.c:403
EspHuifeng commented 3 years ago

Hi, @nagyation Sorry for the late reply. You can not run mconfig_blufi after mwifi starts. because wifi API can not be invoked directly when mesh is running. you can reference Calling Wi-Fi API I suggest you imitate this https://github.com/espressif/esp-mdf/blob/1c76187faaf16d40a574fc7c0c98122e93dee746/examples/development_kit/light/main/light_example.c#L350