The following instructions describe how to build an example vith Visual Studio Code.
Tool | Version |
---|---|
GitHub Repository | MBa117xL.SW.MCU.BSP |
VS-Code | Version 1.88.1 |
NXP's MCUXpresso SDK | MCUX_2.14.0_UPDATE_ENHC1 |
CMAKE | Version 3.27.4 |
West | Version 1.0.0 |
Python | Version 3.10.4 |
Segger J-Link for debugging | Version v7.92l |
Download MinGW for Windows | v13.1.0 |
In order to build and debug the examples via VS-Code you need to add the following VS-Code extentions.
Extention | Version |
---|---|
ms-vscode.cmake-tools | CMake tools (from Microsoft): v1.16.3 |
marus25.cortex-debug | Cortex-Debug (from marus25): v1.12.0 |
1. Install Python3 (needed for west and helper scripts)
sudo apt install python3 python3-pip python3-venv -y
3. Setup Virtual Enviroment
python3 -m venv ~/mba117xl-env source ~/mba117xl-env/bin/activate
2. Install Arm GNU Toolchain Download from: https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads
sudo apt install gcc-arm-none-eabi
3. Install CMake
sudo apt install cmake -y
4. (Optional) Install SEGGER J-Link for Debugging
Clone the TQMa117xL demo repository:
mkdir -p ~/workspace/NXP cd ~/workspace git clone https://https://github.com/tq-systems/MBa117xL.SW.MCU.BSP.git cd MBa117xL.SW.MCU.BSP git checkout MBa117xL.SW.MCU.BSP.0003 -b tqma117xl-bsp
Clone NXP MCUXpresso SDK via West:
pip3 install west cd dependencies west init -m https://github.com/NXPmicro/mcux-sdk --mr MCUX_2.16.000 mcuxsdk cd mcuxsdk west update
cp ../replace_include_guards.py ./
After downloading the SDK from NXP using West, the Python script replace_include_guards.py must be run once. This is required because targets set to global cannot be built in the same build folder due to the existing include guards in the CMake files in the NXP SDK.
cd ..
python3 replace_include_guards.py
VS-Code additional step:
When using Visual Studio Code as your development environment, the `.vscode` folder plays a critical role in configuring how your project is built and debugged.
These files inside the `.vscode` folder are specific to your local development environment.
.vscode/ ├── settings.json → Environment vars and toolchain path ├── launch.json → Debug configuration (e.g. for J-Link) ├── cmake-variants.yaml → Build variants (Debug/Release + bootDisk)
Place the `.vscode` folder under:
mv ~/workspace/MBa117xL.SW.MCU.BSP/templates .vscode
You can use the templates provided in the `templates/` folder of the repository as a starting point. Open VS-Code
code .
After fulfilling the preparations, VS-Code should be displaying the CMake-Tools option on the lower bar. In order to build a target, select the build variant by clicking on the corresponding option. You can also select your target by clicking on "set default build target".
Click after selection of the desired options on "Build" to build your target(s).
Optionally you can choose the target within the CMake-menu-bar.