16.02.2020

Super cheap STM32F030F4P6 ARM CORTEX-M0 board, programming with PlatformIO/Arduino

Cheap ARM0 boards on ebay


There are some super cheap STM32F030F4P6 ARM CORTEX-M0 boards available via ebay/Ali Express. They cost about $1.50 (incl shipping) and are usable via PlatformIO with Arduino software.
They are a bit limited, having only 16kB flash and 4kB RAM memory, but usable for a lot of projects.



Programmer needed


This board cannot be programmed via USB, although there is a connector it is only used to provide power. You need a programmer, i use a ST Link v2 compatible programmer obtained via ebay, costs about $2.50.



Connections


Connect the programmer to the board, you need 5 wires:

ST-Linkv2     Board
3.3V 3.3V
GND GND
RST NRST
SWCLK PA14
SWDIO PA13


Jumper


Set the Boot0-Jumper to "GND"


VS Code with PlatformIO


I use Microsofts Visual Studio Code on Linux (it's available for Windows and OSX too). Install the PlatformIO extension for Visual Studio Code and you are ready to go. This makes life much easier because PlatforIO takes care of installing all the libraries, SDKs and so on which are needed.

For the board choose Demo F030F4, Arduino for the environment. Plug in the programmer and put a blink sketch into "main.cpp":

#include

void setup()
{
// initialize LED digital pin as an output.
pinMode(LED_BUILTIN, OUTPUT);
}

void loop()
{
// turn the LED on (LOW is the voltage level)
digitalWrite(LED_BUILTIN, LOW);
// wait for 10ms
delay(10);
// turn the LED off by making the voltage HIGH
digitalWrite(LED_BUILTIN, HIGH);
// wait for two seconds
delay(2000);
}


Compile and transfer the program to the board and enjoy the warm glow of the LED blinking...

Links



Keine Kommentare:

Kommentar posten