This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to flash the SoftDevice, the bootloader and the application at once?

I have tried to merge the hex files using mergehex, and flashed it to my device.

After flash the device is in DFU mode.

It seems the booloader doesn't know that there is a valid application there.

  • Read this.

    UPD:

    Try to do it like this.

    And you can download your hex files with nrfjprog without merging like this:

    nrfjprog --eraseall --programs softdevice.hex --program application.hex bootloader.hex --verify --reset
    
  • The bootloader believes the application is invalid, and that it is why it is entering DFU mode.

    The bootloader settings tells the bootloader if the application is valid or invalid. Please see bootloader_types.h. The settings are stored in the last page of the flash, at address 0x3FC00.

    One way to convince the bootloader that it has an valid application is to create the bootloader settings manually, in a separate hex file, and merge it with the other hex files.

    To convince the bootloader that the application is valid bank_0 must be 0x01 and bank_0_crc should be 0x00.

    Merge this hex with the SoftDevice, the bootloader, and the application using mergehex. Flash the merged hex with nrfjprog, and you should be good to go.

  • I know that worked earlier, but now I get this error:

    devzone.nordicsemi.com/.../

  • The alternative is to change bootloader_util_arm.c to match However it will cause the keil compiled bootloader size to grow with sdk v6 Petter's solution above is the preferred method.

    const uint8_t m_boot_settings[CODE_PAGE_SIZE] attribute((at(BOOTLOADER_SETTINGS_ADDRESS))) attribute((used)) = {BANK_VALID_APP};

    const uint32_t m_uicr_bootloader_start_address attribute((at(NRF_UICR_BOOT_START_ADDRESS))) = BOOTLOADER_REGION_START;

    nrfjprog.exe --eraseall --programs s110_nrf51822_6.0.0_softdevice.hex --program bootloader.hex application.hex --verify --reset

  • Thanks Petter Myhre your bootloader setting hex file works fine.

    can you expain more why we have to do this everytime , ho can we do this without using this hex ?

    And in what way does this hex sets 0x00 ?

    thanks

Related