Table of Contents

Embedded module TQMa117xL

Building Examples (Visual Studio Code)

Preface

The following instructions describe how to build an example vith Visual Studio Code.

The instructions on this page refer to the TQMa117xL repository and ancillary tools listed in the following table:

Prerequisites

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

VS-Code-Extentions

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
Advice: Check if the 'Status-Bar-Visibility' option by the CMAKE extention is set to 'visible'.

Setup Host System and VS-Code

Setup Host

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

Setup Project

Setup Project

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
Afterwards, copy replace_include_guards.py into the same directory as the mcuxsdk.
ATTENTION: This step is absolutely necessary!
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 .

Building examples

Building

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.

The information provided on this wiki page is subject to change due to circumstances beyond our control. While we strive to keep all details as accurate and up-to-date as possible, it is possible that certain updates or changes may go unnoticed for some time. As a result, some sections of this page may contain outdated information. If you notice any mistakes in the documentation, we kindly ask you to inform the TQ Support through our ticket system.