Using J-Link with Infineon ModusToolBox AI Assistant
Infineon ModusToolbox AI Assistant is an extension for Visual Studio Code from Infineon Technologies that provides AI coding agents with hardware-specific context for Infineon microcontrollers. It analyzes the ModusToolbox workspace locally and supplies the AI agent with information about the target device, the board support package (BSP), installed libraries, code examples, and available tools, so that generated code matches the actual hardware.
J-Link provides the connection between the ModusToolbox project and the target system. ModusToolbox can use J-Link for programming and debugging directly from Visual Studio Code, so code generated with the AI Assistant can be programmed and verified on the target hardware.
Integration status: Programming and debugging available through the J-Link support in ModusToolbox; the assistant's built-in fault analysis does not yet support J-Link (workaround via J-Link Commander available). Evaluation in progress.
Overview
| Component | Description |
|---|---|
| Development tool | ModusToolbox AI Assistant (Infineon Technologies), Preview |
| Integration type | ModusToolbox J-Link launch configurations (J-Link GDB Server) |
| User interface | Visual Studio Code chat (GitHub Copilot Chat, agent mode); instruction files are also generated for Cursor and Windsurf |
| AI model | Any model available in the VS Code chat, including models connected with an own API key and self-hosted models |
| Supported debug interfaces | SWD |
| Required SEGGER software | J-Link Software and Documentation Pack |
| Validation status | Under evaluation |
Supported workflows
The following workflows are available when using the ModusToolbox AI Assistant with J-Link:
| Workflow | J-Link interface | Description |
|---|---|---|
| Hardware-aware code generation | – | The AI agent receives device, BSP, library, and peripheral context from instruction files, skill files, and a local MCP server, and builds the application with the ModusToolbox build system. |
| AI-assisted project creation | – | The agent drafts a project plan from a description or an existing project and creates the ModusToolbox project after approval. |
| Program the target | J-Link (ModusToolbox J-Link configuration) | Program the application from Visual Studio Code. |
| Debug the application | J-Link GDB Server | Set breakpoints, step through the code, and inspect registers and memory in the VS Code debug session (Cortex-Debug). |
| Fault analysis and variable access | J-Link Commander (workaround) | The built-in fault-analysis workflow requires OpenOCD. As a workaround, the agent runs J-Link Commander to halt the target, read the fault registers, and read or write variables. See Fault analysis with J-Link Commander. |
How the integration works
The AI Assistant provides the project context, while programming and debugging use the standard J-Link support of ModusToolbox:
- Add AI Enhancements deploys instruction files, skill files (
.github/skills/mtb-*), and documentation into the workspace. A local MCP server provides device, BSP, library, and build information to the AI agent. - The AI agent in Visual Studio Code plans and implements the requested changes and builds the application.
- ModusToolbox programs and debugs the application through its J-Link launch configurations, which use the J-Link GDB Server.
Prerequisites
Before getting started, make sure the following components are available:
- A J-Link debug probe or a board with an onboard J-Link
- A target device of a family supported by the AI Assistant: PSOC Edge E84, PSOC Control C3, PSOC 4 HV, or TRAVEO T2G
- J-Link Software and Documentation Pack, Visual Studio Code 1.85 or later, ModusToolbox tools package 3.7 or later, and Python 3.9 or later
- The VS Code extensions ModusToolbox for VS Code, ModusToolbox AI Assistant, GitHub Copilot Chat, and Cortex-Debug
- Access to an AI model in the VS Code chat, either through a GitHub Copilot plan or an own model
- Internet access to github.com
- An SWD connection between J-Link and the target, and target power
The Add AI Enhancements function requires the GitHub Copilot Chat extension, even if a different model is used. A GitHub sign-in is not required when the model is connected with an own API key or a self-hosted endpoint.
Tested setup
The following reference configuration was used to evaluate this integration:
| Component | Version or configuration |
|---|---|
| ModusToolbox AI Assistant | 0.6.0 (Preview) |
| ModusToolbox for VS Code | 1.12.1 |
| ModusToolbox tools package | 3.9 |
| Visual Studio Code | 1.130.0 |
| J-Link Software and Documentation Pack | V9.84 |
| J-Link model | J-Link Ultra V8.0 |
| Development board | PSOC Control C3M6 Evaluation Kit (KIT_PSC3M6_EVAL) https://www.infineon.com/evaluation-board/KIT-PSC3M6-EVAL |
| Target device | PSC3M6GES3AH |
| Debug interface | SWD |
| Host operating system | Windows |
| Compiler and version | GCC from the ModusToolbox installation |
| AI agent and model | GitHub Copilot Chat (agent mode) with a self-hosted Qwen 27B model connected via custom endpoint |
| Example project | ModusToolbox FreeRTOS blinky code example for KIT_PSC3M6_EVAL, extended by an AI-generated counter task |
Getting started
1. Install the software
Install the following software:
- J-Link Software and Documentation Pack
- ModusToolbox Setup program. In the Setup program, select the latest ModusToolbox Tools package. The version of the Setup program itself is independent of the tools package version.
- The VS Code extensions: Run
ext install InfineonAG.modustoolbox-aiin Quick Open (Ctrl+P), which also installs ModusToolbox for VS Code. Then install GitHub Copilot Chat and Cortex-Debug from the Extensions view.
2. Select the AI model
Select the model in the model picker of the chat input field. Without a GitHub Copilot plan, add an own model with Chat: Manage Language Models, for example with an own API key or a self-hosted, OpenAI-compatible endpoint. The model must support tool calling to be available in agent mode. For details, see AI language models in VS Code.
3. Create the ModusToolbox project
Connect the board to the host computer.
Then:
- Open the ModusToolbox panel from the Activity Bar in Visual Studio Code.
- Select Create Project and then Guided Setup.
- Select the BSP of the connected kit and a template, for example a FreeRTOS blinky example.
- Create the project and open the workspace.
Alternatively, select Use AI to Assist to let the agent plan and create the project from a description. In this case, configure J-Link afterwards as described in step 4.
4. Configure J-Link as the programming interface
If the BSP uses KitProg3/MiniProg4 by default, switch the project to J-Link. Add the following lines to the bsp.mk file of the application:
BSP_PROGRAM_INTERFACE=JLink MTB_JLINK_DIR=C:/Program Files/SEGGER/JLink
Then run make vscode in a ModusToolbox terminal to regenerate the VS Code configuration. Verify that J-Link launch configurations are available in the Run and Debug view.
5. Build, program, and debug without AI

