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

Mesh FDU : bootloader_verify.py failed

Hello,

I'm trying to use the mesh DFU on 2 nRF52840 DK by following the quick start guide and it didn't work.

Using the mesh sdk 2.0.1 I made the below batch file as described on the quick guide 

title Balise firmware update over mesh
Welcome to  nRF DFU test version

echo  Step 3. Generate a DFU file with nrfutil
cd C:\Program Files (x86)\Nordic Semiconductor\nRFgo Studio
nrfutil dfu genpkg --application C:\Nordic\nrf5_SDK_for_Mesh_v2.0.1_src\bin\blinky\blinky_nrf52840_xxAA_s140_6.0.0.hex  --application-version 2 --sd-req 0x00A9 app_dfu_package.zip

echo  Step 4. Generate a HEX version of your device page
cd C:\Nordic\nrf5_SDK_for_Mesh_v2.0.1_src\tools\dfu
device_page_generator.py -d nrf52840_xxAA -sd "s140_6.0.0"

echo  Step 5. Erase all chip memory (including UICR) on all devices
cd C:\Program Files (x86)\Nordic Semiconductor\nRFgo Studio
nrfjprog -s 683954026 --eraseall
nrfjprog -s 683887275 --eraseall

echo  Step 6. Flash the SoftDevice on all devices
nrfjprog -s 683954026 --program C:\Nordic\nRF5_SDK_15.0.0_a53641a\components\softdevice\s140\hex\s140_nrf52_6.0.0_softdevice.hex
nrfjprog -s 683887275 --program C:\Nordic\nRF5_SDK_15.0.0_a53641a\components\softdevice\s140\hex\s140_nrf52_6.0.0_softdevice.hex

echo  Step 7. Flash the serial bootloader on all devices
nrfjprog -s 683954026 --program C:\Nordic\nrf5_SDK_for_Mesh_v2.0.1_src\bin\bootloader\gccarmemb\mesh_bootloader_serial_gccarmemb_nrf52840_xxAA.hex
nrfjprog -s 683887275 --program C:\Nordic\nrf5_SDK_for_Mesh_v2.0.1_src\bin\bootloader\gccarmemb\mesh_bootloader_serial_gccarmemb_nrf52840_xxAA.hex

echo  Step 8. Flash the first application on all devices
nrfjprog -s 683954026 --program C:\Nordic\nrf5_SDK_for_Mesh_v2.0.1_src\examples\dfu\build\dfu_nrf52840_xxAA_s140_6.0.0_Debug\dfu_nrf52840_xxAA_s140_6.0.0.hex
nrfjprog -s 683887275 --program C:\Nordic\nrf5_SDK_for_Mesh_v2.0.1_src\examples\dfu\build\dfu_nrf52840_xxAA_s140_6.0.0_Debug\dfu_nrf52840_xxAA_s140_6.0.0.hex

echo  Step 9. Flash the device page on all devices
nrfjprog -s 683954026 --program C:\Nordic\nrf5_SDK_for_Mesh_v2.0.1_src\tools\dfu\bin\device_page_nrf52840_xxAA_s140_6.0.0.hex
nrfjprog -s 683887275 --program C:\Nordic\nrf5_SDK_for_Mesh_v2.0.1_src\tools\dfu\bin\device_page_nrf52840_xxAA_s140_6.0.0.hex
nrfjprog -s 683954026 --reset 
nrfjprog -s 683887275 --reset

cd C:\Nordic\nrf5_SDK_for_Mesh_v2.0.1_src\tools\dfu
bootloader_verify.py  683954026 COM26
pause 

When trying to verify the bootloader with bootloader_verify.py it get halt on "resetting device..." (see picture below)

I have used device_page_generator.py and bootloader_verify.phy from mesh sdk v2.2.0 since the original scripts have some bugs.

Here the full log of the process

C:\WINDOWS\system32>title Balise firmware update over mesh

C:\WINDOWS\system32>Welcome to  nRF DFU test version
'Welcome' n’est pas reconnu en tant que commande interne
ou externe, un programme exécutable ou un fichier de commandes.

C:\WINDOWS\system32>echo  Step 3. Generate a DFU file with nrfutil
 Step 3. Generate a DFU file with nrfutil

C:\WINDOWS\system32>cd C:\Program Files (x86)\Nordic Semiconductor\nRFgo Studio

C:\Program Files (x86)\Nordic Semiconductor\nRFgo Studio>nrfutil dfu genpkg --application C:\Nordic\nrf5_SDK_for_Mesh_v2.0.1_src\bin\blinky\blinky_nrf52840_xxAA_s140_6.0.0.hex  --application-version 2 --sd-req 0x00A9 app_dfu_package.zip
Zip created at app_dfu_package.zip

C:\Program Files (x86)\Nordic Semiconductor\nRFgo Studio>echo  Step 4. Generate a HEX version of your device page
 Step 4. Generate a HEX version of your device page

C:\Program Files (x86)\Nordic Semiconductor\nRFgo Studio>cd C:\Nordic\nrf5_SDK_for_Mesh_v2.0.1_src\tools\dfu

C:\Nordic\nrf5_SDK_for_Mesh_v2.0.1_src\tools\dfu>device_page_generator.py -d nrf52840_xxAA -sd "s140_6.0.0"
Wrote device page for nrf52840_xxAA with the s140_6.0.0 SoftDevice to bin/device_page_nrf52840_xxAA_s140_6.0.0.hex.

C:\Nordic\nrf5_SDK_for_Mesh_v2.0.1_src\tools\dfu>echo  Step 5. Erase all chip memory (including UICR) on all devices
 Step 5. Erase all chip memory (including UICR) on all devices

C:\Nordic\nrf5_SDK_for_Mesh_v2.0.1_src\tools\dfu>cd C:\Program Files (x86)\Nordic Semiconductor\nRFgo Studio

C:\Program Files (x86)\Nordic Semiconductor\nRFgo Studio>nrfjprog -s 683954026 --eraseall
Erasing user available code and UICR flash areas.
Applying system reset.

C:\Program Files (x86)\Nordic Semiconductor\nRFgo Studio>nrfjprog -s 683887275 --eraseall
Erasing user available code and UICR flash areas.
Applying system reset.

C:\Program Files (x86)\Nordic Semiconductor\nRFgo Studio>echo  Step 6. Flash the SoftDevice on all devices
 Step 6. Flash the SoftDevice on all devices

C:\Program Files (x86)\Nordic Semiconductor\nRFgo Studio>nrfjprog -s 683954026 --program C:\Nordic\nRF5_SDK_15.0.0_a53641a\components\softdevice\s140\hex\s140_nrf52_6.0.0_softdevice.hex
Parsing hex file.
Reading flash area to program to guarantee it is erased.
Checking that the area to write is not protected.
Programming device.

C:\Program Files (x86)\Nordic Semiconductor\nRFgo Studio>nrfjprog -s 683887275 --program C:\Nordic\nRF5_SDK_15.0.0_a53641a\components\softdevice\s140\hex\s140_nrf52_6.0.0_softdevice.hex
Parsing hex file.
Reading flash area to program to guarantee it is erased.
Checking that the area to write is not protected.
Programming device.

C:\Program Files (x86)\Nordic Semiconductor\nRFgo Studio>echo  Step 7. Flash the serial bootloader on all devices
 Step 7. Flash the serial bootloader on all devices

C:\Program Files (x86)\Nordic Semiconductor\nRFgo Studio>nrfjprog -s 683954026 --program C:\Nordic\nrf5_SDK_for_Mesh_v2.0.1_src\bin\bootloader\gccarmemb\mesh_bootloader_serial_gccarmemb_nrf52840_xxAA.hex
Parsing hex file.
Reading flash area to program to guarantee it is erased.
Checking that the area to write is not protected.
Programming device.

C:\Program Files (x86)\Nordic Semiconductor\nRFgo Studio>nrfjprog -s 683887275 --program C:\Nordic\nrf5_SDK_for_Mesh_v2.0.1_src\bin\bootloader\gccarmemb\mesh_bootloader_serial_gccarmemb_nrf52840_xxAA.hex
Parsing hex file.
Reading flash area to program to guarantee it is erased.
Checking that the area to write is not protected.
Programming device.

C:\Program Files (x86)\Nordic Semiconductor\nRFgo Studio>echo  Step 8. Flash the first application on all devices
 Step 8. Flash the first application on all devices

C:\Program Files (x86)\Nordic Semiconductor\nRFgo Studio>nrfjprog -s 683954026 --program C:\Nordic\nrf5_SDK_for_Mesh_v2.0.1_src\examples\dfu\build\dfu_nrf52840_xxAA_s140_6.0.0_Debug\dfu_nrf52840_xxAA_s140_6.0.0.hex
Parsing hex file.
Reading flash area to program to guarantee it is erased.
Checking that the area to write is not protected.
Programming device.

C:\Program Files (x86)\Nordic Semiconductor\nRFgo Studio>nrfjprog -s 683887275 --program C:\Nordic\nrf5_SDK_for_Mesh_v2.0.1_src\examples\dfu\build\dfu_nrf52840_xxAA_s140_6.0.0_Debug\dfu_nrf52840_xxAA_s140_6.0.0.hex
Parsing hex file.
Reading flash area to program to guarantee it is erased.
Checking that the area to write is not protected.
Programming device.

C:\Program Files (x86)\Nordic Semiconductor\nRFgo Studio>echo  Step 9. Flash the device page on all devices
 Step 9. Flash the device page on all devices

C:\Program Files (x86)\Nordic Semiconductor\nRFgo Studio>nrfjprog -s 683954026 --program C:\Nordic\nrf5_SDK_for_Mesh_v2.0.1_src\tools\dfu\bin\device_page_nrf52840_xxAA_s140_6.0.0.hex
Parsing hex file.
Reading flash area to program to guarantee it is erased.
Checking that the area to write is not protected.
Programming device.

C:\Program Files (x86)\Nordic Semiconductor\nRFgo Studio>nrfjprog -s 683887275 --program C:\Nordic\nrf5_SDK_for_Mesh_v2.0.1_src\tools\dfu\bin\device_page_nrf52840_xxAA_s140_6.0.0.hex
Parsing hex file.
Reading flash area to program to guarantee it is erased.
Checking that the area to write is not protected.
Programming device.

C:\Program Files (x86)\Nordic Semiconductor\nRFgo Studio>nrfjprog -s 683954026 --reset
Applying system reset.
Run.

C:\Program Files (x86)\Nordic Semiconductor\nRFgo Studio>nrfjprog -s 683887275 --reset
Applying system reset.
Run.

C:\Program Files (x86)\Nordic Semiconductor\nRFgo Studio>cd C:\Nordic\nrf5_SDK_for_Mesh_v2.0.1_src\tools\dfu

C:\Nordic\nrf5_SDK_for_Mesh_v2.0.1_src\tools\dfu>bootloader_verify.py  683954026 COM26
Reading UICR..                  OK.
Reading Device page..           OK.
Resetting device..

when trying to run the update I get 

C:\Program Files (x86)\Nordic Semiconductor\nRFgo Studio>nrfutil --verbose dfu serial -pkg C:\Python27\Scripts\app_dfu_package.zip -p COM26 -b 115200 -fc
Upgrading target on COM26 with DFU package C:\Python27\Scripts\app_dfu_package.zip. Flow control is enabled.
[------------------------------------] 0%Starting DFU upgrade of type 4, SoftDevice size: 0, bootloader size: 0, application size: 1656
Sending DFU start packet, afterwards we wait for the flash on target to be initialized before continuing.
Timed out waiting for acknowledgement from device.


Failed to upgrade target. Error is: No data received on serial port. Not able to proceed.

Possible causes:
- bootloader, SoftDevice or application on target does not match the requirements in the DFU package.
- baud rate or flow control is not the same as in the target bootloader.
- target is not in DFU mode. If using the SDK examples, press Button 4 and RESET and release both to enter DFU mode.

Please, advice me if I'm missing something here ?

Thank you

/Chaabane

  • I had similar problem at the same place
    Error message was:

    python ${TOOLS_DFU}/bootloader_verify.py 123456 COM11
    Reading UICR..                  OK.
    Reading Device page..           OK.
    Resetting device..              ERROR: Could not open COM port COM11
    

    Com port was correct
    But I am working in Windows/Cygwin environment
    And after I changed Com port to /dev/ttyS10 bootloader was verified successfully

Related