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.

  • Hi Michael, I'm afraid I couldn't get this to work. I got "cannot download multiple load files because they overlap." I had 3 files to load using the loader in addition to the app. The total set comprised the SD, the app - which just happened to be the ble_app_uart I was working on, the pca10040 dual bank boot loader hex and the boot loader setting hex. The only section placement macros was the for the app (where, perhaps importantly, you only specify the start of the memory for the app, not its length or end), as usual. Any other thoughts? RJH

Reply
  • Hi Michael, I'm afraid I couldn't get this to work. I got "cannot download multiple load files because they overlap." I had 3 files to load using the loader in addition to the app. The total set comprised the SD, the app - which just happened to be the ble_app_uart I was working on, the pca10040 dual bank boot loader hex and the boot loader setting hex. The only section placement macros was the for the app (where, perhaps importantly, you only specify the start of the memory for the app, not its length or end), as usual. Any other thoughts? RJH

Children
No Data
Related