Skip to content

Conversation

@JordanYates
Copy link
Contributor

@JordanYates JordanYates commented Jan 24, 2021

Fixes two causes of excess power consumption.

The initial commit keeps the drivers power state variable in sync with the actual state, to ensure the wakeup function is only called once per exit from sleep.

The second commit disables the DIO1 interrupt when the modem is in sleep mode, fixes #31569

The third commit moves when the LoRaWAN MAC layer is notified of the public network state.
The new location in lorawan_join is the more correct location for the command, and reduces power consumption when lorawan_start and lorawan_join are separated in time.

Jordan Yates added 3 commits January 31, 2021 19:46
Update the global state of the modem on calls to `SX126xReset` and
`SX126xWakeup`. This stops `SX126xCheckDeviceReady` sending spurious SPI
commands on every transieve before `SX126xSetOperatingMode` is called.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
Disable the DIO1 interrupt when the sx126x modem is in sleep mode.
On nRF hardware, this lets the `GPIOTE` hardware be switched off, saving
15uA.

Fixes #31569.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
Move the public network request command from the end of `lorawan_start`
to the start of `lorawan_join`. This MAC command interacts with the
radio driver, bringing it out of sleep mode, and doesn't put it back.

The public network setting is only needed when joining a network, and
`lorawan_start` can be called well before `lorawan_join`. By moving the
command we save ~600uA before joining (for sx1262).

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
@nashif
Copy link
Member

nashif commented Feb 9, 2021

@Mani-Sadhasivam can you please re-review?

@nashif nashif merged commit ddc595b into zephyrproject-rtos:master Feb 10, 2021
@JordanYates JordanYates deleted the 210124_lora_dio1 branch March 22, 2021 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

lora: sx126x: interrupt pin permanently enabled

5 participants