Skip to content

Deep sleep is never achieved with SUBGRF_SetRxDutyCycle #99

@vrAntoine

Description

@vrAntoine

I was trying to use SUBGRF_SetRxDutyCycle, and I noticed that my current consumption in the radio sleep phase is higher than when I call the sleep through SUBGRF_SetSleep.
I measure 77.55uA in the sleep phase of the Rx duty cycle, and 2.10uA if I call SUBGRF_SetSleep.

After some investigation, I have found that the difference is the Radio RF switch set to RBI_SWITCH_RX in SUBGRF_SetRxDutyCycle, while it is set to RBI_SWITCH_OFF in SUBGRF_SetSleep.
In the paper, everything seems all right because in the RX duty cycle process, we want the RF switch set to RBI_SWITCH_RX during the awaken phase. However, by doing a workaround, I was able to set the sleep phase consumption to 2.82uA and still have my listen window working fine.

My workaround:

In HAL_SUBGHZ_ExecSetCmd I force back the switch to RADIO_SWITCH_OFF if a sleep status is set.
https://github.com/STMicroelectronics/stm32wlxx-hal-driver/blob/a496d1eebd7394fb880ebfdd56fdcb5f2cce687b/Src/stm32wlxx_hal_subghz.c#L978

if ((Command == RADIO_SET_SLEEP) || (Command == RADIO_SET_RXDUTYCYCLE))
    {
      HAL_RADIO_SetSwitchConfig (RADIO_SWITCH_OFF);
      hsubghz->DeepSleep = SUBGHZ_DEEP_SLEEP_ENABLE;
    }

This seems to continue to work fine because, from the SX1261/2 datasheet p77 (datasheet link):

When this command [SetRxDutyCycle] is sent in STDBY_RC mode, the context (device configuration) is saved and the chip enters in a loop ...

At the end of the SLEEP window, the chip automatically restarts the process of restoring context en enters the RX mode, and so on.

I guess the initial RF switch status is saved when the Rx duty cycle is set and restored every time the Rx window is entered again.

Can somebody try to reproduce this workaround and validate that the listening window continues to work as expected ?
If everything is working without issue, is it possible to add the workaround in the next version ?

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinghalHAL-LL driver-related issue or pull-request.needs clarificationNeeds clarification or inputs from the usersubghzSub-GHz radiowirelessWireless

Type

Projects

Status

Analyzed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions