Skip to content

ModusToolbox™ and VS Code: Create, Build, Flash, Debug

Companion videos

Watch on YouTube (opens in a new tab)

Videos by Thai Embedded Systems Association (TESA) · The whole series in the playlist AIoT Foundation

Course 1 · Module 2 Suggested time: about 2.5–3 hours (installing tools + creating a project + build / flash / debug) Format: a hands-on lesson — uses a real development machine and board

Lab · Cheatsheet · ← Table of Contents · ← M01 · M03 →

If you plan to build from open source (checked on 2026-09-26): the tesaiot-pse84-devkit-sdk README (commit ef72c1b) pins ModusToolbox™ to 3.6 only, with the Arm GCC 14.2.1 that ships with ModusToolbox, building with make build and flashing with make program. The firmware used in modules 3–8 of this course is distributed as ready-made HEX and is not yet open source. See the note in the Module 3 lesson and on the course page


By the end of this lesson you should be able to:

  1. Explain the role of ModusToolbox™ in creating and managing firmware projects on PSOC™ Edge
  2. Set up the Environment / Toolchain needed to build on your machine
  3. Use Visual Studio Code together with the ModusToolbox™ ecosystem to edit code, Build, and Debug
  4. Manage Project Configuration, Device / BSP Selection and Library Management at a practical level
  5. Connect the tools to real hardware to Flash and Debug until an example program runs

This module takes you from the architecture map in M01 to a real workflow: creating a project on the kit’s BSP, calling the SDK layers, and seeing code run on the board.

A note on versions Infineon’s manuals for PSOC™ Edge (such as the PSOC™ Edge quick start guide) usually recommend ModusToolbox™ tools 3.6 or newer. Treat the version your own lab pack specifies as authoritative; if it differs from the numbers in this lesson, follow the lab pack.

Document Use when
ModusToolbox™ software installation guide Installing for the first time on Windows / Linux / macOS
PSOC™ Edge quick start guide Checking the packages you should install for Edge
AN235935 — Getting started with PSOC™ Edge on ModusToolbox™ An overview of the tool architecture + the Hello World path
Visual Studio Code for ModusToolbox™ user guide (PDF) Opening a project in VS Code, build / program / debug
ModusToolbox™ tools package user guide Project Creator, Library Manager, configurators, the overall flow
mtb-example-psoc-edge-hello-world Infineon’s own Hello World example (tools 3.6+) — extra reference
TESAIoT Developer Hub The course’s main example library — Example Explorer, Code Editor, flowcharts, API Reference
Bitstream Studio A host / Digital Twin inside VS Code — Sensor Telemetry, Sensor Studio, connecting to a board or Simulator
TESAIoT_Hackathon The lab pack — HEX firmware, VSIX, the TESAIoT Flasher, web-app / BLE demos for flashing and practice

1. Why Two Tools: ModusToolbox™ and VS Code

Section titled “1. Why Two Tools: ModusToolbox™ and VS Code”

From M01 we already know that the TESA Firmware SDK is the set of libraries/APIs an app calls, while the development tools are a separate layer.

Tool Main role in this course Read more
ModusToolbox™ Installs the toolchain, creates projects from a BSP/template, manages libraries, opens configurators Tools package user guide
Visual Studio Code Writing code, IntelliSense, build/debug through the workflow ModusToolbox™ supports VS Code for ModusToolbox™
KitProg3 / OpenOCD (on the kit) Flashing and debugging on real hardware The Programming section of AN235935

Key phrase ModusToolbox™ creates projects and manages the toolchain/libraries — VS Code writes code and debugs — the SDK is the API the app calls.

Infineon supports several IDEs, including Eclipse, VS Code, IAR Embedded Workbench and Arm® MDK (µVision), plus CLI-based work. See the overview in AN235935 and the tools package user guide

This course focuses on the pairing of ModusToolbox™ + VS Code, because it is a common approach in modern learning and development teams, and has clear dedicated documentation.


2. ModusToolbox™ for Creating Firmware Projects

Section titled “2. ModusToolbox™ for Creating Firmware Projects”

ModusToolbox™ is not just an IDE installer, but a set of tools + libraries + a build system for developing apps on Infineon MCUs, including the PSOC™ Edge family.

Components you will use often in this course:

Component What it’s for Read more
Setup / tools package Installing base tools, GCC, programming tools Installation guide
Dashboard A starting point for opening tools and creating projects Linked from the Setup / docs of the installed version
Project Creator Creating an app from a BSP + code example / template Tools package user guide — Project Creator
Library Manager Adding, removing, updating a project’s libraries The Library management section of AN235935
Device Configurator Setting up pins, clocks, peripherals, then generating config code The Device Configurator guide in the tools package + make device-configurator
Build system (make) Compiling / programming / opening tools through standard recipes Tools package user guide

The product page and the main download point: ModusToolbox™ The Setup program is usually downloaded through the Infineon Development Center / Software Tools (the link in the VS Code user guide PDF points to softwaretools.infineon.com)

Section titled “2.2 Recommended Install Set for PSOC™ Edge”

Per the PSOC™ Edge quick start guide, in summary you should install at least:

  1. ModusToolbox™ Setup per the installation guide for your OS
  2. Arm® GNU Toolchain (GCC)
  3. The base tools package version that supports Edge (3.6+ per the quick start)
  4. An IDE of your choice — this course chooses VS Code (download VS Code if you don’t have it)
  5. The programming tools package, as offered by Setup
  6. (If needed) the Edge Protect Security Suite, or an ML pack such as DEEPCRAFT™ / the Machine Learning Pack — not required for the first Hello World

LLVM (optional) The quick start states that some work may need the LLVM Embedded Toolchain for Arm, which is not included in the standard Setup — install it additionally when your lab pack’s guide says to

Practical install tips (from Infineon installation guidance)

Section titled “Practical install tips (from Infineon installation guidance)”
  • Use the Setup program as the main method from version 3.2 onward, since it helps choose tools, IDE and toolchain as a set
  • If creating an app or adding a library reports a missing package, go back and open Setup / install the missing package (Project Creator and Library Manager usually warn when an asset is missing)
  • A network that blocks GitHub may affect pulling BSPs/libraries — see the proxy / manifest section of the installation guide and the Project Creator guide of the version installed

2.3 Creating a Project with Project Creator

Section titled “2.3 Creating a Project with Project Creator”

Project Creator has both a GUI and a CLI, installed under ModusToolbox™’s tools folder (such as .../ModusToolbox/tools_<version>/project-creator). Step-by-step detail is in the tools package user guide and the VS Code for ModusToolbox™ guide

The standard sequence:

  1. Open the ModusToolbox™ Dashboard, or open Project Creator directly
  2. Choose the Kit / BSP that matches the board in hand, such as the KIT_PSE84_EVAL family you have
  3. Choose a starting code example or template
    • Course recommendation: open an example from the TESAIoT Developer Hub (filter by Board / Domain to match your kit), then download or open it per your lab pack’s guide
    • A vendor alternative: Hello World for PSOC™ Edge, when you want to compare against Infineon’s raw example
  4. In the Target IDE, choose Visual Studio Code / Microsoft Visual Studio Code so the workspace file and related config are generated
  5. Give a destination folder, then let the tool clone the BSP/template and pull the needed libraries from the manifest

Expected result:

  • A project structure ready for the make system
  • The libraries/BSP already pulled in
  • A *.code-workspace file for VS Code

The course’s example library: TESAIoT Developer Hub Infineon’s own combined example library (extra): Code Examples for ModusToolbox™ Software

2.4 Typical Application Structure (Mental Model)

Section titled “2.4 Typical Application Structure (Mental Model)”

The real structure depends on the template, but the concept is usually similar:

my-app/
├── *.code-workspace # opened with VS Code
├── Makefile / makefiles # ModusToolbox™'s build system
├── main.c / source/ # your app code
├── deps / libs / bsps ... # pulled-in libraries and BSP (folder names vary by version)
├── configs / design.modus # config from the Device Configurator (if any)
└── build/ # build output (created when compiling)

Professional practice

  • Edit product code at the app layer; make a habit of not editing inside library folders
  • Add/update dependencies through the Library Manager
  • Commit only what the team agrees on (some teams don’t commit the whole libs folder — per team policy)

Before you can build, the machine needs at least:

Component What it’s for Reference
ModusToolbox™ tools Project Creator, Library Manager, make recipes, OpenOCD, etc. Installation guide
Arm GNU Toolchain (GCC) Compiling C code into a binary for Cortex-M Edge quick start
VS Code + extensions Editing and debugging VS Code guide
USB access for KitProg Letting the host see the debugger on the board AN235935 — Programming and Debugging
A terminal emulator Viewing UART logs from an example The Hello World example’s README often recommends one, such as Tera Term
Bitstream Studio (recommended install) A host app in VS Code — Sensor Telemetry / Sensor Studio / a digital twin connected to the board after flashing Marketplace — TERNIONDEV.bitstream-studio
The TESAIoT_Hackathon pack Ready-made HEX, the TESAIoT Flasher, a backup VSIX, web-app demos github.com/drsanti/TESAIoT_Hackathon

ModusToolbox™’s build system expects to find the tools package at the standard install path. If it is installed in the wrong place, or several versions overlap, you often see:

  • make cannot find the compiler
  • The configurator won’t open
  • Program/debug fails even though the board is plugged in

Basic troubleshooting steps:

  1. Reinstall or repair through the Setup / installation guide
  2. Open a terminal from the workflow the VS Code / tools package documentation recommends
  3. In the project folder, try a standard target, such as make help or make build (target names may differ by template — check the project’s Makefile)
Section titled “3.3 Optional: J-Link Instead of On-board KitProg”

The Edge quick start states the SEGGER J-Link alternative:

  1. Install the J-Link software and note the path
  2. Edit the BSP file (such as bsp.mk) and add BSP_PROGRAM_INTERFACE=JLink
  3. If installed outside the standard path, add MTB_JLINK_DIR=..., for example
    • Windows: C:/Program Files/SEGGER/JLink_V852
    • macOS: /Applications/SEGGER/JLink_V852
    • Linux: /opt/SEGGER/JLink_V852

Most people use the on-board KitProg first — switch to J-Link only when needed.


4. Using VS Code with the SDK (Edit, Build, Debug)

Section titled “4. Using VS Code with the SDK (Edit, Build, Debug)”

The main documentation for this section: Visual Studio Code for ModusToolbox™ user guide · PDF

The standard sequence:

  1. Create a project with Project Creator, choosing VS Code as the target, or create one and obtain the workspace file
  2. Open VS Code by hand
  3. Open the {project-name}.code-workspace file in the project folder

Don’t just open a random subfolder and lose the task / launch configuration — open the workspace file the tool created for you. More detail is in the “Using the code example” section of several repos, such as the Hello World docs flow

Infineon’s VS Code guide references:

  • The ModusToolbox™ Assistant extension/workflow (depending on the version) to help create apps and open tools
  • Cortex-Debug for extra Cortex-M debugging capability in VS Code

If your lab pack states a locked set of extensions — install per that list so you can:

  • Create/open apps from VS Code
  • Run build / program / debug configurations
  • Open the Device Configurator and other tools from the helper panel

Whether you press a button in VS Code or use a terminal, the same principle applies: it calls the project’s make system that ModusToolbox™ set up. See the build/program/debug overview in the tools package user guide

What to check when a build succeeds:

  • No errors from the compiler / linker
  • An output file exists in the build folder as the template defines it
  • After changing the BSP/a library, it still builds again
Action Meaning
Program / Flash Writing firmware into the device’s memory
Debug Usually includes programming, then halting at a breakpoint / stepping through code via GDB + OpenOCD or another probe

AN235935 states that ModusToolbox™ supports an OpenOCD + GDB server, and probes such as KitProg3 or J-Link. For a standalone PSOC™ Programmer (program/erase/verify/read), see Infineon’s Programming tools documentation that comes with Setup.


5. Project Configuration, Device Selection, and Library Management

Section titled “5. Project Configuration, Device Selection, and Library Management”

The BSP (Board Support Package) tells the project:

  • Which chip/board is being used
  • How pins and on-board devices are mapped
  • Which libraries must be pulled in at a minimum

Choosing the wrong BSP when creating a project = the code may still build, but the LED/UART pins won’t match the real thing.

A simple rule: choose the BSP that matches the kit plugged in. Reference kit examples: KIT_PSE84_EVAL · the PSOC™ Edge E84 page

An example Device Support Library on GitHub: mtb-dsl-pse8xxgp

Open it from the IDE workflow, or from the project folder:

Terminal window
make device-configurator

Per the VS Code for ModusToolbox™ guide, it is used to:

  • View/enable peripherals
  • Set up pins, clocks, DMA, etc.
  • Generate config code that links into the build
  • Open other related configurators (such as CAPSENSE™, QSPI) that the BSP supports

Each resource you open usually has a link to related API documentation.

For PSOC™ Edge: setting up and initialising most peripherals is designed to be done through the configurator + PDL (review M01 §7–8). In M02, practise “opening and recording the config” before writing deeper Drivers in M03.

The Library Manager helps you:

  • Add middleware / libraries
  • Remove unused ones
  • Update versions per Infineon’s manifest on GitHub

Use it when you need an extra feature, such as retarget-io (UART printf), abstraction-rtos, connectivity — don’t copy libraries randomly from another project. See the library management explanation in AN235935

Before deciding the project is ready to keep developing:

  • The BSP matches the kit
  • It opens in VS Code through .code-workspace
  • The build succeeds
  • You know how to open the Device Configurator and the Library Manager
  • You know which file/folder the app code is in

  • The PSOC™ Edge kit you’re using (such as KIT_PSE84_EVAL)
  • A USB cable that can power and talk to KitProg
  • (If any) a UART port per the kit’s guide — some kits use USB-UART through KitProg

Infineon kits usually have an on-board programmer called KitProg. ModusToolbox™ expects KitProg3 (CMSIS-DAP), which is faster than HID mode in many cases, as explained in the VS Code / tools guides.

If the kit is old, or the firmware doesn’t match:

  • Use fw-loader, which ships with ModusToolbox™, to update KitProg
  • On Linux, you may need to install udev rules before first using fw-loader

Read the KitProg section of the VS Code user guide PDF and AN235935 for details

When choosing to use ready-made firmware (not building from source at that point), or when you need the matching flasher / VSIX installer, use the pack from:

TESAIoT_Hackathon

Folder in the repo What it’s for
hex/ The DevKit’s .hex files — flash before the hardware lab
flasher/ The TESAIoT Flasher installer (Windows / macOS / Linux)
vsix/ Bitstream Studio’s .vsix (an install alternative outside the Marketplace)
web-app/ HTML telemetry examples for practice after connecting to the host

Match the VSIX with the HEX version per the repo’s README recommendation (see the latest entry in the firmware manifest, when present)

Other flashing options in this course: ModusToolbox™ Program from a project you build yourself (the previous section), or the TESAIoT Flasher + HEX from this repo.

6.4 First Success Criteria (Hello World Path)

Section titled “6.4 First Success Criteria (Hello World Path)”

The minimum goal of M02:

  1. Build the example project successfully or successfully flash a HEX from the lab pack
  2. Successfully program the board
  3. See confirmable behaviour, such as a blinking LED, and/or a message on the serial terminal / telemetry in Bitstream Studio
  4. Open a debug session, at least halting at main or a simple breakpoint (when using the build-from-source path)

The course’s reference path (code examples): TESAIoT Developer Hub The lab-pack reference path (HEX / Flasher / demos): TESAIoT_Hackathon The vendor’s reference path (extra): mtb-example-psoc-edge-hello-world + the steps in AN235935

