|ARM Technical Support Knowledge Articles|
Applies to: BL51 Code-banking Linker/Locator
Information in this article applies to:
In my design 0000H - 7FFFH is for both code and data (von Neuman architecture) and 8000H - FFFFH is used only for data. How can I configure the linker to use this arrangement?
As far as the linker is concerned data and memory space are seperate and there is no way to tell the linker that you are using a von Neumann architecture. What you will have to do is divide your code and data space into two sections, one for CODE and one for XDATA. For example you would maybe start CODE memory at 0000H and XDATA at perhaps 6000H. You can do this using the following linker directives:
Note that you cannot define the upper limit of CODE or XDATA memory. Using the directives above will define CODE memory from 0000H - FFFFH and XDATA memory from 6000H - FFFFH.
The linker locates segments starting at the lowest available memory location, so as you develop your project the amount of code and xdata space will gradually increase. You will have to keep checking the .m51 file generated by the linker to make sure that your CODE memory usage does not start to overlap with your XDATA memory usage.
For example if you had the arrangement described above and you were using CODE address 6100H the linker will not know that this is also XDATA address 6100H and will not generate an error. You will have to make sure that your XDATA and CODE usage do not overlap.
However, if you wish to treat data as code or vice versa you may wish to overlap segments so they are located in both CODE and XDATA spaces.
If your memory arrangements are more complex and you wish to leave gaps in your CODE memory to avoid overlap then you can declare arrays to generate the gaps:
const code char gap[0x1000] _at_ 0x6000;
Will generate a gap from 6000H to 6FFFH. This block would then be used exclusively for XDATA.
Article last edited on: 2005-07-19 10:08:02
Did you find this article helpful? Yes No
How can we improve this article?