Question

With compiler C18 when I want to use a specific address for a string I use:

In .C

#pragma romdata idsoft
    const rom unsigned char _app_nfo[31]= {"V0.0 No        - 05/12/12"};
#pragma romdata

in linker:

CODEPAGE   NAME=idsoft     START=0x78E0         END=0x78FE

How can i do same with XC8? I've try many things, but none of them are working.

in XC8 linker parameter:

-L-pappnfo=0x78E0

In .C :

unsigned char __section ("appnfo")  app_nfo[31];

It's not working.

Was it helpful?

Solution

You have just to do this:

unsigned char _app_nfo[31] @ 0x78E0 = {"V0.0 No        - 05/12/12"};

See 5.5.4.2 ABSOLUTE OBJECTS IN PROGRAM MEMORY in MPLAB XC8 C Compiler User’s Guide

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top