|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||||
|
|||||
|
Program error - "can not fit the section"
For some reason I've suddenly started getting an error saying:
Error - section '.code_adcread.o' can not fit the section. When I comment a bit of code out, it will build again though. When I check my memory map, I'm only using 86% of the memory... so why is it building when I comment some code out (and it isnt too much I have to comment out) yet I still seem to have a reasonable bit of memory to work with? -Mike |
|
#2
|
|||||
|
|||||
|
Re: Program error - "can not fit the section"
It may be longer than it appears to be.
You may have declared thing that you are not using, included excess things, and some other things, I recommend that you check over the code again, you may notice somthing you did on accident. |
|
#3
|
||||
|
||||
|
Re: Program error - "can not fit the section"
Quote:
|
|
#4
|
|||||
|
|||||
|
Re: Program error - "can not fit the section"
I found the Program Space is max'ed out at 90% of total, rather than the 100% you naturally expect.
|
|
#5
|
|||||
|
|||||
|
Re: Program error - "can not fit the section"
It seems like their is overall very little space for coding. I removed most of the code in the default routines, and I haven't put too much code in for my positioning system, yet it's taking up most of the memory. It's very weird, I just can't see how I'd be taking up all of the memory with my code, unless there in fact is very very little programming space on these controllers.
I'll look into the limit of space with the single object file, I have my calibration/sensors/positioning calculations all in one file so perhaps the problem lies in there... however the user_camera.c file seems to use more space then my thing, which makes me wonder. Oh well, thanks for the ideas! I'll try playing around with it some more. |
|
#6
|
||||
|
||||
|
Re: Program error - "can not fit the section"
Quote:
Code:
-p=18F8520 -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- -nw=2066 |
|
#7
|
||||
|
||||
|
Re: Program error - "can not fit the section"
Quote:
Oh my goodness, don't even get me started. Our team is literally BALD...everytime we code it we run out of space...very sad... |
|
#8
|
|||||
|
|||||
|
Re: Program error - "can not fit the section"
Quote:
|
|
#9
|
|||
|
|||
|
Re: Program error - "can not fit the section"
Using the compiler optimizations helps a bunch. I haven't had the time to prove this, but I don't think the compiler treats floating point operations as functions. What I noticed was that changing my code from floating point operations to integer operations made a very big difference. In fact, it let me fit Kevin's camera code in no prob (not to mention made it run a hell of a lot faster). I wonder if creating and using a function like:
Code:
float fmul(float x, float y) {
return (x * y);
}
Well, it would, if one didn't enable procedural abstraction, which does exactly this: treat operations as functions. A "-Opa-" on your command line signifies that you have this disabled, which can make a pretty big difference. One big advantage to removing the debug options is that it cuts out the extra functions in the math library that one would never use, like asinh. Last edited by TechnocratiK : 19-02-2005 at 01:19. |
|
#10
|
|||
|
|||
|
Re: Program error - "can not fit the section"
We got this error today after adding several autonomous scripts in commads.h.
The way that code is set up, it creates a large variable command_list in RAM and also specifies that it be initialize which uses ROM space. The processor we have has much less RAM space that ROM! You don't need that data as a read/write variable, it will never change. So we found that it could be declared like this: rom struct commands comand_list[].... ^^ The "rom" tells the compiler to just put the data into ROM and not use RAM space. Be sure to change the declaration in robots.h and the defenition in commands.h to match. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| 2-week FIRST summer program @ WPI | ColleenShaver | General Forum | 20 | 31-05-2009 03:02 |
| how to add steps in the provided encoder program for the edu | Zaramel2002 | Programming | 3 | 11-02-2004 08:35 |
| Fried program slots? | Jeff Waegelin | Programming | 18 | 19-03-2003 18:08 |
| Ahh! Program trick confusing! | archiver | 2001 | 9 | 24-06-2002 02:26 |
| Credits for FIRST program. | archiver | 2000 | 6 | 24-06-2002 00:16 |