This project is a demo for meson users to cross build STM32 projects.
Use VSCode with extensions is highly recommand.
The recommended extensions are these (unique id):
- ms-vscode.cpptools
- mesonbuild.mesonbuild
To use this demo as your project template, you could follow the following steps:
- clone this project with --depth=1 argument
- delete .git directory
- edit cross_files/toolchain.ini to setting your toolchain path
- run command
./configure.sh [project_name] cross_files/[specific_stm32_model.ini] crossfiles/debugger/[debugger_file.ini]
, the contents inside the "[]" are selected by your configuration. - double click [project_name].code-workspace then vscode will open a workspace
- modify .config file to configure the project
- run "meson - build" vscode task (hotkey: ctrl+shift+b)
- press F5 to launch openocd to debug
If you need to download your code to chip flash memory, then:
- open "meson" tabbar and unfold "Targets"
- click download, then meson will build a binary file and use openocd to download it
Or use download script by running command ./builddir/download.sh