platformio / platform-ststm8

ST STM8: development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/ststm8
Apache License 2.0
40 stars 26 forks source link

Add spl-uart-printf-simple example, refactor old one #47

Closed maxgerhardt closed 3 years ago

maxgerhardt commented 3 years ago

The old "spl-uart" example was a rather complex UART1 to UART3 loopback and buffer check firmware and utilizes interrupts. The example also wouldn't compile for the boards that do not have a UART1 peripheral, but a UART2 peripheral instead.

This renames the old exapmle to spl-uart-loopback and adds a new, simple, no interrupts, UART printf() example which works for all supported STM8 boards. It outputs a small header text first, then Hello, world! continuously.

Again, the SPL configuration has been stripped down to the bare minimum (CLK, UART1 or UART2) to save flash.

Tested on my STM8S103F3 breakout board.

Build integration for examples has been adapted accordingly.

Environment     Status    Duration
--------------  --------  ------------
stm8sblue       SUCCESS   00:00:01.986
mb208           SUCCESS   00:00:01.934
nucleo_8s207k8  SUCCESS   00:00:01.950
s8uno           SUCCESS   00:00:02.075
stm8s003f3      SUCCESS   00:00:01.969
stm8sblack      SUCCESS   00:00:02.082
stm8sdisco      SUCCESS   00:00:02.085

grafik

valeros commented 3 years ago

Awesome, thanks!