This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Bootloader hardfault

Hi,

Im trying to use BLE DFU Bootloader from examples. I loaded SD8 and then bootloader via nrfStudio (dont have a valid app flashed), but I cant see the device from Android app. I decided to do some debugging via Keil. I recompiled Bootloader with no optimisation and moved bootloader address to 0x3A000.

If I try to debug in Keil it doesnt stop at main, but if i manually press stop it gets into hardfault: image description

Memory settings: image description

Compilation settings: image description

Im using Revision 3 chip. What do I do wrong?

app.zip

hex

Bootloader

Bootloader hex O3

bootloader package without BANK_VALID_APP

Bootloader HEX without BANK_VALID_APP

Memory map according to NRF Studio: Memory map

Bootloader optimisation Level 2 gets stuck on run: image description

Image size > 0x6400

  • When you flash it using a programmer, you will update the bootloader start address that is written to a UICR register. This is not done when performing a OTA DFU, then you only replace the bootloader, but the bootloader start adress will remain the same as the old bootloader.

  • ive added a screenshot of NRF Studio where it shows that start address of bootloader is 0x3A000, so if the image size would be 0x6000 it wouldnt fit and we would get a programming error, correct? Then the question is why you think image size is 0x6000, but NRF Studio programs it as 0x5C00 without errors and BL also works.

    Nevertheless I did what you suggested - Increased BL memory by another 1K, but the result is still the same - getting Exceeded Data Size error. Do you have some other suggestions?

  • NRF_ERROR_DATA_SIZE is returned at line 334, 339, and 415 in dfu_single_bank.c . Start a Debug Session in the bootloader project, set a breakpoint at each of these locations and perform a firmware update.

    When I performed a DFU, I got caught at the breakpoint at line 334:

     if (m_start_packet.bl_image_size > DFU_BL_IMAGE_MAX_SIZE)
        {
            return NRF_ERROR_DATA_SIZE;
        }
    
  • I cant even compile it with Level 0 optimisation, I get this error: ._build\nrf51422_xxac.axf: Error: L6985E: Unable to automatically place AT section bootloader_settings.o(.ARM.__AT_0x0003FC00) with required base address 0x0003fc00. Please manually place in the scatter file using the --no_autoat option.

    If I use 24Kb or 25Kb, same error.

  • You're not able to set breakpoints at the locations when using Level 3 or 2?

Related