Hello.
I have been working for several weeks in a project accessing MQTT servers using the pppos interface provided by the esp-modem component. Everything was working perfect, until I enabled BLE in menuconfig. From that moment, and with exactly the same code that worked perfectly, the system began to crash when calling esp_modem_new_dev() to init the modem. Tracing the error, it was due to
assert(svd != NULL ); in the find_desc_for_source() funcion of intr_alloc.c
Reading the code, this is used to find a shared vector descriptor, but it should not be the case for the modem. In fact, if I comment the formentioned assert, everything works again.
I am using version 4.4.4 of the IDE, but I have verified that that assert is also in the latest version. I do not know if it is a problem with the IDE itself, of it is due to anything wrong in my code. But the system has been tested and had worked for hours without any problem, before enabling BLE.
Thank you very much for your attention.
Germán Fabregat.
Problem in intr_alloc.c module
-
- Posts: 9730
- Joined: Thu Nov 26, 2015 4:08 am
Re: Problem in intr_alloc.c module
That is odd; that assert should never trigger (that's why it's an assert) because if the VECDESC_FL_SHARED flag is set, that should never be NULL. Is there any way you could whittle down your code to something where we can easily reproduce the error?
Re: Problem in intr_alloc.c module
Hello, and thank you for your reply.
The code is basically the same as the pppos_client example from the esp_modem component. I am continuing working around the problem and I am more puzzled each time.
As the mentioned example works with BLE enabled in menuconfig, I have tried the following: my app encapsulated the modem initialization, this code below
----
/* Init and register system/core components */
ESP_ERROR_CHECK(esp_netif_init());
ESP_ERROR_CHECK(esp_event_loop_create_default());
ESP_ERROR_CHECK(esp_event_handler_register(IP_EVENT, ESP_EVENT_ANY_ID, &on_ip_event, NULL));
ESP_ERROR_CHECK(esp_event_handler_register(NETIF_PPP_STATUS, ESP_EVENT_ANY_ID, &on_ppp_changed, NULL));
/* Configure the PPP netif */
esp_modem_dce_config_t dce_config = ESP_MODEM_DCE_DEFAULT_CONFIG(CONFIG_EXAMPLE_MODEM_PPP_APN);
esp_netif_config_t netif_ppp_config = ESP_NETIF_DEFAULT_PPP();
esp_netif_t *esp_netif = esp_netif_new(&netif_ppp_config);
assert(esp_netif);
event_group = xEventGroupCreate();
/* Configure the DTE */
esp_modem_dte_config_t dte_config = ESP_MODEM_DTE_DEFAULT_CONFIG();
/* setup UART specific configuration based on kconfig options */
dte_config.uart_config.tx_io_num = 27; CONFIG_EXAMPLE_MODEM_UART_TX_PIN;
dte_config.uart_config.rx_io_num = 26; CONFIG_EXAMPLE_MODEM_UART_RX_PIN;
dte_config.uart_config.rts_io_num = -1; CONFIG_EXAMPLE_MODEM_UART_RTS_PIN;
dte_config.uart_config.cts_io_num = -1; CONFIG_EXAMPLE_MODEM_UART_CTS_PIN;
dte_config.uart_config.flow_control = EXAMPLE_FLOW_CONTROL;
dte_config.uart_config.rx_buffer_size = CONFIG_EXAMPLE_MODEM_UART_RX_BUFFER_SIZE;
dte_config.uart_config.tx_buffer_size = CONFIG_EXAMPLE_MODEM_UART_TX_BUFFER_SIZE;
dte_config.uart_config.event_queue_size = CONFIG_EXAMPLE_MODEM_UART_EVENT_QUEUE_SIZE;
dte_config.task_stack_size = CONFIG_EXAMPLE_MODEM_UART_EVENT_TASK_STACK_SIZE;
dte_config.task_priority = CONFIG_EXAMPLE_MODEM_UART_EVENT_TASK_PRIORITY;
dte_config.dte_buffer_size = CONFIG_EXAMPLE_MODEM_UART_RX_BUFFER_SIZE / 2;
ESP_LOGI(TAG, "Initializing esp_modem for the SIM7000 module...");
esp_modem_dce_t *dce = esp_modem_new_dev(ESP_MODEM_DCE_SIM7000, &dte_config, &dce_config, esp_netif);
----
into a funcion, compiled in another c module, and linked with my main app. When using this function, the program crashes as described in my first post.
Then, if I copy and paste the code in the main app, the dce gets installed and the assert(svd != NULL ); is not triggered.
I want to remind that if BLE is not enabled, everything works ok. Also, when I removed the assert from intr_alloc the program worked for some time, but then another unhandled exception related to vfsprintf was triggered.
Regards and thank you again.
The code is basically the same as the pppos_client example from the esp_modem component. I am continuing working around the problem and I am more puzzled each time.
As the mentioned example works with BLE enabled in menuconfig, I have tried the following: my app encapsulated the modem initialization, this code below
----
/* Init and register system/core components */
ESP_ERROR_CHECK(esp_netif_init());
ESP_ERROR_CHECK(esp_event_loop_create_default());
ESP_ERROR_CHECK(esp_event_handler_register(IP_EVENT, ESP_EVENT_ANY_ID, &on_ip_event, NULL));
ESP_ERROR_CHECK(esp_event_handler_register(NETIF_PPP_STATUS, ESP_EVENT_ANY_ID, &on_ppp_changed, NULL));
/* Configure the PPP netif */
esp_modem_dce_config_t dce_config = ESP_MODEM_DCE_DEFAULT_CONFIG(CONFIG_EXAMPLE_MODEM_PPP_APN);
esp_netif_config_t netif_ppp_config = ESP_NETIF_DEFAULT_PPP();
esp_netif_t *esp_netif = esp_netif_new(&netif_ppp_config);
assert(esp_netif);
event_group = xEventGroupCreate();
/* Configure the DTE */
esp_modem_dte_config_t dte_config = ESP_MODEM_DTE_DEFAULT_CONFIG();
/* setup UART specific configuration based on kconfig options */
dte_config.uart_config.tx_io_num = 27; CONFIG_EXAMPLE_MODEM_UART_TX_PIN;
dte_config.uart_config.rx_io_num = 26; CONFIG_EXAMPLE_MODEM_UART_RX_PIN;
dte_config.uart_config.rts_io_num = -1; CONFIG_EXAMPLE_MODEM_UART_RTS_PIN;
dte_config.uart_config.cts_io_num = -1; CONFIG_EXAMPLE_MODEM_UART_CTS_PIN;
dte_config.uart_config.flow_control = EXAMPLE_FLOW_CONTROL;
dte_config.uart_config.rx_buffer_size = CONFIG_EXAMPLE_MODEM_UART_RX_BUFFER_SIZE;
dte_config.uart_config.tx_buffer_size = CONFIG_EXAMPLE_MODEM_UART_TX_BUFFER_SIZE;
dte_config.uart_config.event_queue_size = CONFIG_EXAMPLE_MODEM_UART_EVENT_QUEUE_SIZE;
dte_config.task_stack_size = CONFIG_EXAMPLE_MODEM_UART_EVENT_TASK_STACK_SIZE;
dte_config.task_priority = CONFIG_EXAMPLE_MODEM_UART_EVENT_TASK_PRIORITY;
dte_config.dte_buffer_size = CONFIG_EXAMPLE_MODEM_UART_RX_BUFFER_SIZE / 2;
ESP_LOGI(TAG, "Initializing esp_modem for the SIM7000 module...");
esp_modem_dce_t *dce = esp_modem_new_dev(ESP_MODEM_DCE_SIM7000, &dte_config, &dce_config, esp_netif);
----
into a funcion, compiled in another c module, and linked with my main app. When using this function, the program crashes as described in my first post.
Then, if I copy and paste the code in the main app, the dce gets installed and the assert(svd != NULL ); is not triggered.
I want to remind that if BLE is not enabled, everything works ok. Also, when I removed the assert from intr_alloc the program worked for some time, but then another unhandled exception related to vfsprintf was triggered.
Regards and thank you again.
Re: Problem in intr_alloc.c module
Hello.
I have reduced the code to an absolute minimum. It is the pppos_client code but GPIO configuration and modem activation (via GPIO pin) is placed in functions in a component; modem management is placed in another component. Main app just calls the functions as required, then waits on the event group bits.
When BLE is not enabled in menuconfig, it works fine.
When BLE is enabled...
---
Guru Meditation Error: Core 0 panic'ed (LoadProhibited). Exception was unhandled.
Core 0 register dump:
PC : 0x400d5abc PS : 0x00060433 A0 : 0x800d5c05 A1 : 0x3ffb1760
0x400d5abc: find_desc_for_source at C:/Espressif2/frameworks/esp-idf-v4.4.4/components/esp_hw_support/intr_alloc.c:161
A2 : 0x00000023 A3 : 0x00000000 A4 : 0x00000001 A5 : 0x00060423
A6 : 0x00000002 A7 : 0xff000000 A8 : 0x00000001 A9 : 0x00000011
A10 : 0x3ffb7f9c A11 : 0x3ffb7f9c A12 : 0x3ffb16e4 A13 : 0x3ffaed00
A14 : 0x00000000 A15 : 0x00000000 SAR : 0x0000001a EXCCAUSE: 0x0000001c
EXCVADDR: 0x00000001 LBEG : 0x400014fd LEND : 0x4000150d LCOUNT : 0xfffffffe
Backtrace: 0x400d5ab9:0x3ffb1760 0x400d5c02:0x3ffb1780 0x400d5e31:0x3ffb17c0 0x400d5ff5:0x3ffb1800 0x400e3185:0x3ffb1830 0x400e3f61:0x3ffb1870 0x400daf66:0x3ffb18c0 0x400da5f5:0x3ffb1d80 0x400da0a4:0x3ffb1e00 0x400d7541:0x3ffb1e40 0x400d6e05:0x3ffb2410 0x400d6a29:0x3ffb24b0 0x4010e618:0x3ffb24d0 0x40089c3d:0x3ffb24f0
0x400d5ab9: find_desc_for_source at C:/Espressif2/frameworks/esp-idf-v4.4.4/components/esp_hw_support/intr_alloc.c:160
0x400d5c02: get_available_int at C:/Espressif2/frameworks/esp-idf-v4.4.4/components/esp_hw_support/intr_alloc.c:299
0x400d5e31: esp_intr_alloc_intrstatus at C:/Espressif2/frameworks/esp-idf-v4.4.4/components/esp_hw_support/intr_alloc.c:486
0x400d5ff5: esp_intr_alloc at C:/Espressif2/frameworks/esp-idf-v4.4.4/components/esp_hw_support/intr_alloc.c:604
0x400e3185: uart_isr_register at C:/Espressif2/frameworks/esp-idf-v4.4.4/components/driver/uart.c:629 (discriminator 2)
0x400e3f61: uart_driver_install at C:/Espressif2/frameworks/esp-idf-v4.4.4/components/driver/uart.c:1625
0x400daf66: esp_modem::uart_resource::uart_resource(esp_modem_uart_term_config const*, QueueDefinition**, int) at C:/Users/germa/Documents/ESP44/ErrorTest/managed_components/espressif__esp_modem/src/esp_modem_term_uart.cpp:54 (discriminator 4)
0x400da5f5: esp_modem::UartTerminal::UartTerminal(esp_modem_dte_config const*) at C:/Users/germa/Documents/ESP44/ErrorTest/managed_components/espressif__esp_modem/src/esp_modem_uart.cpp:47
(inlined by) std::_MakeUniq<esp_modem::UartTerminal>::__single_object std::make_unique<esp_modem::UartTerminal, esp_modem_dte_config const*&>(esp_modem_dte_config const*&) at c:\espressif2\tools\xtensa-esp32-elf\esp-2021r2-patch5-8.4.0\xtensa-esp32-elf\xtensa-esp32-elf\include\c++\8.4.0\bits/unique_ptr.h:835
(inlined by) esp_modem::create_uart_terminal(esp_modem_dte_config const*) at C:/Users/germa/Documents/ESP44/ErrorTest/managed_components/espressif__esp_modem/src/esp_modem_uart.cpp:104
0x400da0a4: esp_modem::create_uart_dte(esp_modem_dte_config const*) at C:/Users/germa/Documents/ESP44/ErrorTest/managed_components/espressif__esp_modem/src/esp_modem_api_target.cpp:25
0x400d7541: esp_modem_new_dev at C:/Users/germa/Documents/ESP44/ErrorTest/managed_components/espressif__esp_modem/src/esp_modem_c_api.cpp:37
0x400d6e05: modem_Init at C:/Users/germa/Documents/ESP44/ErrorTest/components/modem/modem.c:168
0x400d6a29: app_main at C:/Users/germa/Documents/ESP44/ErrorTest/main/pppos_client_main.c:40
----
I can send the whole project to reproduce the error, as it is really small, all the code but modem init has been removed.
Regards and thank you again.
I have reduced the code to an absolute minimum. It is the pppos_client code but GPIO configuration and modem activation (via GPIO pin) is placed in functions in a component; modem management is placed in another component. Main app just calls the functions as required, then waits on the event group bits.
When BLE is not enabled in menuconfig, it works fine.
When BLE is enabled...
---
Guru Meditation Error: Core 0 panic'ed (LoadProhibited). Exception was unhandled.
Core 0 register dump:
PC : 0x400d5abc PS : 0x00060433 A0 : 0x800d5c05 A1 : 0x3ffb1760
0x400d5abc: find_desc_for_source at C:/Espressif2/frameworks/esp-idf-v4.4.4/components/esp_hw_support/intr_alloc.c:161
A2 : 0x00000023 A3 : 0x00000000 A4 : 0x00000001 A5 : 0x00060423
A6 : 0x00000002 A7 : 0xff000000 A8 : 0x00000001 A9 : 0x00000011
A10 : 0x3ffb7f9c A11 : 0x3ffb7f9c A12 : 0x3ffb16e4 A13 : 0x3ffaed00
A14 : 0x00000000 A15 : 0x00000000 SAR : 0x0000001a EXCCAUSE: 0x0000001c
EXCVADDR: 0x00000001 LBEG : 0x400014fd LEND : 0x4000150d LCOUNT : 0xfffffffe
Backtrace: 0x400d5ab9:0x3ffb1760 0x400d5c02:0x3ffb1780 0x400d5e31:0x3ffb17c0 0x400d5ff5:0x3ffb1800 0x400e3185:0x3ffb1830 0x400e3f61:0x3ffb1870 0x400daf66:0x3ffb18c0 0x400da5f5:0x3ffb1d80 0x400da0a4:0x3ffb1e00 0x400d7541:0x3ffb1e40 0x400d6e05:0x3ffb2410 0x400d6a29:0x3ffb24b0 0x4010e618:0x3ffb24d0 0x40089c3d:0x3ffb24f0
0x400d5ab9: find_desc_for_source at C:/Espressif2/frameworks/esp-idf-v4.4.4/components/esp_hw_support/intr_alloc.c:160
0x400d5c02: get_available_int at C:/Espressif2/frameworks/esp-idf-v4.4.4/components/esp_hw_support/intr_alloc.c:299
0x400d5e31: esp_intr_alloc_intrstatus at C:/Espressif2/frameworks/esp-idf-v4.4.4/components/esp_hw_support/intr_alloc.c:486
0x400d5ff5: esp_intr_alloc at C:/Espressif2/frameworks/esp-idf-v4.4.4/components/esp_hw_support/intr_alloc.c:604
0x400e3185: uart_isr_register at C:/Espressif2/frameworks/esp-idf-v4.4.4/components/driver/uart.c:629 (discriminator 2)
0x400e3f61: uart_driver_install at C:/Espressif2/frameworks/esp-idf-v4.4.4/components/driver/uart.c:1625
0x400daf66: esp_modem::uart_resource::uart_resource(esp_modem_uart_term_config const*, QueueDefinition**, int) at C:/Users/germa/Documents/ESP44/ErrorTest/managed_components/espressif__esp_modem/src/esp_modem_term_uart.cpp:54 (discriminator 4)
0x400da5f5: esp_modem::UartTerminal::UartTerminal(esp_modem_dte_config const*) at C:/Users/germa/Documents/ESP44/ErrorTest/managed_components/espressif__esp_modem/src/esp_modem_uart.cpp:47
(inlined by) std::_MakeUniq<esp_modem::UartTerminal>::__single_object std::make_unique<esp_modem::UartTerminal, esp_modem_dte_config const*&>(esp_modem_dte_config const*&) at c:\espressif2\tools\xtensa-esp32-elf\esp-2021r2-patch5-8.4.0\xtensa-esp32-elf\xtensa-esp32-elf\include\c++\8.4.0\bits/unique_ptr.h:835
(inlined by) esp_modem::create_uart_terminal(esp_modem_dte_config const*) at C:/Users/germa/Documents/ESP44/ErrorTest/managed_components/espressif__esp_modem/src/esp_modem_uart.cpp:104
0x400da0a4: esp_modem::create_uart_dte(esp_modem_dte_config const*) at C:/Users/germa/Documents/ESP44/ErrorTest/managed_components/espressif__esp_modem/src/esp_modem_api_target.cpp:25
0x400d7541: esp_modem_new_dev at C:/Users/germa/Documents/ESP44/ErrorTest/managed_components/espressif__esp_modem/src/esp_modem_c_api.cpp:37
0x400d6e05: modem_Init at C:/Users/germa/Documents/ESP44/ErrorTest/components/modem/modem.c:168
0x400d6a29: app_main at C:/Users/germa/Documents/ESP44/ErrorTest/main/pppos_client_main.c:40
----
I can send the whole project to reproduce the error, as it is really small, all the code but modem init has been removed.
Regards and thank you again.
-
- Posts: 9730
- Joined: Thu Nov 26, 2015 4:08 am
Re: Problem in intr_alloc.c module
Feel free to email it to jeroen at espressif dot com.
Re: Problem in intr_alloc.c module
Any news about this problem?
Re: Problem in intr_alloc.c module
Hello.
I am back with this problem. My client redesigned the hardware and changed the modem module, so I have been out of this project for a while. But I am now back at it and the problem persists.
If I initialize the modem using this function
modem_t *modem_Init(int tx_pin, int rx_pin, int rts_pin, int cts_pin, char *apn)
{
esp_modem_dce_config_t dce_config = ESP_MODEM_DCE_DEFAULT_CONFIG(NULL);
esp_netif_config_t netif_ppp_config = ESP_NETIF_DEFAULT_PPP();
// Si se envía un APN se usará la conexión de red. Se prepara todo ello
if (apn != NULL) {
modemAPN = malloc(strlen(apn) + 1);
if (modemAPN == NULL)
return NULL;
strcpy(modemAPN, apn);
// Inicia el interfaz netif, crea el bucle de gestión de eventos y registra las dos funciones de callback
ESP_ERROR_CHECK(esp_netif_init());
ESP_ERROR_CHECK(esp_event_loop_create_default());
ESP_ERROR_CHECK(esp_event_handler_register(IP_EVENT, ESP_EVENT_ANY_ID, &on_ip_event, NULL));
ESP_ERROR_CHECK(esp_event_handler_register(NETIF_PPP_STATUS, ESP_EVENT_ANY_ID, &on_ppp_changed, NULL));
// Configura los parámetros de la conexión PPP y la asocia a netif
dce_config.apn = modemAPN;
esp_netif = esp_netif_new(&netif_ppp_config);
assert(esp_netif);
}
// Configura la DTE, que gestiona la comunicación UART con el módem
esp_modem_dte_config_t dte_config = ESP_MODEM_DTE_DEFAULT_CONFIG();
dte_config.uart_config.tx_io_num = tx_pin;
dte_config.uart_config.rx_io_num = rx_pin;
dte_config.uart_config.rts_io_num = rts_pin;
dte_config.uart_config.cts_io_num = cts_pin;
dte_config.uart_config.flow_control = ESP_MODEM_FLOW_CONTROL_NONE;
dte_config.uart_config.rx_buffer_size = UART_RX_BUFFER_SIZE;
dte_config.uart_config.tx_buffer_size = UART_TX_BUFFER_SIZE;
dte_config.uart_config.event_queue_size = UART_EVENT_QUEUE_SIZE;
dte_config.task_stack_size = UART_EVENT_TASK_STACK_SIZE;
dte_config.task_priority = UART_EVENT_TASK_PRIORITY;
dte_config.dte_buffer_size = UART_RX_BUFFER_SIZE / 2;
// Crea el dispositivo dce del módem, para el módulo BG96
ESP_LOGI(TAG, "Initializing esp_modem for the BG96 module...");
dce = esp_modem_new_dev(ESP_MODEM_DCE_BG96, &dte_config, &dce_config, esp_netif);
ESP_LOGI(TAG, "Modem initialized");
return dce;
}
the system crashes when BLE is activated in menuconfig. If I paste the above code in appMain, everything works, with or without BLE activated in menuconfig.
But if I then try to start BLE the system crashes again. If I start BLE before initializing the modem, I get the following:
---
assert failed: xTaskRemoveFromEventList tasks.c:3656 (pxUnblockedTCB)
Backtrace: 0x40081ca2:0x3ffbe460 0x400915d9:0x3ffbe480 0x40096ddd:0x3ffbe4a0 0x4009365e:0x3ffbe5c0 0x40092971:0x3ffbe5e0 0x40081eb9:0x3ffbe610 0x4008cd27:0x3ffbe630 0x4008cfe3:0x3ffbe660 0x4008ccd1:0x3ffbe690 0x40083629:0x3ffbe6b0 0x40083ae6:0x3ffbe6d0 0x40086d35:0x3ffbe710 0x4008985e:0x3ffbe730 0x4008ac03:0x3ffbe750 0x40083099:0x3ffbe770 0x401a38e5:0x3ffbb290 0x401a3a92:0x3ffbb2c0 0x401a3f3f:0x3ffbb2f0 0x401a3f66:0x3ffbb330 0x401a3709:0x3ffbb360 0x40132600:0x3ffbb380 0x4012fa1d:0x3ffbb6b0 0x400d8c80:0x3ffbbc80 0x401a45e8:0x3ffbbd10 0x400948f9:0x3ffbbd30
0x40081ca2: panic_abort at C:/Espressif/frameworks/esp-idf-v4.4/components/esp_system/panic.c:408
0x400915d9: esp_system_abort at C:/Espressif/frameworks/esp-idf-v4.4/components/esp_system/esp_system.c:137
0x40096ddd: __assert_func at C:/Espressif/frameworks/esp-idf-v4.4/components/newlib/assert.c:85
0x4009365e: xTaskRemoveFromEventList at C:/Espressif/frameworks/esp-idf-v4.4/components/freertos/tasks.c:3656 (discriminator 1)
0x40092971: xQueueReceiveFromISR at C:/Espressif/frameworks/esp-idf-v4.4/components/freertos/queue.c:1979
0x40081eb9: internal_semphr_take_from_isr_wrapper at C:/Espressif/frameworks/esp-idf-v4.4/components/esp_wifi/esp32/esp_adapter.c:359
0x4008cd27: coex_bb_reset_unlock at ??:?
0x4008cfe3: coex_core_release at ??:?
0x4008ccd1: coex_bt_release at ??:?
0x40083629: coex_bt_release_wrapper at C:/Espressif/frameworks/esp-idf-v4.4/components/bt/controller/esp32/bt.c:1136
0x40083ae6: coex_sw_event_from_isr at ??:?
0x40086d35: r_lld_evt_end_isr at ??:?
0x4008985e: r_rwble_isr at ??:?
0x4008ac03: r_rwbtdm_isr_wrapper at intc.c:?
0x40083099: _xt_lowint1 at C:/Espressif/frameworks/esp-idf-v4.4/components/freertos/port/xtensa/xtensa_vectors.S:1114
0x401a38e5: base_node_add_handler at C:/Espressif/frameworks/esp-idf-v4.4/components/esp_event/esp_event.c:218
0x401a3a92: loop_node_add_handler at C:/Espressif/frameworks/esp-idf-v4.4/components/esp_event/esp_event.c:317
0x401a3f3f: esp_event_handler_register_with_internal at C:/Espressif/frameworks/esp-idf-v4.4/components/esp_event/esp_event.c:750
0x401a3f66: esp_event_handler_register_with at C:/Espressif/frameworks/esp-idf-v4.4/components/esp_event/esp_event.c:761
0x401a3709: esp_event_handler_register at C:/Espressif/frameworks/esp-idf-v4.4/components/esp_event/default_event_loop.c:32
0x40132600: esp_modem::Netif::Netif(std::shared_ptr<esp_modem::DTE>, esp_netif_obj*) at C:/Users/germa/Documents/ESP44/MQTTNuevo/managed_components/espressif__esp_modem/src/esp_modem_netif.cpp:79
0x4012fa1d: esp_modem::DCE_T<esp_modem::GenericModule>::DCE_T(std::shared_ptr<esp_modem::DTE> const&, std::shared_ptr<esp_modem::GenericModule>, esp_netif_obj*) at C:/Users/germa/Documents/ESP44/MQTTNuevo/managed_components/espressif__esp_modem/include/cxx_include/esp_modem_dce.hpp:49
(inlined by) esp_modem::DCE::DCE_T(std::shared_ptr<esp_modem::DTE> const&, std::shared_ptr<esp_modem::GenericModule>, esp_netif_obj*) at C:/Users/germa/Documents/ESP44/MQTTNuevo/managed_components/espressif__esp_modem/include/cxx_include/esp_modem_dce.hpp:101
(inlined by) std::enable_if<std::is_same<esp_modem::DCE*, esp_modem::DCE*>::value, esp_modem::DCE*>::type esp_modem::dce_factory::FactoryHelper::make<esp_modem::DCE, esp_modem::DCE*, std::shared_ptr<esp_modem::DTE>, std::shared_ptr<esp_modem::BG96>, esp_netif_obj*&>(std::shared_ptr<esp_modem::DTE>&&, std::shared_ptr<esp_modem::BG96>&&, esp_netif_obj*&) at C:/Users/germa/Documents/ESP44/MQTTNuevo/managed_components/espressif__esp_modem/include/cxx_include/esp_modem_dce_factory.hpp:35
(inlined by) esp_modem::DCE* esp_modem::dce_factory::Creator<esp_modem::BG96>::create<esp_modem::DCE, esp_modem::DCE*>(esp_modem_dce_config const*) at C:/Users/germa/Documents/ESP44/MQTTNuevo/managed_components/espressif__esp_modem/include/cxx_include/esp_modem_dce_factory.hpp:101
(inlined by) esp_modem::DCE* esp_modem::dce_factory::Factory::build_generic_DCE<esp_modem::BG96, esp_modem::DCE, esp_modem::DCE*, std::shared_ptr<esp_modem::DTE>, esp_netif_obj*&>(esp_modem_dce_config const*, std::shared_ptr<esp_modem::DTE>&&, esp_netif_obj*&) at C:/Users/germa/Documents/ESP44/MQTTNuevo/managed_components/espressif__esp_modem/include/cxx_include/esp_modem_dce_factory.hpp:255
(inlined by) esp_modem::DCE* esp_modem::dce_factory::Factory::build<esp_modem::BG96, std::shared_ptr<esp_modem::DTE>, esp_netif_obj*&>(esp_modem_dce_config const*, std::shared_ptr<esp_modem::DTE>&&, esp_netif_obj*&) at C:/Users/germa/Documents/ESP44/MQTTNuevo/managed_components/espressif__esp_modem/include/cxx_include/esp_modem_dce_factory.hpp:155
(inlined by) esp_modem::DCE* esp_modem::dce_factory::Factory::build<std::shared_ptr<esp_modem::DTE>, esp_netif_obj*&>(esp_modem_dce_config const*, std::shared_ptr<esp_modem::DTE>&&, esp_netif_obj*&) at C:/Users/germa/Documents/ESP44/MQTTNuevo/managed_components/espressif__esp_modem/include/cxx_include/esp_modem_dce_factory.hpp:230
(inlined by) esp_modem_new_dev at C:/Users/germa/Documents/ESP44/MQTTNuevo/managed_components/espressif__esp_modem/src/esp_modem_c_api.cpp:44
0x400d8c80: app_main at C:/Users/germa/Documents/ESP44/MQTTNuevo/main/MQTTSerie_main.c:226
0x401a45e8: main_task at C:/Espressif/frameworks/esp-idf-v4.4/components/freertos/port/port_common.c:141 (discriminator 2)
0x400948f9: vPortTaskWrapper at C:/Espressif/frameworks/esp-idf-v4.4/components/freertos/port/xtensa/port.c:142
---
If I init the modem first, and then BLE, i have:
---
assert failed: xTaskRemoveFromEventList tasks.c:3656 (pxUnblockedTCB)
Backtrace: 0x40081ca2:0x3ffbb960 0x400915d9:0x3ffbb980 0x40096ddd:0x3ffbb9a0 0x4009365e:0x3ffbbac0 0x40092798:0x3ffbbae0 0x400d6526:0x3ffbbb20 0x4008cd43:0x3ffbbb40 0x401827fe:0x3ffbbb70 0x4018269f:0x3ffbbb90 0x400dc5ee:0x3ffbbbb0 0x400da31f:0x3ffbbbd0 0x400d9409:0x3ffbbc30 0x400d8ca3:0x3ffbbc80 0x401a45e8:0x3ffbbd10 0x400948f9:0x3ffbbd30
0x40081ca2: panic_abort at C:/Espressif/frameworks/esp-idf-v4.4/components/esp_system/panic.c:408
0x400915d9: esp_system_abort at C:/Espressif/frameworks/esp-idf-v4.4/components/esp_system/esp_system.c:137
0x40096ddd: __assert_func at C:/Espressif/frameworks/esp-idf-v4.4/components/newlib/assert.c:85
0x4009365e: xTaskRemoveFromEventList at C:/Espressif/frameworks/esp-idf-v4.4/components/freertos/tasks.c:3656 (discriminator 1)
0x40092798: xQueueSemaphoreTake at C:/Espressif/frameworks/esp-idf-v4.4/components/freertos/queue.c:1598
0x400d6526: internal_semphr_take_wrapper at C:/Espressif/frameworks/esp-idf-v4.4/components/esp_wifi/esp32/esp_adapter.c:370
0x4008cd43: coex_bb_reset_unlock at ??:?
0x401827fe: coex_core_enable at ??:?
0x4018269f: coex_enable at ??:?
0x400dc5ee: esp_bt_controller_enable at C:/Espressif/frameworks/esp-idf-v4.4/components/bt/controller/esp32/bt.c:1713
0x400da31f: ble_init at C:/Users/germa/Documents/ESP44/MQTTNuevo/components/BLEDismuntel/ble.c:685
0x400d9409: activate_BLE at C:/Users/germa/Documents/ESP44/MQTTNuevo/components/BLEDismuntel/ble-basic.c:240
0x400d8ca3: app_main at C:/Users/germa/Documents/ESP44/MQTTNuevo/main/MQTTSerie_main.c:232
0x401a45e8: main_task at C:/Espressif/frameworks/esp-idf-v4.4/components/freertos/port/port_common.c:141 (discriminator 2)
0x400948f9: vPortTaskWrapper at C:/Espressif/frameworks/esp-idf-v4.4/components/freertos/port/xtensa/port.c:142
---
Any help will be welcome.
Regards.
I am back with this problem. My client redesigned the hardware and changed the modem module, so I have been out of this project for a while. But I am now back at it and the problem persists.
If I initialize the modem using this function
modem_t *modem_Init(int tx_pin, int rx_pin, int rts_pin, int cts_pin, char *apn)
{
esp_modem_dce_config_t dce_config = ESP_MODEM_DCE_DEFAULT_CONFIG(NULL);
esp_netif_config_t netif_ppp_config = ESP_NETIF_DEFAULT_PPP();
// Si se envía un APN se usará la conexión de red. Se prepara todo ello
if (apn != NULL) {
modemAPN = malloc(strlen(apn) + 1);
if (modemAPN == NULL)
return NULL;
strcpy(modemAPN, apn);
// Inicia el interfaz netif, crea el bucle de gestión de eventos y registra las dos funciones de callback
ESP_ERROR_CHECK(esp_netif_init());
ESP_ERROR_CHECK(esp_event_loop_create_default());
ESP_ERROR_CHECK(esp_event_handler_register(IP_EVENT, ESP_EVENT_ANY_ID, &on_ip_event, NULL));
ESP_ERROR_CHECK(esp_event_handler_register(NETIF_PPP_STATUS, ESP_EVENT_ANY_ID, &on_ppp_changed, NULL));
// Configura los parámetros de la conexión PPP y la asocia a netif
dce_config.apn = modemAPN;
esp_netif = esp_netif_new(&netif_ppp_config);
assert(esp_netif);
}
// Configura la DTE, que gestiona la comunicación UART con el módem
esp_modem_dte_config_t dte_config = ESP_MODEM_DTE_DEFAULT_CONFIG();
dte_config.uart_config.tx_io_num = tx_pin;
dte_config.uart_config.rx_io_num = rx_pin;
dte_config.uart_config.rts_io_num = rts_pin;
dte_config.uart_config.cts_io_num = cts_pin;
dte_config.uart_config.flow_control = ESP_MODEM_FLOW_CONTROL_NONE;
dte_config.uart_config.rx_buffer_size = UART_RX_BUFFER_SIZE;
dte_config.uart_config.tx_buffer_size = UART_TX_BUFFER_SIZE;
dte_config.uart_config.event_queue_size = UART_EVENT_QUEUE_SIZE;
dte_config.task_stack_size = UART_EVENT_TASK_STACK_SIZE;
dte_config.task_priority = UART_EVENT_TASK_PRIORITY;
dte_config.dte_buffer_size = UART_RX_BUFFER_SIZE / 2;
// Crea el dispositivo dce del módem, para el módulo BG96
ESP_LOGI(TAG, "Initializing esp_modem for the BG96 module...");
dce = esp_modem_new_dev(ESP_MODEM_DCE_BG96, &dte_config, &dce_config, esp_netif);
ESP_LOGI(TAG, "Modem initialized");
return dce;
}
the system crashes when BLE is activated in menuconfig. If I paste the above code in appMain, everything works, with or without BLE activated in menuconfig.
But if I then try to start BLE the system crashes again. If I start BLE before initializing the modem, I get the following:
---
assert failed: xTaskRemoveFromEventList tasks.c:3656 (pxUnblockedTCB)
Backtrace: 0x40081ca2:0x3ffbe460 0x400915d9:0x3ffbe480 0x40096ddd:0x3ffbe4a0 0x4009365e:0x3ffbe5c0 0x40092971:0x3ffbe5e0 0x40081eb9:0x3ffbe610 0x4008cd27:0x3ffbe630 0x4008cfe3:0x3ffbe660 0x4008ccd1:0x3ffbe690 0x40083629:0x3ffbe6b0 0x40083ae6:0x3ffbe6d0 0x40086d35:0x3ffbe710 0x4008985e:0x3ffbe730 0x4008ac03:0x3ffbe750 0x40083099:0x3ffbe770 0x401a38e5:0x3ffbb290 0x401a3a92:0x3ffbb2c0 0x401a3f3f:0x3ffbb2f0 0x401a3f66:0x3ffbb330 0x401a3709:0x3ffbb360 0x40132600:0x3ffbb380 0x4012fa1d:0x3ffbb6b0 0x400d8c80:0x3ffbbc80 0x401a45e8:0x3ffbbd10 0x400948f9:0x3ffbbd30
0x40081ca2: panic_abort at C:/Espressif/frameworks/esp-idf-v4.4/components/esp_system/panic.c:408
0x400915d9: esp_system_abort at C:/Espressif/frameworks/esp-idf-v4.4/components/esp_system/esp_system.c:137
0x40096ddd: __assert_func at C:/Espressif/frameworks/esp-idf-v4.4/components/newlib/assert.c:85
0x4009365e: xTaskRemoveFromEventList at C:/Espressif/frameworks/esp-idf-v4.4/components/freertos/tasks.c:3656 (discriminator 1)
0x40092971: xQueueReceiveFromISR at C:/Espressif/frameworks/esp-idf-v4.4/components/freertos/queue.c:1979
0x40081eb9: internal_semphr_take_from_isr_wrapper at C:/Espressif/frameworks/esp-idf-v4.4/components/esp_wifi/esp32/esp_adapter.c:359
0x4008cd27: coex_bb_reset_unlock at ??:?
0x4008cfe3: coex_core_release at ??:?
0x4008ccd1: coex_bt_release at ??:?
0x40083629: coex_bt_release_wrapper at C:/Espressif/frameworks/esp-idf-v4.4/components/bt/controller/esp32/bt.c:1136
0x40083ae6: coex_sw_event_from_isr at ??:?
0x40086d35: r_lld_evt_end_isr at ??:?
0x4008985e: r_rwble_isr at ??:?
0x4008ac03: r_rwbtdm_isr_wrapper at intc.c:?
0x40083099: _xt_lowint1 at C:/Espressif/frameworks/esp-idf-v4.4/components/freertos/port/xtensa/xtensa_vectors.S:1114
0x401a38e5: base_node_add_handler at C:/Espressif/frameworks/esp-idf-v4.4/components/esp_event/esp_event.c:218
0x401a3a92: loop_node_add_handler at C:/Espressif/frameworks/esp-idf-v4.4/components/esp_event/esp_event.c:317
0x401a3f3f: esp_event_handler_register_with_internal at C:/Espressif/frameworks/esp-idf-v4.4/components/esp_event/esp_event.c:750
0x401a3f66: esp_event_handler_register_with at C:/Espressif/frameworks/esp-idf-v4.4/components/esp_event/esp_event.c:761
0x401a3709: esp_event_handler_register at C:/Espressif/frameworks/esp-idf-v4.4/components/esp_event/default_event_loop.c:32
0x40132600: esp_modem::Netif::Netif(std::shared_ptr<esp_modem::DTE>, esp_netif_obj*) at C:/Users/germa/Documents/ESP44/MQTTNuevo/managed_components/espressif__esp_modem/src/esp_modem_netif.cpp:79
0x4012fa1d: esp_modem::DCE_T<esp_modem::GenericModule>::DCE_T(std::shared_ptr<esp_modem::DTE> const&, std::shared_ptr<esp_modem::GenericModule>, esp_netif_obj*) at C:/Users/germa/Documents/ESP44/MQTTNuevo/managed_components/espressif__esp_modem/include/cxx_include/esp_modem_dce.hpp:49
(inlined by) esp_modem::DCE::DCE_T(std::shared_ptr<esp_modem::DTE> const&, std::shared_ptr<esp_modem::GenericModule>, esp_netif_obj*) at C:/Users/germa/Documents/ESP44/MQTTNuevo/managed_components/espressif__esp_modem/include/cxx_include/esp_modem_dce.hpp:101
(inlined by) std::enable_if<std::is_same<esp_modem::DCE*, esp_modem::DCE*>::value, esp_modem::DCE*>::type esp_modem::dce_factory::FactoryHelper::make<esp_modem::DCE, esp_modem::DCE*, std::shared_ptr<esp_modem::DTE>, std::shared_ptr<esp_modem::BG96>, esp_netif_obj*&>(std::shared_ptr<esp_modem::DTE>&&, std::shared_ptr<esp_modem::BG96>&&, esp_netif_obj*&) at C:/Users/germa/Documents/ESP44/MQTTNuevo/managed_components/espressif__esp_modem/include/cxx_include/esp_modem_dce_factory.hpp:35
(inlined by) esp_modem::DCE* esp_modem::dce_factory::Creator<esp_modem::BG96>::create<esp_modem::DCE, esp_modem::DCE*>(esp_modem_dce_config const*) at C:/Users/germa/Documents/ESP44/MQTTNuevo/managed_components/espressif__esp_modem/include/cxx_include/esp_modem_dce_factory.hpp:101
(inlined by) esp_modem::DCE* esp_modem::dce_factory::Factory::build_generic_DCE<esp_modem::BG96, esp_modem::DCE, esp_modem::DCE*, std::shared_ptr<esp_modem::DTE>, esp_netif_obj*&>(esp_modem_dce_config const*, std::shared_ptr<esp_modem::DTE>&&, esp_netif_obj*&) at C:/Users/germa/Documents/ESP44/MQTTNuevo/managed_components/espressif__esp_modem/include/cxx_include/esp_modem_dce_factory.hpp:255
(inlined by) esp_modem::DCE* esp_modem::dce_factory::Factory::build<esp_modem::BG96, std::shared_ptr<esp_modem::DTE>, esp_netif_obj*&>(esp_modem_dce_config const*, std::shared_ptr<esp_modem::DTE>&&, esp_netif_obj*&) at C:/Users/germa/Documents/ESP44/MQTTNuevo/managed_components/espressif__esp_modem/include/cxx_include/esp_modem_dce_factory.hpp:155
(inlined by) esp_modem::DCE* esp_modem::dce_factory::Factory::build<std::shared_ptr<esp_modem::DTE>, esp_netif_obj*&>(esp_modem_dce_config const*, std::shared_ptr<esp_modem::DTE>&&, esp_netif_obj*&) at C:/Users/germa/Documents/ESP44/MQTTNuevo/managed_components/espressif__esp_modem/include/cxx_include/esp_modem_dce_factory.hpp:230
(inlined by) esp_modem_new_dev at C:/Users/germa/Documents/ESP44/MQTTNuevo/managed_components/espressif__esp_modem/src/esp_modem_c_api.cpp:44
0x400d8c80: app_main at C:/Users/germa/Documents/ESP44/MQTTNuevo/main/MQTTSerie_main.c:226
0x401a45e8: main_task at C:/Espressif/frameworks/esp-idf-v4.4/components/freertos/port/port_common.c:141 (discriminator 2)
0x400948f9: vPortTaskWrapper at C:/Espressif/frameworks/esp-idf-v4.4/components/freertos/port/xtensa/port.c:142
---
If I init the modem first, and then BLE, i have:
---
assert failed: xTaskRemoveFromEventList tasks.c:3656 (pxUnblockedTCB)
Backtrace: 0x40081ca2:0x3ffbb960 0x400915d9:0x3ffbb980 0x40096ddd:0x3ffbb9a0 0x4009365e:0x3ffbbac0 0x40092798:0x3ffbbae0 0x400d6526:0x3ffbbb20 0x4008cd43:0x3ffbbb40 0x401827fe:0x3ffbbb70 0x4018269f:0x3ffbbb90 0x400dc5ee:0x3ffbbbb0 0x400da31f:0x3ffbbbd0 0x400d9409:0x3ffbbc30 0x400d8ca3:0x3ffbbc80 0x401a45e8:0x3ffbbd10 0x400948f9:0x3ffbbd30
0x40081ca2: panic_abort at C:/Espressif/frameworks/esp-idf-v4.4/components/esp_system/panic.c:408
0x400915d9: esp_system_abort at C:/Espressif/frameworks/esp-idf-v4.4/components/esp_system/esp_system.c:137
0x40096ddd: __assert_func at C:/Espressif/frameworks/esp-idf-v4.4/components/newlib/assert.c:85
0x4009365e: xTaskRemoveFromEventList at C:/Espressif/frameworks/esp-idf-v4.4/components/freertos/tasks.c:3656 (discriminator 1)
0x40092798: xQueueSemaphoreTake at C:/Espressif/frameworks/esp-idf-v4.4/components/freertos/queue.c:1598
0x400d6526: internal_semphr_take_wrapper at C:/Espressif/frameworks/esp-idf-v4.4/components/esp_wifi/esp32/esp_adapter.c:370
0x4008cd43: coex_bb_reset_unlock at ??:?
0x401827fe: coex_core_enable at ??:?
0x4018269f: coex_enable at ??:?
0x400dc5ee: esp_bt_controller_enable at C:/Espressif/frameworks/esp-idf-v4.4/components/bt/controller/esp32/bt.c:1713
0x400da31f: ble_init at C:/Users/germa/Documents/ESP44/MQTTNuevo/components/BLEDismuntel/ble.c:685
0x400d9409: activate_BLE at C:/Users/germa/Documents/ESP44/MQTTNuevo/components/BLEDismuntel/ble-basic.c:240
0x400d8ca3: app_main at C:/Users/germa/Documents/ESP44/MQTTNuevo/main/MQTTSerie_main.c:232
0x401a45e8: main_task at C:/Espressif/frameworks/esp-idf-v4.4/components/freertos/port/port_common.c:141 (discriminator 2)
0x400948f9: vPortTaskWrapper at C:/Espressif/frameworks/esp-idf-v4.4/components/freertos/port/xtensa/port.c:142
---
Any help will be welcome.
Regards.
Who is online
Users browsing this forum: bfredo123, Bing [Bot] and 99 guests