Go to Post A video is worth 30,000 words a second. - Thromgord [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 11-02-2008, 15:23
Doug Leppard's Avatar
Doug Leppard Doug Leppard is offline
Registered User
FRC #1902 (Exploding Bacon)
Team Role: Engineer
 
Join Date: Apr 2003
Rookie Year: 2003
Location: Orlando
Posts: 435
Doug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond repute
Send a message via AIM to Doug Leppard
complie error can not fit the section. Section xxxx

The error is:
.code__UF8.O' can not fit the section. Section '.code__UF8.O' length=0x0000005e

Reading through the forums it looks like it is a memory error. I cleaned things up. Largest array is three 10 array int. I do use float with trig math only a few variables.

I went back to code that compiled a few days ago and it has as similar compile error but might be in a different function.
__________________
Doug Leppard
  #2   Spotlight this post!  
Unread 11-02-2008, 16:03
Chaos in a Can Chaos in a Can is offline
Joel Spadin
FRC #1736 (Robot Casserole)
Team Role: Programmer
 
Join Date: Mar 2007
Rookie Year: 2007
Location: Peoria, IL
Posts: 58
Chaos in a Can is an unknown quantity at this point
Send a message via MSN to Chaos in a Can
Re: complie error can not fit the section. Section xxxx

If any of your arrays are constant, try putting them in rom.
The C18 User's Guide shows how to do this in section 2.4.3
Basically, you use it like you would use "const", but any pointers to rom data must also be specified as rom pointers.

If you can't stick anything in rom, you can avoid using floats and trig functions by approximating them with integers. You would probably have to approximate the trig functions with lookup tables, which can be placed in rom as well.
__________________
2006 Xerox Creativity Award
2007 General Motors Industrial Design Award
2008 Judges' Award
2009 Chrysler Team Spirit Award

  #3   Spotlight this post!  
Unread 11-02-2008, 16:03
dcbrown dcbrown is offline
Registered User
AKA: Bud
no team
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Hollis,NH
Posts: 236
dcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud of
Re: complie error can not fit the section. Section xxxx

How much program code & romdata do you have!?

Look at the partial map file that was generated.

Code:
CODEPAGES:
    Memory      Start        End              Section    Address Size(Bytes)
 ---------  ---------  ---------            ---------  ---------  ---------
      page     0x0800     0xffff           _entry_scn     0x0800     0x0006
                                  InterruptVectorHigh     0x0808     0x0006
                                   InterruptVectorLow     0x0818     0x0006
                                               .cinit     0x081e     0x00b6
                                 .romdata_drv_Interrupts.o     0x08d4     0x7700
Look for large sections of code/romdata in the size/bytes column. Essentially the linker says you are out of rom space for program instructions (since this is a .code section).

Not generating a map file? Project->Build options->Project, MPLINK Linker tab, check "Generate map file", Apply, OK, Project->Clean, Project->Build All.

Last edited by dcbrown : 11-02-2008 at 16:06.
  #4   Spotlight this post!  
Unread 11-02-2008, 18:31
ericand's Avatar
ericand ericand is offline
Registered User
AKA: Eric Anderson
FRC #3765 (Terrabots)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2004
Location: St. Paul, MN
Posts: 148
ericand is a jewel in the roughericand is a jewel in the roughericand is a jewel in the rough
Re: complie error can not fit the section. Section xxxx

When we saw a similar problem, we also had some floating point code that seemed to be contributing. The code was doing a bunch of floating point calculations, and then casting the result back to a double. I think that generated a lot of compiler generated temporary floating point variables that filled up a .udata section.

We are still trying to figure out what went wrong, since it looks like there should have been enough room if the addressing went to another section, but it didn't (couldn't?).

Check out the mplink manual from Microchip. (Assembler/Linker/Librarian User's Guide). http://ww1.microchip.com/downloads/e...Doc/33014J.pdf
  #5   Spotlight this post!  
Unread 12-02-2008, 05:50
Doug Leppard's Avatar
Doug Leppard Doug Leppard is offline
Registered User
FRC #1902 (Exploding Bacon)
Team Role: Engineer
 
Join Date: Apr 2003
Rookie Year: 2003
Location: Orlando
Posts: 435
Doug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond repute
Send a message via AIM to Doug Leppard
Re: complie error can not fit the section. Section xxxx

Turns out my error was nothing related to the issues.

I had programmed a VEX and then went back to FRC. In the process I had not realized it set the processor back to the 2004 RC. Once that changed the problems went away.
__________________
Doug Leppard
  #6   Spotlight this post!  
Unread 12-02-2008, 09:44
dcbrown dcbrown is offline
Registered User
AKA: Bud
no team
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Hollis,NH
Posts: 236
dcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud of
Re: complie error can not fit the section. Section xxxx

The issue was the linker ran out program rom space as the message indicated. The reason was not large amounts of code or big rom tables but because the processor selected in the project file (the 2004/2005 PIC was the PIC18F8520 w/32kb of program space) has very little program space as compared to the current PIC18F8722 which has 128kb program space -- a lot more.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
MATH_DATA can not fit the section neutrino15 Programming 7 03-02-2008 21:04
Program error - "can not fit the section" miketwalker Programming 9 20-02-2005 01:21
Error - section 'UTIL_LIB' can not fit the section. Section 'UTIL_LIB' length=0x00000 BookerT Programming 13 27-01-2005 09:49
Error - section 'UTIL_LIB' can not fit the section. Section 'UTIL_LIB' length=0x00000 BookerT Programming 0 25-01-2005 19:17
Linking Errors: "section '????' can not fit the section. ..." Astronouth7303 Programming 3 16-01-2005 21:36


All times are GMT -5. The time now is 19:06.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi