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

DFU from SD130 v1.0.0 to SD130 v2.0.3 on nRF51822 with CLENR0 set

Good morning,

I've inherited a line of nRF51822-powered products that are currently running firmware based on SDK10 and SD130 v1.0.0.  UICR->BOOTLOADERADDR is set to 0x3b000, so there is room for the Secure Bootloader.  UICR->CLENR0 is set to 0x1c000 on these devices - which is appropriate for the old SD. 

I would like to update these to a new firmware based on SDK12.3 and SD130 v2.0.3 - but, as these are nRF51 series parts, I cannot reset CLENR0 to the proper value for this SD. 

I've been able to successfully update the bootloader and softdevice to SDK12.3/SD130 v2.0.3, but all app updates fail silently after transfer.

I've tested some changes to CODE_REGION_1_START in nrf_dfu_types.h, but have been unable to find a solution that works.

Thanks for any advice,

Will

  • To anyone else who runs across this; it can be done, but it requires:

    • Relocating the application to 0x1c000 from the default 0x1b000
    • Redefining MAIN_APPLICATION_START_ADDR to 0x1c000
    • Redefining CODE_REGION_1_START to 0x1c000

    With these changes, DFU works normally - you just lose those pages of flash between 0x1b000 and 0x1c000.

    Cheers,

    Will

  • Hi Will, 

     

    Using the softdevice with the CLENR0 pointing to the middle of the softdevice is not recommended. If you have read back protection of the code region 0, code in code region 1 won't be able to read the code in region 0. 

    But if you don't have read back protection, I think it should still work. S130 and the bootloader in SDK v12 doesn't use CLENR0 to jump to the bootloader.

     

    What you would need to test is to test the application first, just test it the new softdevice and the chip with wrong CLENR0 , no bootloader, to see if it can operate. 

    Then you can try to test with the bootloader. If you still have the issue, you would need to check what doesn't work. If it stuck at the bootloader, or it crash when in the application, or if it's the softdevice doesn't function properly. 

    You can also test to update a very simple application, just blinking an LED, to make sure the bootloader can receive the image and switch to the application. 

     

  • Hi Will, 

    Thanks for sharing the solution. I was thinking the size of the S130 v2 should be bigger than S130 v1.x. But it's the opposite. Your solution looks good. 

Related