Tool stack used on project - Zeke133/stm32 GitHub Wiki
Idea was to use only free and open-source tools for development. Such way it will be cross-platform and let more people to use it. Also a project is not hard linked to any IDE, so you are free to choose any tools.
Here I will describe development tools stack used me:
- Code editor - Visual Studio Code
- Console - MS PowerShell
- Build generation - CMake
- Build automation - Make
- Compiler - GCC (arm-none-eabi tool-chain)
- Debug and firmware uploading - OpenOCD + STLink clone
- Target MCU - Board with STM32F103C8T6
Now step by step about each component:
-
VS Code from my point of view is very user friendly editor with wide abilities for setup your custom development tools. But any other editor you like can be also used. In
.vscode
directory are settings files. You need just install and open project folder. -
I've used Windows 10 PowerShell and MacOS terminals for tools execution. In case of VSCode - internal terminal you like can be configured.
-
CMake is modern but sometimes not friendly and intuitive tool. Nevertheless there are no better alternatives today and it is more useful than raw Make files.
CMakeLists.txt
already configured for your pleasure. Install CMake, and add CMake toPath
if it wasn't done automatically. Now you can run scripts fromscripts
folder. For examplegenerateBuildTest.bat
to generate Make files and build project first time. -
I use Make build automation tool, but any other you like can be used instead. For example
Ninja
. CMake can be easily configured for using other build automation tool. -
GCC compiler is used because of alternatives lack. Rust and Clang have no linker for STM32 and have some other issues. I doesn't mean that situation will newer change, but in 2018 GCC is still best choose in my opinion. I've installed it with arm-none-eabi toolchain, but it also can be compiled from source like I did on PowerPC Mac because of distributive lack. Don't forget about adding GCC to
Path
. -
OpenOCD is good choose for debug issues and uploading firmware to MCU. Also you'll need STLink USB adapter. I use STLink v2 Chinese clone from Ebay for a couple of USD. This combination works fine for me. If you don't need Debug on hardware - you can use just any USB to USART adapter and STMDemoLoader or any other tool which uses STM bootloader protocol for firmware updates. Don't forget to move jumper on board to make bootloader active in such case.
-
STM32F103C8T6 development board is extremely cheap and shows great performance for money. Nevertheless any other board or separate MCU on custom board can be used after some checks and possible corrections. Talk about only STM32 generation MCU's of course.