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

Thingy52 DFU fails with message "FW version failure (Code = 5)", using nrfutil and nRF Connect

Hi all,

I've got a single Thingy:52 (FW v2.1.0), and no DK. I'm trying to upgrade its firmware through nRF Connect on Android, but keep on running into a FW version failure (Code = 5) error whilst doing the DFU.

Can anyone enlighten me whether the following workflow is currently supported, and if so, what I am doing wrong? Any hints will be much appreciated and I'll update my question if you need any further details.

Abbreviations:

  • APP - my firmware application code
  • BL - the bootloader
  • SD - the s132 Soft Device

The APP, BL and SD have been taken or compiled from this Github commit of the Thingy SDK v2.1.0.

Suggested Workflow (paths truncated for readability):

  1. Compile the APP, cd <ProjectRoot>/project/pca20020_s132/armgcc && make -j. This builds nrf52832_xxaa_s132.hex.
  2. Generate BL settings, nrfutil settings generate --family NRF52 --application <APPDir>/armgcc/_build/nrf52832_xxaa_s132.hex --application-version 1 --bootloader-version 2 --bl-settings-version 1 settings.hex
  3. Generate key pair and compile the BL, cd <ProjectRoot>/project/bootloader_secure/pca20020/armgcc && make -j. This builds nrf52832_xxaa_s132.hex (same name as APP, but different hex content).
  4. Merge BL with settings, mergehex -m <BLDir>/armgcc/_build/nrf52832_xxaa_s132.hex settings.hex -o bl_with_settings.hex
  5. Generate DFU package, nrfutil pkg generate --application-version 1 --bootloader-version 2 --hw-version 52 --bootloader bl_with_settings.hex --softdevice <ProjectRoot>/external/sdk13/components/softdevice/s132/hex/s132_nrf52_4.0.2_softdevice.hex --application <APPDir>/armgcc/_build/nrf52832_xxaa_s132.hex --sd-req 0x98 --sd-id 0x98 --key-file private-key.pem thingy-dfu.zip
  6. Upload thingy-dfu.zip to internal phone memory and perform nRF Connect DFU, which results in the following error: [DFU] Remote DFU error: EXTENDED ERROR [DFU] Details: FW version failure (Code = 5). See the full nRF Connect log here.

So supposedly something's wrong with my version numbers. I've tried all sorts of combinations, from APP=BL=0, to APP=BL=10.

Thanks!


Update: The nRF52 DK has arrived and flashing, in order, the SD, APP and BL (merged with the settings file as per above) via nRFgo Studio on Windows works. For that I use the Segger debug connector as suggested in this answer, and modify the Bootloader to accept custom FW as suggested here, including the const modification.

Parents Reply Children
No Data
Related