Author: Jacob Chisholm
Written for Queen's Formula SAE
- Built with FreeRTOS
- CMAKE compiling/linking with GCC
- Makefile uploading (binary blobs produced cross compatible)
- Select correct compiler kit in VS code cMake extension
- Allow cMake automatic configuration
- Select flash method in the makefile
- Run
make flashor upload code with another method
- Run
make cmaketo generate cmake configuration files - Run
make buildto build the project - Select the flash method in the makefile
- Run
make flash
- GCC
- arm-none-eabi-gcc
- arm-none-eabi-objcopy
- arm-none-eabi-gdb
- GNU make
- VS Code
- cMake extension
- Teleplot extension (for plotting serial data)
Debugging requires additional software:
- STM32 Cube
- VS Code
- Cortex Debug Extension
- GDB (version > 9.0)
Open the project in Cube IDE and select debug. Should just work. May need to open the project as an "Existing Cmake Project".
If debugging on windows, WSL 2 must be used and the ST-Link must be forwarded through to WSL through these instructions. STM32 Cube must be installed in WSL in addition to all of the aforementioned tools.
This is because MinGW does not currently have support for GDB version > 9.0 required by the Cortex Debug extension.
Once the softwares are installed debugging works identically to the standard GDB debugger. Breakpoints can be set, variables can be watched and all of the CPU registers can be read. To start a session, open up the debug pane in VS Code and select the STlink Launch or STlink Attach option. STlink Launch is preferred as it uploads the code to the micro before starting the session.