How to locate a string at the top end of the ROM?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to locate a string at the top end of the ROM?

558 Views
NeilVP
Contributor II

Is there a means by which I can instruct the compiler to find out how much ROM there is available in the particular microcontroller being used so that I can then place a string at the top of memory minus the length of the string - rather than finding this out manually each time? 

 

Many thanks

 

Neil

Labels (1)
0 Kudos
1 Reply

259 Views
Jim_P
Contributor III

I got this from a different question but might answer your question

 

this allows the code to know where the segment boundaries are.

 

To get start or end of segment use linker defined symbols __SEG_START_xxx, __SEG_END_xxx, __SEG_SIZE_xxx, where xxx is placement. You need to declare those linker defined symbols in your code like

   extern int __SEG_START_xxx[];

 

In case data has to be not initialized, change type of segment in prm from READ_WRITE or READ_ONLY to NO_INIT .

 
see help in CW   Linker-Defined Objects

0 Kudos