This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi there,
I'm very new to relocatable code methodology. With that motive I have below questions:
1. Any good document that I can refer for understanding & writing relocatable code?
2. 'Blindly', I just tried compiling code in relocatable mode in CCSv6x, the CCS says, ".out exceeds code size limit". So, how to much extra memory we need have if we want make our code to be relocatable. Just general number(say10% extra or so). In other words how much memory does relocatable code costs?.
Thanks in advance!
-Rahul
All TI compiler tools, including the MSP430 compiler, use relocatable code and data on a routine basis. For general background on the topic, please see the chapter titled Introduction to Object Modules in the MSP430 assembly tools manual. Pay particular attention to the section titled Symbolic Relocations.
Rahul Udagatti said:I just tried compiling code in relocatable mode in CCSv6x, the CCS says, ".out exceeds code size limit"
You are probably using the free code size limited tools. These tools are free, but don't allow the total amount of code to exceed some limit. Change your code to a much smaller program, and you will be able to continue to experiment.
Thanks and regards,
-George
Thanks George Mock!
Archaeologist,
Actually, We've dual image based firmware for our devices, So, want code to run on both of the firmware 1 or 2 areas. (Meaning, firmware linked to area1 should also run in area2).
-Rahul
Let me rephrase,
We're using CC430F5137 and which has 32k flash memory. We have divided it into two areas 1&2. So, if we compile code for area1(starts @0x8000)., it should also work well if we place same code at firmware area2(starts@0x8000+ 16k).
Thank you!
-Rahul
I'm sorry, it's still unclear to me exactly what you're trying to do. I'm going to assume you are using small memory model.
If you are talking about binding the code to a particular address at link time, this decision is not finalized until link time. When you create an object file and put it into a library, the addresses are not yet bound. You can subsequently use the linker command file to place any code or data section anywhere in the lower 64k of address space, and it will work just fine.
If you are talking about moving the code at run time, you'll need to be more specific.
Thank you Archaeologist!.
yah.. The PIC that I require!.
Then PIC is not the solution perhaps a this point of time. But Can you elaborate your first point.
Is this called relocatable code method?. I'm new to these kind of stuffs, please bear me. :-)
-Rahul
Rahul Udagatti said:Is this called relocatable code method?
No. I don't think there is a widely agreed term for this technique. The key is to allocate a section to one address for loading, and another address for running. For general background, see the sub-chapter titled Load and Run Addresses in the MSP430 assembly tools manual. The usual method to copy the code or data from ROM to RAM is called copy tables. An example of using copy tables in in this application note. The example is for a different processor family (C6000), and it presumes the run address is overlayed (you can also say "shared") between multiple output sections. But you can adapt the copy table technique to your situation.
Thanks and regards,
-George