Once you meet this bar, you are ready for M03 to call the Driver API systematically.

Symptom What to check Read more
The board doesn’t appear / won’t program The USB cable, port, KitProg3, drivers, try another port KitProg / fw-loader in the VS Code guide · Hackathon troubleshooting
The build can’t find the toolchain Install GCC/tools per Setup, open the correct terminal Installation guide
The build succeeds but nothing happens on the board The BSP doesn’t match the kit, it hasn’t been programmed yet, you’re watching the wrong LED/UART Check the BSP against the kit’s page
Debug won’t connect OpenOCD/KitProg, close programs holding the port, check the launch config Cortex-Debug + the VS Code guide
No message over Serial The baud rate, the COM port, the example has no retarget-io/UART yet The code example’s README
Flashing the HEX gives no telemetry The VSIX and HEX are mismatched versions, the baud isn’t 921600, you haven’t Linked in Bitstream Studio yet The TESAIoT_Hackathon README

Once the project is ready, you are standing on the same stack you learned in M01:

VS Code (edit / build / debug)
│
ModusToolbox™ tools (create, libraries, configurators, OpenOCD)
│
Application → Utility / Driver API (the TESA Firmware SDK in this course)
│
BSP / PDL / HAL (Device Support)
│
PSOC™ Edge hardware
  • M02 makes you ready to create and run a project on real tools
  • M03 will have you call the Driver API on that project, deliberately

Review the software layers: M01 — Software Ecosystem · Device Support Library (pse8xxgp)


  1. ModusToolbox™ creates projects from a BSP/template and manages the toolchain / libraries / configurators
  2. The right environment = tools + GCC + VS Code + KitProg access
  3. Open the project through the .code-workspace, then build/debug per the Infineon workflow
  4. The BSP must match the kit; use the Device Configurator and Library Manager as the main path
  5. Flashing + debugging on real hardware is this module’s pass criterion
  1. Do the hands-on exercise: Lab
  2. Keep the summary sheet: Cheatsheet
  3. When ready, continue to M03 — GPIO and Basic Peripherals (M03 lesson)

  1. ModusToolbox™ product page
  2. ModusToolbox™ software installation guide
  3. ModusToolbox™ tools package user guide (PDF)
  4. PSOC™ Edge quick start guide
  5. AN235935 — Getting started with PSOC™ Edge E8 MCU on ModusToolbox™ (PDF)
  6. Visual Studio Code for ModusToolbox™ user guide · PDF
  7. PSOC™ Edge E84 product page
  8. KIT_PSE84_EVAL evaluation kit
  1. TESAIoT Developer Hub — Example Explorer, flowcharts, API Reference (the course’s main example source)
  2. mtb-example-psoc-edge-hello-world — an extra Infineon example
  3. Code Examples for ModusToolbox™ Software
  4. mtb-dsl-pse8xxgp (Device Support Library)
  1. Visual Studio Code · Download · Docs
  2. Cortex-Debug extension (GitHub)
  3. SEGGER J-Link (optional probe)
  4. LLVM Embedded Toolchain for Arm (optional)
  5. OpenOCD / KitProg3, per your kit’s guide
  1. Bitstream Studio — Visual Studio Marketplace (TERNIONDEV.bitstream-studio) — a VS Code extension for Sensor Telemetry, Sensor Studio, a 3D digital twin, and a host connecting to firmware on TESAIoT / PSoC Edge (USB / Wi‑Fi / MQTT, or a Simulator)
  1. TESAIoT_Hackathon (GitHub) — HEX firmware (hex/), the TESAIoT Flasher (flasher/), VSIX (vsix/), web-app telemetry demos (web-app/) for hands-on practice

Three short questions in quiz.yaml, one per objective of this lesson. Try answering them yourself first, then compare with the answer key and explanations in the file.

Continue hands-on at Lab: create, build, flash and debug a firmware project

Lab · Cheatsheet · ← Table of Contents · ← M01 · M03 →

