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 …

Compiled fw no longer working on non-mKit

08 Dec 2014

Hi all,

I am unable to get my firmware working on non-mkit hardware. Up until September 17 it was working on this same hardware. If I load the .hex file from then, it works. But firmware compiled today doesn't work. Earlier, all I had to change was the LF clock source as my custom board doesn't have a 32k crystal. Unfortunately I am unable to revert my project to Sept 17 because it somehow links to a non-existent changeset of the nRF51822 library - perhaps I forgot to commit?

To isolate the problem I've tried creating a new project and copy-pasting my code. -> no success. Next I tried creating a fresh BLE_HeartRate project, and only changed the LFCLK source to synthesized from HF CLK (nRF51822 library code). -> no success. Finally I tried running just mbed_blinky with the appropriate LED pin for my board. Even that did not work.

All of this works fine when running on the mkit. I'm out of ideas!

Thanks.

09 Dec 2014

are you using the online IDE to build your projects? If using offline tools, please specify how you build. If using the online IDE, have you set the target platform correctly?

10 Dec 2014

Hi Rohit, I'm using the online IDE. The platform is set correctly to Nordic nRF51822.

11 Dec 2014

Hello Prashant,

You mentioned you are using "non-mkit" hardware. What kit are you using? How are you programming the part? What hardware?

If you are programming in a BTLE program you compiled locally, not in the the cloud then you need to also load the Softdevice as well as your application. Depending on the platform you are using you can use the Nordic nRFgoStudio or nRFjprog. Both of these need the J-link programming debugger device like the nRF51822-ek has or the nRF51822-DK has with the external Segger J-link lite. You can also merge the Softdevice and application .hex files and load the merged hex file.

Be sure you are starting your application above the top of the Softdevice. The S110 Softdevice was recently enlarged to about 88k. Many of the older application examples started at 0x14000. Try changing to 0x16000 if yours is below that.

J.

11 Dec 2014

Hi Jay,

I'm not using a kit, but a custom-designed PCB based on the nordic reference design. It works fine in general, including with older mbed-compiled firmwares. The notable difference in this board is that it doesn't have a 32kHz crystal.

I did compile the program in the online IDE so the softdevice should be included, right?

Also, I am not able to run even the "blinky" program which doesn't use the softdevice at all! I am programming the firmware through the mini Segger that comes with nordic developer kit.

I have a feeling it's got something to do with LF clock. Is the "btle.cpp" file the only place where the LFCLK is initialised? I did a project-wide search and did not find another place to modify. Nordic have also told me that even without clock init the chip should at least work for GPIO toggling.

11 Dec 2014

Building with the online IDE does include the softdevice.

For the sake of getting the best energy consumption profile, standard mbed platforms configure the nRF51822 to use the Low-Frequency external clock (32Khz crystal). This is done early on during the startup process:

look at SystemInit in mbed/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/system_nrf51822.c

If you don't have the low-freq. crystal on your hardware, you'll need to update SystemInit to switch to some other available clock; perhaps the HFCLK.

11 Dec 2014

Genius! That works! Thank you so much. I'm gonna have to replace 'mbed' with 'mbed-src' in all my projects and modify that particular line, but that's no problem.

FYI, I ended up using LFCLK synthesised from HFCLK. This is fine because it's an AC-powered device.