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 using it to debug it my custom hardware?
This article describes how to use an LPCXpresso V2/V3 board to debug another board using the LPCXpresso board 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-existing and hard to find.
The LPC-Link2 debug probe from NXP is an inexpensive debug probe. I love it because it is inexpensive (around $20).
With the MCUXpresso IDE I can use it to debug both LPC and Kinetis microcontroller:
There are several features in MCUXpresso IDE which are only available with using a LPC-Link (or LinkServer) debug probe, such as the ‘LinkServer GUI Flash programmer’. This is a ‘standalone’ flash programmer which I can use to flash/program any binary file (.elf, .axf, .bin) to a board:
But here is my problem: I only have a single LPC-Link2 debug probe/board. And that one I left on my desk at the university, but need now one at home. What can I do? Taking a +2h commute back to the university to get it? Luckily I read somewhere that it should be possible to use a LPCXpresso board as a 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?
There are several LPCXpresso boards available (see http://www.nxp.com/products/microcontrollers-and-processors/arm-processors/lpc-cortex-m-mcus/software-tools/lpcxpresso-boards:LPCXPRESSO-BOARDS), 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:
The board has a LPC4322JET100 on it which acts as debug probe:
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?
The schematics have the needed information:
The following shows the DEFAULT setting:
To use the SWD debug header (U2), there are two jumpers to control the settings:
- JP1: This jumper isolate 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 shifter, 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 provides power to the pin 1 of the SWD header. are between the on-board LPC device and the SWD header pins. Around 100mA of power can be provided . Have jumper on 1-2 to power external board and if 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 jumper on 2-3 if target board has different voltage level than the LPCXpresso board, or if 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 it 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 standard SWD cable to U2 (pay attention to pin 1):
Connection to Target Board
Connect the SWD/JTAG cable to the target board SWD/JTAG and power the target 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 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 🙂 :
I can use the debug circuit on a LPCXpresso V2/V3 board which is basically the same as the ‘external’ LPC-Link2 debug probe. All what I need are two jumper settings and a SWD/JTAG cable. Compared to the NXP Freedom/Tower boards this is much simpler (no soldering required), but 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, but not for custom boards.
Happy LPCLinking 🙂
- LPCXpresso boards: http://www.nxp.com/products/microcontrollers-and-processors/arm-processors/lpc-cortex-m-mcus/software-tools/lpcxpresso-boards:LPCXPRESSO-BOARDS
- LPCXpresso54102 Board: http://www.nxp.com/products/software-and-tools/software-development-tools/software-tools/lpcxpresso-boards/lpcxpresso-board-for-the-lpc54100-family-of-mcus:OM13077
- LPCXpresso54102 Schematics: http://www.nxp.com/assets/downloads/data/en/schematics/LPCX54102_Schematic_RevA1.pdf
- LPC-Link2 Debug Probe: http://www.nxp.com/products/microcontrollers-and-processors/arm-processors/lpc-cortex-m-mcus/lpc1100-cortex-m0-plus-m0/lpc-link2:OM13054