Build
Building dingoPDM firmware locally on your machine
Note
dingoPDM firmware is already pre-built and ready for use on the release page
Linux
ARM Toolchain
Download the relevant ARM toolchain from the ARM website
x86_64 Linux hosted cross toolchains
AArch32 bare-metal target (arm-none-eabi)
arm-gnu-toolchain-14.3.rel1-x86_64-arm-none-eabi.tar.xz
The ARM toolchain needs to be on your PATH in order to use it on your machine.
- Extract to a folder on your machine
- Put the folder on your PATH (example with version 14.2 and folder in /opt/):
nano ~/.bashrc- Place this at the bottom of the
.bashrcfileexport PATH="/opt/arm-gnu-toolchain-14.2.rel1-x86_64-arm-none-eabi/bin:$PATH"
- Save and close nano
- Restart terminal (or run
source ~/.bashrc) - Validate with
arm-none-eabi-gcc -v
OpenOCD
OpenOCD can be installed using: sudo apt install openocd
Validate with openocd -v
Windows
ARM Toolchain
Download the relevant ARM toolchain from the ARM website
Windows (mingw-w64-x86_64) hosted cross toolchains
AArch32 bare-metal target (arm-none-eabi)
arm-gnu-toolchain-14.3rel1-mingw-w64-x86_64-arm-none-eabi.zip
The ARM toolchain needs to be on your PATH in order to use it on your machine.
- Unzip to a folder on your machine
- Put the folder on your PATH:
- Open Environment Variables (Windows key, type Environment Variables)
- Add the path to the
/binfolder to your PATH variable - Open terminal
- Validate with
arm-none-eabi-gcc -v- If you receive an error, restart your terminal (or VS Code if using VS Code)
OpenOCD
I've found that the easiest way to use OpenOCD on Windows is to use the xPack OpenOCD packages.
- Download the xPack OpenOCD package from the repo
- Example
xpack-openocd-0.11.0-1-win32-x64.zip - Note: I've only been able to get v0.11 to work on my machine
- Example
- Unzip to a folder on your machine
- Put the
/binfolder on your PATH (same process as ARM toolchain above) - Validate with
openocd -v- If you receive an error, restart your terminal (or VS Code if using VS Code)
Make
Use MSYS2 to add make and other Linux tools to Windows
- Install from the MSYS2 site
- Add the MSYS2
usr/binfolder to PATHC:\msys64\usr\bin
- Check by running
pacman -V- Note the capital -V
- If you receive an error, restart your terminal (or VS Code if using VS Code)
- Install make using `pacman -S make'
VS Code
The dingoPDM firmware repo includes VS Code settings to make working with the firmware easier.
Setup
The path to your ARM toolchain must be set in these settings files so VS Code can find the toolchain.
c_cpp_properties.json- Change
compilerPathto the toolchain/binpath on your machine - Note that there are two configurations:
STM32-ChibiOS-WindowsandSTM32-ChibiOS-Linux, make sure you're editing the correct configuration
- Change
settings.json- Find the correct configuration:
windowsorlinux - Edit
cortex-debug.armToolchainPathto the toolchain/binpath on your machine - If on Windows, edit
cortex-debug.openocdPathto the OpenOCD.exepath on your machine
- Find the correct configuration:
Build
To build the firmware in VS Code, press Ctrl+Shift+B
VS Code will ask you which board type to build for, select the board type and press Enter
Debug
To debug the firmware, press Ctrl+Shift+D
Select the debug type from the dropdown based on the board type
Press F5 to start debugging with OpenOCD