Skip to content

STM32WL - LoRa sleep-mode #15314

Closed
Closed
@chrissnow

Description

@chrissnow

Description of defect

Were trying to reduce sleep current like the SX126X driver by using the following
"stm32wl-lora-driver.sleep-mode": 1

However it doesn't even compile, fixing the obvious errors results in the radio not working properly and failing to join a network.

Compile [ 13.0%]: STM32WL_LoRaRadio.cpp
[Warning] STM32WL_LoRaRadio.cpp@218,23: 'sleep_for' is deprecated: Pass a chrono duration, not an integer millisecond count. For example use `5s` rather than `5000`. [since mbed-os-6.0.0] [-Wdeprecated-declarations]
[Warning] STM32WL_LoRaRadio.cpp@224,25: 'read_ms' is deprecated: Use the Chrono-based elapsed_time method.  If integer milliseconds are needed, you can use `duration_cast<milliseconds>(elapsed_time()).count()` [since mbed-os-6.0.0] [-Wdeprecated-declarations]
[Error] STM32WL_LoRaRadio.cpp@720,9: use of undeclared identifier 'wait_us'
[Error] STM32WL_LoRaRadio.cpp@735,5: use of undeclared identifier 'sleep_state'
[ERROR] .\mbed-os\connectivity\drivers\lora\TARGET_STM32WL\STM32WL_LoRaRadio.cpp:218:23: warning: 'sleep_for' is deprecated: Pass a chrono duration, not an integer millisecond count. For example use `5s` rather than `5000`. [since mbed-os-6.0.0] [-Wdeprecated-declarations]
    rtos::ThisThread::sleep_for(sleep_duration);
                      ^
./mbed-os/rtos/include/rtos\ThisThread.h:215:1: note: 'sleep_for' has been explicitly marked deprecated here
MBED_DEPRECATED_SINCE("mbed-os-6.0.0", "Pass a chrono duration, not an integer millisecond count. For example use `5s` rather than `5000`.")
^
./mbed-os/platform/include\platform/mbed_toolchain.h:429:37: note: expanded from macro 'MBED_DEPRECATED_SINCE'
#define MBED_DEPRECATED_SINCE(D, M) MBED_DEPRECATED(M " [since " D "]")
                                    ^
./mbed-os/platform/include\platform/mbed_toolchain.h:410:43: note: expanded from macro 'MBED_DEPRECATED'
#define MBED_DEPRECATED(M) __attribute__((deprecated(M)))
                                          ^
.\mbed-os\connectivity\drivers\lora\TARGET_STM32WL\STM32WL_LoRaRadio.cpp:224:25: warning: 'read_ms' is deprecated: Use the Chrono-based elapsed_time method.  If integer milliseconds are needed, you can use `duration_cast<milliseconds>(elapsed_time()).count()` [since mbed-os-6.0.0] [-Wdeprecated-declarations]
    while (elapsed_time.read_ms() < (int) max_carrier_sense_time) {
                        ^
./mbed-os/drivers/include/drivers\Timer.h:85:5: note: 'read_ms' has been explicitly marked deprecated here
    MBED_DEPRECATED_SINCE("mbed-os-6.0.0", "Use the Chrono-based elapsed_time method.  If integer milliseconds are needed, you can use `duration_cast<milliseconds>(elapsed_time()).count()`")
    ^
./mbed-os/platform/include\platform/mbed_toolchain.h:429:37: note: expanded from macro 'MBED_DEPRECATED_SINCE'
#define MBED_DEPRECATED_SINCE(D, M) MBED_DEPRECATED(M " [since " D "]")
                                    ^
./mbed-os/platform/include\platform/mbed_toolchain.h:410:43: note: expanded from macro 'MBED_DEPRECATED'
#define MBED_DEPRECATED(M) __attribute__((deprecated(M)))
                                          ^
.\mbed-os\connectivity\drivers\lora\TARGET_STM32WL\STM32WL_LoRaRadio.cpp:720:9: error: use of undeclared identifier 'wait_us'
        wait_us(3500);
        ^
.\mbed-os\connectivity\drivers\lora\TARGET_STM32WL\STM32WL_LoRaRadio.cpp:735:5: error: use of undeclared identifier 'sleep_state'
    sleep_state = 0x00;
    ^
2 warnings and 2 errors generated.

Target(s) affected by this defect ?

NUCLEO_WL55JC

Toolchain(s) (name and version) displaying this defect ?

ARMC6

What version of Mbed-os are you using (tag or sha) ?

Master SHA-1: 91b793c

What version(s) of tools are you using. List all that apply (E.g. mbed-cli)

mbed-cli --version
1.10.5

How is this defect reproduced ?

Add "stm32wl-lora-driver.sleep-mode": 1 to mbed_app

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions