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

fix address for variables which are stored in flash

I want allocate the fix address for variables which are stored in flash. for example:
const float engine_speed[6]={0,1000,2000,3000,4000,5000};
after compiling it, the address of these variables (engine_speed[6])is shown as bellow: C04000H engine_speed VAR --- NCONST ?NC?CR_MAP.
if i want to fix the address of the variables into flash memory: C1F000H,
how can i do? Thanks!

Parents
  • Thanks for you answers!
    the microcontroller is XC164Cs:
    FCONST (0xC00000-0xC1FFFF), NCONST (0xC04000-0xC07FFF),
    I have another question:
    what're the differences between NCONST and FCONST in the flash code? before i fix the address. the address of variables is:
    C04000H engine_speed VAR --- NCONST ?NC?CR_MAP.
    I want to fix the address: 0xC1F000, do I must use FCONST? AND the address should be:
    C1F000H engine_speed VAR --- FCONST ?FC?CR_MAP
    Is it right?

    Regards!

Reply
  • Thanks for you answers!
    the microcontroller is XC164Cs:
    FCONST (0xC00000-0xC1FFFF), NCONST (0xC04000-0xC07FFF),
    I have another question:
    what're the differences between NCONST and FCONST in the flash code? before i fix the address. the address of variables is:
    C04000H engine_speed VAR --- NCONST ?NC?CR_MAP.
    I want to fix the address: 0xC1F000, do I must use FCONST? AND the address should be:
    C1F000H engine_speed VAR --- FCONST ?FC?CR_MAP
    Is it right?

    Regards!

Children