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

Application doesn't work after update with DFU

Hi!

SDK 16.0

I use secure bootloader from SDK with button.

1. Single app written from Segger Studio work fine.

2. Firmware (bootloader with app) written from script below work fine.

However App package (app_dfu_package.zip) updated from nrfConnect for Android start fail.

3. When bootloader written from Segger Studio and app_dfu_package.zip updated from nrfConnect for Android, all work fine.

Why can't write full package and then update app with DFU?

# write bootloader, softdevice and app

OUTPUT_DIR=Output

mergehex=/opt/mergehex/mergehex
nrfjprog=/opt/nrfjprog/nrfjprog
nrfutil=nrfutil

SOFTDEVICE=../../../components/softdevice/s132/hex/s132_nrf52_7.0.1_softdevice.hex
BOOTLOADER=../secure_bootloader/pca10040_s132_ble/ses/Output/Release/Exe/secure_bootloader_ble_s132_pca10040.hex

PRIVATE_KEY=private.pem
APP=../fw/pca10040/s132/ses/Output/Release/Exe/fw_aac_52832_s132.hex
APP_VERSION=1

NRF_FAMILY=NRF52
HW_VERSION=52

BOOTLOADER_SETTINGS=$(OUTPUT_DIR)/bootloader_settings.hex
BOOTLOADER_VERSION=1
BOOTLOADER_SETTINGS_VERSION=1


MERGED_BOOTLOADER_SETTINGS=$(OUTPUT_DIR)/m_bootloader_settings.hex
MERGED_APP_BOOTLOADER_SETTINGS=$(OUTPUT_DIR)/m_app_bootloader_settings.hex

#make bootloader settings
nrfutil settings generate --family $(NRF_FAMILY) --application $(APP) --application-version $(APP_VERSION) --bootloader-version $(BOOTLOADER_VERSION) --bl-settings-version $(BOOTLOADER_SETTINGS_VERSION) $(BOOTLOADER_SETTINGS)

#add softdevice to bootloader with settings
$(mergehex) -m $(SOFTDEVICE) $(BOOTLOADER_SETTINGS)  $(BOOTLOADER) -o $(MERGED_BOOTLOADER_SETTINGS)

#add app
$(mergehex)  -m  $(MERGED_BOOTLOADER_SETTINGS) $(APP) -o $(MERGED_APP_BOOTLOADER_SETTINGS)

#flash into device
$(nrfjprog) --family $(NRF_FAMILY) --recover
$(nrfjprog) --family $(NRF_FAMILY) --program $(MERGED_APP_BOOTLOADER_SETTINGS)  --chiperase  --verify
$(nrfjprog) --family $(NRF_FAMILY) --reset

#make package for DFU updating
$(nrfutil) pkg generate --hw-version $(HW_VERSION) --application-version $(APP_VERSION) --application $(APP) --sd-req 0xCB --sd-id 0xCB  --key-file $(PRIVATE_KEY) $(OUTPUT_DIR)/app_dfu_package.zip

Parents Reply
  • Are you only using logging to check if the 'simple' app is running fine? The reason I ask is that RTT clients will usually fail to retrieve log messages after the transition from bootloader to application because the RTT RAM buffer holding the log data gets moved around (client must scan RAM again to find out where the buffer is located). Can you try using a LED or the UART logger backend for indication instead?

Children
Related