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

SDK 15.3 : Flash application does not run after flash softdevice and bootloader as advised on Devzone topics

Target : NRF52832, SD S132 6.1.1. program on Eclipse. 

Hello, 

Intro :

I migrated to SDK 15.3 for my application and it works.

Then I migrated DFU to SDK15.3 too but does not work fine. 

We would like to be able to do updates of app via BLE. We are used to do it with SDK 13.0, so flash first time bootloader and softdevice (and application)  with programmer on Eclipse, and then update the application OTA DFU via BLE. 

My linker script of DFU is set as below (coming from dfu example secure bootloader):

 

MEMORY
{
  FLASH (rx) : ORIGIN = 0x78000, LENGTH = 0x6000
  RAM (rwx) :  ORIGIN = 0x200057b8, LENGTH = 0xa848
  uicr_bootloader_start_address (r) : ORIGIN = 0x00000FF8, LENGTH = 0x4
  uicr_mbr_params_page (r) : ORIGIN = 0x00000FFC, LENGTH = 0x4
  mbr_params_page (r) : ORIGIN = 0x0007E000, LENGTH = 0x1000
  bootloader_settings_page (r) : ORIGIN = 0x0007F000, LENGTH = 0x1000
}

First when I flashed Bootloader and softdevice, I coud not see DfuTarg (on NRFConnect mobile). I saw differents topics as this topic here, then by starting to flash softdevice and then flash bootloader with deleting --sectorerase for flash bootloader, I can get DfuTarg at last. 

It's indicated that " However, the MBR v2.4.x is backward compatible with earlier version, meaning if it couldn't find the bootloader address in flash, it will check the bootloader address in UICR. " 

AIM issue: 

After that, I flash the app and it does not run and I still see DfuTarg. I tried to delete --sectorerase from makefile for flash application but still the same.

So I guess that --sectorerase should only erase the pages of application i.e from 0x00026000 to 0x00049000 (in my case).

It stays stuck in Dfu mode.

Questions : 

#1 : Are there any parameter missing to start app? Can the bootloader not be able to find the start address of the app ? What could it be else ? 

#2 : MBR being backward compatible, if we erase the MBR it should be able to find the address of Bootloader start in &(NRF_UICR->NRFFW[0]) and it should be able to run DfuTarg ? 

Thank you in advance for your help and suggestions.

  • After that, I flash the app and it does not run and I still see DfuTarg. I tried to delete --sectorerase from makefile for flash application but still the same.

    So I guess that --sectorerase should only erase the pages of application i.e from 0x00026000 to 0x00049000 (in my case).

    It stays stuck in Dfu mode.

    Questions : 

    #1 : Are there any parameter missing to start app? Can the bootloader not be able to find the start address of the app ? What could it be else ? 

     It depends on what is in the flash before you flash your application and bootloader on the other places than where the bootloader and application are.

    Try to run "nrfjprog --eraseall" first, so that you know you start with a blank flash.

    Another thing: The bootloader uses a CRC check to verify the application. That it was transferred via DFU, and not inserted by someone else. So either you need to update the application via DFU, or you need to also program the bootloader settings to match the CRC of the application. You can generate bootloader settings like this. Then you program it like you program the bootloader and application:

    nrfjprog --program bootloader_settings.hex.

    #2 The MBR should be backwards compatible. The MBR is part of the softdevice, but is never changed during DFU. Also, it doesn't change between softdevices. Try #1 solution first, and we can look into the MBR stuff if that doesn't work.

    Best regards,

    Edvin

Related