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

SDK 8.0.0 DFU bootloader code size too large, gcc

I've taken the example project at nRF51_SDK_8.0.0_5fc2c3a/examples/dfu/bootloader and attempted to build it using gcc. I'm going for a single bank update over BLE. The SDK docs here...

developer.nordicsemi.com/.../a00088.html

...claim the bootloader can be built in under 16kB but mine is coming in at over 64kB, so clearly I'm doing something quite wrong.

gcc_nrf51_bootloader_xxac.ld(/attachment/1833090283e7aacc3d6f36a5c294ab07)

bootloader_s110.Map

I've attached my linker script and my *.Map file for the bootloader. There's plenty of discussion here about getting this working but I can't find another thread with a working linker script and makefile for SDK 8.0.0 and gcc.

Parents
  • GCC can do it, here's an example. The bootloader_util_gcc.c file in the SDK is fairly close. This works with both single and dual bank updates. It would be nice if a GCC version, like this, was included in future versions of the SDK.

    First, if you set m_uicr_bootloader_start_address as a volatile, BOOTLOADER_REGION_START will be written to flash when you program the hex file. If not, it will be optimized out so you'll have to program BOOTLOADER_REGION_START into the UICR later.

    Next, you have to pass the argument start_addr to the assembly template so you get the expected application reset vector. If you don't do this the DFU will upload successfully but the application will not start. The code above address this start_addr issue.

    I left out isr_abort because it isn't working for whatever reason. I only get to the bootloader after a restart so I don't need this code or this code (or the bond sharing feature) but it does makes sense to get a gcc version of this working.

    bltest.tgz

    bootloader_s110v8_xxaa.map

  • Thank you very much indeed! This builds on my machine and weighs in at about 18KB. I'm now playing spot the difference with my own Makefile and sources and these ones to see how mine is getting so big. I haven't run it as a bootloader yet.

Reply Children
No Data
Related