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

Can't get DFU to work

I am developing an app for the 51822 with 16KB RAM, which is supposed to integrate the buttonless DFU.

I have attached the whole hex of the merged application+softdevice+bootloader, and also the linker script for my app.

Sadly, I have lost the linker script for the bootloader, but the address offsets can be seen in this extract from the nrf-intel-hex demo site:

please correct me if any of my labeling is wrong.
The bootloader works and allows uploading my code (standalone hex in that case) via Bluetooth.
The issue occurs when the application starts (even when there is not bootloader in place at all):
That's the RTT output of my application.
To me, the error seems to appear in the line
in nrf_dfu_flash.c::nrf_dfu_flash_erase().
1. Is there anything with my memory layout?
2  How can I get the application to boot normaly?
3. Why is the code trying to delete something at address 0x200021e8? Is that some kind of mapping of the flash to the ram?
     0x200021e8 Clearly exceeds the boundaries of the flash itself, thus I am wondering wha it does not try to delete an address contained in the flash...
4. How does the size parameter in the linker script (0x1D9E0 and 0x2008) affect the resulting hex or flash layout?
    The sizes of the blocks in the hex do not seem to have any correlation to the sizes given in the linker script as far as I can cell.
Parents
  • Hi Daniel, 

    Did you do any modification to the bootloader ? 
    What showed in the log looks strange. The m_dfu_settings_buffer should be located in flash at location BOOTLOADER_SETTINGS_ADDRESS ( 0x0003FC00) but in your log it's located at 0x200021e8 which is RAM. 
    This setting is configurated in nrf_dfu_settings.c . Could you let me know which compiler do you use ? 

    Have you tried to test updating a very small example using unmodified bootloader from the SDK ? I have a step by step guide here

Reply
  • Hi Daniel, 

    Did you do any modification to the bootloader ? 
    What showed in the log looks strange. The m_dfu_settings_buffer should be located in flash at location BOOTLOADER_SETTINGS_ADDRESS ( 0x0003FC00) but in your log it's located at 0x200021e8 which is RAM. 
    This setting is configurated in nrf_dfu_settings.c . Could you let me know which compiler do you use ? 

    Have you tried to test updating a very small example using unmodified bootloader from the SDK ? I have a step by step guide here

Children
  • I am using the armgcc folder on the command line with "arm-none-eabi-gcc" as my compiler through "make build".

    Here is what I found out:

    nrf_dfu_settings.c states

    During the compilation, "__GNUC__" seems to be set, which seems to involve 

    section(".bootloaderSettings"), which is not configured in my linker script.
    Is there any adjustment I need to make to my linker script?
  • Indeed it turned out that my linker script was incomplete.

    8156.freshener_nrf51.lddemonstrates how it works for me when compiling using armgcc and make.