MCUXpresso for VS Code: Create, Build, and Debug a new Project using AI

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

MCUXpresso for VS Code: Create, Build, and Debug a new Project using AI

MCUXpresso for VS Code: Create, Build, and Debug a new Project using AI

 

 

A step-by-step walkthrough of how to use Copilot chat to import a multi-task FreeRTOS example for the LPCXpresso55S69, building it, debugging it, and analyzing memory usage – all driven from a single natural-language prompt.

Introduction

This tutorial shows how GitHub Copilot AI, along with the MCUXpresso for VS Code extension, can drive a complete FreeRTOS workflow from natural-language prompts: importing an SDK example, building it, debugging it, and analyzing the resulting artifact.
 
Instead of clicking through views, wizards, and commands, an embedded software engineer describes the intended outcome in plain language and the agent orchestrates the extension's language model tools to carry out each step.

 

In this scenario, the engineer asks the MCUXpresso agent to accomplish an end-to-end task:
  • Get started quickly with a FreeRTOS example from MCUXpresso SDK.
  • Target the LPCXpresso55S69 board.
  • Import the new project as a freestanding example into the VS Code workspace, then build it. Freestanding will prompt for a folder to save the project.
  • Start debugging and automatically resume execution after 10 seconds.
  • Analyze the build artifact to see how much memory is used.
  • Open the linker file used to build the artifact.
The MCUXpresso agent decomposes this request into a sequence of tool calls – discovering boards and SDK revisions, listing suitable examples, importing the chosen example, building all configurations, launching and resuming the debug session, opening the Image Info view, and finally opening the linker script. The sections below follow that same order.
The MCUXpresso agent leverages skill files that outline how to perform actions through the extension's own tools, so the steps it takes maps directly to functionality you could also trigger manually from the MCUXpresso for VS Code UI.

System Architecture

FreeRTOS Multi-Task Example — LPCXpresso55S69
System Architecture Overview
Hardware
Host PC
MCUXpresso for VS Code
MCUXpresso Agent/Skills
 
 
USB
Debug Probe
On-board LinkServer
CMSIS-DAP
 
 
SWD
TARGET
LPCXpresso55S69
Runs FreeRTOS example

 

Component Description
Host PC Runs VS Code with the MCUXpresso for VS Code extension and the Copilot AI agent and skills. The agent properly imports the SDK example, builds it, launches the debug session, and opens the Image Info and linker views.
Debug Probe The on-board LinkServer / CMSIS-DAP debug probe on the LPCXpresso55S69. Bridges USB from the Host PC to the SWD debug interface of the target MCU, and hosts the GDB server used during debugging.
LPCXpresso55S69 Target evaluation board (LPC55S69 dual-core Arm Cortex-M33). Runs the FreeRTOS example with multiple tasks.

Getting started

The engineer describes the whole goal to the MCUXpresso agent in a single natural-language prompt, and the agent carries out each step below in order.

Prerequisites

This tutorial assumes the environment has already been prepared with the MCUXpresso Installer, which was previously used to install all required dependencies. Before starting you should have:
  • Visual Studio Code with the MCUXpresso for VS Code extension installed and activated, and GitHub Copilot Chat available.
  • All toolchain and tooling dependencies installed via the MCUXpresso Installer: the Arm GNU toolchain, LinkServer debug probe support, CMake and Ninja, and the west / SDK management tooling.
  • MCUXpresso SDK v26.06 installed via the extension.
  • One LPCXpresso55S69 board connected to the Host PC over USB (using the on-board LinkServer / CMSIS-DAP debug probe).
If any dependency is missing, the MCUXpresso agent can open the MCUXpresso Installer for you (see Troubleshooting).

 

Step 1 – Import a FreeRTOS example

The engineer opens Copilot Chat and describes the whole goal to in a single prompt – the board, the preferred kind of example (FreeRTOS, multiple tasks), the SDK version, and the follow-up actions.
kyledando_0-1790359170506.png
The engineer states the complete goal in natural language.

 

