Log in

View Full Version : Mplink error


jimmyrock88
14-11-2007, 13:18
hey guys i m gettin this link error:

MPLINK 4.11, Linker
Copyright (c) 2007 Microchip Technology Inc.
Error - section '.code_vfprintf.o' can not fit the section. Section '.code_vfprintf.o' length=0x00000c22
Errors : 1

I would guess its because MPLAB doesn't alloy more than 256 bytes ( which is default)

I have also seclected the option "Large Code Model >64Kbytes" and "Large Data Model" from Project->Build Options ->Project.

You think that the chip doesn't have enough memory. Should I change it to PIC184431 (has more memory) from original PIC184331 ?

Here's map file.

bear24rw
14-11-2007, 15:42
If you are using a large array try doing
rom unsigned int array[256];
putting rom in front will put the variable in the program memory which has a log more space

Mark McLeod
14-11-2007, 15:50
rom won't help this, the controller doesn't have enough program memory to hold all the code you're trying to shove into it.
The code needs to be trimmed down or you need a processor with more memory.

You can get a very rough idea of how much more didn't get into the space allotted by looking at the Linker command and seeing where printf.o probably fell and what is listed after it.
You could also, as you seem to suggest, select a target PIC that has a lot of memory, then take a look at the MPLAB memory gauge to see how much space it all takes up.

Are you compiling with a particular PIC in mind or don't you care which one is the target?