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

Programmatically accessing flash_placement.xml

Hi 

I am writing a bootloader and am trying to get the start locations of the different memory segments e.g. the FLASH start segment from the flash_placement file.

On a different manufacturer's micro on a Rowley IDE I used:

  int ramEnd = (int)(&__FLASH_segment_start__ );

But this returns 0x0 using Segger Embedded on a nrf52832

Please can you give me an example for Segger Embedded Studio

Thank you

Parents Reply Children
  • well you always need a declaration of a variable just to tell the compiler 'this exists somewhere and this is what type it is' so it can compile, then it's the linker's job to actually find and resolve it. If you just put the thing in the linker file (which is what flash_placement.xml really is) then nothing at compile time has a clue it's even there. Hence the need for an external. 

    I think for the Rowley standard symbols they define them in some of the top level header files so that's why you can use them. If the original poster clicks on __FLASH_segment_start__ and asks the IDE to go to the definition he'll probably find where it was defined. 

Related