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

DFU Bootloader with S120 config

Hello,

I started to make an app for a board with nRF51822 with softdevice S120 version 1.0.1. Now I would like to have the DFU implementation in it but I am stuck at the project configuration.

Still quite new and I don't know how to solve this problem.

With version 1.0.1 I had this memory configuration: image description

Now, as @hungbui explained in this answer and from his example, I got this memory set-up: image description

If I let it like this, I got like 200 errors, as all the files and implementations I have already does not fit in that memory size.

If I change the IROM1 size to 0x27000, it compiles without errors, but when I try to Download it on the board, I get the error message:

Erase Failed! Error: Flash Download failed - "Cortex-M0"

Any help would be much appreciated.

Thank you.

  • @Gabriel C. :

    Why do you want to use S120 v1.0.0 ? The latest one is S120 v2.0.0. And the S120 example I uploaded is for S120 v2.0.0.

    If you don't do any modification and do compilation do you have any error? I don't know why you modified the IRAM1 setting ?

    The error: "Erase Failed! Error: Flash Download failed - "Cortex-M0"" Could be that you haven't given the algorithm to program the chip. Please check that in the Debug => JLink setting => Flash Download => Select nRF51xxx

  • @Hung Bui, when I started to develop the app, there were no V2.0.0 yet. And all worked great till now, when I need to implement the DFU and I'm not able to adapt your example to my code. Also all the examples from SDK are not installed in "\SDKv8.0\examples\dfu" but in "C:\Programas\Keil\ARM\NordicSemiconductor\nRF_Examples\8.1.1\dfu" and when I copy there your folder it is missing all the files except "main" and "dfu_ble_svc". Also, do I need to flash a bootloader.hex file when I flash softdevice? Does dfu_test_bootloader_b.hex work? Thank you and sorry for my ignorance. I'm having quite a bad time with it...

  • @ Gabriel: Seems that you are using pack. The example I provided is with the .zip SDK, not the pack type.

    You can download the .zip SDK here

    My example was based on SDK v8.0 and support S120 v2.0.0. You would need to port it to be compatible with S120 v1.0.0 or you can try to port your application to S120 v2.0.0. I would suggest you to do the latter one. You can follow the migration guide in the S120 v2.0.0 zip file. It should be straight forward.

    To have the bootloader to work, you need to flash the sofdevice first, after that flash the bootloader. And use the bootloader to update the application firmware.

  • Thank you! I will try to port it following the steps you mentioned!

  • @HungBui Finally I achieved to port the application to s120 V2.1.0 (which works great) and also managed to compile and run the bootloader you uploaded for s120. But now I have another problem. All the examples from SDK are for nRF51422 and I use a nRF51822. With the app I managed to make the proper changes and it works in my board but not the bootloaders. I have a 32MHz system clock in my board and for the soft device I use the default internal clock (NRF_CLOCK_LFCLKSRC_RC_250_PPM_TEMP_4000MS_CALIBRATION). Ports work good for the apps, but not for the bootloader. Both s120 and s130 bootloaders works in a dev board I have with 51422 but I am not able to port them to 51822. Any advice would be much appreciated. It is something in the bootloader related with ANT? Thank you...

Related