nRF52 avoid "DfuTarg": how to prevent from staying stuck in bootloader mode without starting the app

board: nRF52832_xxac_s132 nordic / SDK 11

While you try to add DFU  OTA service and flash softdevice, application ,and bootloader to your nRF52 (by nRFgo or command line tools),  you might see its BLE Advertising name as “ Dfutarg”. Like this :



and that means your application does not start. The device stays stuck in bootloader.

There are 2 ways to solve this problem:

First solution: program by command line tools and write memory

1. go to
C:\..\Nordic Semiconductor\nrf5x\bin
open command line, and write :


:: power by Agatha Kuan 20170419
 
 
.\nrfjprog.exe --family NRF52 --eraseall
.\nrfjprog.exe --family NRF52 --program %your_softdevice_name%
.\nrfjprog.exe --family NRF52 --program %your_application_name%
.\nrfjprog.exe --family NRF52 --program %your_bootloader_name%
.\nrfjprog.exe --family NRF52 --memwr 0x7f000 --val 1
.\nrfjprog.exe --family NRF52 --reset



then after it reset , the application will start.


Second solution : add patch file 

I provide you a patch file to force the device to start application after reset.
please download by this link :
https://drive.google.com/open?id=0ByqJaZSFoV7Hb190d1l4UjNzb28

and program by command line tools. Open command line and write:



:: power by Agatha Kuan 20170419

.\nrfjprog.exe --family NRF52 --eraseall
.\nrfjprog.exe --family NRF52 --program %your_softdevice_name%
.\nrfjprog.exe --family NRF52 --program %your_application_name%
.\nrfjprog.exe --family NRF52 --program %your_bootloader_name%
.\nrfjprog.exe --family NRF52 --program patch.hex
.\nrfjprog.exe --family NRF52 --reset



Note:

1.the patch.hex file can only use on nRF52832 SDK11

2.these 2 solution does not work after reset or DFU

3.if you want to use the first solution on nRF51, please see  here

(it is 0x3FC00 for nrf51)







Reference:



https://devzone.nordicsemi.com/question/22056/combining-sd-dfu-and-application-hex-and-programming/

https://devzone.nordicsemi.com/question/37880/initdat-file-for-dfu-gets-crc-error-correct-order-nrf-beacon-help/

https://devzone.nordicsemi.com/question/70738/bootloader-does-not-start-application/


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值