hkn gravatar image

Posted 2014-06-25 15:45:41 +0200

blogs->nordicers

Using nRF51 SDK with the nRF51822 MBED Kit

Dependencies:

This blog post will not take installation of above dependencies into consideration.

Configuring a project for CMSIS-DAP debugger:

  1. Open a project in Keil, and go to Options for Target, and select CMSIS-DAP Debugger under the debug tab: image description

  2. Check that the "Use Debug Driver" is checked under Utilities tab: image description

  3. Now go into the debugger settings and verify that the nRF51xxx programming algorithm is chosen: image description

  4. Go to tab "debug" and see that the debugger and device is recognized and properly configured: image description

Loading Softdevice S110 v6 or older:

As the softdevice depends on writing to UICR in these versions, and the flash algorithm does not allow this, we must use the MBED enumerated drive to load the softdevice.

  1. Download the S110 softdevice from our website.

  2. Extract the content to your desired location.

  3. Copy the softdevice .hex file to the MBED enumerated drive X:\ (where X is the MBED drive for your specific computer)

  4. Once loaded, please follow the "configuring a project for CMSIS-DAP debugger" section for the s110 project of your desire.

Loading Softdevice S110 v7 or newer:

Since this version of the softdevice does not write into UICR, you have two options:

  1. Load it using the same option as for S110 <= v6

  2. Load it by creating an empty project, with the softdevice .hex file as the "Name of Executable" in Keil project settings. Copy the softdevice .hex file to the location of the newly created "empty" Keil project.

Troubleshooting:

  • I'm getting this error when trying to program the softdevice:

    Error: Flash Download failed - "Cortex-M0"

Try blanking the nRF device. This is done by holding in the RESET button for 5 seconds. The LED "LD3" will start blinking slowly, then faster. Hold the RESET button until the LED is continuously lit. Now the flash on the nRF should be completely erased.

Note: The softdevice is not erase-protected using these method, so do not choose "Erase Full Chip" under "Flash Download" section when developing your application! This behavior will change with future versions of the flash programming algorithm that is supplied with the nRF51 SDK installer.

6 comments

ruweibie gravatar image

Posted July 19, 2014, 5:41 p.m.

On step 4, my computer show this, keil doesn't provide any option in the drop down menu under CMSIS-DAP -JTAG/SW Adapterimage description

hkn gravatar image

Posted July 22, 2014, 9:21 a.m.

Hi Roy,

I had the same issue initially on my PC. Try downloading the mbed-drivers: https://mbed.org/handbook/Windows-serial-configuration

It should enumerate three devices:

  • mbed Serial Port
  • MBED CMSIS-DAP
  • HID-compliant device

See if these are present on your PC.

Best regards Håkon

sandys gravatar image

Posted Aug. 4, 2014, 1:22 p.m.

@hkn - can you comment if this (or a similar step) can be used to flash a nrf51822 breakout board ? I know that we also need to mergehex the softradio, but I dont know if I can use a Ulink/Stlink with the Keil to do that.

hkn gravatar image

Posted Aug. 4, 2014, 2:31 p.m.

I have not tested this procedure with any other debugger. It will work with the CMSIS-DAP. STlink and ULink should work, but it's untested from my end.

peteryeungct gravatar image

Posted Oct. 31, 2014, 4:45 a.m.

I had sent the softdevice S110v7.0.0 to mbed driver.

The start address is point to 0x00000050 when I try to start debug session for ble_app_beacon proj

Is there something I missed?

image description image description

jjww gravatar image

Posted July 8, 2015, 10:52 a.m.

I can download, softdevice and program can see service broadcasting but no connection is success.

Sign in to comment.

User menu

    or sign up

Recent questions

Related posts by tag