To satisfy the request, the agent first establishes the context and locates a suitable example using the extension's discovery tools:
  • mcuxpresso_listSupportedBoards – confirms the LPCXpresso55S69 is a supported board.
  • mcuxpresso_listRemoteRevisions – selects the requested MCUXpresso SDK v26.06 revision.
  • mcuxpresso_listSupportedExamples – finds a FreeRTOS example with multiple tasks (for example a freertos_generic example).
  • mcuxpresso_browseFolder – lets the engineer pick the destination folder for the imported example.
kyledando_1-1790359233665.png
Choosing where the example will be imported.

 

NP3_import_example_confirmation.png
The agent confirms the example selection before importing.

 

kyledando_3-1790359297280.png
The example is fetched and imported into the workspace.

 

Step 2 – Build the project

Once the example is imported, the agent builds it using mcuxpresso_buildProjectAllConfigs, which compiles all configured build configurations for the project.
kyledando_4-1790359323728.png
The agent triggers a build of all configurations.

 

After a successful build, the imported project is visible in the extension's Projects view, ready for debugging and further analysis.
kyledando_5-1790359349790.png
The built project appears in the Projects view.

 

Step 3 – Debug the project

The agent starts a debug session with mcuxpresso_startDebug. This launches the GDB server against the LPCXpresso55S69 through the on-board LinkServer / CMSIS-DAP debug probe, flashes the artifact, and halts at the program entry.

 

Because the engineer asked to automatically resume execution after 10 seconds, the agent then calls mcuxpresso_continueDebug to resume the program, letting the FreeRTOS tasks run on the target.
kyledando_6-1790359376528.png
The debug session starts, then execution is resumed automatically.
The complementary tool mcuxpresso_pauseDebug can halt the running program again if you want to inspect state after resuming.

 

Step 4 – Open Image Info

To analyze how much memory the firmware uses, the agent opens the Image Info view with mcuxpresso_openImageInfo. This inspects the build artifact and reports the memory footprint – the sizes of the code and data regions and how they map onto the device's flash and RAM.
NP-8_image_info_and_linker_script.png
Image Info reports the artifact's memory usage; the linker script is opened alongside it.

 

Step 5 – Open the Linker Script

Finally, the agent opens the linker file used to build the artifact with mcuxpresso_openLinkerScript. The linker script defines the memory regions and section placement referenced by the Image Info analysis, so the engineer can correlate the reported memory usage with the actual linker configuration (shown in the same screenshot above).

Verifying the Result

 The workflow is successful when all of the following hold:

  • The FreeRTOS example was imported and appears in the Projects view (you can also confirm with mcuxpresso_listProjectsFromWorkspace).
  • The build completed without errors and produced a build artifact.
  • The debug session started and execution was resumed after the requested delay.
  • The Image Info view shows the artifact's memory usage.
  • The linker script used for the build is open in the editor.

Videos

The following videos capture the steps for creating and debugging a project using AI in the MCUXpresso for VS Code extension.

1. Create and import a freestanding SDK project for your NXP board using Copilot in VS Code.

(在“我的视频”中查看)

2. Build, debug, and analyze memory usage for a FreeRTOS Hello World project with Copilot.

(在“我的视频”中查看)


Troubleshooting

Most issues in this workflow come from missing or incomplete dependencies. In almost all cases the fix is to (re)run the MCUXpresso Installer – the MCUXpresso agent can open it for you with mcuxpresso_openInstaller.

 

Symptom Likely cause Suggested action
Project was not imported A west tooling issue (missing or misconfigured SDK management tooling) Start the MCUXpresso Installer (mcuxpresso_openInstaller) and (re)install the SDK / west dependencies, then retry the import.
Build error A west issue, or no Arm GNU toolchain installed Start the Installer to install or repair the Arm GNU toolchain and build tooling, then rebuild.
No debug probe support LinkServer / debug probe support is not installed Start the Installer and install LinkServer / debug probe support, then reconnect the board.
Debug session does not start GDB server failed to launch, or probe/toolchain support is missing Inspect the GDB server terminal output for errors. If probe or toolchain support is missing, start the Installer to install it, then start debugging again.

标签 (1)
无评分
版本历史
最后更新:
星期一
更新人: