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

Custom DFU bootloader

Hi,

I have a custom board with the nRF52840.

Is it possible to customize the DFU to be able to update the firmware through other interfaces than BLE or USB/UART?

I have a SD-card connected and would like to check for a flash image on the card and then update the firmware if there is an image.

Would that be possible?

  • Hi Morten, 

    I used your tool (thanks again) to make a .hex file. Now my application reads that file and write it byte by byte. 

    Now the NRF_DFU_EVT_DFU_STARTED switch case gets fired but right after, the nrf_dfu_req_handler complaints about the firmware size:

    Creating the object with size 0x00001000 would overflow firmware size. Offset is 0x00000000 and firmware size is 0x00000844

    I'm not sure if I set a wrong value for the firmware size or if there is any other problem. 

    The full log is this:

    <info> app: Application version 0
    <info> app: Writting
    <info> app: NRF_DFU_EVT_DFU_STARTED
    <error> nrf_dfu_req_handler: Creating the object with size 0x00001000 would overflow firmware size. Offset is 0x00000000 and firmware size is 0x00000844.
    <warning> nrf_dfu_serial: DFU request completed with result: 0x8
    <info> app: NRF_DFU_EVT_DFU_FAILED
    <error> nrf_dfu_req_handler: Write request too long
    <warning> nrf_dfu_serial: DFU request completed with result: 0x3
    <info> app: NRF_DFU_EVT_DFU_FAILED
    <error> nrf_dfu_req_handler: Write request too long
    <warning> nrf_dfu_serial: DFU request completed with result: 0x3
    <info> app: NRF_DFU_EVT_DFU_FAILED
    <error> nrf_dfu_serial_uart: Failed to allocate buffer
    <error> nrf_dfu_req_handler: Write request too long
    <warning> nrf_dfu_serial: DFU request completed with result: 0x3
    <info> app: NRF_DFU_EVT_DFU_FAILED
    <error> nrf_dfu_serial_uart: Failed to allocate buffer
    <error> nrf_dfu_req_handler: Write request too long
    <warning> nrf_dfu_serial: DFU request completed with result: 0x3
    <info> app: NRF_DFU_EVT_DFU_FAILED

    Am I missing something?

    Javier Balboa

  • Hi Javier,

    Can you check your linker settings in your project.

    I use a nRF52840 with Softdevice 6.1.1 and SDK 15.3 and has the following settings:

    FLASH_PH_START=0x0

    FLASH_PH_SIZE=0x100000

    RAM_PH_START=0x20000000

    RAM_PH_SIZE=0x40000

    FLASH_START=0x26000

    FLASH_SIZE=0xda000

    RAM_START=0x20002b88

    RAM_SIZE=0x3d478

    I believe I had the same problem until I found the correct values.

  • I'm using the same softdevice and SDK as you. I changed the settings according with your specs and when I try to debug the application I get a 'Stopped by vector catch' and doesn't start...

    The linker configuration I'm using is this:

    linker_section_placement_macros="FLASH_PH_START=0x0;FLASH_PH_SIZE=0x100000;RAM_PH_START=0x20000000;RAM_PH_SIZE=0x40000;FLASH_START=0x26000;FLASH_SIZE=0xda000;RAM_START=0x20002b88;RAM_SIZE=0x3d478"
    linker_section_placements_segments="FLASH RX 0x0 0x100000;RAM RWX 0x20000000 0x40000;uicr_bootloader_start_address RX 0x00000FF8 0x4;uicr_mbr_params_page RX 0x00000FFC 0x4;mbr_params_page RX 0x0007E000 0x1000;bootloader_settings_page RX 0x0007F000 0x1000"

  • I verified that we have the same linker_section_placement_macros values.

    We differ in linker_section_placements_segments:

    FLASH RX 0x0 0x100000;RAM RWX 0x20000000 0x40000;uicr_bootloader_start_address RX 0x00000FF8 0x4 ;uicr_mbr_params_page RX 0x00000FFC 0x4;mbr_params_page RX 0x000FE000 0x1000;bootloader_settings_page RX 0x000FF000 0x1000

    I Also checked the settings from the DFU_bootloader. Here are my settings:

    FLASH RX 0x0 0x100000;RAM RWX 0x20000000 0x40000;uicr_bootloader_start_address RX 0x00000FF8 0x4;bootloader_settings_page RX 0x000FF000 0x1000;uicr_mbr_params_page RX 0x00000FFC 0x4;mbr_params_page RX 0x000FE000 0x1000

    FLASH_PH_START=0x0;FLASH_PH_SIZE=0x100000;RAM_PH_START=0x20000000;RAM_PH_SIZE=0x40000;FLASH_START=0xf8000;FLASH_SIZE=0x6000;RAM_START=0x20004000;RAM_SIZE=0x3bad0

  • Sorry for being a real pain but, could you share the flash_placement.xml file? I think I have a misconfiguration and I don't know where...

Related