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

How to make it run application when there is a bootloader in the nRF52

Hi,

I'm using the bootloader in nRF5_SDK V12.0 with nRF52832. I have some problems want to know:

  1. How to make it run application first after I program softdevice,bootloader and application? I found that it runs the bootloader and broadcast as "DfuTarg". I know it can set m_boot_settings in nRF5_SDK V11.

  2. After I finish the OTA, it can run the application. However, if I just do a little modification in my application and then program it, it would neve run the application,it runs the bootloader. Is it normal?

  3. I want to use AT command received by the UART to make it switch to bootloader instead of using a button. I do that like this: In my application,when received the AT command, I will write a value to the flash(the last page in the flash) using fstorage then do a reset. In the bootloader, I add some code to read the flash to check the value. So my question is I should use the fstorage or do it like flashwrite example in SDK? Which way would you suggest? Thanks.

Parents
  • Hi Alice,

    1. You have to generate the bootloader settings page that sets the application crc and the bank 0 status flag to NRF_DFU_BANK_VALID_APP, see this page in the nrfutil documentation.
    2. The bootloader will check the CRC of the application against the application CRC stored in the bootloader settings page. If you flash a new application to your device, then the CRCs will not match. Thus, you have to update the bootloader settings page that corresponds to your new application.
    3. If you're only writing one value to flash then I suggest that you use the SoftDevice Flash API, see sd_flash_write documentation in the S132 SoftDevice API documentation.

    Best regards

    Bjørn

  • I couldn't find how to add a attachment, the settings page as follow:

    0x0007F000: 5BA4336D 00000001 00000001 00000001   |m3.[............|
    0x0007F010: 00000000 00000000 00005F14 F3CC7A53   |........._..Sz..|
    0x0007F020: 00000001 00000000 00000000 00000000   |................|
    0x0007F030: 00000000 00000000 00000000 00000000   |................|
    0x0007F040: 00000000 00000000 00000000 00000000   |................|
    0x0007F050: 00000000 00000000 00000000 FFFFFFFF   |................|
    0x0007F060: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F070: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F080: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F090: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F0A0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F0B0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F0C0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F0D0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F0E0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F0F0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|`
    

    I set the all version to 1

    Would you see the same problem with GPREGRET register as me?

Reply
  • I couldn't find how to add a attachment, the settings page as follow:

    0x0007F000: 5BA4336D 00000001 00000001 00000001   |m3.[............|
    0x0007F010: 00000000 00000000 00005F14 F3CC7A53   |........._..Sz..|
    0x0007F020: 00000001 00000000 00000000 00000000   |................|
    0x0007F030: 00000000 00000000 00000000 00000000   |................|
    0x0007F040: 00000000 00000000 00000000 00000000   |................|
    0x0007F050: 00000000 00000000 00000000 FFFFFFFF   |................|
    0x0007F060: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F070: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F080: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F090: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F0A0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F0B0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F0C0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F0D0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F0E0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
    0x0007F0F0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|`
    

    I set the all version to 1

    Would you see the same problem with GPREGRET register as me?

Children
No Data
Related