cancel
Showing results for 
Search instead for 
Did you mean: 

Radio power supply shutdown

JLall
Associate II

Hi,

I have a project with heavy constrains on power consumption.

I want to completely shut down the supply of the LoRa modem when not in use to save the needed µA.

The CPU can save any context needed.

The NVM module seems to be the way to go.

I've seen some use of it in the lmhandler of the Pattern/Advanced directory but I don't see any example code in the i-cube-lrwan package.

Is there such an example code available somewhere?

If not, is the lmhandler code known as working? and should I replace the LoRa Basic calls by lmhandler ones?

Thanks in advance,

Best regards,

JC

2 REPLIES 2
JLall
Associate II

Hi,

I went further on my discovery of the inners of the stack to find out that the NVM contexts are available through the MIB interface.

Initially, I looked at the NvmContextChange callback that is not implemented. It does not go upper than the LoRaMac layer.

There is only a little piece missing in the passing of a callback through the LoRaMainCallback_t structure as far as I understand. Anyone knows if there is a specific reason for this?

I have made the following test (main.c attached, modified from the EndNode example for STM32L4 and sx1261dvk1bas):

  • if not done dynamically allocate some space to save the NVM context structure and the pointed content
  • if done, restore the content from the stored one
  • Upon a change of an internal variable, exit the main loop
  • copy the content of the NVM context in my allocated memory

If I restore the context before the LORA_Init call, the context seems to be heavily modified right after the init. A Join is done at the first packet send.

If I restore after the LORA_Init call, a Join is tried out as well.

Like stated before, consumption is very important, we work on small solar cells taking "ages" to recharge a supercap.

As a consequence, I'd like to get away with the 1µA radio consumption in warm sleep.

I also need to get away with the Join performed everytime the radio is started.

Has anyone here successfully tried out to store and restore the context to support radio power down or sleep cold wakeup?

Thanks,

JC

JLall
Associate II

The LORA_Init modifies the MIB parameters and the callback is being generated.

The consequence is that I'm updating the context in an unwanted manner.

Inhibiting the update while the Init is running solves the issue.