Hello! I need to use a large table of const in my project. I need to locate this constants in concrete adresses on Flash and to access const value by pointing to adress. What is the simpliest way to do this? The table consist of 2000 const. Thanks.
A-w, If you're alright with these constant tables having global scope, then it's pretty easy to do. Make a separate C file that includes only the definition for one of your variables. For instance, make a file called ARR1.C and put in it:
Arr1[2048]={...};
?CO?ARR1(0xC04000)
Whoops... should have looked at your toolset. My example is for C51. The knowledgebase article that Mike references is the same procedure for the C166 toolset though.
Thanks. Will test it. But i made next thing: in one C-file declare first array as NEAR and the second array as FAR. Now i can locate sections separetly: ?FC?CONST%FCONST(0xC04000), ?nC?CONST%NCONST(0xC07D00) It is works, but it is not a solution to my problem. I want to declare both arrays as NEAR. And one small question: Is it important to define section size with SECSIZE directive?
Linker gives error: ERROR L110: CANNOT FIND SECTION OR REGBANK SECTION: ?CO?ARR2 Directive for linker is: ?CO?ARR2(0xC07D00) in uVision2 L166 Locate - User Sections Maybe i do something wrong?