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

Single bank Bootloader is over 16k when generating zip file for OTA

Hi there,

I have a nrf51422CEAA chip with 16k variant with single bank bootloader code. I compile it using (03) optimazation and the final result is :

"Program Size: Code=12000 RO-data=332 RW-data=1248 ZI-data=3976"

My Keil setting is what this support group suggested. And these are: IROM1: 0x3C000 - 0x3C00 IRAM1: 0x20002C00 - 0x1380 IRAM2: 0x20003F80 - 0x80 (noint, checked)

I deleted all the button and LED component code save ROM and RAM. This bootloader is using s310_nrf51422_3.0.0_softdevice and working good with my app code and softdevice and but manually flashing it using Keil.

But when I make a zip for bootloader OTA, the size is more than 16k.

Will you help me solve this problem. I wanted to OTA the bootloader.

Thanks, MC With_BANK_VALID_APP_bt.map nrf51422_xxac.map With_BANK_VALID_APP_bt.hex nrf51422_xxac.hex

Parents
  • Hi,

    Are you using nrfutil to generate the distribution file as explained here?

    e.g., nrfutil dfu genpkg ../application.zip --bootloader .hex --application-version 0xFFFFFFFF --dev-revision 0xFFFF --dev-type 0xFFFF --sd-req 0xFFFE

    Note that this tool strips the UICR section from the .hex file before converting to a binary image. Otherwise you'd gotten a lot of byte padding in the image since UICR register are memory mapped to 0x10001000 (0x3c000 -> 0x10001000 = ~250MB).

    Attachment:

    application.zip

Reply
  • Hi,

    Are you using nrfutil to generate the distribution file as explained here?

    e.g., nrfutil dfu genpkg ../application.zip --bootloader .hex --application-version 0xFFFFFFFF --dev-revision 0xFFFF --dev-type 0xFFFF --sd-req 0xFFFE

    Note that this tool strips the UICR section from the .hex file before converting to a binary image. Otherwise you'd gotten a lot of byte padding in the image since UICR register are memory mapped to 0x10001000 (0x3c000 -> 0x10001000 = ~250MB).

    Attachment:

    application.zip

Children
  • Hi Vidar,

    This is my command in generating the bootloader package:

    nrfutil dfu genpkg --bootloader MyBT16kFile.hex --application-version 0xFFFFFFFF --dev-type 0x0### --dev-revision 0x0### --sd-req 0x## MyBT16kOTA.zip

    This much the same in you suggestion. ### is handled in the bootloader code.

    I tried the example dual bank of S310 but there is an error when converting to 16k but get struck with the error:

    ._build\nrf51422_xxac.axf: Error: L6406E: No space in execution regions with .ANY selector matching arm_startup_nrf51.o(STACK). ._build\nrf51422_xxac.axf: Error: L6407E: Sections of aggregate size 0x800 bytes could not fit into .ANY selector(s).

    I tried to search for the fix of this but no luck...I tried hacking the stack size to 255 and it compiled okay but I do not wan't to have a problem in the future of hacking stack.

    I am back to solving the puzzle of nrfutil why it exceeds 16k. Some note, I used the no pack of SDK9.0 for my code.

    -MC

  • Hi Vidar,

    I think I find the answer on this link. devzone.nordicsemi.com/.../p>

    The problem is until now this was not yet solve.

    Thank you for helping.

    -MC

  • Hi Vidar,

    The link help me solve why there is an extra bytes in my bootloader code when enabling the:

    uint8_t m_boot_settings[CODE_PAGE_SIZE] attribute((at(BOOTLOADER_SETTINGS_ADDRESS))) attribute((used)) = {BANK_VALID_APP} ;

    The work around was suggested that merging the bootloader_setting.hex with the code of

    uint8_t m_boot_settings[CODE_PAGE_SIZE] attribute((at(BOOTLOADER_SETTINGS_ADDRESS))) attribute((used));

    But then is still when generating the package size its still above 16k. *.bin = 15368, *.dat = 14, *.json = 492. A total of 16,226 bytes. The nRF_toolbox always says "data Size Exceeds".

    Do you have any idea on how to lower it below 16k.

    Thanks.

  • The .bin file is just exceeding 15K. Note that it's only the binary image that will be loaded to flash and potentially cause the "data Size Exceeds". The content of .dat will be transferred in the init packet, and loaded to RAM, and the json is used by the smart phone app determine the content of the distribution packet.

    Could you share the .map file from your build output so I can see if there might be anything linked outside of the default address range?

  • Hi Vidar,

    Attached is the map files. The nRF51422-xxac.map is the file I merge with bootloader_setting.hex that just exceeding 15k as you mentioned.

    Regards, MC

Related