This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Can I directly start programming a nrf51822 breakout board

Hi guys, I want to know if it is possible to get started on developing applications for nRF51822 without using the evaluation kit. I want ot have a couple of breakout boards made and buy a debugger to flash the code on the board. Is this even possible? Also are there are good docs which tell us how to get started?

Parents
  • A J-Link is not required. OpenOCD can speak SWD, given an appropriate adapter. I'm told that it can work with ST-Link, certain FTDI-based adapters, or a Linux system with accessible GPIO (say, a Raspberry Pi).

    I have only used it with an ST-Link myself (in this case, the ST-Link on an STM32F429 Discovery). I disconnected the ST-Link half of the board from the STM32 half of the board by removing the jumpers at CN4, and I connected the pins from the SWD header at CN2 to the nRF51822. Specifically, CN2 pin 1 (VDD_TARGET) was connected to my power source, pin 2 (SWCLK) to SWCLK on the nRF, pin 3 (GND) to ground, and pin 4 (SWDIO) to SWDIO on the nRF.

    Then invoke OpenOCD with:openocd -f interface/stlink-v2.cfg -f target/nrf51_stlink.tcl

    Then tools like GDB may interface with OpenOCD. target remote localhost:3333 to point GDB to it, and load whatever.elf to flash it. (Not sure yet how to flash a softdevice from GDB, but I will look into it.)

    Later update: For newer versions of OpenOCD (e.g. the git version as of right now) you need a line more like: openocd -f interface/stlink-v2.cfg -c"transport select hla_swd" -f target/nrf51.cfg. The section Flashing SoftDevice with OpenOCD at Hoan Hoang's page also gives the method he used to flash the SoftDevice using OpenOCD.

  • Thank you. Now it's possible to use JLink (and clones) SWD with openOCD using this patch

    openocd.zylin.com/

Reply Children
No Data
Related