|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Error - section 'UTIL_LIB' can not fit the section. Section 'UTIL_LIB' length=0x00000
What does:
Error - section 'UTIL_LIB' can not fit the section. Section 'UTIL_LIB' length=0x00000146 means? |
|
#2
|
||||
|
||||
|
Re: Error - section 'UTIL_LIB' can not fit the section. Section 'UTIL_LIB' length=0x0
It means that your program is too large to fit onto the PIC chip. Try defining fewer global variables.
|
|
#3
|
|||||
|
|||||
|
Re: Error - section 'UTIL_LIB' can not fit the section. Section 'UTIL_LIB' length=0x00000
Or enabling more optimizations. This is what worked for me. (Since it was primarily just the libraries)
|
|
#4
|
|||
|
|||
|
Re: Error - section 'UTIL_LIB' can not fit the section. Section 'UTIL_LIB' length=0x00000
How can I enable more optimization?
|
|
#5
|
|||||
|
|||||
|
Re: Error - section 'UTIL_LIB' can not fit the section. Section 'UTIL_LIB' length=0x00000
Quote:
Last edited by Mark McLeod : 25-01-2005 at 23:19. |
|
#6
|
|||||
|
|||||
|
Re: Error - section 'UTIL_LIB' can not fit the section. Section 'UTIL_LIB' length=0x00000
In case it helps anyone else I had the same error when I tried for some massive arrays (ram) for instance:
Code:
unsigned int left[254] unsigned int right[254] |
|
#7
|
|||||
|
|||||
|
Re: Error - section 'UTIL_LIB' can not fit the section. Section 'UTIL_LIB' length=0x00000
Quote:
|
|
#8
|
|||||
|
|||||
|
Re: Error - section 'UTIL_LIB' can not fit the section. Section 'UTIL_LIB' length=0x0
Quote:
Could you elaborate on "the ways around this limit"? |
|
#9
|
||||
|
||||
|
Re: Error - section 'UTIL_LIB' can not fit the section. Section 'UTIL_LIB' length=0x0
Quote:
Does 8 bits ring a bell? |
|
#10
|
|||||
|
|||||
|
Re: Error - section 'UTIL_LIB' can not fit the section. Section 'UTIL_LIB' length=0x0
Quote:
anyway, my question would still hold if it did, what happens to the rest of the space? |
|
#11
|
||||
|
||||
|
Re: Error - section 'UTIL_LIB' can not fit the section. Section 'UTIL_LIB' length=0x0
Quote:
Look at the code that Brian posted in this thread: http://www.chiefdelphi.com/forums/sh...ad.php?t=33466 See how the address needed to be split into an 8 bit part and a "high" part? All memory must be accessible via registers. In most processors, these are 8 bit, 16 pit or 32 bit. To access more memory, you have to "page" (the high part). It really does not matter if the memory/IO space in inside of the chip or outside, the principle is the same. To get the most out of your hardware, you have to understand your hardware. The PICmicro® 18C MCU Family Reference Manual is 976 pages long. The MPLAB® C18 C COMPILER USER’S GUIDE is almost 200 pages long. You have to start reading! The answer depends on the type of memory you are trying to access. For example, try reading section 3.2.4 on page 41 of the latter reference. This pertains only to stack size (dynamic and non-static variables) and explains how to cross the 256 byte barrier for stack allocation... <arms flailing> DANGER WILL ROBINSON!!! Increasing stack allocation will decrease other allocations and cause your code to really slow down as every reference to (in this case stack) memory must be inspected at run time as to which "page" it is in. Now the same condescending note I gave in another thread... If you are exceeding memory allocations, you are doing something wrong! I most strongly urge you to look closely at what you are doing. The 2004 Bobcat user routines spans about 1000 lines of code and required about 500 man-hours to develop. That's 1/2 hour per line. Why? Because you have to understand what each and every line does! Embedded programming requires thought, planning and hard work. That's why it's called software engineering. Hope this helps... |
|
#12
|
|||||
|
|||||
|
Re: Error - section 'UTIL_LIB' can not fit the section. Section 'UTIL_LIB' length=0x0
Quote:
So, I only want extra space for calibrating, the actually program will be much more simple. |
|
#13
|
||||
|
||||
|
Re: Error - section 'UTIL_LIB' can not fit the section. Section 'UTIL_LIB' length=0x0
Quote:
Permanent changes to my code were a few lines of code which are now commented out (pending the next time I need this test done). Free your mind and other portions of your anatomy will follow... |
|
#14
|
|||||
|
|||||
|
Re: Error - section 'UTIL_LIB' can not fit the section. Section 'UTIL_LIB' length=0x0
Quote:
After your code has been compiled, the MPLAB linker determines how your code gets mapped into the available memory on the physical PIC. The linker is guided by the linker script (18f8520user.lkr) in the project folder that among other things specifies how the PIC ram is blocked out or partitioned. In the case of FIRST our script sets aside several protected areas for exclusive use by the IFI code and sets aside a block (gpr6) for use as a stack for saving things like subroutine call branch locations, etc. The rest is divided up into blocks of 256 bytes each. You can change how large these blocks are. In addition to the reference Mike gave you, for more information on the linker script see Chapter 5 of the MPASM User’s Guide with MPLINK and MPLIB Be careful of course. It can be very hard to debug (and for us to help you debug) any problems you create by mucking with this. Last edited by Mark McLeod : 27-01-2005 at 09:57. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Linking Errors: "section '????' can not fit the section. ..." | Astronouth7303 | Programming | 3 | 16-01-2005 21:36 |