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

Had to remove the "softDevice" in order to flash the NRF51822-QFAC App!!

HI,

so i designed my board based on the NRF51822-QFAC chip. here's the link of the nrf : www.digikey.com/.../5125206

image description

and find attached the schema of the BOARD that i made. nrf51822-Beacon-schema.pdf

and i use an USB J-link programmer, this one : store.cutedigi.com/.../

so the first things i went check the simple example of the blinky LED (without SOFTDEVICES) i made some modification according to my board and my nrf devices, i flash it to my board and it work perfectly.

I want then to try the famous 'ble_app_uart' program, that i founded in this tutorial.

so i downloaded the nRF51_SDK_10.0.0_dc26b5e. then opened the nRFgo and as showed below the programmer and the n51822 was recognized by the software.

image description

then i went to browse and went to : nRF51_SDK_10.0.0_dc26b5e\components\softdevice\s130\hex and select and select the s130_nrf51_1.0.0_softdevice.hex and hit program.

image description

then i went to the example located here : nRF51_SDK_10.0.0_dc26b5e\examples\ble_peripheral\ble_app_uart\pca10028\s130\arm5_no_packs

i opened with keil and made some modification to adapt it with my board.

-1- First i modified the device reference from the "OPTION Target**" and changed the debugger to J-link/J-Trace**

image description

-2- Second i went to the pca10028.h where the Input/output mapping of the board and adapt it to my board. (change the LED position).

BUT when i tried to flash the board a problem occurs and tells me 'Error : flash download failed - "CORTEX-M0"'

image description

the only solution is to go back to nRFgo and erase all the programs then go back to KEIL and flash the Nrf. but the problem is that the SoftwareDevice is removed from the NRF and nothing won't work ? is that right ?

i've tried to runing the ble_app_uart without having the SoftDevices installed and the program block at this function SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_XTAL_20_PPM, NULL);. normally this is the first function in the code that uses the "SoftDevices". so this is why it doesn't work?

i've tried with the nRF5_SDK_11.0.0_89a8197 and use the S130, and i've tried also with nRF51_SDK_10.0.0_dc26b5e combined with the S110 and nothing happen allways the same problem 'Error : flash download failed - "CORTEX-M0',so i have to erase the softDevices in order to be able to download the program into the nrf chip.

any solution?? , i'm struggling for two days with this problem and didn't find any solution. by the way i'm using uVision V5.18.0.0 .

Thx,

  • You are getting the error: 'Error : flash download failed - "CORTEX-M0"' because the softdevice is write protected and you're trying to write your application to the softdevice address space.

    You have to have softdevice flashed to your chip in order for any examples to work, that use BLE and/or softdevice. In your case, you have to change the RAM and flash start addresses and sizes, as you circled them in your fourth image above, when you changed the device reference. You have to look up the adresses in softdevice specification for the SD you are using.

    For example, this is how addresses look in my case, I'm using S120:

    image description

  • thx a lot for your help, it work and the Bluetooth was detected by my phone.

    but they have to mention that in the tutorial.like when you use another broads or devices you have to modify the IROM and IRAM in order to avoid confusion between the SoftDevices and the APP code.

Related