Try the real thing on the TESAIoT Dev Kit: open examples on the Developer Hub to read the code, download it, or flash ready-made firmware.

Review questions

Answer on your own first, then open the answer.

  1. เครื่องมือใดทำหน้าที่ “สร้างโปรเจกต์จาก BSP/template และจัดการ toolchain / library” (Objective 1)

    1. VS Code
    2. KitProg3
    3. TESA Firmware SDK
    4. ModusToolbox™
    Show answer

    Answer: D. ModusToolbox™

    Key phrase ของหัวข้อ 1: ModusToolbox™ สร้างโปรเจกต์และจัดการ toolchain/library, VS Code ใช้เขียนโค้ดและ debug, SDK คือ API ที่แอปเรียกใช้

  2. ข้อใดเป็นเงื่อนไขที่บทเรียนย้ำว่า “ต้องตรง” ก่อนคาดหวังผลบนบอร์ด (Objective 2)

    1. ต้องใช้ J-Link แทน KitProg เสมอ
    2. BSP ต้องตรงกับคิตที่ใช้
    3. ต้องใช้ IAR Embedded Workbench
    4. ต้องติดตั้ง Blender
    Show answer

    Answer: B. BSP ต้องตรงกับคิตที่ใช้

    Module Summary ข้อ 4: BSP ต้องตรงคิต และตาราง 6.5 ก็ชี้ว่า BSP ผิดคิตเป็นสาเหตุแรกของอาการ build ผ่านแต่บอร์ดเงียบ

  3. Flash HEX แล้วแต่ไม่มี telemetry ใน Bitstream Studio ตารางในหัวข้อ 6.5 ชี้สาเหตุใด (Objective 3)

    1. ยังไม่ได้ติดตั้ง Arm MDK
    2. BSP มี LED มากเกินไป
    3. ต้องใช้ LLVM แทน GCC
    4. VSIX กับ HEX คนละเวอร์ชัน, baud ไม่ใช่ 921600 หรือยังไม่ Link
    Show answer

    Answer: D. VSIX กับ HEX คนละเวอร์ชัน, baud ไม่ใช่ 921600 หรือยังไม่ Link

    แถวสุดท้ายของตาราง 6.5 Troubleshooting Quick Table

Cite this lesson

If you teach from this lesson or reuse it in slides or documents, credit it with the text below. If you changed it, add (adapted) after the title.

"ModusToolbox™ and VS Code: Create, Build, Flash, Debug" from TESA Open Knowledge by the Thai Embedded Systems Association (TESA), https://github.com/tesaiot/tesa-qualification-program, licensed under CC BY-NC 4.0

Thai attribution: "ModusToolbox™ และ VS Code: สร้าง build flash debug" จาก TESA Open Knowledge โดยสมาคมสมองกลฝังตัวไทย (Thai Embedded Systems Association: TESA) https://github.com/tesaiot/tesa-qualification-program สัญญาอนุญาต CC BY-NC 4.0

Lesson link: https://tesaiot.github.io/tesa-qualification-program/en/courses/firmware-sdk-edge-ai/m02-toolchain/l01-modustoolbox-and-vscode/

This lesson adapts the source below; keep its credit too.
https://github.com/drsanti/TESAIoT-Courses/blob/287c21814ba8c75f693136616dcd270349a15966/C1/M02/README.md · Original content by Asst. Prof. Dr. Santi Nuratch (ผศ.ดร.สันติ นุราช), KMUTT. Course 1 (C1/) of drsanti/TESAIoT-Courses. TESA funded the work and holds the rights; published here under CC BY-NC 4.0. The upstream repository carries no licence file. Text kept faithful; structure, front matter, quizzes and notes added by TESA Open Knowledge.

Full guide: how to cite TESA

TESA Open Knowledge · © 2026 สมาคมสมองกลฝังตัวไทย (TESA) · CC BY-NC 4.0

Content is licensed CC BY-NC 4.0. Reuse it non-commercially and credit the Thai Embedded Systems Association (TESA) every time. · How to cite TESA