This repository is a guide to landing STM32 chip development. Let's get started stm32 project just like arduino.
Hands on black pill board : STM32F401 (<4$)
You can use ST-Link v2 copy (<2$)
Highly recommend to use package manager to set-up environment.
With regard to windows, We'll use scoop
.
- Install scoop with the instruction
- Add packages required
scoop bucket add extras
scoop install main/cmake main/openocd main/ninja extras/gcc-arm-none-eabi # if you have no git, install main/git as well
Unfortunately, gcc-arm-none-eabi(embedded)
is not available in apt package manager from focal. So we use nix package manager as alternative. If you have any other package manager you prefer, do not hesitate to use it :)
- Install nix with the instruction
- Add packages required
nix-env -iA nixpkgs.cmake nixpkgs.openocd nixpkgs.ninja nixpkgs.gcc-arm-embedded
Mac have all with brew
. Cheers! 🍻
- Install brew with the instruction
brew install cmake openocd ninja gcc-arm-embedded #if you have no git, add it
You can use vscode with extensions (recommended!)
Just hit the F5
for launch. and, that's it.
If you hate vscode, just compile it as you always do with cmake.
git clone https://github.com/DongHoonPark/blackpill-stm32-cmake
cd blackpill-stm32-cmake
# If you use vscode & cmake plugin, the procedure below can be done in vscode
mkdir build
cd build
cmake .. -G Ninja
cmake --build . --target stm32-blackpill
After then, you can use .elf
file to utilize openocd debugger