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

Serial DFU and Application with SoftDevice Issues

Having problems bootloading my own application on my hardware. The application runs fine alone. Using SDK 16.0 and secure_bootloader/pca10056_uart example via Segger SES.

1. Build pca10056_uart DFU using SES
2. Erase and download DFU using SES
3. Build my firmware package (test_app and SoftDevice)

nrfutil pkg generate --application test_app.hex --application-version 0x02 --hw-version 52 --key-file ../priv.pem --sd-req 0x00 --sd-id 0x00 --softdevice s140_nrf52_7.0.1_softdevice.hex --sd-boot-validation NO_VALIDATION --app-boot-validation NO_VALIDATION test_sd.zip

4. Download my firmware - no errors
nrfutil -v dfu serial -pkg test_sd.zip -p COM22 -b 115200 -fc 0

The app however does not run. I can re-enter the DFU on power cycle using a GPIO as expected.

Here's my FLASH contents read back using nrfjprog

nrfjprog --readcode test.hex
nrfutil settings display test.hex
Unknown Bootloader DFU settings version: 4294967295

Bootloader DFU Settings:
* File:                     test.hex
* Family:                   NRF52840
* Start Address:            0x00000000
* CRC:                      0x1D3B9BA7
* Settings Version:         0x00000002 (2)
* App Version:              0x00000002 (2)
* Bootloader Version:       0x00000000 (0)
* Bank Layout:              0x00000000
* Current Bank:             0x00000000
* Application Size:         0x0002703C (159804 bytes)
* Application CRC:          0x91BD21DA
* Bank0 Bank Code:          0x00000001
* Softdevice Size:          0x00025598 (152984 bytes)
* Boot Validation CRC:      0xACDA1BA2
* SD Boot Validation Type:  0x00000000 (0)
* App Boot Validation Type: 0x00000000 (0)

and my SES linker settings for the app:

linker_section_placement_macros="FLASH_PH_START=0x0;FLASH_PH_SIZE=0x100000;RAM_PH_START=0x20000000;RAM_PH_SIZE=0x40000;FLASH_START=0x27000;FLASH_SIZE=0xd9000;RAM_START=0x20002260;RAM_SIZE=0x3dda0"
linker_section_placements_segments="FLASH RX 0x0 0x100000;RAM RWX 0x20000000 0x40000"


Am I missing something here? Do in need to merge the application hex with settings.h? Not clear if this is needed or not based on documentation.

Please advise - TID

