platform-ststm32 icon indicating copy to clipboard operation
platform-ststm32 copied to clipboard

serial wakeup works on ArduinoIDE not on PlatfromIO

Open naveen-79 opened this issue 10 months ago • 11 comments

I'm using Lora-E5-Mini board with the Lowpower Serial Deep Sleep Example. The code works fine if compiled in Arduino IDE but fails to work while using PlatformIO.

https://github.com/stm32duino/STM32LowPower/issues/118

naveen-79 avatar Jan 22 '25 11:01 naveen-79

Hi @naveen-79, unfortunately, I don't have any STM32W-based hardware at hand to reproduce the issue. I tried the Serial Deep Sleep example with Nucleo-L053R8 and it works quite well:

Alt Text

Could you try linking extra libraries as object files? Just add the following option:

[env:myenv]
...
lib_archive = no

valeros avatar Jan 23 '25 14:01 valeros

still wakeup fails

naveen-79 avatar Jan 23 '25 15:01 naveen-79

Image

naveen-79 avatar Jan 23 '25 15:01 naveen-79

Could you also try adding the CUSTOM_PERIPHERAL_PINS macro to your build?

[env:myenv]
...
build_flags = -DCUSTOM_PERIPHERAL_PINS

valeros avatar Jan 23 '25 18:01 valeros

Serial does not print anything.

HardwareSerial SleepSerial(PC0, PC1);

platformio.ini

[env:lora_e5_mini]
platform = ststm32
board = lora_e5_mini
framework = arduino
 

build_flags = 
        -D PIO_FRAMEWORK_ARDUINO_SERIAL_WITHOUT_GENERIC
        -D CUSTOM_PERIPHERAL_PINS

lib_deps = 
        https://github.com/stm32duino/STM32LowPower @ ~1.3.0
        https://github.com/stm32duino/STM32RTC @ ~1.6.0

lib_archive = no

anything wrong with the ini file

naveen-79 avatar Jan 24 '25 07:01 naveen-79

-D PIO_FRAMEWORK_ARDUINO_SERIAL_WITHOUT_GENERIC

Are you sure you need this option? It's an equivalent of the Enabled (no generic 'Serial') option which is not enabled by default in the Arduino IDE for this board.

valeros avatar Jan 24 '25 11:01 valeros

I enabled the same in Arduino IDE

naveen-79 avatar Jan 24 '25 14:01 naveen-79

Could you make a screenshot of the board settings you're using in Arduino IDE?

valeros avatar Jan 24 '25 20:01 valeros

Image

naveen-79 avatar Jan 25 '25 06:01 naveen-79

any updates

naveen-79 avatar Jan 28 '25 07:01 naveen-79

Unfortunately, there are no obvious reasons why it doesn't work with the STM32WL targets. I hope I'll be able to get back to this problem in a few days, but it's quite hard to debug the issue in a reasonable manner without real hardware at hand.

valeros avatar Jan 30 '25 11:01 valeros