Skip to content

danchouzhou/Nuvoton-VScode-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nuvoton Visual Studio Code Template

Usage

To clone this project

This project work with submodule from Nuvoton corporation. You need to initialize submodules by passing --recurse-submodules to the git clone command.

git clone https://github.com/danchouzhou/Nuvoton-VScode-template.git --recurse-submodules

Build tools

Windows users

Since we use VScode setting.json provide the build environment, only the execution binary need to be download (without installing). Download the following files, extract to the path C:\Users\"Your user name"\BuildTools\Windows which specific in .vscode/setting.json.

Linux users

mkdir -p ~/BuildTools/Linux/
tar jxvf gcc-arm-none-eabi-10.3-2021.07-x86_64-linux.tar.bz2 -C ~/BuildTools/Linux/
unzip OpenOCD_Linux.zip -d ~/BuildTools/Linux/
chmod +x ~/BuildTools/Linux/OpenOCD/bin/openocd
  • GNU Make should be installed.
sudo apt install make

Build the template

If you want to build the target for Nuvoton M480 series for example. Open a terminal inside the VScode.

cd NuMicro-M4/HelloWorld

Simply make. HelloWorld.bin should be inside the Objects folder.

make

Flash the firmware

make flash

For Linux users, probably need to add the access permission for usb device.

sudo chmod -R 777 /dev/bus/usb/

Rebuild

make clean
make

image

Create your own project from this template

  1. Add BSP submodule from OpenNuvoton. For example:
git submodule add https://github.com/OpenNuvoton/M480BSP.git NuMicro-M4/M480BSP
  1. Edit CORTEX_M, BASE, DEVICE in the makefile.conf.

Reference