Parents
  • Hi Gary, 

    Have you modified the bootloader ? 

    I don't think you can call nrfutil settings display with a hex dump from the chip. The function only works with the generated bootloader setting hex (or the hex that cover the exact part of bootloader setting).

    Have you tried to test DFU only the application, not with the softdevice ? 
    I'm not sure why you set the sd-req and sd-id to 0x00. You would need to use the correct id of the softdevice as shown by nrfutil pkg generate --help

    When you take the hex dump, do you see the application copied to the correct location ? 

  • Hi Hung,

    1. I can DFU a simple application (blinky SES w/mbr) onto my hardware with no issues.

    2. I get same results with a simple application with SD (ble_app_blinky_pca10056_s140).  sd-req and sd-id set to 0x00 Image loads with no errors but does not run. 

    3. When I change sd-req and sd-id to 0xCA  (one or both) I get the following error :  Extended Error 0x07: The array of supported SoftDevices for the update does not contain the FWID of the current SoftDevice.

    C:\junk\test>nrfutil -v dfu serial -pkg testB.zip -p COM22 -b 115200 -fc 0
    
    Traceback (most recent call last):
      File "C:\Python38-32\Scripts\nrfutil-script.py", line 11, in <module>
        load_entry_point('nrfutil==6.0.1', 'console_scripts', 'nrfutil')()
      File "c:\python38-32\lib\site-packages\click\core.py", line 764, in __call__
        return self.main(*args, **kwargs)
      File "c:\python38-32\lib\site-packages\click\core.py", line 717, in main
        rv = self.invoke(ctx)
      File "c:\python38-32\lib\site-packages\click\core.py", line 1137, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "c:\python38-32\lib\site-packages\click\core.py", line 1137, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "c:\python38-32\lib\site-packages\click\core.py", line 956, in invoke
        return ctx.invoke(self.callback, **ctx.params)
      File "c:\python38-32\lib\site-packages\click\core.py", line 555, in invoke
        return callback(*args, **kwargs)
      File "c:\python38-32\lib\site-packages\nordicsemi\__main__.py", line 1034, in serial
        do_serial(package, port, connect_delay, flow_control, packet_receipt_notification, baud_rate, serial_number, True,
      File "c:\python38-32\lib\site-packages\nordicsemi\__main__.py", line 949, in do_serial
        dfu.dfu_send_images()
      File "c:\python38-32\lib\site-packages\nordicsemi\dfu\dfu.py", line 119, in dfu_send_images
        self._dfu_send_image(self.manifest.softdevice)
      File "c:\python38-32\lib\site-packages\nordicsemi\dfu\dfu.py", line 95, in _dfu_send_image
        self.dfu_transport.send_init_packet(data)
      File "c:\python38-32\lib\site-packages\nordicsemi\dfu\dfu_transport_serial.py", line 256, in send_init_packet
        self.__execute()
      File "c:\python38-32\lib\site-packages\nordicsemi\dfu\dfu_transport_serial.py", line 421, in __execute
        self.__get_response(DfuTransportSerial.OP_CODE['Execute'])
      File "c:\python38-32\lib\site-packages\nordicsemi\dfu\dfu_transport_serial.py", line 502, in __get_response
        raise NordicSemiException('Extended Error 0x{:02X}: {}'.format(resp[3], data))
    pc_ble_driver_py.exceptions.NordicSemiException: Extended Error 0x07: The array of supported SoftDevices for the update does not contain the FWID of the current SoftDevice.

    4. Looking at the hex dump or using nRF Connect GUI tool the memory map looks as expected.

    Can anyone provide an actual script to generate DFU image for an example using SoftDevice (e.g., ble_app_blinky_pca10056_s140 )

    Thanks!

Reply
  • Hi Hung,

    1. I can DFU a simple application (blinky SES w/mbr) onto my hardware with no issues.

    2. I get same results with a simple application with SD (ble_app_blinky_pca10056_s140).  sd-req and sd-id set to 0x00 Image loads with no errors but does not run. 

    3. When I change sd-req and sd-id to 0xCA  (one or both) I get the following error :  Extended Error 0x07: The array of supported SoftDevices for the update does not contain the FWID of the current SoftDevice.

    C:\junk\test>nrfutil -v dfu serial -pkg testB.zip -p COM22 -b 115200 -fc 0
    
    Traceback (most recent call last):
      File "C:\Python38-32\Scripts\nrfutil-script.py", line 11, in <module>
        load_entry_point('nrfutil==6.0.1', 'console_scripts', 'nrfutil')()
      File "c:\python38-32\lib\site-packages\click\core.py", line 764, in __call__
        return self.main(*args, **kwargs)
      File "c:\python38-32\lib\site-packages\click\core.py", line 717, in main
        rv = self.invoke(ctx)
      File "c:\python38-32\lib\site-packages\click\core.py", line 1137, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "c:\python38-32\lib\site-packages\click\core.py", line 1137, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "c:\python38-32\lib\site-packages\click\core.py", line 956, in invoke
        return ctx.invoke(self.callback, **ctx.params)
      File "c:\python38-32\lib\site-packages\click\core.py", line 555, in invoke
        return callback(*args, **kwargs)
      File "c:\python38-32\lib\site-packages\nordicsemi\__main__.py", line 1034, in serial
        do_serial(package, port, connect_delay, flow_control, packet_receipt_notification, baud_rate, serial_number, True,
      File "c:\python38-32\lib\site-packages\nordicsemi\__main__.py", line 949, in do_serial
        dfu.dfu_send_images()
      File "c:\python38-32\lib\site-packages\nordicsemi\dfu\dfu.py", line 119, in dfu_send_images
        self._dfu_send_image(self.manifest.softdevice)
      File "c:\python38-32\lib\site-packages\nordicsemi\dfu\dfu.py", line 95, in _dfu_send_image
        self.dfu_transport.send_init_packet(data)
      File "c:\python38-32\lib\site-packages\nordicsemi\dfu\dfu_transport_serial.py", line 256, in send_init_packet
        self.__execute()
      File "c:\python38-32\lib\site-packages\nordicsemi\dfu\dfu_transport_serial.py", line 421, in __execute
        self.__get_response(DfuTransportSerial.OP_CODE['Execute'])
      File "c:\python38-32\lib\site-packages\nordicsemi\dfu\dfu_transport_serial.py", line 502, in __get_response
        raise NordicSemiException('Extended Error 0x{:02X}: {}'.format(resp[3], data))
    pc_ble_driver_py.exceptions.NordicSemiException: Extended Error 0x07: The array of supported SoftDevices for the update does not contain the FWID of the current SoftDevice.

    4. Looking at the hex dump or using nRF Connect GUI tool the memory map looks as expected.

    Can anyone provide an actual script to generate DFU image for an example using SoftDevice (e.g., ble_app_blinky_pca10056_s140 )

    Thanks!

Children
Related