Closed neryvini closed 1 year ago
Which board? Core version? Rtc and power library version? Ide?
It is a custom board, but with all components removed except crystal and capacitors. I am using this core with STM32LowPower library.
This is my platformio.ini
'[env:bluepill_f103c8_128k] platform = ststm32 framework = arduino board = bluepill_f103c8_128k upload_protocol = stlink
And my compiler output.
'Verbose mode can be enabled via -v, --verbose
option
CONFIGURATION: https://docs.platformio.org/page/boards/ststm32/bluepill_f103c8_128k.html
PLATFORM: ST STM32 (15.4.1) > BluePill F103C8 (128k)
HARDWARE: STM32F103C8T6 72MHz, 20KB RAM, 128KB Flash
DEBUG: Current (stlink) External (blackmagic, cmsis-dap, jlink, stlink)
PACKAGES:
You don't need HAL_ResumeTick and suspend as the deepSleep disable the irq. About peripheral, while there is not used it should not be clocked not enabled. Don't know how you measure the current (only IDD?), HSE enabled? Check also at which freq you run. Anyway I could not help more. This library provide basic LP services and it could always be optimized by disabling some clock, decreasing system core clock freq. Ensure also to have a legacy STM32 mcu. Note that we do not support PIO as the core is not up to date. Latest one is 2.6.0.
Understood.
I measured the current using 1Ohm resistor and osciloscope. HSE enabled, running in 72 MHz. About disable and enable peripherals. I was having problem with Wire and Serial, it runs fine in the first loop, but when come back from stop mode it do not work anymore. What should i do before enter in stop mode to disable this peripheral and how to enable when wakeup?
Use .end function.
One of the libraries was using Serial as debug function. I add the Serial.end() and after that the consumption in stop mode is arround 15uA.
I am trying to use the STOP mode with a STM32F103CBT6, but even after set all gpio set as input analog i am getting 300uA consumption. It should be arround 30uA (with standby mode i got 10uA, testing in the same way).
I cant use standby because it must wake up from PB1, not PA0 and we should know if the wakeup source was an interrupt in PB1 or a RTC Alarm. With standby we can't know it.
Going further i tried to disable peripherals, but i do not know if i did it in the proper way. For example how can i disable Serial1 and i2c after init both? In programming manual they say to only set gpio as input_analog and disable dac.