-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C030 SARA-R412M: URC already added with prefix. Cellular state machine failure. #15143
Comments
@ARMmbed/team-ublox please review |
Hi there, sorry to see you're having problems. From the AT log you've pasted in above it seems that you are getting nothing at all back from the cellular module; no response whatsoever, either before or after Assuming this was a working lump of HW/SW that is now a not working lump of HW/SW without anything obvious having been physically done to it (aside from possibly the power loss mentioned), I'd guess that your problem is unlikely to be (a), (b) or (d). You can check that (c) or (d) are not the problem by probing the If all of the above finds nothing, you could probe the I suggest you poke around at these things and then update this issue with the outcome of your investigations, hoping that we don't end up at (e). |
On #include "CellularLog.h"
nsapi_error_t ONBOARD_UBLOX_AT::hard_power_on()
{
tr_error("HARD POWER ON!");
::onboard_modem_init();
return NSAPI_ERROR_OK;
}
nsapi_error_t ONBOARD_UBLOX_AT::soft_power_on()
{
tr_error("SOFT POWER ON!");
::onboard_modem_power_up();
return NSAPI_ERROR_OK;
} But this trace errors are never shown in the serial console. I have set build profile as
So, e.g. |
@0xc0170: hi Martin, I've not built mbed-os in nearly three years now so it would take me a little while to work out which way was up in order to help with the specific debug issue above; do you have any immediate suggestions? |
@RobMeades removing "target_overrides": {
"*": {
"platform.stdio-convert-newlines": true,
"platform.stdio-baud-rate": 115200,
"platform.default-serial-baud-rate": 115200,
"mbed-trace.enable": true,
"cellular.debug-at": true,
"cellular.clear-on-connect": true,
"cellular.use-apn-lookup": true,
"nsapi.default-cellular-apn": "\"some.provider.com\"",
"nsapi.default-cellular-plmn": null,
"nsapi.default-cellular-sim-pin": null,
"nsapi.default-cellular-username": null,
"nsapi.default-cellular-password": null,
"lwip.ipv4-enabled": true,
"lwip.ipv6-enabled": true,
"lwip.tcp-enabled": true,
"lwip.ethernet-enabled": false,
"lwip.ppp-enabled": false,
"ppp.ipv4-enabled": false,
"ppp.ipv6-enabled": false
},
"UBLOX_C030_R412M": {
"target.features_add": ["STORAGE"],
"target.components_add": ["SD"],
"target.network-default-interface-type": "CELLULAR",
"storage.storage_type": "FILESYSTEM",
"UBLOX_AT.tx": "MDMTXD",
"UBLOX_AT.rx": "MDMRXD",
"UBLOX_AT.cts": "MDMCTS",
"UBLOX_AT.rts": "MDMRTS"
}
} |
Could you probe the If If the answer to the above is "yes" then we're at (e). |
@RobMeades VINT etc. works fine. But is this code correct: ublox_low_level_api.c#L41 void ublox_board_init(void) {
gpio_t gpio;
// Enable power to 3V3
gpio_init_inout(&gpio, PWR3V3, PIN_OUTPUT, OpenDrain, 1);
#if defined(TARGET_UBLOX_C030_R41XM)
/* In case of SARA-R4, MDMRST needs to be asserted for 10 seconds before modem actually powers down.
* This means that modem is initially responsive to AT commands but powers down
* after 10 seconds unless MDMRST is de-asserted (onboard_modem_init()).
*
* This will cause confusion for application as CellularDevice::is_ready()
* will return TRUE initially and later modem will power off without any indication to application.
*/
gpio_init_out_ex(&gpio, MDMRST, 1); // <----------------- see here!
gpio_init_inout(&gpio, MDMPWRON, PIN_OUTPUT, OpenDrain, 1);
#else
gpio_init_out_ex(&gpio, MDMRST, 0); // <----------------- see here!
gpio_init_out_ex(&gpio, MDMPWRON, 0);
#endif
gpio_init_out_ex(&gpio, MDMRTS, 0); // <----------------- see here! In my opinion, this line should be removed.
gpio_init_in_ex(&gpio, MDMCURRENTSENSE, PullNone);
... In comparison to: onboard_modem_api.c#L48 void onboard_modem_init()
{
gpio_t gpio;
#if defined(TARGET_UBLOX_C030_R41XM)
// Set the pin to high so on powerup we can set low
gpio_init_inout(&gpio, MDMPWRON, PIN_OUTPUT, OpenDrain, 1);
#endif
// Take us out of reset
gpio_init_out_ex(&gpio, MDMRST, 1); // <----------------- see here!
} |
I think you may be confusing If you have an MCU pin connected to the SARA-R412M module's reset (i.e. The Does that make sense? |
@RobMeades they look so much alike. My mistake! |
What is the best way to catch cellular errors like the following, to be able to debug better?
Thank you so much for the help and time @RobMeades!!! |
I'm not sure exactly what this snippet of log really means, I'm afraid; the last time I used mbed-os it didn't have a state machine in the cellular driver. Can you widen the debug you post to include the bit above this? On the face of it Can you clarify? |
INVALID SOLUTIONI use What I do: deinit()
{
onboard_modem_power_down();
onboard_modem_deinit();
NVIC_SystemReset();
} Adding 10.5 seconds to void onboard_modem_deinit()
{
#ifndef TARGET_UBLOX_C030_R41XM
gpio_t gpio;
// Back into reset
gpio_init_out_ex(&gpio, MDMRST, 0);
thread_sleep_for(10500);
#endif
} Why? I don't know and I need to investigate more. |
What does
|
After more investigation I have found a bug! Whit this "target_overrides": {
"*": {
"platform.stdio-convert-newlines": true,
"platform.stdio-baud-rate": 115200,
"platform.default-serial-baud-rate": 115200,
"mbed-trace.enable": true,
"cellular.debug-at": true,
"cellular.use-apn-lookup": true,
"nsapi.default-cellular-apn": "\"some.provider.com\"",
"nsapi.default-cellular-plmn": null,
"nsapi.default-cellular-sim-pin": null,
"nsapi.default-cellular-username": null,
"nsapi.default-cellular-password": null,
"lwip.ipv4-enabled": true,
"lwip.ipv6-enabled": true,
"lwip.tcp-enabled": true,
"lwip.ethernet-enabled": false,
"lwip.ppp-enabled": false,
"ppp.ipv4-enabled": false,
"ppp.ipv6-enabled": false
},
"UBLOX_C030_R412M": {
"target.features_add": ["STORAGE"],
"target.components_add": ["SD"],
"target.network-default-interface-type": "CELLULAR",
"storage.storage_type": "FILESYSTEM",
"sd.SPI_MOSI": "SPI_MOSI",
"sd.SPI_MISO": "SPI_MISO",
"sd.SPI_CLK": "SPI_CLK",
"sd.SPI_CS": "SPI_NSS"
}
} Bugfix on ONBOARD_UBLOX.cpp#L30 add line CellularDevice *CellularDevice::get_target_default_instance()
{
#if defined(TARGET_UBLOX_C030_R41XM)
static UARTSerial serial(MDMTXD, MDMRXD, MBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE);
serial.set_flow_control(SerialBase::RTSCTS, MDMRTS, MDMCTS);
static ONBOARD_UBLOX_AT device(&serial);
#elif defined(TARGET_UBLOX_C030_N211)
... |
Interesting: how did it ever work before? The |
@RobMeades with And you can see, that UBLOX_AT.cpp#L99 uses Using this target definition for C030 in TARGET_UBLOX_C030 folder is the correct way, because with this definition it uses the correct `onboard_modem_api.c``etc. |
@0xc0170 hi again Martin. What approach should we take to this? Do you maintain any form of mbed-os 5 maintenance branch that such a fix should be made to, or does this become some form of "known issue" so that others don't have to repeat the investigation that phlegx has done? |
5.15 branch is still being maintained. Please create a fix for mbed-os-5.15 branch for review |
@phlegx: will you do this or would you like me to? I have no way to build/test mbed-os at the moment but if you'd prefer that I did it please give me the changed file that you have tested and I will do the "paperwork". |
I will make a pull request. |
Description of defect
Normally the cellular connection works without problems. We noticed that a reboot with external power supply of the device after the battery (without external power) went dead, the Ublox SIM chip is in a bad state and it shows this warnings:
After many retries of
AT TX ( 9): AT+CFUN=4
we get the errors:and the connection procedure don't continue. Our code is simple:
Questions
CellularStateMachine
error?iface
(CellularContext) to try some commands?Target(s) affected by this defect ?
C030-R412M
Toolchain(s) (name and version) displaying this defect ?
Mbed Studio 1.4.3
What version of Mbed-os are you using (tag or sha) ?
mbed-os-5.15.7
What version(s) of tools are you using. List all that apply (E.g. mbed-cli)
Mbed Studio 1.4.3
How is this defect reproduced ?
The text was updated successfully, but these errors were encountered: