This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

specify a code string to certain memory address

I have a string of code type defined in a function:

void func1
{
 unsigned char code string_0[]="a string";
 unsigned char stringLen;
  ....
}
The func1 is located to address 0xF000. But string_0[] is not located together with func1 although it is the code type.

Is there a way to specify the location of string_0[]to a certain code memory address? I have tried _at_, but the variable cannot be initiated.

Parents
    1. Create a single file with this function and code variable.

    • When compiled, there will be 2 segments ?PR?filename?function and ?CO?filename.


    • Use the linker CODE directive to locate them starting at an address. For example:

      BL51 ... CODE(?PR?filename?function(0x4000),?CO?filename)

    • This locates function at 0x4000 and the code variables declared in filename immediately after it.

    Jon

Reply
    1. Create a single file with this function and code variable.

    • When compiled, there will be 2 segments ?PR?filename?function and ?CO?filename.


    • Use the linker CODE directive to locate them starting at an address. For example:

      BL51 ... CODE(?PR?filename?function(0x4000),?CO?filename)

    • This locates function at 0x4000 and the code variables declared in filename immediately after it.

    Jon

Children
No data