Chat
Ask me anything
Ithy Logo

Unlock Advanced Debugging: Configuring Your Segger J-Link with the CY8CKIT-062S2-43012

A step-by-step guide to seamlessly integrate the powerful Segger J-Link debugger with your Infineon PSoC 62S2 Wi-Fi BT Pioneer Kit.

segger-jlink-cy8ckit-062s2-config-whnls4hg

The Infineon CY8CKIT-062S2-43012 PSoC 62S2 Wi-Fi BT Pioneer Kit is a versatile platform for developing cutting-edge IoT applications. While it includes an onboard KitProg3 debugger, many developers prefer the advanced capabilities and performance of a Segger J-Link debugger. This guide provides a comprehensive walkthrough for configuring your Segger J-Link to work effectively with this powerful kit.


Key Configuration Highlights

  • Hardware Connection is Crucial: Proper connection via the Serial Wire Debug (SWD) interface, including SWDIO, SWCLK, GND, and VTarget, is fundamental for successful debugger operation.
  • Software and IDE Synergy: Utilizing the latest Segger J-Link software and a compatible Integrated Development Environment (IDE) like ModusToolbox is essential for a smooth debugging experience.
  • Correct Device and Core Selection: Accurately specifying the PSoC 62 MCU (e.g., CY8C624ABZI-S2D44 or CY8C6xx7_CM4 for the Cortex-M4 core) within your IDE's debug configuration is vital for communication.

Understanding Your Tools: The Kit and the Debugger

The CY8CKIT-062S2-43012 Pioneer Kit

The CY8CKIT-062S2-43012 features the PSoC 62S2 MCU, which boasts a dual-core Arm architecture (Cortex-M4 and Cortex-M0+), 1MB of Flash memory, and extensive peripherals, including Wi-Fi and Bluetooth connectivity provided by the Murata 1LV Module (CYW43012). This makes it an ideal choice for complex embedded systems. The kit comes with an integrated KitProg3 programmer/debugger, but for enhanced debugging features, an external debugger like the Segger J-Link is often preferred.

Infineon CY8CKIT-062S2-43012 PSoC 62S2 Wi-Fi BT Pioneer Kit

The Infineon CY8CKIT-062S2-43012 Pioneer Kit.

The Segger J-Link Debugger

Segger J-Link debug probes are renowned for their high performance, extensive feature set, and broad MCU support. They typically connect to target devices via SWD or JTAG interfaces. For the PSoC 62S2 MCU, SWD is the standard. J-Link offers faster debugging speeds, an unlimited number of breakpoints in Flash memory (with J-Flash), and advanced features like Real-Time Transfer (RTT) for efficient data logging and visualization.

Segger J-Link On-Board (OB) on a Cypress Development Kit

Conceptual representation: A Segger J-Link OB, similar to external J-Link probes, integrated on a Cypress development kit.


Prerequisites for Configuration

Before you begin, ensure you have the following hardware and software components ready:

Hardware Requirements

  • CY8CKIT-062S2-43012 PSoC 62S2 Wi-Fi BT Pioneer Kit: The target development board.
  • Segger J-Link Debugger: A compatible J-Link model (e.g., J-Link BASE, J-Link PLUS, J-Link ULTRA+, J-Link PRO, J-Link EDU Mini). Ensure its firmware is up-to-date, as older J-Link versions (like v8) might have limited or no support for the Cortex-M4 core in PSoC 6 MCUs.
  • USB Cable: To connect the J-Link debugger to your computer and to power the Pioneer Kit.
  • Appropriate Debug Cable/Adapter: Typically a 10-pin Cortex Debug connector or individual jumper wires for the SWD interface.

Software Requirements

  • Segger J-Link Software and Documentation Pack: Download the latest version from the Segger website. This package includes drivers, J-Link Commander, J-Flash, J-Link GDB Server, and other utilities.
  • Integrated Development Environment (IDE):
    • Infineon ModusToolbox™ Software: This is the recommended IDE for PSoC 6 development and offers excellent integration with Segger J-Link.
    • Other compatible IDEs: ARM Keil MDK (uVision), IAR Embedded Workbench for Arm (EW-ARM), or Eclipse-based IDEs with GNU Arm Embedded Toolchain and Segger J-Link plugins. Note that PSoC Creator primarily supports the onboard KitProg3 and MiniProg3, so exporting projects to one of these other IDEs is necessary when using an external J-Link.
  • Board Support Package (BSP) for CY8CKIT-062S2-43012: Usually obtained through ModusToolbox or from the Infineon website.

