Debugging an LPC810 Breakout Board via SWD/J-Link

I’m playing with a LPC810 Breakout Board connected with the IAR EW IDE via a SEGGER J-Link debugger utilizing SWD. The J-Link is connected via a small 20 to 10-pin adapter board. Since I am unable to power the µC via the 3.3V J-Link pin (not sure why), I’m also using a USB connection with the PC to provide power to the board.

Contrary to the User Manual, I needed to enable the SWDIO and SWCLK pins on the LPC810 to get this to work. After compiling inside the IAR EW IDE, I upload the iHex format file to the µC via the FlashMagic program. When the debugger is started, it outputs a warning about the target not having enough memory. I simply ignore the warning and it all seems to work okay. Debugging is with full symbol support, and I’m able to set breakpoints once inside the debugger.

In the picture, the µC is running a simplified version of a LED blink program.

LPC810 BoB J-Link SWD Debugging

About Jim Eli

µC experimenter
This entry was posted in Uncategorized and tagged , , , , , , , . Bookmark the permalink.

3 Responses to Debugging an LPC810 Breakout Board via SWD/J-Link

  1. Peter Jackson says:

    Thanks for posting your experiences with the LPC810 Jim. I’m trying to do something very similar but using the Keil uVision5 toolchain and a ULINK2 debugger. How exactly did you enable the SWD pins in your code prior to programming it in the LPC810 using FlashMagic?

    • Jim Eli says:

      The pins are enabled per the following code:

      // Name: LPC810_Blink.c
      // Purpose: LED Flasher
      // pin #8 set for LED


      int main(void) {
      //enable AHB clock to SWM & IOCON
      //enable SWCLK & SWDIO on PIO02 & PIO03
      PINENABLE0 &= ~((1<<(uint32_t)2) | (~0x1ff));
      PINENABLE0 &= ~((1<<(uint32_t)3) | (~0x1ff));
      //disable AHB clock to SWM


      • Jim Eli says:

        #define SYSCON_SYSAHBCLKCTRL (*((volatile unsigned int *)(SYSCON_BASE + 0x080)))
        #define SWM 7
        #define IOCON 18
        #define PINENABLE0 (*((volatile unsigned int *)(SWM_BASE + 0x1c0)))

Leave a Reply to Jim Eli Cancel reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s