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

NRF51822 FOTA with GCC

Hello,

I tried firmware over the air update with mbed using the compiled bootloader hex file and it works pretty well.

However, I am back to GCC with softdevice 7.1. I would like to use the same bootloader as the one supplied with mbed.

I was able to add the DFU service in the GCC application and it displays properly. I think I need to modify the linker scripts and maybe some other operation when merging the hex file but I am not sure.

Is there some linker scripts available that I can use to simplify this task, or someone that could help ?

My linker script for normal operation with SoftDevice 7.1 is the following : (chip is _xxaa)

/* Linker script to configure memory regions. */

SEARCH_DIR(.)
GROUP(-lgcc -lc -lnosys)

MEMORY
{
  FLASH (rx) : ORIGIN = 0x00016000, LENGTH = 0x2A000 
  RAM (rwx) :  ORIGIN = 0x20002000, LENGTH = 0x2000 
}


INCLUDE "gcc_nrf51_common.ld"

Thank you very much!

Simon

Parents
  • In my opinion, you should compile yourself your bootloader code in order to have complete control over it and over interoperability between it and the application;

    Anyway, a starting point to avoid incompatibilities is to be sure that the same SDK version is used for bootloader and application code (some sources are shared between them);

    You have to pay attention to these 2 files: "bootloader_util_gcc.c" and "dfu_app_handler.c" in order that application can interoperate safely with the bootloader;

    On the linker scripts side, for GCC environment you don't need any changes to the file you posted; eventually the only parameter you could change is the length of the FLASH region, accomodating it in base on the flash space required by the bootloader (the region reserved to the bootloader code is specified in the relative linker scripts files of the bootloader)

Reply
  • In my opinion, you should compile yourself your bootloader code in order to have complete control over it and over interoperability between it and the application;

    Anyway, a starting point to avoid incompatibilities is to be sure that the same SDK version is used for bootloader and application code (some sources are shared between them);

    You have to pay attention to these 2 files: "bootloader_util_gcc.c" and "dfu_app_handler.c" in order that application can interoperate safely with the bootloader;

    On the linker scripts side, for GCC environment you don't need any changes to the file you posted; eventually the only parameter you could change is the length of the FLASH region, accomodating it in base on the flash space required by the bootloader (the region reserved to the bootloader code is specified in the relative linker scripts files of the bootloader)

Children
No Data
Related