Step-by-Step Configuration Guide

Follow these steps to configure your Segger J-Link debugger for use with the CY8CKIT-062S2-43012 kit.

Step 1: Hardware Connection

Connecting J-Link to the Pioneer Kit

The CY8CKIT-062S2-43012 provides a debug connector for external debuggers. This is often a 10-pin Cortex Debug connector (0.05" pitch) typically labeled, for example, as J8 or P6 on similar PSoC 6 kits, or it might be accessible via specific SWD jumper headers. Consult your kit's user guide for the exact location and pinout of the SWD connector.

Connect the Segger J-Link to the SWD interface on the Pioneer Kit using the appropriate cable. The essential connections are:

  • SWDIO (Serial Wire Data Input/Output): Connect to the J-Link's SWDIO pin.
  • SWCLK (Serial Wire Clock): Connect to the J-Link's SWCLK pin.
  • GND (Ground): Connect to the J-Link's GND pin.
  • VTref / VTarget (Target Voltage Reference): Connect to the J-Link's VTref pin. This allows the J-Link to sense the target's operating voltage (typically 3.3V for this kit).
  • (Optional) SWO (Serial Wire Output): For trace capabilities, connect to J-Link's SWO pin if your J-Link model and application support it.
  • (Optional) nRESET (Target Reset): Connect to J-Link's nRESET pin for hardware reset control.

SWD Pinout Summary Table

The following table provides a general SWD pinout for a standard 10-pin Cortex-M debug connector. Always verify with your specific board's documentation.

Pin (10-pin Connector) Signal Name Description
1 VTref / VCC Target Voltage Sense
2 SWDIO / TMS Serial Wire Data / JTAG Test Mode Select
3 GND Ground
4 SWCLK / TCK Serial Wire Clock / JTAG Test Clock
5 GND Ground
6 SWO / TDO Serial Wire Output / JTAG Test Data Out
7 KEY / NC Key (No Pin) / No Connect
8 NC / TDI No Connect / JTAG Test Data In
9 GNDDetect Ground Detect (optional)
10 nRESET / RTCK Target Reset / JTAG Return Test Clock

Note: Ensure the JTAG/SWD selection on your J-Link (if applicable) is set to SWD mode.

Powering the Board

Connect the CY8CKIT-062S2-43012 kit to a power source using its USB connector or an external 3.3V supply as specified in the kit's documentation. The J-Link's VTref pin must detect the target voltage for proper operation.

Disabling/Bypassing Onboard KitProg3 (If Necessary)

In some cases, the onboard KitProg3 debugger might conflict with an external J-Link. If you encounter issues, you may need to disable or bypass the KitProg3. Refer to the CY8CKIT-062S2-43012 user manual for instructions on how to do this. This might involve changing jumper settings or physically removing certain components if you intend to permanently use an external debugger. For instance, on some kits, specific jumpers switch the debug lines between the onboard and an external debugger.

Step 2: Software Installation

Install Segger J-Link Software

If you haven't already, download the "J-Link Software and Documentation Pack" from the official Segger website (www.segger.com/downloads/jlink/). Install it on your development machine. This package includes the necessary drivers, J-Link Commander (a command-line utility for testing and configuration), J-Flash (for programming flash memory), and the J-Link GDB Server (for IDE integration).

Step 3: IDE Configuration

The process for configuring your IDE will vary slightly depending on the software you are using.

Using Infineon ModusToolbox™ Software (Recommended)

  1. Create or Import Project: Open ModusToolbox and either create a new project for the CY8CKIT-062S2-43012 or import an existing one.
  2. Open Debug Configurations: Navigate to the debug configuration settings. This is typically done by right-clicking your project and selecting "Debug As" -> "Debug Configurations..." or via a dedicated debug icon/menu.
  3. Create a New J-Link Configuration:
    • Create a new debug configuration. Select "GDB SEGGER J-Link Debugging" or a similar option.
    • Main Tab: Ensure your project and C/C++ Application (e.g., the .elf file) are correctly specified.
    • Debugger Tab:
      • J-Link Device name: Select the specific PSoC 62 device. This might be listed as "CY8C624ABZI-S2D44" (the MCU on this board), a generic "CY8C62xx", or by its core, such as "CY8C6xx7_CM4" for the Cortex-M4 core. Accurate device selection is critical.
      • Interface: Set to "SWD".
      • Speed: Start with a moderate speed like 4000 kHz (4 MHz). You can adjust this later if you encounter stability issues (lower speed) or want faster performance (higher speed, if supported reliably).
      • Ensure the path to the J-Link GDB Server executable is correctly configured if required.
    • Startup Tab: Configure reset options, initial breakpoints (e.g., at `main`), and load behavior as needed.
  4. Apply and Debug: Save the configuration and start a debug session.
ModusToolbox IDE Interface

A representative view of an IDE like ModusToolbox, where debug configurations are set up.

Using Other IDEs (e.g., Keil uVision, IAR EW-ARM, Eclipse)

  • Export Project (if from PSoC Creator): If your project was created in PSoC Creator, use the "Project -> Export to IDE" feature to generate project files for Keil, IAR, or a generic Makefile for Eclipse.
  • Keil MDK (uVision):
    1. Open "Options for Target..." -> "Debug" tab.
    2. Select "J-LINK / J-TRACE Cortex" from the dropdown list of debuggers.
    3. Click "Settings" next to it. In the J-Link Target Driver Setup dialog, ensure SWD is selected and the correct PSoC 6 device is chosen or configured.
  • IAR Embedded Workbench for Arm:
    1. Go to "Project" -> "Options..." -> "Debugger" category.
    2. Select "J-Link/J-Trace" as the Driver.
    3. Under "Setup" (or "Connection" tab for J-Link), configure the connection type (SWD) and select the appropriate device from the list or via a device description file.
  • Eclipse with GNU ARM Eclipse Plugins:
    1. Install the Segger J-Link GDB server plugin if not already present.
    2. Create a new debug configuration under "GDB SEGGER J-Link Debugging."
    3. Configure the path to `JLinkGDBServerCL.exe`, the device name (e.g., `CY8C624ABZI-S2D44`), interface (SWD), and connection speed.

Step 4: Verifying Connection and Device Selection

Using J-Link Commander

Before diving into IDE debugging, you can use J-Link Commander to test the physical connection and J-Link's ability to communicate with the PSoC 6 MCU.

  1. Open J-Link Commander from your Start Menu or by running `JLink.exe` from the installation directory.
  2. Type `connect` when prompted.
  3. You will be asked to specify the device. Enter the appropriate device name (e.g., `CY8C624ABZI-S2D44` or `PSoC 62 CY8C62...`). If unsure, you can type `?` to list supported devices or select from a GUI if it appears.
  4. Select `S` for SWD interface.
  5. Specify the target interface speed (e.g., `4000` for 4 MHz).
  6. If successful, J-Link Commander will report information about the connected CPU (e.g., Arm Cortex-M4 core ID, DPIDR). You can then try commands like `r` (reset and halt), `mem32` (read memory), etc.

Example J-Link Commander session startup:

SEGGER J-Link Commander V7.xx (Compiled Apr xx 2025 xx:xx:xx)
DLL version V7.xx, compiled Apr xx 2025 xx:xx:xx

Connecting to J-Link via USB...O.K.
Firmware: J-Link V11 compiled Feb 28 2025 15:36:05
Hardware version: V11.00
S/N: XXXXXXXX
License(s): RDI, GDB
VTref=3.300V

Type "connect" to establish a target connection, '?' for help
J-Link>connect
Please specify target interface:
  J) JTAG (Default)
  S) SWD
TIF>S
Specify target interface speed [kHz]. <Default>: 4000 kHz>
Device>CY8C624ABZI-S2D44  // Or similar PSoC 6 device name
Connecting to target via SWD
InitTarget() start
Found SW-DP with ID 0x6BA02477
Scanning AP map to find all available APs
AP[2]: Stopped AP scan as AP IDR is 0x00000000
AP[0]: AHB-AP (IDR: 0x84770001)
AP[1]: APB-AP (IDR: 0x54770002)
Iterating through AP map to find AHB-AP to debug
AP[0]: Core found
AP[0]: AHB-AP ROM base: 0xE00FF000
CPUID register: 0x410FC241. Implementer code: 0x41 (ARM)
Found Cortex-M4 r0p1, Little endian.
...
J-Link>
    

This confirms basic hardware and driver setup is working.

Handling Device Protection

PSoC devices can have various protection settings (e.g., eFuses) that might prevent debugging. If the device is locked, J-Link tools may offer an option to unprotect or erase it. This usually involves erasing the entire flash memory, so proceed with caution and ensure you have backups of any important data or firmware.


IDE Debugging Capabilities Comparison

When using a Segger J-Link with your PSoC 6 kit, different IDEs offer varying levels of integration and ease of use. The radar chart below provides a conceptual comparison of popular IDEs based on factors relevant to J-Link debugging with PSoC 6 devices. These are qualitative assessments based on general developer experiences.

