首页 > 其他分享 >NRF 52810 beacon app 添加DFU 烧写固件失败

NRF 52810 beacon app 添加DFU 烧写固件失败

时间:2022-10-19 10:11:52浏览次数:53  
标签:0x00000000 DFU app hex NRF -- version bootloader setting


Parsing hex file.
ERROR: The file specified is not a valid hex file, has data outside valid areas
ERROR: or does not have data in valid areas.

固件有问题 可以在后面添加 --log 查看详细的日志。

The error you are getting indicates that some part of the hex file has data outside of the flash. The first step is to check each hex file before they are merged to see if there are regions outside the range 0x00000000 - 0x00040000 (you may still have data in the UICR region). This online tool can be a suitable way to do this with.
In addition to the steps you have described I noticed that you need to update the value of BOOTLOADER_START_ADDR and BOOTLOADER_SETTINGS_ADDRESS in the bootloader source code. These defines are used runtime by the MBR and bootloader and have to match the project settings.

 
看到最后一句BOOTLOADER_SETTINGS_ADDRESS的地址要和工程里设置的地址相同,突然灵光闪现。
我之前制作的bootloader_setting.hex信息如下:

Bootloader DFU Settings:
* File:                     setting.hex
* Family:                   nRF52
* Start Address:            0x0007F000
* CRC:                      0xB3F6314D
* Settings Version:         0x00000001 (1)
* App Version:              0x00000000 (0)
* Bootloader Version:       0x00000000 (0)
* Bank Layout:              0x00000000
* Current Bank:             0x00000000
* Application Size:         0x0000B9D0 (47568 bytes)
* Application CRC:          0x15413590
* Bank0 Bank Code:          0x00000001
* Softdevice Size:          0x00000000 (0 bytes)
* Boot Validation CRC:      0x00000000
* SD Boot Validation Type:  0x00000000 (0)
* App Boot Validation Type: 0x00000000 (0)

看到那个Start Address 怎么是0x0007F000,居然不是

NRF52810_XXAA对应的是0x0002F000UL setings文件里面写的是0x0007F000,当然不行。

line 97行定义的那个地址,那里的地址NRF52810_XXAA对应的是0x0002F000UL,我的居然是0x0007F000,这不是NRF52832_XXAA对应的么?看下面的宏定义


   #define BOOTLOADER_SETTINGS_ADDRESS     (0x0002F000UL)


于是乎把之前制作的bootloader_setting.hex改成如下:
原来:

nrfutil settings generate --family NRF52 --application app.hex --application-version 0 --bootloader-version 0 --bl-settings-version 1 bootloader_setting.hex
更新:
nrfutil settings generate --family NRF52810 --application app.hex --application-version 0 --bootloader-version 0 --bl-settings-version 1 bootloader_setting.hex


重新按照之前的步骤,合成burn.hex执行
nrfjprog.exe -f NRF52 --program .\burn.hex --verify --reset --chiperase


标签:0x00000000,DFU,app,hex,NRF,--,version,bootloader,setting
From: https://www.cnblogs.com/fengchengbiao/p/16793922.html

相关文章