Skip to content

RAK3172 ADC pins don't work when deep sleep is enabled #15391

Open
@goshawk22

Description

@goshawk22

Description of defect

ADC pins on the RAK3172 stops working correctly after deep sleep.
Using the below code to measure the voltage:

#include "mbed.h"
AnalogIn voltage(PB_3);

int main()
{
    //sleep_manager_lock_deep_sleep();
    while (true) {
        float raw_adc;
        float calc_voltage;
        raw_adc = voltage.read();
        calc_voltage = ((3.3f*raw_adc*(5.0f))/(3.0f))*(1.3f);
        printf("\r\nRaw ADC: %f\r\n", raw_adc);
        printf("\r\n Calc Voltage: %f\r\n", calc_voltage);
        ThisThread::sleep_for(5s);
    }
}

When deep sleep is locked, the code works correctly and consistently reports around 3.3v as expected.
When deep sleep is unlocked, it reports around 2.77v the first time and then seems to hang, not reporting anything else.

Target(s) affected by this defect ?

RAK3172 (STM32WL)

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

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

mbed-os-6.17.0

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

mbed studio 1.4.4

How is this defect reproduced ?

Use the above code on a RAK3172 with the adc pin connected to a voltage divider. Build in develop or release mode to enable deep sleep.

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