This chart illustrates that ModusToolbox generally offers strong, dedicated support for PSoC 6 and good J-Link integration, while Keil and IAR are powerful alternatives with excellent debugging features, particularly well-regarded in the Arm ecosystem. Eclipse provides flexibility but might require more manual configuration.


Visualizing the Configuration Workflow

The following mindmap illustrates the key stages and considerations involved in configuring your Segger J-Link debugger for use with the CY8CKIT-062S2-43012.

mindmap root["Segger J-Link with CY8CKIT-062S2-43012"] id1["Prerequisites"] id1a["Hardware"] id1a1["Pioneer Kit"] id1a2["Segger J-Link (Updated FW)"] id1a3["Cables (USB, SWD)"] id1b["Software"] id1b1["Segger J-Link Pack"] id1b2["IDE (ModusToolbox, Keil, IAR)"] id1b3["BSP for Kit"] id2["Hardware Setup"] id2a["Connect J-Link to Kit SWD Port"] id2a1["SWDIO, SWCLK, GND, VTref"] id2b["Power On Pioneer Kit"] id2c["Bypass/Disable KitProg3 (if needed)"] id3["Software & IDE Configuration"] id3a["Install J-Link Software & Drivers"] id3b["Configure IDE Debug Settings"] id3b1["Select J-Link as Debug Probe"] id3b2["Specify Target Device (PSoC 62)"] id3b3["Set Interface to SWD"] id3b4["Configure Connection Speed"] id4["Verification & Debugging"] id4a["Test with J-Link Commander"] id4b["Handle Device Protection (if any)"] id4c["Start Debug Session in IDE"] id4c1["Flash Firmware"] id4c2["Set Breakpoints"] id4c3["Step Through Code"] id4c4["Inspect Variables & Memory"] id5["Troubleshooting"] id5a["Check Connections"] id5b["Verify J-Link Firmware"] id5c["Consult Kit/J-Link Documentation"] id5d["Check IDE/Compiler Error Logs"]

This mindmap provides a high-level overview of the entire process, from initial preparations to active debugging and potential troubleshooting steps.


Programming and Debugging with ModusToolbox

ModusToolbox is Infineon's preferred development environment for PSoC MCUs, offering a comprehensive suite of tools for configuring hardware, developing firmware, and debugging applications. The video below provides an introduction to programming and debugging within the ModusToolbox ecosystem, which is highly relevant when using a Segger J-Link.

This video, "Welcome to Modus Toolbox: #4 Program & Debug," explains how to use various debugger hardware, including Segger J-LINK and Cypress KitProg, within ModusToolbox. It covers fundamental debugging functions like programming the device, running code, setting breakpoints, and stepping through execution. Understanding these basics within ModusToolbox will greatly aid your use of the Segger J-Link with the CY8CKIT-062S2-43012 kit.


Frequently Asked Questions (FAQ)

Q: Can I use Segger J-Link directly with PSoC Creator?
Q: What if my J-Link doesn't connect to the PSoC 6 target?
Q: Which core of the PSoC 62S2 (Cortex-M4 or Cortex-M0+) does the J-Link connect to?
Q: How can I get debug trace information using Segger J-Link?

Recommended Further Exploration


References


Last updated May 19, 2025
Ask Ithy AI
Download Article
Delete Article