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

RE: in the SDK 15.3,How to directly execute the application when the DFU function is added。MCU:nrF52832

hi,

        in the SDK15.3,I successfully ported the DFU demo to app_uart, but the 52830 will enter the upgrade state each time after downloading the program. I want to know how to solve this problem? I have tried adding bootloader setting, I am sorry that this problem has not been improved.

      And I tried the following method:

     @echo Flashing Softdevice and bootloader
     mergehex -m $(OUTPUT_DIRECTORY)/nrf52832_xxaa_s132.hex $(SDK_ROOT)/components/softdevice/s132/hex/s132_nrf52_6.1.1_softdevice.hex -o sdbl.hex
      nrfjprog  -F - nrf52 --program sdbl.hex --chiperase -r.

       thanks.

Parents Reply Children
  • Can you show how you're generating and programming the settings page?

  • of course,I learned from this blog,and I am doing this too.

           When I downloaded all the hex (soft device, bootloader, application.hex) files, the device started broadcasting "DFUTarg".And I tried to update through DFU, it succeeded.

    Then,

    nrfutil settings generate --family NRF52 --application myapp.hex --application-version 0 --bootloader-version 0 --bl-settings-version 1 bootloader_setting.hex
    After generating boot seting, I use nrf connect to download both softdevcie, boot, boot setting and app.When I found that there was no change, I combined the bootloader and setting into a file.But the result is the same after downloading.

           These are the logs that the NRF connect prints when programming

    2019-10-30T05:39:44.987Z INFO Parsing HEX file:  E:\key\s132_nrf52_6.1.1_softdevice.hex
    2019-10-30T05:39:44.987Z INFO File was last modified at  2018/11/2 下午2:39:16
    2019-10-30T05:39:45.066Z INFO Data block: 0x00000000-0x00000B00 (0x00000B00  bytes long)
    2019-10-30T05:39:45.067Z INFO Data block: 0x00001000-0x00025150 (0x00024150  bytes long)
    2019-10-30T05:39:45.068Z INFO SoftDevice detected, id 0xB7 (S132 v6.1.1)
    2019-10-30T05:39:45.089Z INFO Parsing HEX file:  E:\key\output.hex
    2019-10-30T05:39:45.089Z INFO File was last modified at  2019/10/30 下午1:37:15
    2019-10-30T05:39:45.102Z INFO Data block: 0x00000FF8-0x00001000 (0x00000008  bytes long)
    2019-10-30T05:39:45.102Z INFO Data block: 0x00078000-0x0007DD0C (0x00005D0C  bytes long)
    2019-10-30T05:39:45.102Z INFO Data block: 0x0007F000-0x0007F05C (0x0000005C  bytes long)
    2019-10-30T05:39:45.104Z INFO SoftDevice detected, id 0xB7 (S132 v6.1.1)
    2019-10-30T05:39:45.116Z INFO Parsing HEX file:  E:\key\nrf52832_xxaa.hex
    2019-10-30T05:39:45.116Z INFO File was last modified at  2019/10/30 下午1:26:36
    2019-10-30T05:39:45.147Z INFO Data block: 0x00026000-0x00037814 (0x00011814  bytes long)
    2019-10-30T05:39:45.148Z INFO SoftDevice detected, id 0xB7 (S132 v6.1.1)
    2019-10-30T05:39:56.760Z INFO Recovery procedure finished
    2019-10-30T05:39:56.764Z INFO Using nrfjprog to communicate with target
    2019-10-30T05:39:58.057Z INFO Using J-Link Software version 6.50
    2019-10-30T05:40:00.749Z INFO Segger serial:  682973788
    2019-10-30T05:40:00.749Z INFO Segger speed:  2000  kHz
    2019-10-30T05:40:00.749Z INFO Segger version:  J-Link OB-SAM3U128-V2-NordicSemi compiled Jan  7 2019 14:07:15
    2019-10-30T05:40:00.770Z INFO Probed: 682973788.
    2019-10-30T05:40:00.771Z INFO Model: NRF52832_xxAA_REV2.
    2019-10-30T05:40:00.771Z INFO RAM: 64KiB.
    2019-10-30T05:40:00.771Z INFO Flash: 512KiB in pages of 4KiB.
    2019-10-30T05:40:03.089Z INFO Reading device non-volatile memory. This may take a few seconds.
    2019-10-30T05:40:03.330Z INFO SoftDevice detected, id 0xB7 (S132 v6.1.1)
    2019-10-30T05:40:03.334Z INFO Writing procedure starts
    2019-10-30T05:40:16.211Z INFO Write procedure finished
    2019-10-30T05:40:16.212Z INFO Using nrfjprog to communicate with target
    2019-10-30T05:40:17.373Z INFO Using J-Link Software version 6.50
    2019-10-30T05:40:18.426Z INFO Segger serial:  682973788
    2019-10-30T05:40:18.426Z INFO Segger speed:  2000  kHz
    2019-10-30T05:40:18.426Z INFO Segger version:  J-Link OB-SAM3U128-V2-NordicSemi compiled Jan  7 2019 14:07:15
    2019-10-30T05:40:18.447Z INFO Probed: 682973788.
    2019-10-30T05:40:18.448Z INFO Model: NRF52832_xxAA_REV2.
    2019-10-30T05:40:18.448Z INFO RAM: 64KiB.
    2019-10-30T05:40:18.448Z INFO Flash: 512KiB in pages of 4KiB.
    2019-10-30T05:40:19.648Z INFO Reading device non-volatile memory. This may take a few seconds.
    2019-10-30T05:40:19.827Z INFO SoftDevice detected, id 0xB7 (S132 v6.1.1)

    PS E:\key> nrfutil settings generate --family NRF52 --application nrf52832_xxaa.hex --application-version 0 --bootloader-version 0 --bl-settings-version 1 bootloader_setting.hex
    
    Generated Bootloader DFU settings .hex file and stored it in: bootloader_setting.hex
    
    Bootloader DFU Settings:
    * File:                 bootloader_setting.hex
    * Family:               nRF52
    * CRC:                  0xE890C494
    * Settings Version:     0x00000001 (1)
    * App Version:          0x00000000 (0)
    * Bootloader Version:   0x00000000 (0)
    * Bank Layout:          0x00000000
    * Current Bank:         0x00000000
    * Application Size:     0x00011814 (71700 bytes)
    * Application CRC:      0xECCD8805
    * Bank0 Bank Code:      0x00000001
    
    PS E:\key> mergehex --merge nrf52832_xxaa_s132.hex bootloader_setting.hex --output output.hex
    Parsing input hex files.
    Merging files.
    Storing merged file.

  • Thank you. I see you've set the "--bootloader-settins-version" '1'. It should be '2' since you use SDK 15.3.0. Can you try to change it and see if it helps?

  • Thank you,but It doesn't seem to change anything.

    PS E:\key> nrfutil settings generate --family NRF52 --application nrf52832_xxaa.hex --application-version 1 --bootloader-version 2 --bl-settings-version 1 bootloader_setting.hex                                                               
    Generated Bootloader DFU settings .hex file and stored it in: bootloader_setting.hex
    
    Bootloader DFU Settings:
    * File:                 bootloader_setting.hex
    * Family:               nRF52
    * CRC:                  0x8ADC5471
    * Settings Version:     0x00000001 (1)
    * App Version:          0x00000001 (1)
    * Bootloader Version:   0x00000002 (2)
    * Bank Layout:          0x00000000
    * Current Bank:         0x00000000
    * Application Size:     0x00011814 (71700 bytes)
    * Application CRC:      0xECCD8805
    * Bank0 Bank Code:      0x00000001
    
    PS E:\key> mergehex --merge nrf52832_xxaa_s132.hex bootloader_setting.hex --output output.hex
    Parsing input hex files.
    Merging files.
    Storing merged file.
    PS E:\key>                                                                                                                                                                                                                                                                   

  • Hi,

    Can you upload the .hex files you use so I can try it here? I can make the ticket private if you want. 

Related