Tagged: CMSIS-DAP

Beginning LPC1114FN28 with Arch Board

It’s cool that LPC1114FN28 based on ARM Cortex-M0 uses DIP package. We enjoy playing LPC1114 with a breadboard, wires, LEDs and etc. Programming LPC1114 is quite easy with an Arch board as a CMSIS DAP interface. To download a new binary into LPC1114 is just to drag-n-drop the binary file into “MBED” drive.

Setup Hardware

Use Arch board as an mbed interface and connect Arch with LPC1114 through SWD interface or UART interface.

Arch board LPC1114
P0_11 (A0) nRESET
P0_12 (A1) SWCLK
P0_13 (A2) SWDIO
P0_18 (D0) RXD
P0_19 (D1) TXD

Turn Arch into mbed Interface

The Arch board is an mbed enabled development board for rapid prototyping. It can also be used as a CMSIS DAP interface(SWD/JTAG debug adapter, USB to UART bridge). We just need a specific firmware.

  1. Download mbed interface firmware for Arch board.
  2. Connect Arch with PC, long press Arch’s button and replace firmware.bin with the new firmware in “CRP DISABLD” drive.
  3. Quick press the button. “MBED” drive will pop up.
  4. Install the mbed interface driver to enable USB to UART function

Develop

  1. In “MBED” drive, there is a “MBED.HTM” file which will lead to mbed.org.
  2. Add LPC1114FN28 to mbed compiler.
  3. On mbed compiler, it’s easy to write code, import libraries and share programs.
  4. Compile and download a binary into “MBED” drive. The program will run!

Resources

  1. CMSIS DAP interface
  2. Getting started with mbed LPC1114


Read more

nRF51822 with pyOCD and Arch Board

I’m quite excited that Bluetooth Low Energy (nRF51822) is comming to mbed. So I’m exploring what we can do with BLE (nRF51822). Preparing tools to get started with new things is always the beginning.

Here we use CMSIS-DAP and pyOCD. CMSIS-DAP is the software running on mbed interface to provide drag-n-drop, USB2UART communication and SWD debug. pyOCD is an Open Source python library or programming and debugging ARM Cortex-M microcontrollers using CMSIS-DAP.

First, use Arch as an mbed interface to run CMSIS-DAP.

  1. Download mbed interface firmware for Arch.
  2. Connect Arch with PC, long press Arch’s button and replace firmware.bin with the new firmware in “CRP DISABLD” drive on windows. use dd if=lpc11u24_nrf51822_if_mbed.bin of={path-to}/firmware.bin conv=notrunc on Linux/Mac
  3. Quick press the button. “MBED” drive will pop up.
  4. Install the mbed interface driver for windows to enable USB2UART function

CMSIS-DAP debug adapter

Second, setup pyOCD for nRF51822. We need pyOCD, pyUSB(Linux) or pyWinUSB(Windows) and flash_nrf51822.py

On Ubuntu

1
2
3
4
sudo apt-get install python-setuptools
sudo easy_install pyusb
sudo easy_install pyocd
wget https://github.com/xiongyihui/pyOCD/raw/master/util/flash_nrf51822.py

On windows, install pyWinUSB instread of pyUSB.

Third, flash softdevice hex file or application binary file to nRF51822.

The softdevice hex file include two parts — Code Region 0(CR0) and User Information Configuration Registers(UICR). Here we use arm-none-eabi-objcopy to divide the hex file into two binary files for CR0 and UICR. It’s done in flash_nrf51822.py, so we just need to keep arm-none-eabi-objcop in the PATH variable.

To flash softdevice hex, just run

1
sudo python flash_nrf51822.py -s softdevice.hex

To flash an application binary

1
sudo python flash_nrf51822.py -a {application.bin}



Read more