I recently updated my multi-protocol (Thread FTD + BLE Peripheral Connectable) to use 'nRF5_SDK_for_Thread_and_Zigbee_3.0.0_d310e71'. I had been previously using 'nRF5_SDK_for_Thread_and_Zigbee_2.0.0_29775ac' based on SDK v15.2, so I'm not making a major leap here. Devices are currently running S140 v6.1.0.
I am able to run it successfully when programmed using a JLINK, however, when I program a device with DFU over BLE pm_init() fails with NRF_ERROR_INTERNAL. Comparing the memories for each case using nRF Connect Programmer suggests the DFU package is not respecting the boundaries of FStorage in the same way the JLINK does.
Programming with JLINK is scripted as follows:
nrfutil settings generate --family NRF52840 --application Output/Debug/Exe/NameOfProduct_USB840F_s140.hex --application-version 1 --application-version-string "$VERSION" --bootloader-version 1 --bl-settings-version 1 flasher_out/settings.hex
mergehex -m softdevice_here/s140_nrf52_6.1.0_softdevice.hex bootloader_here/bootloader.hex flasher_out/settings.hex -o flasher_out/sbc.hex
mergehex -m flasher_out/sbc.hex Output/Debug/Exe/NameOfProduct_USB840F_s140.hex -o flasher_out/packet.hex
nrfjprog --family nrf52 --eraseall
nrfjprog --family nrf52 --program flasher_out/packet.hex
nrfjprog --family nrf52 --reset
Generation of Signed Application package continues with the following script:
nrfutil pkg generate --application Output/Debug/Exe/LinePost_USB840F_s140.hex --application-version 1 --application-version-string "$VERSION" --hw-version 52 --sd-req 0xAE --key-file key_here/KeyDescription_private.pem flasher_out/fj\_USB840F\_ses\_$NAME\_$VERSION\_dfu.zip
(This file is used with nRFConnect Android to perform DFU)
I plan to use peer manager for caching GATT characteristics soon, so its important to me, however when I disable peer manager, I am able to DFU the new application without issue. Thread is also using FStorage for network parameter storage. I have been using peer manager and Thread fstorage for quite some time and never had these issues with DFU'ing new applications to fielded devices. Can you help me understand how use of FSTORAGE and/or Peer Manager's use of FSTORAGE may have changed in this release?
Thanks! --Rob
