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?

  • Thats some commendable work you have done. Its awesome. The only problem with using mc hck is that you cant buy it off the shelf. You need to make the boards and then you have the chicken and egg problem and without having a bus pirate or bus blaster or Jlink lite there is no other way to program the Mc hck.

  • I believe the McHck folks are working on an [url=https://mchck.org/blog/2013-08-13-self_hosted_toolchain_the_mc_hck_as_swd_adapter/]Arduino sketch bitbang implementation[/url]. Personally, I'm adding the MKL2/MK20 chip to my existing design. The key in my mind is their SWD implementation is simple and readable, as compared with something like OpenOCD which has layers and layers of support for stuff like JTAG that I don't need.

  • 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.

  • i'm totally new to this ble ... bacon lettuce and eggs :)

    and ordered an mbed eval board, hopefully arriving tomorrow ... so sorry if i'm not totally up on it.

    i work now for more than a year on lpc1347 and lpc1549 parts in c++ with lpcxpresso ... FREE

    lpcxpresso supports as a debug interface a CMSIS-DAP device and the mbed board supposedly also supports CMSIS-DAP

    now the thought was, this could be a way to write code for the nrf51xxx in lpcxpresso (eclipse based ... runs on windows and even faster under linux).

    this nrf51xxx eval board costs about $ 60 and lpcxpresso is free ... up to 256 k of code size or so and the code gcc produces is at least as good as the one from keil.

    if you don't want to use this nrf51xxx mbde board and are just looking for a SWD debug jig, then the lpc-link2 cost about $25 and supports natively the lpc-link2 usb interface to lpcxpresso and if you want to use CMSIS-DAP you can download the free lpc-tool and load a CMSIS-DAP image as an alterantive solution into the lpc-link2 SWD debug jig ... this way you can run the keil compiler with it

    as i said previously, i do not have the nrf51xxx mbde board yet and can't verify this claim

    anyone already working with it could add a few comments to this post ... i will continue, once i have figured out more

    one more thought without offending anyone i hope ... free ... what is it ... if you spend 2 days plus on getting some free debug stuff to work versus spending $ 25 or $ 60 (which you need to get the bt stack image) and compare this to going out a couple times for dinner :)

    cheers, efiLabs

    guess what, i got the board and here is the 1st part of the story ... not too glorious

    i assumed that i would get a product key to be able to download header files and the sdk or whatever to be able to write code ... nada

    yes you can make an led blink with using mbed to compile and receive a hex file to go-no-go test download like 30 years ago.

    i'll see if nordic provides any usable customer support since i purchased a nordic semi product already.

    is there a $ 100 price limit which you have to exceed to be allowed to download the necessary files to be able to write code and if you purchase a $ 60 nrf51822-mkit you do not qualify ...

    i don't get it. i'm waiting and will see if it's worth to consider nordic as a vendor for ble enabled embedded products

    cheers, efiLabs

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

    openocd.zylin.com/

Related