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

Memory allocation macros in Segger Embedded Studio to program a Soft Device, Application and Bootloader all at once

I am looking for some guidance as to the memory regions to reserve for the Bootloader hex if I pull it in via Segger Embedded Studio. I have the memory allocations for the Application down pat and there is no problem linking in the SoftDevice. However how do I specify where the Bootloader goes (at the top of the memory allocation) using the section placement macros in Linker Options?

[UPDATE 10 JUNE - Brought up from the dead as it would be good if an answer could be found to this]

Thanks a lot - RJH

Parents
  • Short Answer: You don't need to specify where the Bootloader goes (see the 'Loading .hex files' section below). Basically a .hex file specifies where the data should go. You have already configured the Section Placement Macro/Memory Map for the SoftDevice and don't need to do anything else here.

    Loading the .hex files:

    The .hex file specifies both the actual program data to be written to flash, along with the address of where that data should be written (i.e. write 0xDEADBEEF to address 0x1C000, 0xB16B00B5 to address 0x1C004, etc...) So when we load these .hex files to the board we are sure there will be no overlapping.

    Doing this all in Embedded Studio:

    We want to specify both the SoftDevice and Bootloader as 'Additional Load Files' in 'Project Properties -> Debugger -> Loader Options.' So specify the paths to each of the .hex files there. (To flash the Application when a Bootloader is present you also need to write a flag in FLASH. I recommend also specifying this bootloader_settings_nrf52.hex as an additional file to loader. It is a .hex file that writes that flag for you). bootloader_settings_nrf51.hex

    Now when you compile your application and load it to your board, Embedded Studio will flash the SD, BL and write the flag for you! And if there are any collisions between the .hex file you will get an error.

  • There is both a Memory Map XML and a Flash Placement XML. With the Flash Placement XML there is no obvious way in which to add a length or end memory address looking in the example files. Nor is there an obvious way in which to associate each memory segment with the linker files. Are you able to provide further guidance? You mentioned you had managed to get this to work, how did you do it?

Reply
  • There is both a Memory Map XML and a Flash Placement XML. With the Flash Placement XML there is no obvious way in which to add a length or end memory address looking in the example files. Nor is there an obvious way in which to associate each memory segment with the linker files. Are you able to provide further guidance? You mentioned you had managed to get this to work, how did you do it?

Children
No Data
Related