-
Notifications
You must be signed in to change notification settings - Fork 3k
Description
Description of defect
Under certain conditions the LoRaWAN stack can lock up. Specifically it appears to happen when when late (or close to late) acks are received and create interrupts near the dispatch of other events.
Target(s) affected by this defect ?
Specifically experienced under FF1705_L151CC & XDOT_L151CC, but likely all targets that use the LoRaWAN stack.
Toolchain(s) (name and version) displaying this defect ?
Online compiler (https://ide.mbed.com/compiler/)
mbed-cli's GCC
What version of Mbed-os are you using (tag or sha) ?
mbed 5.15.6 b114a9c
mbed 5.11
What version(s) of tools are you using. List all that apply (E.g. mbed-cli)
mbed-cli 1.8.3
Online compiler (https://ide.mbed.com/compiler/)
How is this defect reproduced ?
Take the mbed-os-example-lorawan program and import it into the online compiler, select mbedos 5.15.6 and add the default semtech drivers.:
https://os.mbed.com/teams/mbed-os-examples/code/mbed-os-example-lorawan/
https://github.com/ARMmbed/mbed-semtech-lora-rf-drivers
Change it to uplink in confirmed mode by replacing MSG_UNCONFIRMED_FLAG with MSG_CONFIRMED_FLAG
And replace ev_queue.dispatch_forever(); with:
while(1){
ev_queue.dispatch(0);
}
Then let the device send uplinks in a high latency (late ack) network server environment.
Eventually (a few hours later) you will see this happen:
[27/01/21 - 08:16:35:456] [DBG ][LSTK]: Transmission completed
[27/01/21 - 08:16:35:471] [DBG ][LSTK]: Awaiting ACK
[27/01/21 - 08:16:36:456] [DBG ][LMAC]: RX1 slot open, Freq = 925700000
[27/01/21 - 08:16:36:471] ++ MbedOS Error Info ++
[27/01/21 - 08:16:36:471] Error Status: 0x80FF0144 Code: 324 Module: 255
[27/01/21 - 08:16:36:487] Error Message: Assertion failed: ret != 0
[27/01/21 - 08:16:36:503] Location: 0x801029B
[27/01/21 - 08:16:36:503] File: /extras/mbed-os.lib/features/lorawan/LoRaWANStack.cpp+531
[27/01/21 - 08:16:36:503] Error Value: 0x0
[27/01/21 - 08:16:36:503] Current Thread: LR-SX1272 Id: 0x20003658 Entry: 0x800A58D StackSize: 0x400 StackMem: 0x200038C8 SP: 0x
[27/01/21 - 08:16:36:518] 20003C0C
[27/01/21 - 08:16:36:518] For more info, visit: https://mbed.com/s/error?error=0x80FF0144&tgt=XDOT_L151CC
[27/01/21 - 08:16:36:518] -- MbedOS Error Info --
Alternatively, take the mbed-os-example-lorawan program, change it to uplink in confirmed mode like above, and add the following code:
replace ev_queue.dispatch_forever(); with
ev_queue.call_every(20, led_blink_func);
ev_queue.dispatch_forever();
And add the code:
DigitalOut led1(GPIO0);
void led_blink_func(void){
led1 = !led1;
}
Then let the device send uplinks in a high latency (late acks) network server environment. The same crash will happen.
It feels like something isn't quite interrupt safe, but I can't pinpoint it. Ideas?