![]() |
MPLAB 8.0 error "Can not fit section"
I am getting the following error when compiling some code:
Code:
MPLINK 4.1 LinkerIs this more than MPLAB can handle??? |
Re: MPLAB 8.0 error "Can not fit section"
If I remember correctly, the PIC can't have more than 256 bytes in one memory segment. 2x11x5x3 will be 330 bytes, which is too big. You'll have to use a #pragma statement to put each array into its own chunk of memory. Take a look at section 2.9 of the C18 manual.
|
Re: MPLAB 8.0 error "Can not fit section"
386 had this problem...
our solution was changing some static variables to non-static, or making them global. I apologize in advance for the lack of verbose response, I'm recovering from the all-nighters. --Chris |
Re: MPLAB 8.0 error "Can not fit section"
Steve and Chris,
Thanks for the replies, I had a feeling it was something like this. I will see if I can find a different approach. All nighters are probably why I tried something like this in the first place.:) |
Re: MPLAB 8.0 error "Can not fit section"
You could also break those declarations into separate files.
|
Re: MPLAB 8.0 error "Can not fit section"
If your arrays are tables of constants, you can put them into the much-less-limited ROM by:
Code:
rom const int name [11][5]; |
Re: MPLAB 8.0 error "Can not fit section"
Quote:
Quote:
Thanks to both for your input. These are both techniques I/we should master in the off season. Thanks for adding to our list of things to learn!!! |
Re: MPLAB 8.0 error "Can not fit section"
This is a linker default limitation. There is a method for supporting stacks > 256 as outlined in the MCC18 user guide, it involves merging multiple banks of registers. This seems to work for variable space too, but there may be limitations I'm unaware of. The code would need to be thoroughly reviewed and tested but this should work as I've seen it used on other PIC projects.
In the linker file, change: Code:
DATABANK NAME=gpr6 START=0x600 END=0x6FFI built three int [11][5] arrays and got the same linker error. Then I merged the banks and did it again and it will link. I poked at some of the arrays with C code and looked at the machine code -- it looks correct. Code:
int vars1[11][5]; |
| All times are GMT -5. The time now is 00:57. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi