cancel
Showing results for 
Search instead for 
Did you mean: 

Hi, I'm trying to understand how storing and restoring the LoRa context for stm32wl works. To my understanding it would be ossible to skip the join process if the device is already joined once even if it is power cycled?

ABläs.1
Associate II

I've made sure "force rejoins at reboot" is not not ticked in the configuration file, and then I set the task "LoRaStoreContextEvent" in the beginning of the user code section like this

static void OnNvmDataChange(LmHandlerNvmContextStates_t state)
{
  /* USER CODE BEGIN OnNvmDataChange_1 */
  UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_LoRaStoreContextEvent), CFG_SEQ_Prio_0);
....

Since it stills rejoins when power cycling I think I'm probably misunderstanding how things are supposed to be used.

2 REPLIES 2
Louis AUDOLY
ST Employee

Hello @Arvid Bläser​,

I suggest you to try the LoRaWAN_End_Node project from the STM32Cube_FW_WL_V1.2.0. After flashing this code, once your device join the network, you can presse the push button 3 and this will store the context of the device. Power cycle the device and you will see that the device restore the context and do not join once again.

Your error may come from the fact the context is not stored correctly, so when the device reboot it does not use the stored context and will start a new join procedure.

Or if you don't store the context in the right memory space. In that case even if you store your context it will not be kept in retention after the reboot.

Let me know if this work on your side with the LoRaWAN_End_Node example.

Regards

Louis

ABläs.1
Associate II

Hello Louis,

thank you for your answer. I have managed to change the appkey, store it and resore it without a problem.

The thing I am not sure if I understand correctly or not is what is considered to be the join procedure. Even when running the LoRaWAN_End_Node I will get a Join Accept and Join Forward when storing the data with the pushbutton and then reseting the device.

This is not really a problem, I am just curious if it is possbile to directly start sending uplinks without trying to join when rebooting (Assuming it has joined successfully at least once).

BR Arvid