About the memory in PIC18F25k50

111 Views Asked by At

I faced 'section '.udata_xxx.o' can not fit the section' error and after searching through the net (http://www.xargs.com/pic/c18large.html), we actually can create objects larger than 256 Bytes by configure the linker files like below:

DATABANK   NAME=gpr1       START=0x100             END=0x1FF
DATABANK   NAME=gpr2       START=0x200             END=0x2FF
DATABANK   NAME=gpr3       START=0x300             END=0x3FF
DATABANK   NAME=gpr4       START=0x400             END=0x4FF
DATABANK   NAME=gpr5       START=0x500             END=0x5FF
These 256-byte regions need to be combined into larger regions to fit the new sections:
DATABANK  NAME=large_udata  START=0x100  END=0x389  PROTECTED
DATABANK  NAME=large_idata  START=0x38A  END=0x519  PROTECTED
DATABANK  NAME=gpr5         START=0x51A  END=0x5FF 

If I don't put the word PROTECTED, it can compile. But everytime I put the word PROTECTED, the 'cannot fit error' occurs again. Does this means my firmware really have no memory already?

1

There are 1 best solutions below

0
On

No, this is reserved memory! Read your link again!

The PROTECTED keyword tells the linker not to place anything into the large regions of its own accord; only objects which have been explicitly placed into the associated sections with source code #pragmas can be placed there.