stm32duino / STM32LowPower

Arduino Low Power library for STM32
183 stars 52 forks source link

Examples of STM32LowPower for STM32WLE5CCU6 #71

Closed DEDP01 closed 2 years ago

DEDP01 commented 2 years ago

Hello!

I prove the examples (AlarmTimedWakeup, ExternalWakeup and TimeWakeup), the first two examples worked correctly but the last one (TimedWakeup) doesn´t do anything, it only turns on the led and it keeps like that.

The example works correctly or is incompatible or the program has a actualization?

ABOSTM commented 2 years ago

Hi @DEDP01 , I tested TimeWakeup example on my Nucleo WL55JC1 and it is working properly, led is toggling every seconds. My setup:

MCU STM32WL55JC from my nucleo board is closed to your STM32WLE5CCU6, except that yours is single core. So it should work on your chip too.

Can you tell us more about your setup ? which version of the core, and libraries?

I guess you are using variant "Generic WL55CCU", can you confirm ? By default Generic variants are for boards with only MCU (no led definition, no other external component, ...) And I guess you have a custom board, thus Generic variant needs to be customized, especially to define which pin to use for the LED (LED_BUILTIN used in the example). So did you do so ? can you give us details ? If needed: https://github.com/stm32duino/wiki/wiki#customization https://github.com/stm32duino/wiki/wiki/Add-a-new-variant-%28board%29

DEDP01 commented 2 years ago

Can you tell us more about your setup ?

Yes, my setup:

I guess you are using variant "Generic WL55CCU", can you confirm ? No , the variant is Generic WLE5CCUx

Yes, I customized the output, in my case LED_BUILTIN I changed to PB5.

#include "STM32LowPower.h"

void setup() {
  // in  my case the pin is PB5.
  pinMode(PB5, OUTPUT);
  LowPower.begin();
}

void loop() {
  digitalWrite(PB5, HIGH); //only the led keeps on.
  LowPower.deepSleep(1000);
  digitalWrite(PB5, LOW);
  LowPower.deepSleep(1000);
}
ABOSTM commented 2 years ago

Can you check whether after sketch is loaded in Flash, unplug/plug of PowerSupply make a difference ?

DEDP01 commented 2 years ago

I already tried and it still doesn't work

ABOSTM commented 2 years ago

@DEDP01, I proposed a fix in RTC library: https://github.com/stm32duino/STM32RTC/pull/68 You can test it if you want.