STMicroelectronics / STM32CubeWL

STM32Cube MCU Full FW Package for the STM32WL series - (HAL + LL Drivers, CMSIS Core, CMSIS Device, MW libraries plus a set of Projects running on boards provided by ST (Nucleo boards)
Other
103 stars 53 forks source link

Device crashes when uplink send after switching to class B. #89

Open ankit-thealchemist opened 1 month ago

ankit-thealchemist commented 1 month ago

Describe the set-up

Describe the bug (skip if none)

I am running the Lorawan AT Slave example(although it appears on lorawan end node example also). I configure the lorawan version 1.0.4 with lorawan package 2.0.0(other details in the screenshot). After switiching to class B, when ever I do the uplink, the device crashes.

How to reproduce the bug (skip if none)

  1. List the modules that you suspect to be the cause of the problem LoraMacClassB. After swtiching to the class B device tries to calculate the multicast ping slot offset. Since the multicast setup have not been setup, the default value of the ping period is 0. In the first state, ie PINGSLOT_STATE_CALC_PING_OFFSET, the device try to calculate the ping offset, since the ping period is 0, the divide by 0 fault crashes the device.

  2. How we can reproduce the problem

Additional context

Device should not look for the multicast Class B pingslot until and unless multicast session has been setup.

Screenshots

image image image

RJMSTM commented 1 month ago

ST Internal Reference: 187438

pd-vt commented 3 weeks ago

We are able to fix this issue as workaround with commenting an If condition as attached image in LoRaMacClassB.c file and LoRaMacClassBProcess() function.

image

We know this is not proper solution but since we didn't had need of Multicast Class-B feature we could bypass this.