1
\$\begingroup\$

I've been working at this for days with not much information out there to assist me in fixing my issues, so I figured I'd make a post here.

I'm using a cheap chinese nRF51822 module and motherboard that I bought on AliExpress, and programming it in Keil uVision5 with an ST-link (or other non-JLink SWD device). How do I get the official Nordic Semiconductor examples to work and have the device show up on bluetooth?

\$\endgroup\$
4
\$\begingroup\$

I'd advise you constult the 'BLE examples' section in the SDK documentation to choose an appropriate example based, then follow these steps. I've chosen the Heart Rate Sensor example to run through here.

  1. With the Keil pack installer, ensure you have the appropriate devices, drivers and example packs installed.
  2. In the Pack installer, choose an example that uses the 'S110' soft device, and corresponds to an example you've found in the SDK. Choose the 'PCA100028' version.
  3. Click 'Copy' to create a local copy of the project. It should open by default once you choose a location.
  4. Once open, select the 'flash_softdevice' target from the dropdown.
  5. Change the target options to use the appropriate programmer in the correct mode.
  6. Change the flash download options to do a full chip erase. (You may also need to change the programming algorithm to 'nRF51xxx External Connection Board' for it to program without error.)
  7. Confirm the options then flash the soft device to the board (You shouldn't need to compile anything at this point).
  8. Change the target from the drop-down menu back to the example: e.g. 'nrf51422_xxac_s110' (The chip name is wrong, but it will still run fine since the nRF51822 supports the s110 soft device)
  9. Set up the st-link debugger as you did before, except leave the programming algorithm as the 'nrf51xxx', and ensure it's only set to 'Erase Sectors' with the 'Reset and Run' active.
  10. Compile the project and load program onto the board.
  11. At this point, if you have the module attached to the motherboard, you should see One active LED and one flashing LED. The flashing LED indicates the device is ready for connection. You can connect to the device using the nRF mobile apps.

Feel free to add comments if you stumble across this and find problems of your own!

\$\endgroup\$
  • 1
    \$\begingroup\$ Thank you a lot for your answer! I was finally able to run an application and you probably saved me days of frustration and searching. I couldn't comment on your post or send you PM so I'm trying to thank you like that :) \$\endgroup\$ – Surcouf Nov 21 '18 at 21:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.