Build the application, program it to the target, and start a debug session before using the AI Assistant. This verifies the toolchain, the J-Link connection, and the target independently of the AI workflow.
Commit the working project to version control. This makes it easy to review and revert the changes made by the AI agent.
6. Add the AI enhancements

After the baseline project works:
- Open the Application tab in the ModusToolbox panel.
- Select Add AI Enhancements.
- If the AI Assistant reports a missing
openocd.tcland offers to runmake vscode, confirm. Back up manually modified files in the.vscodefolder first. - Check the folder
.github/skills. For a supported device, it contains device-specificmtb-*skills.
Projects configured for J-Link do not contain an
openocd.tcl file. The AI Assistant may therefore continue to report the missing file. Code generation, skills, and builds are not affected.7. Start an AI-assisted workflow

Open the chat view (Ctrl+Shift+I), switch to Agent mode, and select the model. Describe the required change and ask the agent for a plan before it modifies files.
For example:
Add a second FreeRTOS task to this project that prints a counter over
the debug UART once per second. Keep the existing LED blink task
unchanged.
Use the BSP's debug UART definitions and the libraries already in the
project. If a library is missing, tell me which one and how you would
add it before changing anything.
Use the ModusToolbox skills and project information available to you,
and tell me which ones you used.
First show me a short plan of which files and functions you will
change, and wait for my OK.
After my OK, implement it, run the ModusToolbox build, and fix errors
until it builds cleanly.Review the plan for device, drivers, and scope before approving it. After the agent has implemented and built the change, review the changes (for example with git diff), program the target using J-Link, and verify the behavior on the hardware. Report unexpected behavior to the agent and repeat the test. This creates a closed-loop workflow in which the AI-generated code is verified on the actual target hardware.
If the application does not behave as expected:
After your change the LED no longer blinks and no counter output
appears on the UART. Compare main.c with the last git commit, find what
your edit broke, fix it, build, and explain the cause.The agent displays the operations it intends to perform before executing them. Review all file changes and terminal commands before approving them.
Fault analysis with J-Link Commander
The built-in fault-analysis workflow of the AI Assistant currently requires OpenOCD. As a workaround, the AI agent can run J-Link Commander with a command file through the terminal of the VS Code chat. This workaround is not part of the ModusToolbox AI Assistant.
JLink.exe -device [J-Link device name] -if SWD -speed 4000 -autoconnect 1 -NoGui 1 -CommandFile cmds.jlinkReplace [J-Link device name] with the exact device name supported by the J-Link Software and Documentation Pack.
Example command file that halts the CPU and reads the CPU registers and the fault status registers CFSR, HFSR, MMFAR, BFAR, and SFSR:
connect
h
regs
mem32 0xE000ED28 1
mem32 0xE000ED2C 1
mem32 0xE000ED34 1
mem32 0xE000ED38 1
mem32 0xE000EDE4 1
exitExample prompt:
The target stopped responding. Use SEGGER J-Link Commander to inspect
it. Create a command file cmds.jlink that connects, halts the CPU,
reads the CPU registers and the fault status registers CFSR, HFSR,
MMFAR, BFAR, and SFSR, and exits. Run it with:
JLink.exe -device [J-Link device name] -if SWD -speed 4000 -autoconnect 1 -NoGui 1 -CommandFile cmds.jlink
Decode the fault registers, read the stacked PC from the exception
stack frame, and map it to the source line with arm-none-eabi-addr2line
on the ELF file.The same method can be used to read or modify application variables. The agent determines the variable addresses from the ELF file with arm-none-eabi-nm and uses mem32 to read and w4 to write them.
J-Link Commander is executed as a terminal command. Review and approve each command before execution, especially commands that modify the target, such as
w4, loadfile, or erase. Close active debug sessions first to avoid conflicting accesses to the target.Troubleshooting
| Problem | Possible cause | Solution |
|---|---|---|
| Add AI Enhancements reports that GitHub Copilot Chat is required | The GitHub Copilot Chat extension is not installed or not enabled, or AI features are disabled in VS Code | Install or enable GitHub Copilot Chat. Make sure that chat.disableAIFeatures is not set. If the setting is managed by the organization, contact the IT administrator.
|
Add AI Enhancements fails with command 'modusToolbox-ai.generateInstructions' not found
|
The ModusToolbox AI Assistant extension is not installed, not enabled, or not running in the current window | Run Extensions: Show Installed Extensions and Developer: Show Running Extensions from the Command Palette. Check the active VS Code profile, verify that Python 3.9 or later is installed, update both ModusToolbox extensions, and reload the window. |
| Message Missing openocd.tcl in workspace folder | The AI Assistant expects an OpenOCD configuration. Projects configured for J-Link do not contain openocd.tcl.
|
Confirm running make vscode. If the message remains, it can be ignored for code generation and builds. For fault analysis, use J-Link Commander as described in Fault analysis with J-Link Commander.
|
| AI suggestions are not hardware-aware or use outdated project information | The instruction files were not generated, or the workspace analysis is outdated | Run Generate AI Instructions or Reset MCP Cache from the Command Palette. Check the ModusToolbox AI Assistant output channel for errors. |
Support responsibilities
For problems related to the J-Link debug probe, target connectivity, device support, flash programming, or the J-Link GDB Server, contact SEGGER Support.
For problems related to the ModusToolbox AI Assistant, the ModusToolbox for VS Code extension, skills, the MCP server, the ModusToolbox build system, or generated source code, use the issue tracker of the ModusToolbox AI Assistant or contact Infineon Support.
For problems related to the AI model or the VS Code chat, contact the respective provider.
When reporting a problem, provide:
- J-Link serial number and model
- J-Link Software and Documentation Pack version
- ModusToolbox tools package version
- ModusToolbox AI Assistant and ModusToolbox for VS Code versions
- Visual Studio Code version and AI model used
- Host operating system
- Target device and board
- Debug interface
- Relevant log output, for example from the ModusToolbox AI Assistant output channel
- A description of the operation that failed
Limitations
- Supported device families are PSOC Edge E84, PSOC Control C3, PSOC 4 HV, and TRAVEO T2G. PSOC 6 and PSOC 4 are announced. For unsupported devices, the agent receives little or no device-specific context.
- PSOC Control C3 M8 (multi-core) is not yet supported (open request in the issue tracker of the ModusToolbox AI Assistant).
- The built-in fault-analysis workflow requires OpenOCD (open request in the issue tracker; Infineon is evaluating J-Link support). The J-Link Commander workaround does not cover breakpoints or single stepping, does not identify the faulting core on multi-core devices, and relies on the AI model to decode the fault registers.
- AI agents other than GitHub Copilot Chat, Cursor, and Windsurf require manual configuration.
- Prompts and code context are sent to the selected model provider unless a self-hosted model is used.
- AI-generated changes and target operations should be reviewed before execution. A successful build does not guarantee correct behavior on the target.
- Support for a J-Link device does not automatically imply that the complete ModusToolbox AI Assistant workflow has been validated for that device.
Related links
- J-Link product page
- J-Link Software and Documentation Pack
- J-Link Commander
- J-Link GDB Server
- Infineon PSC3
- Infineon KIT PSC3M6 EVAL
- AI-assisted Embedded Development
- ModusToolbox AI Assistant (Visual Studio Marketplace)
- ModusToolbox AI Assistant support repository
- Using J-Link with ModusToolbox in VS Code