Sign in

username:

password:



Not a member?

Search piclist



Search tips

Subscribe to piclist



piclist by Keywords

12F675 | 16F628 | 16F84 | 16f877 | 16F877A | 16F88 | 18F458 | ADC | AVR | Bootloader | CAN | CCS | CRC | EAGLE | EEPROM | ICD | ICSP | IDE | JDM | LED | Macros | Microchip | MPLAB | PCB-CAD | PIC10F | Pic12f675 | PIC16F84 | PIC16F84A | PIC16F877 | PIC18 | PIC18F452 | PicBasic | PICC | PICSTART | PWM | RS-485 | RS232 | SMT | SPI | UART | USART | USB | Wireless | Wisp628 | Xilinx

Discussion Groups

Discussion Groups | Piclist | Please help with "cannot fit the section" error.

A discussion group for the PICMicro microcontroller. Also called the Microchip PIC, this list is dedicated to the use and abuse of this fine, simple, microcontroller. Close to topic posts are welcome, ie. general electronics.

Please help with "cannot fit the section" error. - Basic Poke - May 16 11:38:44 2008


I am getting the following error in MPLAB 8.10. Any idea what's going
on? I don't even see any uninitialized variables in Main.c.

MPLINK 4.20, Linker
Copyright (c) 2008 Microchip Technology Inc.
Error - section '.udata_Main.o' can not fit the section.
Section '.udata_Main.o' length=0x00000648
Errors : 1

Thanks
BasicPoke
------------------------------------

to unsubscribe, go to http://www.yahoogroups.com and follow the instructions



(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )

Re: Please help with "cannot fit the section" error. - Dennis Clark - May 16 11:52:44 2008


> I am getting the following error in MPLAB 8.10. Any idea what's going
> on? I don't even see any uninitialized variables in Main.c.
>
> MPLINK 4.20, Linker
> Copyright (c) 2008 Microchip Technology Inc.
> Error - section '.udata_Main.o' can not fit the section.
> Section '.udata_Main.o' length=0x00000648
> Errors : 1

This is my NUMBER ONE grouch with PIC's, the banked data sections. What
this error means is that you have either defined more variables than you
have data space for or that you have a struct or array that is too big
to fit into a randomly selected data section which may have other stuff
in it. Each data section in a PIC is 256 bytes, so any structure larger
than that will require you to play games with the linker to combine
blocks and you will need to use #pragma commands to assign those bigger
structures to that section. I have found that if you just have a large
structure that is less than or equal to 256 bytes that you can do this:

#pragma udata commandparsebuffer //holds the serial command to be parsed
char commandBuf[256];
#pragma udata

This will cause the C18 compiler to assign this and ONLY this to its own
256 data section.

have fun,
DLC

> Thanks
> BasicPoke
> ------------------------------------
>
> to unsubscribe, go to http://www.yahoogroups.com and follow the
> instructions



(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )