HW setup with an LPC-Link2 in CMSIS-DAP mode
Good post @aaribaud !

I'd like to comment that any 8-dollar Daplink from AliXpress is also a good option and it comes ready-to-use with PineTime (and other nRF52 boards). It can be managed with OpenOCD (and pyocd).

For the first time, nRF5x microcontrollers usually need to be erased. This step can be done with the next script (tested with OpenOCD 0.10), save it as 'flash_erase.cfg':

# flash_erase.cfg

source [find interface/cmsis-dap.cfg]
source [find target/nrf52.cfg]

nrf52.dap apreg 1 0x04 0x01
sleep 100

Connect the Daplink to the PineTime (GND, CLK, SWD, 3V3)  and simply execute from the command line:

openocd -f flash_erase.cfg

Disconnect the 3V3 (or the USB cable from computer) and connect again. Now, your PineTime is ready to be flashed with a fresh firmware.

I've tested pyocd runner with Zephyr:

cd $ZEPHYR_BASE/samples/basic/blinky
west flash --runner pyocd

Happy flashing!

Messages In This Thread
RE: HW setup with an LPC-Link2 in CMSIS-DAP mode - by caligari - 10-28-2019, 07:45 PM

Forum Jump:

Users browsing this thread: 1 Guest(s)