jp_salgueiro
New Member
- Total Posts : 3
- Reward points : 0
- Joined: 2007/09/03 08:04:59
- Location: 0
- Status: offline
RE: MPLINK error: section '<sectionname>' can not fit the absolute section
2007/11/26 07:40:12
(permalink)
I had the same problem. That happened because you probably have tried to do your own project with the files provided in the folder TempDemoCoord of the Version 1.0-3.6 of Microchip Stack for the ZigBee™ Protocol instead of open a New MPLAB IDE and then open the project TempDemoCoord.mcp doing Project>Open... . Be sure that you are not using a expired demo version of MPLAB, because of the Procedural Abstraction, I think. João Pedro Apóstolo Salgueiro
|
futurX
New Member
- Total Posts : 15
- Reward points : 0
- Joined: 2008/01/01 01:25:58
- Location: 0
- Status: offline
RE: MPLINK error: section '<sectionname>' can not fit the absolute section
2008/05/17 23:00:59
(permalink)
Hi Guys I've been reading a lot of the posts about this issue...and unfortunately for me none of the suggestions to fix it have worked with my code.... Here is the message I'm getting MPLINK 4.14, Linker Copyright (c) 2007 Microchip Technology Inc. Error - section '.org_1' can not fit the absolute section. Section '.org_1' start=0x00000005, length=0x00000d2e Errors : 1 And here is the link file I have modified. // Sample linker command file for 16F887 LIBPATH . //CODEPAGE NAME=vectors START=0x0 END=0x4 PROTECTED //CODEPAGE NAME=page0 START=0x5 END=0x7FF CODEPAGE NAME=page0 START=0x000 END=0x7FF CODEPAGE NAME=page1 START=0x800 END=0xFFF CODEPAGE NAME=page2 START=0x1000 END=0x17FF CODEPAGE NAME=page3 START=0x1800 END=0x1FFF CODEPAGE NAME=.idlocs START=0x2000 END=0x2003 PROTECTED CODEPAGE NAME=.config START=0x2007 END=0x2008 PROTECTED CODEPAGE NAME=eedata START=0x2100 END=0x21FF PROTECTED DATABANK NAME=sfr0 START=0x0 END=0x1F PROTECTED DATABANK NAME=sfr1 START=0x80 END=0x9F PROTECTED DATABANK NAME=sfr2 START=0x100 END=0x10F PROTECTED DATABANK NAME=sfr3 START=0x180 END=0x18F PROTECTED DATABANK NAME=gpr0 START=0x20 END=0x6F DATABANK NAME=gpr1 START=0xA0 END=0xEF DATABANK NAME=gpr2 START=0x110 END=0x16F DATABANK NAME=gpr3 START=0x190 END=0x1EF SHAREBANK NAME=gprnobnk START=0x70 END=0x7F SHAREBANK NAME=gprnobnk START=0xF0 END=0xFF SHAREBANK NAME=gprnobnk START=0x170 END=0x17F SHAREBANK NAME=gprnobnk START=0x1F0 END=0x1FF //SECTION NAME=STARTUP ROM=vectors // Reset and interrupt vectors SECTION NAME=PROG1 ROM=page0 // ROM code space - page0 SECTION NAME=PROG2 ROM=page1 // ROM code space - page1 SECTION NAME=PROG3 ROM=page2 // ROM code space - page2 SECTION NAME=PROG4 ROM=page3 // ROM code space - page3 SECTION NAME=IDLOCS ROM=.idlocs // ID locations SECTION NAME=DEEPROM ROM=eedata // Data EEPROM With the first 2 lines commented out and Section in regards to vectors.....it still does not build? Any Ideas?
|
dchisholm
Super Member
- Total Posts : 3805
- Reward points : 0
- Joined: 2003/12/14 15:30:12
- Location: St Louis Mo
- Status: offline
RE: MPLINK error: section '<sectionname>' can not fit the absolute section
2008/05/18 01:14:21
(permalink)
ORIGINAL: futurX . . . Here is the message I'm getting MPLINK 4.14, Linker Copyright (c) 2007 Microchip Technology Inc. Error - section '.org_1' can not fit the absolute section. Section '.org_1' start=0x00000005, length=0x00000d2e Errors : 1 . . . It says, "You are trying to stuff 3.4 pounds into a 2 pound box.". More specifically - you have a chunk of code that assembles to 3374 (i.e., 0x0D2E) instructions, but the largest available piece of memory in your microcontroller is only 2047 (0x07FF) instructions long. Use a couple more "CODE" directives to break up your program into logical segments. You can go farther, by explicitly assigning each segment to a particular section of codespace. Whether you do this or not, remember that your program will be split between two or more codepages, so you will need to use "pagesel" directives (or manually manipulate PCLATH) when moving between them. Dale
|
pau2756
New Member
- Total Posts : 2
- Reward points : 0
- Joined: 2008/09/12 06:15:04
- Location: 0
- Status: offline
RE: MPLINK error: section '<sectionname>' can not fit the absolute section
2008/09/12 06:27:41
(permalink)
Hi I am very new to this and have just installed MPLAB IDE v8.10 and have worked through the first example. I am a bit stuck as i get an error the same as what others in this thread are reporting. My code is as follows ;********************************************************************** list p=12F508 ; list directive to define processor #include <p12F508.inc> ; processor specific variable definitions __CONFIG _MCLRE_ON & _CP_OFF & _WDT_OFF & _IntRC_OSC ; '__CONFIG' directive is used to embed configuration word within .asm file. ; The lables following the directive are located in the respective .inc file. ; See respective data sheet for additional information on configuration word. ;***** VARIABLE DEFINITIONS TEMP_VAR UDATA temp RES 1 ;example variable definition ;********************************************************************** RESET_VECTOR CODE 0x1FF ; processor reset vector ; Internal RC calibration value is placed at location 0x1FF by Microchip ; as a movlw k, where the k is a literal value. MAIN CODE 0x000 movwf OSCCAL ; update register with factory cal value start nop ; example code movlw 0xFF ; example code movwf temp ; example code ; remaining code goes here org 0 clrf GPIO ;all outputs = 0 movlw b'11111110' tris GPIO ;lowest bit of GPIO becomes an output bsf GPIO,0 ;bring GPIO bit to high x goto x ;endless loop END ; directive 'end of program' My error is MPLINK 4.20, Linker Copyright (c) 2008 Microchip Technology Inc. Error - section 'MAIN' can not fit the absolute section. Section 'MAIN' start=0x00000000, length=0x00000008 Errors : 1 I can gather it is something to do with addresses but i do not understand what to do to resolve.  I have 12f508.lkr as my link file and 12f508tmpo.asm as my source file. Really hope someone can help me here. Paul.
|
dchisholm
Super Member
- Total Posts : 3805
- Reward points : 0
- Joined: 2003/12/14 15:30:12
- Location: St Louis Mo
- Status: offline
RE: MPLINK error: section '<sectionname>' can not fit the absolute section
2008/09/12 08:36:57
(permalink)
ORIGINAL: pau2756 Hi I am very new to this and have just installed MPLAB IDE v8.10 and have worked through the first example. I am a bit stuck as i get an error the same as what others in this thread are reporting. . . . . I have 12f508.lkr as my link file and 12f508tmpo.asm as my source file. Really hope someone can help me here. There are several threads on the Forum where this problem, and its solution, are thoroughly discussed. For now, change your linker file to the "12f508_g.lkr" version supplied with MPLAB 8.10 et seq. Dale p.s. - When posting code, please use the "code tags".
|
pau2756
New Member
- Total Posts : 2
- Reward points : 0
- Joined: 2008/09/12 06:15:04
- Location: 0
- Status: offline
RE: MPLINK error: section '<sectionname>' can not fit the absolute section
2008/09/12 08:45:34
(permalink)
Many thanks for the fast reply. I have changed my lnk file to the 12f508_g.lkr and it still fails. <%="MPLINK 4.20, Linker Copyright (c) 2008 Microchip Technology Inc. Error - section 'MAIN' can not fit the absolute section. Section 'MAIN' start=0x00000000, length=0x00000008 Errors : 1"%> I am sure it is something to do with the line <%=" org 0 "%> as if i remove this it compiles correctly. I hope you can help me some more.
|
dchisholm
Super Member
- Total Posts : 3805
- Reward points : 0
- Joined: 2003/12/14 15:30:12
- Location: St Louis Mo
- Status: offline
RE: MPLINK error: section '<sectionname>' can not fit the absolute section
2008/09/12 09:03:02
(permalink)
ORIGINAL: pau2756 I am sure it is something to do with the line <%=" org 0 "%> Yes, I see now that it does. You are telling the linker to place two different pieces of code at the same address. The line: MAIN CODE 0x000 directs the linker to place the following code segment (4 instructions) at address 0x0000 in codespace. The line org 0 also directs the linker to place the code that follows at the same address, 0x00. Yes, removing the " org 0" will solve your problem. (I am surprised you didn't get another warning or error message, since the ORG directive shouldn't be used when assembling relocatable (i.e., linked) code.) Dale
|
Olin Lathrop
Super Member
- Total Posts : 7463
- Reward points : 0
- Joined: 2004/02/26 17:59:01
- Location: Littleton Massachusetts
- Status: offline
RE: MPLINK error: section '<sectionname>' can not fit the absolute section
2008/09/12 09:20:53
(permalink)
I am surprised you didn't get another warning or error message, since the ORG directive shouldn't be used when assembling relocatable (i.e., linked) code. Unfortunately they have now made it legal. That means you get less clear notice that there is a ORG lurking in the code somewhere. The section name is something derived from the fixed address, so each ORG creates a new section. Using ORG is just as bad as before, but now the assembler won't tell you about it.
|
DarioG
Allmächtig.
- Total Posts : 54081
- Reward points : 0
- Joined: 2006/02/25 08:58:22
- Location: Oesterreich
- Status: offline
RE: MPLINK error: section '<sectionname>' can not fit the absolute section
2008/09/15 01:27:33
(permalink)
ORIGINAL: Olin Lathrop Unfortunately they have now made it legal. That means you get less clear notice that there is a ORG lurking in the code somewhere. The section name is something derived from the fixed address, so each ORG creates a new section. Hmmm, I see... thanks for pointing this out.
|
nur53
Super Member
- Total Posts : 1102
- Reward points : 0
- Joined: 2008/06/07 08:16:33
- Location: 0
- Status: offline
RE: MPLINK error: section '<sectionname>' can not fit the absolute section
2008/11/15 09:33:09
(permalink)
I have solved this problem using the method mentioned on page 194 of Assembler/Linker/Librarian User's Guide DS33014J ( 13.3.3 Finding the Error & 13.3.4 Fixing the Error ) .
|
mrmadman
New Member
- Total Posts : 6
- Reward points : 0
- Joined: 2008/11/04 14:12:58
- Location: 0
- Status: offline
RE: MPLINK error: section '<sectionname>' can not fit the absolute section
2008/11/19 17:02:31
(permalink)
Hi all Just chiming in with a "me too". Tried to Build All, got the error message, searched the message board, found this thread, deleted the LKR file, and all's well. This is a most helpful forum. Oh - just to add to the misery, I ran into the maximum pathname limit before I ran into the org_1 error message. That was a little harder to figure out, because at first it just said file not found. It also appears that some functions in the assembler/linker don't like white space or underscores. So I had to watch the output folder to see what files weren't created, and noticed some truncated filenames. Peace out MADman
|
RogerStone
New Member
- Total Posts : 6
- Reward points : 0
- Joined: 2009/03/10 10:15:16
- Location: 0
- Status: offline
RE: MPLINK error: section '<sectionname>' can not fit the absolute section
2009/03/12 10:37:28
(permalink)
I am working through the projects with the Low Pin Count USB Development Kit. I can get all the source files to compile, but when linking them I get the following error message:- Executing: "C:\MCC18\bin\mplink.exe" /l"C:\MCC18\lib" /k"C:\MCC18\lkr" "..\..\MCC18\lkr\18f14k50.lkr" "main.o" "usb_descriptors.o" "usb_device.o" "usb_function_cdc.o" /u_CRUNTIME /u_DEBUG /z__MPLAB_BUILD=1 /z__MPLAB_DEBUG=1 /o"C:\LPCUSBDK_Labs\Lab4_files\output\Project Lab 4.cof" /M"C:\LPCUSBDK_Labs\Lab4_files\output\Project Lab 4.map" /W MPLINK 4.30.01, Linker Copyright (c) 2009 Microchip Technology Inc. Error - section '.udata_usb_function_cdc.o' can not fit the section. Section '.udata_usb_function_cdc.o' length=0x00000019 Errors : 1 I am stuck because the previous solutions on this and other threads seem to be applicable to Assembler and the code provided in Development Kit is in C. I have tried not using the Linker scriptwhich did not help. There are no org statments in the .c files and so I have no way of determining where the linker is trying to put everything. Any help or ideas will be much appreciated. Regards Roger
|
JasonK
Moderator
- Total Posts : 3414
- Reward points : 0
- Joined: 2003/11/14 09:49:40
- Location: Microchip Technology in Arizona, USA
- Status: offline
RE: MPLINK error: section '<sectionname>' can not fit the absolute section
2009/03/12 11:28:05
(permalink)
Use #pragma udata to separate your variables into multiple sections. I believe that there is an FAQ in the C18 Getting Started Guide that should help.
|
RogerStone
New Member
- Total Posts : 6
- Reward points : 0
- Joined: 2009/03/10 10:15:16
- Location: 0
- Status: offline
RE: MPLINK error: section '<sectionname>' can not fit the absolute section
2009/03/12 16:09:24
(permalink)
Jason, Thank you for your suggestion. As I broke it up into more sections I found the last one still would not fit in. However adding an extra section with nothing in it seems to have done the trick. I don't understand C enough to know why it worked, maybe 'nothing' can fit in anywhere. Hope this helps the next person who gets stuck ! Regards Roger
|
skranish
New Member
- Total Posts : 8
- Reward points : 0
- Joined: 2010/01/08 23:57:42
- Location: 0
- Status: offline
RE: MPLINK error: section `<sectionname>` can not fit the absolute section
2010/01/09 00:26:35
(permalink)
Is there some deep-seated, secret business reason that this particular topic remains the most visited of EVERYTHING under development tools? The hopelessly vague response "Use #pragma udata to separate your variables into multiple sections. I believe that there is an FAQ in the C18 Getting Started Guide that should help." really is no help. Translated from Inglish, I think this says "I don't remember the details, and I can't be bothered to look it up". WHERE is the solution to this? Which document EXACTLY? Which page EXACTLY? Why is the typical Microchip response "it is documented somewhere, you just have to hunt for it..."? How about an ACTUAL, COMPLETE EXAMPLE of the solution? Why isn't the linker documentation installed when you install C18? Is there some deep-seated, secret business reason for keeping it separate? Why isn't the linker file COMPLETELY explained? Is there some reason for keeping so many details secret - especially when so many people run into the EXACT same problems? The online help with MPLab/C18 isn't just bad, it is WRONG. The explanation of of this particular error says to use the -m option to create a "linker error map". I have the /m option enabled, it creates a map file that contains essentially NO information because there is... a linker error! After numerous projects with Microchip MCUs of various flavors, I have simply had enough. I will STRONGLY recommend that we change to something else before going to production (min 50K/year, likely 250K/year), and I will never, ever again recommend using one of your MCUs.
|
itdontgo
Senior Member
- Total Posts : 164
- Reward points : 0
- Joined: 2004/06/14 05:31:07
- Status: offline
Re:MPLINK error: section '<sectionname>' can not fit the absolute section
2011/04/17 06:07:02
(permalink)
I had a similar problem on one PC and not another. I had run out of program memory due to being in DEBUG and not RELEASE. Always worth checking. This is the second time this problem has occured for me - I happened to know about it the second time!
|
AlainV
New Member
- Total Posts : 11
- Reward points : 0
- Joined: 2011/04/26 11:18:27
- Location: 0
- Status: offline
Re:MPLINK error: section '<sectionname>' can not fit the absolute section
2011/04/26 11:30:30
(permalink)
I have read few explaination on the error I get: Error - section '.org_1' can not fit the absolute section. Section '.org_1' start=0x00000004, length=0x00000226 but I am still not able to figure out why. the lkr file I use is: // Sample linker command file for 16F84A // $Id: 16f84a.lkr,v 1.4.16.1 2005/11/30 15:15:29 curtiss Exp $ LIBPATH . CODEPAGE NAME=vectors START=0x0 END=0x4 PROTECTED CODEPAGE NAME=page START=0x5 END=0x3FF CODEPAGE NAME=.idlocs START=0x2000 END=0x2003 PROTECTED CODEPAGE NAME=.config START=0x2007 END=0x2007 PROTECTED CODEPAGE NAME=eedata START=0x2100 END=0x213F PROTECTED DATABANK NAME=sfr0 START=0x0 END=0xB PROTECTED DATABANK NAME=sfr1 START=0x80 END=0x8B PROTECTED DATABANK NAME=gprs START=0xC END=0x4F SECTION NAME=STARTUP ROM=vectors // Reset and interrupt vectors SECTION NAME=PROG ROM=page // ROM code space SECTION NAME=IDLOCS ROM=.idlocs // ID locations SECTION NAME=DEEPROM ROM=eedata // Data EEPROM and the code is : list p=16F84A ; list directive to define processor #include <p16F84A.inc> ; processor specific variable definitions __CONFIG _CP_OFF & _WDT_OFF & _PWRTE_ON & _HS_OSC ; VARIABLE DEFINITIONS w_temp equ 0X0C ; variable used for context saving status_temp equ 0X0D ; variable used for context saving BL_INPUT equ 0 LF_INPUT equ 1 RF_INPUT equ 2 FLAGBLBL equ 0 FLAGLF equ 1 FLAGRF equ 2 FLAGHZ equ 3 FLAGHZB equ 4 FLAGTL equ 5 datagroup1 idata 0xc PORTB_temp db 0x00 DELAY.001SEC db 0x00 DELAY.0001SEC db 0x00 delay.001sec db 0x00 delay.0001sec db 0x00 BLFLASHTIMEMSB db 0x00 blflashtimemsb db 0x00 blflashtimelsb db 0x00 BLFLCYCLE db 0x00 blflcycle db 0x00 BLNEVERHIGH db 0x00 blneverhigh db 0x00 BLNEVERLOW db 0x00 blneverlow db 0x00 flasheronmsb db 0x00 flasheronlsb db 0x00 HZBLON db 0x00 hzblon db 0x00 HZBLOFF db 0x00 hzbloff db 0x00 hzonmsb db 0x00 hzonlsb db 0x00 TLON db 0x00 tlon db 0x00 TLOFF db 0x00 tloff db 0x00 FLAGS db 0x00 ;********************************************************************** ORG 0x000 ; processor reset vector goto Main ; go to beginning of program ORG 0x004 ; interrupt vector location movwf w_temp ; save off current W register contents movf STATUS,0 ; move status register into W register movwf status_temp ; save off contents of STATUS register ; isr code can go here or be located as a call subroutine elsewhere movf status_temp,0 ; retrieve copy of STATUS register movwf STATUS ; restore pre-isr STATUS register contents swapf w_temp,f swapf w_temp,w ; restore pre-isr W register contents retfie ; return from interrupt ; remaining code goes here Main bcf STATUS,RP0 ; bank0 movlw 0x0f movwf TRISA bcf STATUS,RP0 ; bank0 clrf PORTA bsf STATUS,RP0 ; bank1 movlw 0x00 movwf TRISB ; set all pin on portB as output bcf STATUS,RP0 ; bank0 clrf PORTB etc... anyone as an idea why
|
majic79
Starting Member
- Total Posts : 36
- Reward points : 0
- Joined: 2011/03/05 10:09:25
- Location: 0
- Status: offline
Re:MPLINK error: section '<sectionname>' can not fit the absolute section
2011/08/05 17:39:06
(permalink)
I don't know if this will help things at all, I've got a similar problem, but it lies with a UDATA block I'm developing for a PIC16F882 and I've got four modules (with their own UDATA and CODE declarations) that if I leave UDATA declared as just "LIBNAME_VARS UDATA", it compiles fine. Looking at the memory map though, it puts everyting starting at A0. I'm using 39 bytes of memory and overflowing that data area - why does the compiler pick the second (smaller) databank when there's a huge area in bank0?? If I change some of the declarations to "LIBNAME_VARS UDATA 0x20" then I get some vars in bank0 and the rest in bank1, but any attempt to put all my data in bank1 leads to a Error - section 'RTC_LIB_DATA' can not fit the absolute section. Section 'RTC_LIB_DATA' start=0x00000020, length=0x0000000b If my file registers area starting at 0x20 is 96 bytes long (it says so in the lkr script and the datasheet) and I should be able to use that surely?!! And for that matter, if I leave everything blank, why does it happily compile and overflow the data area at 0xA0 and not report any error?
|
cchma
New Member
- Total Posts : 3
- Reward points : 0
- Joined: 2012/11/23 03:29:53
- Location: 0
- Status: offline
Re:MPLINK error: section '<sectionname>' can not fit the absolute section
2012/11/24 02:55:09
(permalink)
I got a similar problem when I did 'Build All' within MPLab IDE V8.88, for a project which still gets built successfully in a previous version of the MPLab IDE. The error message is: MPLINK 4.45, Linker Device Database Version 1.10 Copyright (c) 1998-2011 Microchip Technology Inc. Error - section '.org_9' can not fit the absolute section. Section '.org_9' start=0x00000004, length=0x000009ca Errors : 1 I don't have "org_9" anywhere in my programs, and I checked all the settings for the linker (as far as I could) and they look the same as for the previous version of the MPLab IDE. So, this is strange. Is there a bug in MPLINK 4.45 (too)????
|
marec
Starting Member
- Total Posts : 51
- Reward points : 0
- Joined: 2015/01/25 20:03:55
- Location: Brazil
- Status: offline
Re:MPLINK error: section '<sectionname>' can not fit the absolute section
2015/01/25 20:35:01
(permalink)
If you use generic linker script, everything goes ok if the generic script is correct. For example, the 16f84a cited in first message has a generic script which doesnt have definition for the RAM area, but brings a wrong SHAREBANK definition that doesnt exist in device. I was trying to compile a 16F630 relocatable code and found the same errors in its script. To fix the 16f84a.lkr file, change : add this two lines: (they missing) DATABANK NAME=gpr0 START=0x0C END=0x4F DATABANK NAME=gpr0 START=0x8C END=0xCF PROTECTED delete this two lines: (doesnt exist that RAM) SHAREBANK NAME=gpr0 START=0xC END=0x4F SHAREBANK NAME=gpr0 START=0x8C END=0xCF PROTECTED Then everyting compiles ok. Many LKR files are wrong, I see. It is strange that nobody saw this before... It is a shame Microchip let pass those ridiculous simple errors... So, lets ask Microchip debug the LKR scripts, then relocatable code will be as easy as absolute code.
|