This repository demonstrates how to develop projects for the NuMaker-M032BTAI
using gcc-arm-none-eabi
with a makefile
.
We use pyOCD
for flashing and debugging because OpenOCD
does not fully support the NuMaker-M032BTAI
.
The example used is SampleCode/NuMaker-M03xBT/BLE/Demo/Central/TRSP_UART_Central.
Use make help
to quickly see available commands.
Before proceeding with the commands, ensure you have the following installed:
- Required
make
gcc-arm-none-eabi 13.2.Rel1+
ordocker
- Optional
- To install
pyOCD
:- Install
Python 3.7+
andpip
- Use
make install
to installpyOCD
and required setup
- Install
- To build documentation:
- Install
node.js 18+
andnpm
- Install
pandoc
andtinytex
- Use
make docs-install
to install required extensions
- Install
- To install
choco install -y make gcc-arm-embedded python3 nodejs-lts pandoc tinytex
# Linux
sudo apt update && sudo apt install -y curl git
# macOS
brew install coreutils curl git
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.14.0
echo ". $HOME/.asdf/asdf.sh" >> ~/.bashrc
echo ". $HOME/.asdf/completions/asdf.bash" >> ~/.bashrc
source ~/.bashrc
asdf plugin add make
asdf plugin add gcc-arm-none-eabi
asdf plugin add python
asdf plugin add nodejs
asdf plugin add pandoc
asdf plugin add tinytex
asdf install make latest
asdf install gcc-arm-none-eabi latest
asdf install python latest
asdf install nodejs 18.18.0
asdf install pandoc latest
asdf install tinytex latest
asdf global make latest
asdf global gcc-arm-none-eabi latest
asdf global python latest
asdf global nodejs 18.18.0
asdf global pandoc latest
asdf global tinytex latest
- Compile
make
- Recompile
make clean && make
make rebuild
- Flash
make flash
- Recompile and Flash
make upgrade
- Generate Documentation
make docs
To debug the firmware manually, use the following commands:
Start the GDB server with pyOCD
:
pyocd gdbserver -t M032BTAIAAN --elf Source\build\TRSP_UART_Central.elf
In the GDB command line, connect to the target and load the firmware:
(gdb) target remote localhost:3333
(gdb) monitor reset halt
(gdb) load