This example compiles by SDCC (tested v4.0.0) and works with STM8 SPL (STSW-STM8069) v2.3.1 patched by STM8-SPL_SDCC_patch.
The LED connected to the PA1
pin. It's how the LED connected on the STM8S001J3 tiny board.
To delay function uses the timer TIM4
, CPU runs on 16Mhz.
To flash firmware to STM8S001J3 MCU uses ST-Link and stm8flash tool.
The compiled ihx
firmware for STM8S001J3 can be downloaded from Releases section. The last version can be downloaded by the blink_heartbeat_spl.ihx link.
To flash it through stm8flash and ST-Link programmer just run:
stm8flash -c stlinkv2 -p stm8s001j3 -w blink_heartbeat_spl.ihx
make
make flash
If needed use the command make size
to get the size of the binary firmware before actually flashing into MCU.