View Single Post
  #6   Spotlight this post!  
Unread 17-02-2005, 15:34
Dave Flowerday Dave Flowerday is offline
Software Engineer
VRC #0111 (Wildstang)
Team Role: Engineer
 
Join Date: Feb 2002
Rookie Year: 1995
Location: North Barrington, IL
Posts: 1,366
Dave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond repute
Re: Program error - "can not fit the section"

Quote:
Originally Posted by miketwalker
It seems like their is overall very little space for coding.
I agree. 32K was plenty for remote-control robots, but now they're asking us to do a lot of autonomous work which can be quite a bit more complicated to code. Honestly, I'm not sure how some teams even manage to make it work! We've offloaded a good percentage of stuff to our custom circuit and we're still running dangerously close to the limit on our RC. The last few days we've had to put a lot of effort into optimization, mainly by looking at the generated assembly file (.lst) and looking for any lines of C that generated too much assembly and working on optimizing them. We're also ready to move back to our stripped-down printf library that we used last year, and to turn back on most of the compiler optimization if needed to gain some extra space. That's something you could look into as well - unfortunately I'm not sure where the setting is in MPLAB since we run it all command-line with makefiles, but somewhere in there is a bunch of flags like this:
Code:
-p=18F8520 -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- -nw=2066
You could look into removing some of those options (they turn off individual compiler optimizations) to free up some space, but be aware that it could introduce problems with your code (by exposing bugs that were hidden before without optimization, etc). If you're just playing around a good one to try removing is (-Ou-) as that turns off the "dead code" removal - if that optimization is on then the compiler will remove any code which isn't called by anyone (which should be a fairly safe optimization).