Skip to content

Nuvoton NuMaker-M032BTAI Sample Code with Makefile, Docker and CICD workflows

License

Notifications You must be signed in to change notification settings

leoli0605/Hello_NuMaker-M032BTAI

Repository files navigation

Hello_NuMaker-M032BTAI

Prerequisites

Before proceeding with the commands, ensure you have the following installed:

  • make
  • gcc-arm-none-eabi or docker
  • Python 3.7+ and pip (for flashing and debugging)

Quick Commands

The following quick commands are available for convenience:

  • make upgrade: Executes make clean, make, and make flash sequentially.

Building the Firmware

Using Makefile

To build the firmware using Makefile, run:

make clean && make

Flashing the Firmware

We use pyOCD for cross-platform compatibility and to support the latest versions. OpenOCD is not used in this process.

Installing pyOCD

First, install pyOCD using pip:

python -m pip install -U pyocd

Installing the Required Pack

Next, install the pack for the target MCU:

pyocd pack install M032BTAIAAN

Flashing the MCU

Finally, flash the MCU with the following command:

make flash

Debugging the Firmware

To debug the firmware manually, use the following commands:

Starting the GDB Server

Start the GDB server with pyOCD:

pyocd gdbserver -t M032BTAIAAN --elf Source\build\TRSP_UART_Central.elf

Connecting GDB to the Target

In the GDB command line, connect to the target and load the firmware:

(gdb) target remote localhost:3333
(gdb) monitor reset halt
(gdb) load

Documentation

To build the documentation, run:

make docs

You need to install these software first

  • On Windows:
choco install -y pandoc miktex
  • On macOS:
brew install pandoc
brew install --cask mactex-no-gui
  • On Linux:
sudo apt-get update && sudo apt-get install -y pandoc texlive-latex-base texlive-fonts-recommended texlive-fonts-extra texlive-latex-extra
  • Then, install the required extensions:
make docs-install