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

Program bluetooth for nrf51822 yunjia board with STLink-v2

Hello everyone,

i'm kinda new to microcontroller programming and feel like i bit of more than i can chew. I bought a variant of the nrf51822 chip ( and thought it would be easier to get it to run with BLE.

For the start I wanted to run the example programs provided in Keil from Nordic, since I don't have the Nordic Developer board, programming seems to be a bit more challenging. Following different guides that support my available resources like STLink-V2, using SWD andOpenOCD seemed most promising. Using the following:

openocd -f interface/stlink-v2.cfg  -f target/nrf51.cfg   or
openocd cat -f C:/openocd/openocd-0.9.0/tcl/RIOT/boards/yunjia-nrf51822/dist/openocd.cfg


telnet 4444
nrf51 mass_erase
flash write_image erase "../ble_app_hrs.hex" 0

With this the nrf is programmed, I bought the BLE400 board later since I couldnt be sure that the programming worked and also because I thought it would make programming easier (what was wrong). The blinky example (\ARM\Device\Nordic\nRF51822\Board\PCA10001\blinky_example\arm\blinky.uvproj) is working, so I know the programming is ok.

What isn't working are bluetooth examples. I try to get ble_app_hrs.hex running, which as I understand needs the softdevice programmed additionally. I had some orientation from here:

But it seems softdevice (I tried s110_nrf51_8.0.0_softdevice.hex) just gets overwritten when using:

program softdevice.hex

program app.hex


or vice versa.

So the normal functionality of the bluetooth heart rate example doesn't seem to work, no leds are blinking. Functionality:

I don't get any errors, the programming seems to run normally. Does anyone have a tip how get BLE running on this chip?

Or do I have to buy a new programming device? A problem is that I do not have any debugging feedback to see what went wrong.

My setup:

image description

Chip description: N51822, QFAAC0, 1311AH

Parents Reply Children
No Data