USB DFU on a NRF52833

Hi,

I am trying to implement USB DFU on a NRF52833 with nRF5 SDK for Thread and Zigbee v4.1.0 and nRF5 SDK v16.0.0.

  •  In a first step I want to perform this on the devkit.
  •  In a second step on our custom PCB.

Unfortunatelly there is no NRF52833 USB bootloader example. So i performed this on a NRF52840 (pca10056).

1. What I managed to do is flashing the "pca10056_usb_debug" via the first USB port and then connecting to the other USB port. Then I performed

nrfutil dfu usb-serial -pkg blinky_mbr.zip -p COM16

which was also successful judging by the LEDs. Now I want to create an own .zip (infocenter.nordicsemi.com/index.jsp and this is where I have problems. Public and private keys are provided but when I run

nrfutil pkg generate --hw-version 52 --application out.hex --key-file priv.pem package.zip

I get the error message

Usage: nrfutil pkg generate [OPTIONS] ZIPFILE
Try 'nrfutil pkg generate --help' for help.
Error: --sd-req required. 

Which means I have to specify a soft device version. I am confused about this because I though soft devices can be used but are not required since this is neither an BLE nor an ANT project.

How do I know which version I have to pass to create the .zip?

Parents
  • Hi,

    I could do it the following way:

    nrfutil pkg generate --sd-req 0x00 --hw-version 52 --application-version 1 --application out.hex --key-file priv.pem package.zip

    As described in the documentation https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_nrf5_v16.0.0%2Flib_bootloader_dfu_validation.html&anchor=lib_dfu_image in the chapter "Updates without a SoftDevice".

  • Hi,

    Great that you figured it out! Does this mean the issue can be closed?

    Best regards,

    Marte

  • Hi,

    I have another question. Since there is no bootloader example for the NRF52833 in the SDK 16.0.0, I downloaded the SDK 17.1.0. Now I am trying to build a bootloader based on the secure_bootloader_usb_mbr_pca10100e because it already has the crypto needed (when migrating from a 10065 example we had to do this manually). I had to download and build uECC. I could flash the bootloader to our custom PCB. Also I could perform

    nrfutil dfu usb-serial -pkg blinky_mbr.zip -p COM16

    just like before with the dev kit. It worked. Now I want to do the same thing with our custom .zip. I created custom public and private keys and provided the public one to the bootloader. When executing

    nrfutil dfu usb-serial -pkg release_package.zip -p COM16

    I get following error message:

      [------------------------------------]    0%                                                                                                                                                                                               Traceback (most recent call last):                                                                                                                                                                                                             File "C:\Users\gv9479\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 197, in _run_module_as_main                                                                                                                                   return _run_code(code, main_globals, None,                                                                                                                                                                                                 File "C:\Users\gv9479\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in _run_code                                                                                                                                              exec(code, run_globals)                                                                                                                                                                                                                    File "C:\Users\gv9479\AppData\Local\Programs\Python\Python39\Scripts\nrfutil.exe\__main__.py", line 7, in <module>                                                                                                                           File "C:\Users\gv9479\AppData\Local\Programs\Python\Python39\lib\site-packages\click\core.py", line 1128, in __call__                                                                                                                          return self.main(*args, **kwargs)                                                                                                                                                                                                          File "C:\Users\gv9479\AppData\Local\Programs\Python\Python39\lib\site-packages\click\core.py", line 1053, in main                                                                                                                              rv = self.invoke(ctx)                                                                                                                                                                                                                      File "C:\Users\gv9479\AppData\Local\Programs\Python\Python39\lib\site-packages\click\core.py", line 1659, in invoke                                                                                                                            return _process_result(sub_ctx.command.invoke(sub_ctx))                                                                                                                                                                                    File "C:\Users\gv9479\AppData\Local\Programs\Python\Python39\lib\site-packages\click\core.py", line 1659, in invoke                                                                                                                            return _process_result(sub_ctx.command.invoke(sub_ctx))                                                                                                                                                                                    File "C:\Users\gv9479\AppData\Local\Programs\Python\Python39\lib\site-packages\click\core.py", line 1395, in invoke                                                                                                                            return ctx.invoke(self.callback, **ctx.params)                                                                                                                                                                                             File "C:\Users\gv9479\AppData\Local\Programs\Python\Python39\lib\site-packages\click\core.py", line 754, in invoke                                                                                                                             return __callback(*args, **kwargs)                                                                                                                                                                                                         File "C:\Users\gv9479\AppData\Local\Programs\Python\Python39\lib\site-packages\nordicsemi\__main__.py", line 1022, in usb_serial                                                                                                               do_serial(package, port, connect_delay, flow_control, packet_receipt_notification, baud_rate, serial_number, False,                                                                                                                        File "C:\Users\gv9479\AppData\Local\Programs\Python\Python39\lib\site-packages\nordicsemi\__main__.py", line 978, in do_serial                                                                                                                 dfu.dfu_send_images()                                                                                                                                                                                                                      File "C:\Users\gv9479\AppData\Local\Programs\Python\Python39\lib\site-packages\nordicsemi\dfu\dfu.py", line 127, in dfu_send_images                                                                                                            self._dfu_send_image(self.manifest.application)                                                                                                                                                                                            File "C:\Users\gv9479\AppData\Local\Programs\Python\Python39\lib\site-packages\nordicsemi\dfu\dfu.py", line 95, in _dfu_send_image                                                                                                             self.dfu_transport.send_init_packet(data)                                                                                                                                                                                                  File "C:\Users\gv9479\AppData\Local\Programs\Python\Python39\lib\site-packages\nordicsemi\dfu\dfu_transport_serial.py", line 256, in send_init_packet                                                                                          self.__execute()                                                                                                                                                                                                                           File "C:\Users\gv9479\AppData\Local\Programs\Python\Python39\lib\site-packages\nordicsemi\dfu\dfu_transport_serial.py", line 421, in __execute                                                                                                 self.__get_response(DfuTransportSerial.OP_CODE['Execute'])                                                                                                                                                                                 File "C:\Users\gv9479\AppData\Local\Programs\Python\Python39\lib\site-packages\nordicsemi\dfu\dfu_transport_serial.py", line 504, in __get_response                                                                                            raise NordicSemiException('Response Code {}'.format(                                                                                                                                                                                     pc_ble_driver_py.exceptions.NordicSemiException: Response Code InsufficientResources 

    Is this related to ressources in a memory sense?

    Here is our layout. Please correct if anything is wrong.

    Bootloader:

    <!DOCTYPE Linker_Placement_File>
    <Root name="Flash Section Placement">
      <MemorySegment name="FLASH1" start="$(FLASH_PH_START)" size="$(FLASH_PH_SIZE)">
        <ProgramSection load="no" name=".reserved_flash" start="$(FLASH_PH_START)" size="$(FLASH_START)-$(FLASH_PH_START)" />
        <ProgramSection alignment="0x100" load="Yes" name=".vectors" start="$(FLASH_START)" />
        <ProgramSection alignment="4" load="Yes" name=".init" />
        <ProgramSection alignment="4" load="Yes" name=".init_rodata" />
        <ProgramSection alignment="4" load="Yes" name=".text" size="0x4" />
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".crypto_data" inputsections="*(SORT(.crypto_data*))" address_symbol="__start_crypto_data" end_symbol="__stop_crypto_data" />
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".dfu_trans" inputsections="*(SORT(.dfu_trans*))" address_symbol="__start_dfu_trans" end_symbol="__stop_dfu_trans" />
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".nrf_queue" inputsections="*(.nrf_queue*)" address_symbol="__start_nrf_queue" end_symbol="__stop_nrf_queue" />
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".log_const_data" inputsections="*(SORT(.log_const_data*))" address_symbol="__start_log_const_data" end_symbol="__stop_log_const_data" />
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".nrf_balloc" inputsections="*(.nrf_balloc*)" address_symbol="__start_nrf_balloc" end_symbol="__stop_nrf_balloc" />
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".log_backends" inputsections="*(SORT(.log_backends*))" address_symbol="__start_log_backends" end_symbol="__stop_log_backends" />
        <ProgramSection alignment="4" keep="Yes" load="No" name=".nrf_sections" address_symbol="__start_nrf_sections" />
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".fs_data"  inputsections="*(.fs_data*)" runin=".fs_data_run"/>
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".log_dynamic_data"  inputsections="*(SORT(.log_dynamic_data*))" runin=".log_dynamic_data_run"/>
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".log_filter_data"  inputsections="*(SORT(.log_filter_data*))" runin=".log_filter_data_run"/>
        <ProgramSection alignment="4" load="Yes" name=".dtors" />
        <ProgramSection alignment="4" load="Yes" name=".ctors" />
        <ProgramSection alignment="4" load="Yes" name=".rodata" size="0x4" />
        <ProgramSection alignment="4" load="Yes" name=".ARM.exidx" address_symbol="__exidx_start" end_symbol="__exidx_end" />
        <ProgramSection alignment="4" load="Yes" runin=".fast_run" name=".fast" />
        <ProgramSection alignment="4" load="Yes" runin=".data_run" name=".data" />
        <ProgramSection alignment="4" load="Yes" runin=".tdata_run" name=".tdata" />
        <ProgramSection alignment="4" keep="Yes" load="No" name=".mbr_params_page" address_symbol="__start_mbr_params_page" end_symbol="__stop_mbr_params_page" start = "0x0007E000" size="0x1000" />
        <ProgramSection alignment="4" keep="Yes" load="No" name=".bootloader_settings_page" address_symbol="__start_bootloader_settings_page" end_symbol="__stop_bootloader_settings_page" start = "0x0007F000" size="0x1000" />
      </MemorySegment>
      <MemorySegment name="RAM1" start="$(RAM_PH_START)" size="$(RAM_PH_SIZE)">
        <ProgramSection load="no" name=".reserved_ram" start="$(RAM_PH_START)" size="$(RAM_START)-$(RAM_PH_START)" />
        <ProgramSection alignment="0x100" load="No" name=".vectors_ram" start="$(RAM_START)" address_symbol="__app_ram_start__"/>
        <ProgramSection alignment="4" keep="Yes" load="No" name=".nrf_sections_run" address_symbol="__start_nrf_sections_run" />
        <ProgramSection alignment="4" keep="Yes" load="No" name=".fs_data_run" address_symbol="__start_fs_data" end_symbol="__stop_fs_data" />
        <ProgramSection alignment="4" keep="Yes" load="No" name=".log_dynamic_data_run" address_symbol="__start_log_dynamic_data" end_symbol="__stop_log_dynamic_data" />
        <ProgramSection alignment="4" keep="Yes" load="No" name=".log_filter_data_run" address_symbol="__start_log_filter_data" end_symbol="__stop_log_filter_data" />
        <ProgramSection alignment="4" keep="Yes" load="No" name=".nrf_sections_run_end" address_symbol="__end_nrf_sections_run" />
        <ProgramSection alignment="4" load="No" name=".fast_run" />
        <ProgramSection alignment="4" load="No" name=".data_run" />
        <ProgramSection alignment="4" load="No" name=".tdata_run" />
        <ProgramSection alignment="4" load="No" name=".bss" />
        <ProgramSection alignment="4" load="No" name=".tbss" />
        <ProgramSection alignment="4" load="No" name=".non_init" />
        <ProgramSection alignment="4" size="__HEAPSIZE__" load="No" name=".heap" />
        <ProgramSection alignment="8" size="__STACKSIZE__" load="No" place_from_segment_end="Yes" name=".stack"  address_symbol="__StackLimit" end_symbol="__StackTop"/>
        <ProgramSection alignment="8" size="__STACKSIZE_PROCESS__" load="No" name=".stack_process" />
      </MemorySegment>
      <MemorySegment name="uicr_bootloader_start_address" start="0x10001014" size="0x4">
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".uicr_bootloader_start_address" address_symbol="__start_uicr_bootloader_start_address" end_symbol="__stop_uicr_bootloader_start_address" start = "0x10001014" size="0x4" />
      </MemorySegment>
      <MemorySegment name="uicr_mbr_params_page" start="0x10001018" size="0x4">
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".uicr_mbr_params_page" address_symbol="__start_uicr_mbr_params_page" end_symbol="__stop_uicr_mbr_params_page" start = "0x10001018" size="0x4" />
      </MemorySegment>
    </Root>
    

    Application:

    <!DOCTYPE Linker_Placement_File>
    <Root name="Flash Section Placement">
      <MemorySegment name="FLASH" start="$(FLASH_PH_START)" size="$(FLASH_PH_SIZE)">
        <ProgramSection alignment="0x100" load="Yes" name=".vectors" start="$(FLASH_START)" />
        <ProgramSection alignment="4" load="Yes" name=".init" />
        <ProgramSection alignment="4" load="Yes" name=".init_rodata" />
        <ProgramSection alignment="4" load="Yes" name=".text" />
    	<ProgramSection alignment="4" load="Yes" name="VERSIONSTRING_SECTION" />
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".pwr_mgmt_data" inputsections="*(SORT(.pwr_mgmt_data*))" address_symbol="__start_pwr_mgmt_data" end_symbol="__stop_pwr_mgmt_data" />
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".log_const_data" inputsections="*(SORT(.log_const_data*))" address_symbol="__start_log_const_data" end_symbol="__stop_log_const_data" />
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".log_backends" inputsections="*(SORT(.log_backends*))" address_symbol="__start_log_backends" end_symbol="__stop_log_backends" />
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".nrf_balloc" inputsections="*(.nrf_balloc*)" address_symbol="__start_nrf_balloc" end_symbol="__stop_nrf_balloc" />
        <ProgramSection alignment="4" keep="Yes" load="No" name=".nrf_sections" address_symbol="__start_nrf_sections" />
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".log_dynamic_data"  inputsections="*(SORT(.log_dynamic_data*))" runin=".log_dynamic_data_run"/>
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".log_filter_data"  inputsections="*(SORT(.log_filter_data*))" runin=".log_filter_data_run"/>
        <ProgramSection alignment="4" load="Yes" name=".dtors" />
        <ProgramSection alignment="4" load="Yes" name=".ctors" />
        <ProgramSection alignment="4" load="Yes" name=".rodata" />
        <ProgramSection alignment="4" load="Yes" name=".ARM.exidx" address_symbol="__exidx_start" end_symbol="__exidx_end" />
        <ProgramSection alignment="4" load="Yes" runin=".fast_run" name=".fast" />
        <ProgramSection alignment="4" load="Yes" runin=".data_run" name=".data" />
        <ProgramSection alignment="4" load="Yes" runin=".tdata_run" name=".tdata" />
      </MemorySegment>
      <MemorySegment name="RAM" start="$(RAM_PH_START)" size="$(RAM_PH_SIZE)">
        <ProgramSection alignment="0x100" load="No" name=".vectors_ram" start="$(RAM_START)" address_symbol="__app_ram_start__"/>
        <ProgramSection alignment="4" keep="Yes" load="No" name=".nrf_sections_run" address_symbol="__start_nrf_sections_run" />
        <ProgramSection alignment="4" keep="Yes" load="No" name=".log_dynamic_data_run" address_symbol="__start_log_dynamic_data" end_symbol="__stop_log_dynamic_data" />
        <ProgramSection alignment="4" keep="Yes" load="No" name=".log_filter_data_run" address_symbol="__start_log_filter_data" end_symbol="__stop_log_filter_data" />
        <ProgramSection alignment="4" keep="Yes" load="No" name=".nrf_sections_run_end" address_symbol="__end_nrf_sections_run" />
        <ProgramSection alignment="4" load="No" name=".fast_run" />
        <ProgramSection alignment="4" load="No" name=".data_run" />
        <ProgramSection alignment="4" load="No" name=".tdata_run" />
        <ProgramSection alignment="4" load="No" name=".bss" />
        <ProgramSection alignment="4" load="No" name=".tbss" />
        <ProgramSection alignment="4" load="No" name=".non_init" />
        <ProgramSection alignment="4" size="__HEAPSIZE__" load="No" name=".heap" />
        <ProgramSection alignment="8" size="__STACKSIZE__" load="No" place_from_segment_end="Yes" name=".stack"  address_symbol="__StackLimit" end_symbol="__StackTop"/>
        <ProgramSection alignment="8" size="__STACKSIZE_PROCESS__" load="No" name=".stack_process" />
      </MemorySegment>
      <MemorySegment name="ot_flash_data" start="0x7E000" size="0x2000">
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".ot_flash_data" address_symbol="__start_ot_flash_data" end_symbol="__stop_ot_flash_data" start = "0x7E000" size="0x2000" />
      </MemorySegment>
    </Root>
    

Reply
  • Hi,

    I have another question. Since there is no bootloader example for the NRF52833 in the SDK 16.0.0, I downloaded the SDK 17.1.0. Now I am trying to build a bootloader based on the secure_bootloader_usb_mbr_pca10100e because it already has the crypto needed (when migrating from a 10065 example we had to do this manually). I had to download and build uECC. I could flash the bootloader to our custom PCB. Also I could perform

    nrfutil dfu usb-serial -pkg blinky_mbr.zip -p COM16

    just like before with the dev kit. It worked. Now I want to do the same thing with our custom .zip. I created custom public and private keys and provided the public one to the bootloader. When executing

    nrfutil dfu usb-serial -pkg release_package.zip -p COM16

    I get following error message:

      [------------------------------------]    0%                                                                                                                                                                                               Traceback (most recent call last):                                                                                                                                                                                                             File "C:\Users\gv9479\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 197, in _run_module_as_main                                                                                                                                   return _run_code(code, main_globals, None,                                                                                                                                                                                                 File "C:\Users\gv9479\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in _run_code                                                                                                                                              exec(code, run_globals)                                                                                                                                                                                                                    File "C:\Users\gv9479\AppData\Local\Programs\Python\Python39\Scripts\nrfutil.exe\__main__.py", line 7, in <module>                                                                                                                           File "C:\Users\gv9479\AppData\Local\Programs\Python\Python39\lib\site-packages\click\core.py", line 1128, in __call__                                                                                                                          return self.main(*args, **kwargs)                                                                                                                                                                                                          File "C:\Users\gv9479\AppData\Local\Programs\Python\Python39\lib\site-packages\click\core.py", line 1053, in main                                                                                                                              rv = self.invoke(ctx)                                                                                                                                                                                                                      File "C:\Users\gv9479\AppData\Local\Programs\Python\Python39\lib\site-packages\click\core.py", line 1659, in invoke                                                                                                                            return _process_result(sub_ctx.command.invoke(sub_ctx))                                                                                                                                                                                    File "C:\Users\gv9479\AppData\Local\Programs\Python\Python39\lib\site-packages\click\core.py", line 1659, in invoke                                                                                                                            return _process_result(sub_ctx.command.invoke(sub_ctx))                                                                                                                                                                                    File "C:\Users\gv9479\AppData\Local\Programs\Python\Python39\lib\site-packages\click\core.py", line 1395, in invoke                                                                                                                            return ctx.invoke(self.callback, **ctx.params)                                                                                                                                                                                             File "C:\Users\gv9479\AppData\Local\Programs\Python\Python39\lib\site-packages\click\core.py", line 754, in invoke                                                                                                                             return __callback(*args, **kwargs)                                                                                                                                                                                                         File "C:\Users\gv9479\AppData\Local\Programs\Python\Python39\lib\site-packages\nordicsemi\__main__.py", line 1022, in usb_serial                                                                                                               do_serial(package, port, connect_delay, flow_control, packet_receipt_notification, baud_rate, serial_number, False,                                                                                                                        File "C:\Users\gv9479\AppData\Local\Programs\Python\Python39\lib\site-packages\nordicsemi\__main__.py", line 978, in do_serial                                                                                                                 dfu.dfu_send_images()                                                                                                                                                                                                                      File "C:\Users\gv9479\AppData\Local\Programs\Python\Python39\lib\site-packages\nordicsemi\dfu\dfu.py", line 127, in dfu_send_images                                                                                                            self._dfu_send_image(self.manifest.application)                                                                                                                                                                                            File "C:\Users\gv9479\AppData\Local\Programs\Python\Python39\lib\site-packages\nordicsemi\dfu\dfu.py", line 95, in _dfu_send_image                                                                                                             self.dfu_transport.send_init_packet(data)                                                                                                                                                                                                  File "C:\Users\gv9479\AppData\Local\Programs\Python\Python39\lib\site-packages\nordicsemi\dfu\dfu_transport_serial.py", line 256, in send_init_packet                                                                                          self.__execute()                                                                                                                                                                                                                           File "C:\Users\gv9479\AppData\Local\Programs\Python\Python39\lib\site-packages\nordicsemi\dfu\dfu_transport_serial.py", line 421, in __execute                                                                                                 self.__get_response(DfuTransportSerial.OP_CODE['Execute'])                                                                                                                                                                                 File "C:\Users\gv9479\AppData\Local\Programs\Python\Python39\lib\site-packages\nordicsemi\dfu\dfu_transport_serial.py", line 504, in __get_response                                                                                            raise NordicSemiException('Response Code {}'.format(                                                                                                                                                                                     pc_ble_driver_py.exceptions.NordicSemiException: Response Code InsufficientResources 

    Is this related to ressources in a memory sense?

    Here is our layout. Please correct if anything is wrong.

    Bootloader:

    <!DOCTYPE Linker_Placement_File>
    <Root name="Flash Section Placement">
      <MemorySegment name="FLASH1" start="$(FLASH_PH_START)" size="$(FLASH_PH_SIZE)">
        <ProgramSection load="no" name=".reserved_flash" start="$(FLASH_PH_START)" size="$(FLASH_START)-$(FLASH_PH_START)" />
        <ProgramSection alignment="0x100" load="Yes" name=".vectors" start="$(FLASH_START)" />
        <ProgramSection alignment="4" load="Yes" name=".init" />
        <ProgramSection alignment="4" load="Yes" name=".init_rodata" />
        <ProgramSection alignment="4" load="Yes" name=".text" size="0x4" />
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".crypto_data" inputsections="*(SORT(.crypto_data*))" address_symbol="__start_crypto_data" end_symbol="__stop_crypto_data" />
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".dfu_trans" inputsections="*(SORT(.dfu_trans*))" address_symbol="__start_dfu_trans" end_symbol="__stop_dfu_trans" />
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".nrf_queue" inputsections="*(.nrf_queue*)" address_symbol="__start_nrf_queue" end_symbol="__stop_nrf_queue" />
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".log_const_data" inputsections="*(SORT(.log_const_data*))" address_symbol="__start_log_const_data" end_symbol="__stop_log_const_data" />
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".nrf_balloc" inputsections="*(.nrf_balloc*)" address_symbol="__start_nrf_balloc" end_symbol="__stop_nrf_balloc" />
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".log_backends" inputsections="*(SORT(.log_backends*))" address_symbol="__start_log_backends" end_symbol="__stop_log_backends" />
        <ProgramSection alignment="4" keep="Yes" load="No" name=".nrf_sections" address_symbol="__start_nrf_sections" />
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".fs_data"  inputsections="*(.fs_data*)" runin=".fs_data_run"/>
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".log_dynamic_data"  inputsections="*(SORT(.log_dynamic_data*))" runin=".log_dynamic_data_run"/>
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".log_filter_data"  inputsections="*(SORT(.log_filter_data*))" runin=".log_filter_data_run"/>
        <ProgramSection alignment="4" load="Yes" name=".dtors" />
        <ProgramSection alignment="4" load="Yes" name=".ctors" />
        <ProgramSection alignment="4" load="Yes" name=".rodata" size="0x4" />
        <ProgramSection alignment="4" load="Yes" name=".ARM.exidx" address_symbol="__exidx_start" end_symbol="__exidx_end" />
        <ProgramSection alignment="4" load="Yes" runin=".fast_run" name=".fast" />
        <ProgramSection alignment="4" load="Yes" runin=".data_run" name=".data" />
        <ProgramSection alignment="4" load="Yes" runin=".tdata_run" name=".tdata" />
        <ProgramSection alignment="4" keep="Yes" load="No" name=".mbr_params_page" address_symbol="__start_mbr_params_page" end_symbol="__stop_mbr_params_page" start = "0x0007E000" size="0x1000" />
        <ProgramSection alignment="4" keep="Yes" load="No" name=".bootloader_settings_page" address_symbol="__start_bootloader_settings_page" end_symbol="__stop_bootloader_settings_page" start = "0x0007F000" size="0x1000" />
      </MemorySegment>
      <MemorySegment name="RAM1" start="$(RAM_PH_START)" size="$(RAM_PH_SIZE)">
        <ProgramSection load="no" name=".reserved_ram" start="$(RAM_PH_START)" size="$(RAM_START)-$(RAM_PH_START)" />
        <ProgramSection alignment="0x100" load="No" name=".vectors_ram" start="$(RAM_START)" address_symbol="__app_ram_start__"/>
        <ProgramSection alignment="4" keep="Yes" load="No" name=".nrf_sections_run" address_symbol="__start_nrf_sections_run" />
        <ProgramSection alignment="4" keep="Yes" load="No" name=".fs_data_run" address_symbol="__start_fs_data" end_symbol="__stop_fs_data" />
        <ProgramSection alignment="4" keep="Yes" load="No" name=".log_dynamic_data_run" address_symbol="__start_log_dynamic_data" end_symbol="__stop_log_dynamic_data" />
        <ProgramSection alignment="4" keep="Yes" load="No" name=".log_filter_data_run" address_symbol="__start_log_filter_data" end_symbol="__stop_log_filter_data" />
        <ProgramSection alignment="4" keep="Yes" load="No" name=".nrf_sections_run_end" address_symbol="__end_nrf_sections_run" />
        <ProgramSection alignment="4" load="No" name=".fast_run" />
        <ProgramSection alignment="4" load="No" name=".data_run" />
        <ProgramSection alignment="4" load="No" name=".tdata_run" />
        <ProgramSection alignment="4" load="No" name=".bss" />
        <ProgramSection alignment="4" load="No" name=".tbss" />
        <ProgramSection alignment="4" load="No" name=".non_init" />
        <ProgramSection alignment="4" size="__HEAPSIZE__" load="No" name=".heap" />
        <ProgramSection alignment="8" size="__STACKSIZE__" load="No" place_from_segment_end="Yes" name=".stack"  address_symbol="__StackLimit" end_symbol="__StackTop"/>
        <ProgramSection alignment="8" size="__STACKSIZE_PROCESS__" load="No" name=".stack_process" />
      </MemorySegment>
      <MemorySegment name="uicr_bootloader_start_address" start="0x10001014" size="0x4">
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".uicr_bootloader_start_address" address_symbol="__start_uicr_bootloader_start_address" end_symbol="__stop_uicr_bootloader_start_address" start = "0x10001014" size="0x4" />
      </MemorySegment>
      <MemorySegment name="uicr_mbr_params_page" start="0x10001018" size="0x4">
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".uicr_mbr_params_page" address_symbol="__start_uicr_mbr_params_page" end_symbol="__stop_uicr_mbr_params_page" start = "0x10001018" size="0x4" />
      </MemorySegment>
    </Root>
    

    Application:

    <!DOCTYPE Linker_Placement_File>
    <Root name="Flash Section Placement">
      <MemorySegment name="FLASH" start="$(FLASH_PH_START)" size="$(FLASH_PH_SIZE)">
        <ProgramSection alignment="0x100" load="Yes" name=".vectors" start="$(FLASH_START)" />
        <ProgramSection alignment="4" load="Yes" name=".init" />
        <ProgramSection alignment="4" load="Yes" name=".init_rodata" />
        <ProgramSection alignment="4" load="Yes" name=".text" />
    	<ProgramSection alignment="4" load="Yes" name="VERSIONSTRING_SECTION" />
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".pwr_mgmt_data" inputsections="*(SORT(.pwr_mgmt_data*))" address_symbol="__start_pwr_mgmt_data" end_symbol="__stop_pwr_mgmt_data" />
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".log_const_data" inputsections="*(SORT(.log_const_data*))" address_symbol="__start_log_const_data" end_symbol="__stop_log_const_data" />
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".log_backends" inputsections="*(SORT(.log_backends*))" address_symbol="__start_log_backends" end_symbol="__stop_log_backends" />
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".nrf_balloc" inputsections="*(.nrf_balloc*)" address_symbol="__start_nrf_balloc" end_symbol="__stop_nrf_balloc" />
        <ProgramSection alignment="4" keep="Yes" load="No" name=".nrf_sections" address_symbol="__start_nrf_sections" />
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".log_dynamic_data"  inputsections="*(SORT(.log_dynamic_data*))" runin=".log_dynamic_data_run"/>
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".log_filter_data"  inputsections="*(SORT(.log_filter_data*))" runin=".log_filter_data_run"/>
        <ProgramSection alignment="4" load="Yes" name=".dtors" />
        <ProgramSection alignment="4" load="Yes" name=".ctors" />
        <ProgramSection alignment="4" load="Yes" name=".rodata" />
        <ProgramSection alignment="4" load="Yes" name=".ARM.exidx" address_symbol="__exidx_start" end_symbol="__exidx_end" />
        <ProgramSection alignment="4" load="Yes" runin=".fast_run" name=".fast" />
        <ProgramSection alignment="4" load="Yes" runin=".data_run" name=".data" />
        <ProgramSection alignment="4" load="Yes" runin=".tdata_run" name=".tdata" />
      </MemorySegment>
      <MemorySegment name="RAM" start="$(RAM_PH_START)" size="$(RAM_PH_SIZE)">
        <ProgramSection alignment="0x100" load="No" name=".vectors_ram" start="$(RAM_START)" address_symbol="__app_ram_start__"/>
        <ProgramSection alignment="4" keep="Yes" load="No" name=".nrf_sections_run" address_symbol="__start_nrf_sections_run" />
        <ProgramSection alignment="4" keep="Yes" load="No" name=".log_dynamic_data_run" address_symbol="__start_log_dynamic_data" end_symbol="__stop_log_dynamic_data" />
        <ProgramSection alignment="4" keep="Yes" load="No" name=".log_filter_data_run" address_symbol="__start_log_filter_data" end_symbol="__stop_log_filter_data" />
        <ProgramSection alignment="4" keep="Yes" load="No" name=".nrf_sections_run_end" address_symbol="__end_nrf_sections_run" />
        <ProgramSection alignment="4" load="No" name=".fast_run" />
        <ProgramSection alignment="4" load="No" name=".data_run" />
        <ProgramSection alignment="4" load="No" name=".tdata_run" />
        <ProgramSection alignment="4" load="No" name=".bss" />
        <ProgramSection alignment="4" load="No" name=".tbss" />
        <ProgramSection alignment="4" load="No" name=".non_init" />
        <ProgramSection alignment="4" size="__HEAPSIZE__" load="No" name=".heap" />
        <ProgramSection alignment="8" size="__STACKSIZE__" load="No" place_from_segment_end="Yes" name=".stack"  address_symbol="__StackLimit" end_symbol="__StackTop"/>
        <ProgramSection alignment="8" size="__STACKSIZE_PROCESS__" load="No" name=".stack_process" />
      </MemorySegment>
      <MemorySegment name="ot_flash_data" start="0x7E000" size="0x2000">
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".ot_flash_data" address_symbol="__start_ot_flash_data" end_symbol="__stop_ot_flash_data" start = "0x7E000" size="0x2000" />
      </MemorySegment>
    </Root>
    

Children
  • Hi,

    Yes, this would be resources regarding memory. Either your application is too large or memory is configured incorrectly. Please see Memory layout to see where different firmware components are located.

    Are you using dual-bank or single-bank updates? What are NRF_DFU_SINGLE_BANK_APP_UPDATES and NRF_DFU_FORCE_DUAL_BANK_APP_UPDATES set to in sdk_config.h in the project? 

    Best regards,

    Marte

  • Hi,

    single bank would be enough.

    #define NRF_DFU_SINGLE_BANK_APP_UPDATES 0

    #define NRF_DFU_FORCE_DUAL_BANK_APP_UPDATES 0

  • Hi,

    Try to enable single-bank updates by setting NRF_DFU_SINGLE_BANK_APP_UPDATES to 1. 

    Best regards,

    Marte

  • Hi,

    thanks for your quick reply. I get the same error message.

  • Hi,

    I see that you have made changes to the memory layout in section placement macros. FLASH_START is the start address of the program, so in the bootloader project, secure_bootloader_usb_mbr_pca10100e, this will be the start address of the bootloader. This should be 0x78000, but you have set this to 0x24000, which is too low.

    If you look at the memory layout I linked to in one of my previous replies, you will see that for nRF52833 you have the following:

    Usage Memory range nRF52833 (S113 v7.0.x) Memory range nRF52833 (S140 v7.0.x)
    Bootloader settings 0x0007 F000 - 0x0008 0000 (4 kB) 0x0007 F000 - 0x0008 0000 (4 kB)
    MBR parameter storage 0x0007 E000 - 0x0007 F000 (4 kB) 0x0007 E000 - 0x0007 F000 (4 kB)
    Bootloader 0x0007 8000 - 0x0007 E000 (24 kB) 0x0007 8000 - 0x0007 E000 (24 kB)
    Application area (incl. free space) 0x0001 C000 - 0x0007 8000 (368 kB) 0x0002 6000 - 0x0007 8000 (328 kB)
    SoftDevice 0x0000 1000 - 0x0001 C000 (112 kB) 0x0000 1000 - 0x0002 6000 (148 kB)
    Master Boot Record (MBR) 0x0000 0000 - 0x0000 1000 (4 kB) 0x0000 0000 - 0x0000 1000 (4 kB)

    This is with SoftDevice, but even without SoftDevice and MBR the application area is 0x0 to 0x78000. You can also see this in the section placement macros in your application, where FLASH_START is 0x0 and FLASH_SIZE is 0x7e000. Right now you are programming the bootloader at 0x24000 - 0x36000, and then you try to perform DFU with an application that should be located in the area 0x0 - 0x78000, but part of this is already taken by the bootloader. The size of bootloader flash, 0x12000, is also larger than it needs to be. As you can see in the the memory layout, you only need 0x6000. 

    Best regards,

    Marte

Related