DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
11 Monitoring and Observability Tools for 2023
Learn more
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Maintenance
  4. Using LPCXpresso V2/V3 Boards to Debug an External Board

Using LPCXpresso V2/V3 Boards to Debug an External Board

The LPCXpresso V2/V3 boards can be used to debug external custom boards. This guide walks through the setup and procedure using the LPCXpresso's LPC-Link-2 circuit.

Erich Styger user avatar by
Erich Styger
·
May. 15, 17 · Tutorial
Like (1)
Save
Tweet
Share
4.21K Views

Join the DZone community and get the full member experience.

Join For Free

The MCUXpresso IDE (see MCUXpresso IDE: Unified Eclipse IDE for NXPs ARM Cortex-M Microcontrollers) has one great feature: It includes debug support for the popular LPC-Link2 debug probes. That way, I have yet another powerful debug probe with extra features for ARM-based boards. That LPC-Link2 circuit is present on many LPCXpresso boards from NXP. So why not use it to debug it my custom hardware?

Debugging Custom Hardware with LPCXpresso Board

Debugging custom hardware with the LPCXpresso Board

This article describes how to use an LPCXpresso V2/V3 board to debug another board using the LPCXpresso board's LPC-Link-2 circuit. You need:

  • LPCXpresso V2/V3 board, e.g. LPCXpresso54102
  • 10pin SWD/JTAG cable
  • 1 jumper
  • Target board with a Kinetis or LPC microcontroller on it
  • Needed USB cables to power the two boards
  • Debugger and IDE, e.g. MCUXpresso IDE

Unfortunately (as for Freescale/NXP for the Tower/Freedom boards) the documentation about how to use the board to debug another board is nearly non-existent and hard to find.

LPC-Link2

The LPC-Link2 debug probe from NXP is an inexpensive debug probe. I love it because of its cost (around $20).

LPC-Link2 Debug Probe

LPC-Link2 debug probe

With the MCUXpresso IDE, I can use it to debug both the LPC and Kinetis microcontroller:

LPC-Link2 with CMSIS-DAP debugging Robot

LPC-Link2 with CMSIS-DAP debugging robot with a Kinetis microcontroller

There are several features in MCUXpresso IDE that are only available with using an LPC-Link (or LinkServer) debug probe, such as the ‘LinkServer GUI Flash programmer’. This is a ‘standalone’ flash programmer that I can use to flash/program any binary file (.elf, .axf, .bin) to a board:

LinkServer GUI Flash Programmer

LinkServer GUI flash programmer

But here is my problem: I only have a single LPC-Link2 debug probe/board. And I left it on my desk at the university. What can I do? Take a two-hour commute back to the university to get it? Luckily, I read somewhere that it should be possible to use an LPCXpresso board as an LPC-Link2 debug probe to debug another board. And I was lucky to have one at home from my multicore debugging experiments!

I have used the NXP Freedom boards already to debug another board (see Using the Freescale Freedom (FRDM-KL43Z) to Debug other Boards), so this should be possible with the LPCXpresso boards too, right?

There are several LPCXpresso boards available, and only the V2 and V3 boards have the LPC-Link2 debug probe on it. I have the LPCXpresso54102 (Evaluation board OM13077), which is a V3:

LPCXpresso54102 Board

LPCXpresso54102 board

The board has an LPC4322JET100 on it, which acts as debug probe:

LPC4322 acting as LPC-Link2

LPC4322 acting as LPC-Link2

The board has a 10pin SWD debug header (upper left corner in above picture) to use a normal external debug probe to debug the target processor on the LPCXpresso board. Similar to the Freedom boards, it should be possible to use that header to debug an external board, yes?

The schematics have the needed information:

LPCXpresso54102 Schematics

LPCXpresso54102 Schematics

The following shows the DEFAULT setting:

Default Jumper Position

Default Jumper Position

To use the SWD debug header (U2), there are two jumpers to control the settings:

  • JP1: This jumper isolates the debug lines (SWDCLK, RESET and SWO) between the LPC-Link2 and the onboard microcontroller. Put a jumper on JP1 to debug an external processor.
  • JP2 controls the power to the ‘buffers’ plus the power on the pin 1 to the SWD connector. The buffers (74LVC1T45GW) are in fact level shifters, translating the levels for the SWD/JTAG signals between the LPC-Link2 (3.3V) and the debug target/microcontroller. The location of the jumper of the JP2 can be used in two positions:
    • 1-2 (default): VDD_LPC54102 (default 3.3V, but can be 1.8V too, see JP7) powers the buffers/level shifter, plus providing power to pin 1 of the SWD header. They are between the onboard LPC device and the SWD header pins. Around 100mA of power can be provided. Have jumper on 1-2 to power the external board, if the external board is using same voltage as VDD_LPC54102.
    • 2-3 (recommended): In this position, the target board power is used to power the level shifter through pin 1 of the SWD header. Have jumpers on 2-3 if the target board has a different voltage level than the LPCXpresso board, or if the target board is powered separately.

My recommendation is to put a jumper on JP1 and use JP2 on 2-3 (or remove the JP2 jumper and use JP1). That way, power is *not* provided to the external board. Instead, the target board voltage level is used to safely do the level shifting. Connect a standard SWD cable to U2 (pay attention to pin 1):

Debug External Board with Power Sense

Debug an external board with Power Sense

Connection to Target Board

Connect the SWD/JTAG cable to the target board SWD/JTAG, and power the target board:

Debugging NXP FRDM-K64F with MCUXpresso Board

Debugging NXP FRDM-K64F with the MCUXpresso Board

If the other board (in my example, the NXP FRDM-K64F) has a debug circuit like OpenSDA or another LPC-Link2 on it, make sure it does not use the SWD/JTAG lines at the same time. That depends on the debug firmware running on that circuit, too. So in the above case, I’m powering the board on the target USB connector, not on the OpenSDA one.

Now I’m able to debug the other board using the LPC-Link2 on the LPCXpresso board:

Debugging the FRDM-K64F with the LPCXpresso54102 Board

Debugging the FRDM-K64F with the LPCXpresso54102 Board

I can use the debug circuit on an LPCXpresso V2/V3 board, which is basically the same as the ‘external’ LPC-Link2 debug probe. All that I need are two jumper settings and an SWD/JTAG cable. Compared to the NXP Freedom/Tower boards, this is much simpler (no soldering required) but it's barely documented. I hope, with this guide, you can now enable the LPCXpresso board to debug your custom Kinetis or LPC board.

It is possible to load the Segger J-Link firmware on the LPC-Link2 circuit (see https://www.segger.com/lpc-link-2.html). But with this, only LPC (not Kinetis) devices are supported. And the legal terms only allow to use it with evaluation boards, not for custom boards.

Happy LPCLinking!

Debug (command)

Published at DZone with permission of Erich Styger, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Accelerating Enterprise Software Delivery Through Automated Release Processes in Scaled Agile Framework (SAFe)
  • 5 Common Firewall Misconfigurations and How to Address Them
  • The Beauty of Java Optional and Either
  • DeveloperWeek 2023: The Enterprise Community Sharing Security Best Practices

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: