Problem with idata_user_routines.o?

Hi,

When trying to build my code in MPLAB 7.20, I get a strange error:

Clean: Deleting intermediary and output files.
Clean: Deleted file “C:\FIRST\2006\FINAL CODE 2-07-06\camera.o”.
Clean: Deleted file “C:\FIRST\2006\FINAL CODE 2-07-06\camera_menu.o”.
Clean: Deleted file “C:\FIRST\2006\FINAL CODE 2-07-06\eeprom.o”.
Clean: Deleted file “C:\FIRST\2006\FINAL CODE 2-07-06\ifi_startup.o”.
Clean: Deleted file “C:\FIRST\2006\FINAL CODE 2-07-06\ifi_utilities.o”.
Clean: Deleted file “C:\FIRST\2006\FINAL CODE 2-07-06\main.o”.
Clean: Deleted file “C:\FIRST\2006\FINAL CODE 2-07-06\serial_ports.o”.
Clean: Deleted file “C:\FIRST\2006\FINAL CODE 2-07-06 erminal.o”.
Clean: Deleted file “C:\FIRST\2006\FINAL CODE 2-07-06 racking.o”.
Clean: Deleted file “C:\FIRST\2006\FINAL CODE 2-07-06 racking_menu.o”.
Clean: Deleted file “C:\FIRST\2006\FINAL CODE 2-07-06\user_routines.o”.
Clean: Deleted file “C:\FIRST\2006\FINAL CODE 2-07-06\user_routines_fast.o”.
Clean: Done.
Executing: “C:\mcc18\bin\mcc18.exe” -p=18F8722 “camera.c” -fo=“camera.o” -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- -nw=2066 -D_FRC_BOARD
Executing: “C:\mcc18\bin\mcc18.exe” -p=18F8722 “camera_menu.c” -fo=“camera_menu.o” -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- -nw=2066 -D_FRC_BOARD
Executing: “C:\mcc18\bin\mcc18.exe” -p=18F8722 “eeprom.c” -fo=“eeprom.o” -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- -nw=2066 -D_FRC_BOARD
Executing: “C:\mcc18\bin\mcc18.exe” -p=18F8722 “ifi_startup.c” -fo=“ifi_startup.o” -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- -nw=2066 -D_FRC_BOARD
Executing: “C:\mcc18\bin\mcc18.exe” -p=18F8722 “ifi_utilities.c” -fo=“ifi_utilities.o” -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- -nw=2066 -D_FRC_BOARD
Executing: “C:\mcc18\bin\mcc18.exe” -p=18F8722 “main.c” -fo=“main.o” -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- -nw=2066 -D_FRC_BOARD
Executing: “C:\mcc18\bin\mcc18.exe” -p=18F8722 “serial_ports.c” -fo=“serial_ports.o” -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- -nw=2066 -D_FRC_BOARD
Executing: “C:\mcc18\bin\mcc18.exe” -p=18F8722 “terminal.c” -fo=“terminal.o” -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- -nw=2066 -D_FRC_BOARD
Executing: “C:\mcc18\bin\mcc18.exe” -p=18F8722 “tracking.c” -fo=“tracking.o” -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- -nw=2066 -D_FRC_BOARD
Executing: “C:\mcc18\bin\mcc18.exe” -p=18F8722 “tracking_menu.c” -fo=“tracking_menu.o” -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- -nw=2066 -D_FRC_BOARD
Executing: “C:\mcc18\bin\mcc18.exe” -p=18F8722 “user_routines.c” -fo=“user_routines.o” -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- -nw=2066 -D_FRC_BOARD
Executing: “C:\mcc18\bin\mcc18.exe” -p=18F8722 “user_routines_fast.c” -fo=“user_routines_fast.o” -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- -nw=2066 -D_FRC_BOARD
Executing: “C:\mcc18\bin\mplink.exe” /l"C:\mcc18\lib" “18f8722.lkr” “C:\FIRST\2006\FINAL CODE 2-07-06\camera.o” “C:\FIRST\2006\FINAL CODE 2-07-06\camera_menu.o” “C:\FIRST\2006\FINAL CODE 2-07-06\eeprom.o” “C:\FIRST\2006\FINAL CODE 2-07-06\ifi_startup.o” “C:\FIRST\2006\FINAL CODE 2-07-06\ifi_utilities.o” “C:\FIRST\2006\FINAL CODE 2-07-06\main.o” “C:\FIRST\2006\FINAL CODE 2-07-06\serial_ports.o” “C:\FIRST\2006\FINAL CODE 2-07-06 erminal.o” “C:\FIRST\2006\FINAL CODE 2-07-06 racking.o” “C:\FIRST\2006\FINAL CODE 2-07-06 racking_menu.o” “C:\FIRST\2006\FINAL CODE 2-07-06\user_routines.o” “C:\FIRST\2006\FINAL CODE 2-07-06\user_routines_fast.o” “C:\FIRST\2006\FINAL CODE 2-07-06\FRC_library.lib” /o"camera.cof" /M"camera.map"
MPLINK 3.90, Linker
Copyright © 2004 Microchip Technology Inc.
Error - section ‘.idata_user_routines.o’ can not fit the section. Section ‘.idata_user_routines.o’ length=0x0000010b
Errors : 1

BUILD FAILED: Sat Feb 11 18:06:42 2006

What does this mean?

I’m using Kevin Watson’s “Bells and Whistles” camera code and I’ve added a bunch of code, running the drive, our shooter, and our harvester.

Can anyone shed any light on this subject? Thank you.

The short answer is something is too big and you’ve exceeded one of the many kinds of space limitations.

I would guess that the most likely answer is you’ve declared a large array somewhere, e.g.,
int myarray[256];
would be one thing that could be too large and cause this kind of error, but there are other possible ways.

Wow. Thanks Mark! You pinned it right on the tail!

char speed_table[256];

So that’s the problem? What’s the maximum array size I can use? I could probably settle for 127, or 100 elements. Would that work?

I’ll try it out.

Thanks.

There are two of these particular kinds of limits that can be at fault in this case.

  1. We are restricted to declaring a maximum of 256 bytes of global and static variables within any single .c file. So an array of 256 bytes by itself will actually fit, but the same array plus one byte more, e.g.,
    char myarray[256];
    char onetoomany;
    will cause it to bomb. Easy work arounds include using smaller arrays of course, moving the array to the Program memory if it will never change and th values can all be preset, a la
    rom const char myarrary[256]={0,1,2,3,4,…255};
    or moving the 256 byte array to a dummy .c file and referencing it locally as an “extern”.

  2. Each of our routines within a .c file is limited to no more than 120 bytes of local variables, so char myarray[120]; would be it.

e.g., these represent the maximums and not one byte more:


/************
*  my_routines.c
************/

char myglobal[256];

void myroutine()
{
  char mylocal[120];
...
}