sparkfun / mbed-os-ambiq-apollo3

Arm Mbed OS is a platform operating system designed for the internet of things
https://mbed.com
Other
18 stars 13 forks source link

MCU never enters eny kind of sleep #41

Open kalle16lab opened 4 years ago

kalle16lab commented 4 years ago

Description of defect

While running the blinky example (https://github.com/ARMmbed/mbed-os-example-blinky) the current consumption of the MCU is constant (~500 uA).

What is expected to happen is during blinking the current consumption should change drastically. Extremely low during LED off and higher during LED on.

It seems like the OS is never actually entering any kind of sleep - normal or deep. When running the ambiq SDK RTOS blinky example the current consumption is as expected.

Target(s) affected by this defect ?

Currently I'm using the ambiq apollo3 EVB board (Rev 1.7) to test

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

gcc version 9.3.1 20200408 (release) (GNU Arm Embedded Toolchain 9-2020-q2-update)

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

I'm using the ambiq-apollo3-dev branch (hash b5710d79404f0fb8573521bc0b5e792a6fb9fc0b)

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

mbed-cli version 1.10.4

How is this defect reproduced ?

Build the blinky example (https://github.com/ARMmbed/mbed-os-example-blinky). Flash it to the board and measure current consumption.

idea--list commented 4 years ago

@kalle16lab I only have the Artemis Thing Plus board, my meter is the Ruideng UM25C which is a cheap device that still can measure 4 digits floating point.

In my case i can not see any consumption difference between the Ambiq SDK blinky example and between the Mbed OS blinky (with the official V6.3). Both consume 6.4 mA while only the status LED is on and 6.9 mA when both LEDs are on. That might mean the Artemis Thing Plus does not go to sleep even with the Ambiq SDK, or you might have added some code to your Ambiq example.

kalle16lab commented 4 years ago

The SDK example I am using is located under: AmbiqSuite-R2.5.1/boards/apollo3_evb/examples/freertos_lowpower

diesel-mil commented 4 years ago

I did check that "ambiq-apollo3-arduino/targets/targets.json" doesn't have "SLEEP" defined in the "device_has" section so it seems like no sleep is implemented yet.

kalle16lab commented 4 years ago

fixed in https://github.com/ARMmbed/mbed-os/pull/13849/commits/851eca4ddb7196e05db548b4379f569f6ad8e820

will127534 commented 3 years ago

The fix doesn't seems to work with Release build profile though, it doesn't wake up the MCU after sleep.

idea--list commented 3 years ago

The fix doesn't seems to work with Release build profile though, it doesn't wake up the MCU after sleep.

This is interesting. We shall opt for the Develop profile then as the Debug profile disables sleep mode by design. Here is the reference.