8 years, 9 months ago.

How to program or debug a microcontroller in Keil using SWDAP-LPC11U35?

I would like to use a SWDAP-LPC11U35 to program and various Cortex microcontrollers in Keil.

1) I know that to use drag and drop programming, the version of the DAPLink firmware being used must match the target system. Is it also required to program and debug in Keil?

2) I am used to program and debug microcontrollers with on board CMSIS-DAP interface (mbed LPC1768, NXP LCP800-MAX) in Keil. Is there anything I should do differently to use the SWDAP-LPC11U35 and a microcontroller without on board debug interface?

1 Answer

8 years, 9 months ago.

Hi Jasmin,

So this is a great question, i'd be happy to help :)

So the https:developer.mbed.org/platforms/SWDAP-LPC11U35/ is an external debug probe that allows the capability of drag and drop programming as per mbed, without the target device needing an interface.

This is particularly useful for your target if you want to save on complexity in the design and cost.

This debugger programs the 'target' via Serial Wire Debugging. I.e. requires SWDIO and SWDCK lines to program.

If you navigate to the page it shows prebuilt images:

Here this shows that currently the SWDAP can be used to program these target devices at an instance, you must flash one these images to the SWDAP to become that 'targets' 'interface'.

To program the SWDAP you must follow these steps:

When a new SWDAP is plugged in to your machine, it will not contain valid any firmware, and so will appear as a disk drive called "CRP Disabled" as.

  • Open the drive, and delete the file called "firmware.bin"
  • Download the required image from the table above (or built your own using DAPLink project)
  • Copy the .bin file onto the "CRP Disabled" drive.
    • On Windows, replace firmware.bin with the above firmware
    • On Linux/Mac, use command: dd if={new_firmware.bin} of={firmware.bin} conv=notrunc
  • Unplug your SWDAP, and plug it back in
  • It should now appear as a disk drive called DAPLink

Now, how do i add a target not listed for the SWDAP capability?

This is relevantly easy, this requires you to fork and create an entry in the DAPlink firmware, all the steps are there.

STEPS TO USE WITH MBED

  1. Obtain SWDAP, flash SWDAP with required firmware that enables flashing for target from list
  2. Set target in online IDE of offline as "SWDAP-LPC11U35" by adding to compiler
  3. Connect SWDAP to 'target' with SWD pins.
  4. Drag binary from computer to SWDAP "MBED" drive.
  5. Reset 'target', finished.

In terms of debugging i'd recommend looking at the identical DIPDAP, this is the same as the SWDAP but allows UART as well via 2.54mm headers.

If you need help with any of these steps, please let me know.

Regards,

Andrea, team mbed