The nRF51822-mKIT is a low cost ARM mbed enabled development board for Bluetooth® Smart designs with the nRF51822 SoC. The kit gives access to all GPIO pins via pin headers …

Experiments with mbed code on non-mkit nRF51822 hardware

25 Feb 2016

So you can't longer flash with the use of BMP? Furthermore, how did you upload Softdevice to the chip. By flashing Softdevice through BMP and then your mBed code after through BMP? :)

Roger Clark wrote:

David

I bought some of these http://www.wireless-tag.com/index.php/Product/dis/25.html (from AliExpress). They come with some AT based command firmware, and they are read protected, so you need to clear them before you can use them, which I found a bit tricky to do, as JLink didnt seem to be able to communicate with device at all while it was read protected. From what I recall I ended up using my Black Magic Probe to write some values to specific memory locations which forced a total erase of the device (Sorry, I should have written down the link, but at the time I was so relieved to have not bricked the device, I didn't think to document what I'd done)

I then managed to get MBED to to work on that module, by selecting the HRM1017 module for the project, as that module doesn't have the 32kHz crystal either.

Unfortunately I've been so busy with work, that I've not had time to write any more blog entries or do any more YouTube videos.

I have enhanced my Arduino for NRF51822 repo and you can no upload to the Waveshare (http://www.waveshare.com/wiki/Core51822 ) module using JLink as well as Black Magic Probe, but I've not had time to publicise this on my blog etc :-(

BTW. The Wireless-tag modules are OK, but because they don't have the 32kHz crystal it makes them useless for a lot of low power applications, as the power consumption in sleep is much higher than the modules with the 32kHz crystal.

I actually ended up buying a bag of 32kHz crystals and some 12pF capacitors, which I solder onto those boards, so that they can be programmed via the Arduino IDE, but mainly to get the current consumption down.

25 Feb 2016

So you can't longer flash with the use of BMP? If so, do you know why and does ST-LINK still work? :)

09 Mar 2016

Hi All,

I have a few questions, I hope someone can help me with.

I have a ST Link device and a BLE 400 board with a nrf51822 board.

Do I need anything else to program it? Do I need to burn any firmware onto the nrf51822? And if so can I use the ST Link for this? Can I upload the program using mbed via the ST Link, or do I need to use OpenOCD?

Thanks again.

Kihon.

09 Mar 2016

Hello Kapila,

I think you should follow instruction from your board vendor: http://www.waveshare.com/wiki/BLE400 and here http://www.waveshare.com/wiki/NRF51822_Eval_Kit .

From my understanding, you can use nRFgo to program your board. The ST Link is not relevant here since there is no ST mcu involved.

09 Mar 2016

Hi again,

Thanks for the response. The Eval Board has a SWD port which I understand can be used to program the device via a ST Link device.

A blog post

http://icarus-sensors.github.io/general/starting-with-nRF51822.html

Seems to also suggest that it should be possible. In the post he uses OpenOCD to program the device. I was hoping someone here might have done something similar.

09 Mar 2016

Vincent

"The ST Link is not relevant here since there is no ST mcu involved."

The STLink can be used to program many non-ST devices, using Open OCD

I think people use the STLink as its cheap and easily available e.g. on eBay for less than $10

Personally I think using the Black Magic Probe is a better option

For a novice, I suspect using a Segger J-Link is the simplest option. (but not the cheapest, even if you buy an Educational version of JLink)

10 Mar 2016

Hi All,

Just a quick update.

I was able to program the NRF51822 on the BLE400 board using a ST Link V2 (clone) dongle.

Just wired up the 3v,GND, SWDIO and SWDCLK pins to the BLE400 SWD port, and loaded up OpenOCD.

Didn't have to upload any firmware etc, just uploaded the .hex file compiled through mbed.

10 Mar 2016

Another method: buy the arm debugger (http://www.waveshare.com/arm-debugger.htm) and follow procedure described in following page:

http://www.waveshare.net/wiki/ARM-Debugger-UF

Open the page in chrome, and let chrome translate it from Chinese(?) to English.

19 May 2016

I have a (recent) nRF51-DK & bought a couple of the Waveshare Core51822 breakout boards.

I'm hoping I can program this board with an mbed .hex file using the nRF51-DK (on Mac, not Windows), ideally via drag & drop like a normal mbed .hex upload. Happy to try installing other s/w if I need to, but can't be Windows s/w.

I'd like to use nRF51-DK P20 debug out connection ('in order to program shield mounted targets') (rather than the Debug out P19 header) as it's easier to connect jumper leads to. Docs say 'the Interface MCU will detect the supply voltage on the mounted shield and program/ debug the shield target'.

How should I connect it up? On the Core51822 I can see pins marked VDD, (2x) GND, SCLK, SDO On the nRF51-DK P20 there are: GND DETECT, RESET, SWO, SWD CLK, SWD IO, VTG, VDD, VnRF

Very new at this (although long time programming) so somewhat clueless, thanks for any help!

30 Jun 2017

Well, this thread is super old, but in case this helps anyone coming across this on a search:

I've used a handful of nRF51822's from ebay and aliexpress. They're all pretty much the same, just exposing different number of I/O pins. I've been able to program them using the mbed binary and OCD on a raspberry pi. Pretty much just need to hook up the GND, SWDIO, and SWDCLK on the nRF51822 module and you'll be able to flash it.

Super inexpensive!

26 Feb 2018

Hi guys,

for a long time I was trying to make this module work with mbed and finally I succeeded:

/media/uploads/danman/img_20180109_184545.jpg

/media/uploads/danman/img_20180224_100921.jpg

I am using PlatformIO and all what was needed was to set target board to BBC micro:bit in platformio.ini:

platform = nordicnrf51
board = bbcmicrobit
framework = mbed
upload_protocol = stlink
28 Aug 2018

Daniel Kucera wrote:

Hi guys,

for a long time I was trying to make this module work with mbed and finally I succeeded:

/media/uploads/danman/img_20180109_184545.jpg

/media/uploads/danman/img_20180224_100921.jpg

I am using PlatformIO and all what was needed was to set target board to BBC micro:bit in platformio.ini:

platform = nordicnrf51
board = bbcmicrobit{{/media/uploads/eddienuel/connecting_nrfdk_external_module.png}}

framework = mbed
upload_protocol = stlink

Hi Please i have 2 of this module you are holding in your hand in the image. I have tried programming it with the nrf51-DK, but after pushing in the hex it looks lifeless and wont advertise as it was meant to. Here is the diagram i used for my connection. please Help how were you able to successfully make yours work. Thanks

28 Aug 2018

/media/uploads/eddienuel/connecting_nrfdk_external_module.png

24 May 2019

Emmanuel Edwards wrote:

Hi Please i have 2 of this module you are holding in your hand in the image. I have tried programming it with the nrf51-DK, but after pushing in the hex it looks lifeless and wont advertise as it was meant to. Here is the diagram i used for my connection. please Help how were you able to successfully make yours work. Thanks

Hi Emmanuel, this answer comes probably too late for you but for reference I'll publish it. If you have the same variant as me "QFAAH2", this only has 16kB of RAM (see https://infocenter.nordicsemi.com/pdf/nRF51822_PS_v3.3.pdf?cp=4_4_0_0 page 76). nrf51-DK has 32kB which is required for running mbed 5 AKA mbed-rtos. If you want to use mbed 2, you need to use some other reference board for building, e.g. BBC:microbit.