Closed VasilNikolovRilabs closed 1 year ago
it seems the "LoadProhibited" occuring at "dce->set_flow_control" is a follow-up-error.
the main Error is that dce is nullptr.
so this is the core Problem: E (11360) modem_api: create_modem_dce: Exception caught with ESP err_code=259 E (11360) modem_api:
we have debugged all stuff, (maybe you can participate in a Debug session ?)
and found out that the Error might be after this Line: https://github.com/espressif/esp-protocols/blob/master/components/esp_modem/include/cxx_include/esp_modem_dce_factory.hpp#L104
because the 2 Lines with "return nullptr" were not be executed.
err_code=259 seems to be a invalid state Error
ESP_ERR_INVALID_STATE
Hi @david-cermak
Here are the verbose outputs:
I (12568) ESPmodem_Cmux: config MODEM
D (12578) esp_netif_lwip: LwIP stack has been initialized
D (12578) esp_netif_lwip: esp-netif has been successfully initialized
I (12588) uart: queue free spaces: 30
V (12588) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): checking args
V (12598) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): Args okay. Resulting flags 0xE
D (12608) intr_alloc: Connected src 28 to int 18 (cpu 0)
I (12608) ESPmodem_Cmux: config NETWORK
D (12618) esp_netif_objects: esp_netif_add_to_list 0x3fce8680
D (12628) esp_netif_objects: esp_netif_add_to_list netif added successfully (total netifs: 1)
D (12638) esp-netif_lwip-ppp: esp_netif_new_ppp: PPP connection created: 0x3fce898c
D (12638) esp-netif_lwip-ppp: Phase Dead
E (12648) modem_api: create_modem_dce: Exception caught with ESP err_code=259 ESP_ERR_INVALID_STATE
E (12648) modem_api:
It sems that D (12638) esp-netif_lwip-ppp: Phase Dead is causing a problem
Hi @VasilNikolovRilabs
It seems like that the suspect is this line:
Which really indicates an invalid state, as the signal
was triggered and at the same time the command result wasn't updated
(but we set the signal only if the result is updated:
)
Moreover, no command should be issued during DCE creation, as far as I know.
This issue might have something to do with the ESP_MODEM_FLOW_CONTROL_HW
configuration that you use, and possibly a command for the modem to use the HW flow control (e.g. AT+IFC=2,2
or similar). Could you please share more details about setting the mode?
Hello @david-cermak
thank you for the information.
I have 3 further questions:
We start the flow control just after the DCE and the DTE were created in our code. The order is as following: 3.1 We create DTE instance
dte_configuration.uart_config.tx_io_num = 17;
dte_configuration.uart_config.rx_io_num = 18;
dte_configuration.uart_config.rts_io_num = 14;
dte_configuration.uart_config.cts_io_num = 13;
dte_configuration.uart_config.flow_control = ESP_MODEM_FLOW_CONTROL_HW;
dte = create_uart_dte(&dte_configuration);
3.2 We create NetIf instance
/* Configure the PPP netif */
esp_netif_config_t netif_ppp_config = ESP_NETIF_DEFAULT_PPP();
/* Create the PPP and DCE objects */
esp_netif = esp_netif_new(&netif_ppp_config);
3.3 We create DCE using the DTE and NetIf instances and a standart DCE config
/* Configure the DCE */
esp_modem_dce_config_t dce_config = ESP_MODEM_DCE_DEFAULT_CONFIG("nbiot.global-m2m.net");
dce = create_SIM7070_dce(&dce_config, dte, esp_netif);
3.4 At the end we start the flow control
if (command_result::OK != dce->set_flow_control(2, 2)) {
ESP_LOGE(TAG, "Failed to set the set_flow_control mode");
return; //TODO: error reaction must be defined
It seems that we fail on 3.3 to create the DCE successfully and as a result there is a address violation when setting the flow control using the DCE in step 3.4.
If you want we can make one session online and I can share our code base with you. Think that 30 minutes can be enough.
What does the term "signal" means -
The signal
from the code snippet above is just a single event group indicating reception of AT reply.
and why getting the signal times out?
That's the weird part. It hasn't timed out, it was set, yet the value was not updated accordingly. The only reason I could think of is a memory corruption.
How can we know that the creation of the DCE is finished, does it mean that?
The creation is completed once create_XXX_dce()
returns, and the result is a valid non-nullptr object.
We start the flow control just after the DCE and the DTE were created in our code. The order is as following:
Could you please make sure that before 3.4
, you have a valid pointer. I somehow understood from the above that the creation itself failed.
Hello @david-cermak
I did not fully understand this sentence: "That's the weird part. It hasn't timed out, it was set, yet the value was not updated accordingly. The only reason I could think of is a memory corruption."
Yes, in step 3.3 at the time when we create the DCE we dont receive a valid pointer for DCE which leads to the problem in step 3.4.
My questions is: What could really lead to this problem, could this happen if the modem is not physically switched on(with the power key)? Which AT command is issued exactly to the SIMCOM modem while creating the DCE and could this be the reason for the timeout if the modem is not in the proper state while switching it on?
Sorry, just wanted to say, that this error should never happen, so the only reason I could think about is that the member variables get corrupted, i.e. rewritten by another (unrelated) code or program.
What could really lead to this problem, could this happen if the modem is not physically switched on(with the power key)?
No, the objects should be easily created even if there's no modem.
Which AT command is issued exactly to the SIMCOM modem while creating the DCE
No command is sent during the creation of any DCE.
Am Mo., 11. Juli 2022 um 14:00 Uhr schrieb david-cermak < @.***>:
What does the term "signal" means -
The signal from the code snippet above is just a single event group indicating reception of AT reply.
and why getting the signal times out?
That's the weird part. It hasn't timed out, it was set, yet the value was not updated accordingly. The only reason I could think of is a memory corruption.
How can we know that the creation of the DCE is finished, does it mean that?
The creation is completed once create_XXX_dce() returns, and the result is a valid non-nullptr object.
but we have a null pointer. that is sure.
We start the flow control just after the DCE and the DTE were created in our code. The order is as following:
Could you please make sure that before 3.4, you have a valid pointer. I somehow understood from the above that the creation itself failed.
no need, we get a nullpointer.
— Reply to this email directly, view it on GitHub https://github.com/espressif/esp-protocols/issues/74#issuecomment-1180322675, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJAHMXKXRZFCRDAR4WWQZSTVTQEGTANCNFSM522QKBSA . You are receiving this because you commented.Message ID: @.***>
-- Diplom-Informatiker Franz Höpfinger e.K. Reibersdorf 16a 84419 Schwindegg
Added https://github.com/espressif/esp-protocols/pull/88 to print more info if exceptions are enabled and caught internally, for example:
D (1533) esp_netif_objects: esp_netif_add_to_list 0x3ffbe634
D (1533) esp_netif_objects: esp_netif_add_to_list netif added successfully (total netifs: 1)
D (1543) esp-netif_lwip-ppp: esp_netif_new_ppp: PPP connection created: 0x3ffbe940
D (1553) esp-netif_lwip-ppp: Phase Dead
E (1573) modem_api: create_modem_dce: Exception caught with ESP err_code=259
E (1573) modem_api: esp_modem_netif.cpp:85 ERROR
assert failed: void app_main() simple_cmux_client_main.cpp:78 (dce)
our code is very much the "simple_cmux_client",
and the Exception is raised at this line:
dce = create_SIM7070_dce(&dce_config, dte, esp_netif);
later the call to dce->set_flow_control(2, 2) fails, because dce is a Nullpointer.
but this a a follow-up Failure.
so, the Question is what is the "invalid state" on create dce ?
Thanks, Franz
Am Mo., 11. Juli 2022 um 09:34 Uhr schrieb david-cermak < @.***>:
Hi @VasilNikolovRilabs https://github.com/VasilNikolovRilabs
It seems like that the suspect is this line:
Which really indicates an invalid state, as the signal was triggered and at the same time the command result wasn't updated (but we set the signal only if the result is updated:
)
Moreover, no command should be issued during DCE creation, as far as I know.
This issue might have something to do with the ESP_MODEM_FLOW_CONTROL_HW configuration that you use, and possibly a command for the modem to use the HW flow control (e.g. AT+IFC=2,2 or similar). Could you please share more details about setting the mode?
— Reply to this email directly, view it on GitHub https://github.com/espressif/esp-protocols/issues/74#issuecomment-1180064497, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJAHMXKUGJ5UZUC6G4VNO7DVTPFBVANCNFSM522QKBSA . You are receiving this because you commented.Message ID: @.***>
-- Diplom-Informatiker Franz Höpfinger e.K. Reibersdorf 16a 84419 Schwindegg
Hello,
we faced the following issue when creating DCE for SIM7070