Go to Post the FIRST season is never over . . it just pauses a while so you can get some sleep. - Stuart [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 08-01-2007, 13:32
mprikril mprikril is offline
Registered User
FRC #0056 (R.O.B.B.E.)
Team Role: Engineer
 
Join Date: Mar 2005
Rookie Year: 2003
Location: NJ
Posts: 27
mprikril is a jewel in the roughmprikril is a jewel in the roughmprikril is a jewel in the rough
Exclamation _entry_scn error on building

I am attempting to build Kevin's code with the streamlined camera program and I get an error:

'_entry_scn' type is non-overlay and absolure but occurs in more than one input file.

This has come up before as noted in this closed thread: http://www.chiefdelphi.com/forums/sh...ght=_entry_scn but I'm not entirely sure if I know what to do to fix it - as it seems like it shouldn't happen

Has anyone else run into this?

Thanks
  #2   Spotlight this post!  
Unread 08-01-2007, 14:05
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,801
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: _entry_scn error on building

Are you compiling Kevin's original code without any changes of your own?
If you've changed any files in the project which ones are they and what did you change?
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
  #3   Spotlight this post!  
Unread 08-01-2007, 14:50
mprikril mprikril is offline
Registered User
FRC #0056 (R.O.B.B.E.)
Team Role: Engineer
 
Join Date: Mar 2005
Rookie Year: 2003
Location: NJ
Posts: 27
mprikril is a jewel in the roughmprikril is a jewel in the roughmprikril is a jewel in the rough
Re: _entry_scn error on building

It was entirely Kevin's code. I had not changed a thing.

In the thread that was closed that I mentioned above, the user just tried again with a fresh download of Kevin's code. I downloaded his code again and tried, and it built with no errors. So we're back in business - or rather, we're at step 2 of 1000 - but you get the idea

That fact that it works now is odd, but not entirely unexpected.
  #4   Spotlight this post!  
Unread 08-01-2007, 16:11
kiettyyyy's Avatar
kiettyyyy kiettyyyy is offline
Registered User
FRC #1538 (The Holy Cows)
Team Role: Engineer
 
Join Date: Mar 2006
Rookie Year: 2005
Location: San Diego, CA
Posts: 181
kiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond repute
Send a message via AIM to kiettyyyy
Re: _entry_scn error on building

Did you try to do a "Rebuild-all"? That is the button next to the build button.
Worked for me

Try that

Cheers!
  #5   Spotlight this post!  
Unread 08-01-2007, 16:15
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: _entry_scn error on building

That sort of error seems to be common when you change project directories and don't do a "clean" make. It looks like MPLAB keeps some information around about the previous project and tries to link both the old and new object files.

I believe it always goes away if you "build all" instead of just doing a normal fast compile of only the changed files, or if you delete all the intermediate files before compiling.
  #6   Spotlight this post!  
Unread 09-01-2007, 21:21
teh_pwnerer795 teh_pwnerer795 is offline
Registered User
AKA: !!Mitch!!
FRC #1392
Team Role: Programmer
 
Join Date: Nov 2006
Rookie Year: 2006
Location: Ajax, Canada
Posts: 142
teh_pwnerer795 is just really niceteh_pwnerer795 is just really niceteh_pwnerer795 is just really niceteh_pwnerer795 is just really nice
Send a message via MSN to teh_pwnerer795 Send a message via Yahoo to teh_pwnerer795
Re: _entry_scn error on building

are u sure u arent calling any files like this??

#include camera.c

because that can cause a major problem...

do it like this instead

#include camera.h

also i had this problem once... sometimes if u uninstall MPLAB and reinstall it... it sometimes works that waay...
__________________
Great Art is Created; Master Pieces are Stolen

[n00b]Teh_Foxdonut teh_pwnerer795 - CounterStrike:Source
  #7   Spotlight this post!  
Unread 16-01-2007, 22:06
Roger Roger is offline
Registered User
FRC #1153
 
Join Date: Jan 2006
Rookie Year: 1900
Location: Walpole MA
Posts: 685
Roger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond repute
Re: _entry_scn error on building

This is my problem too, but whatever has been suggested above and in many other places doesn't cure my woes. I've even taken the code from a "good" code" subdirectory to a 2nd computer and matched up all the options side by side. Everything matches (except see below for $(INCDIR)).

As Alan Anderson says, I copied a subdirectory of good code to another directory. After all, you want to be able to fall back to good code if you mess up the newer code. If this can't be done MPLAB is a bit useless. I've always done "Build All", and as Alan suggests, I've tried the "Clean".

The only difference is the Include Path $(INCDIR) -- the good code had none in "Build Options" General. With none in the "bad" code, I get

C:\CODE\0601-SHOOTER\2007-01-14 TEST\camera.c:30:Error [1027] unable to locate 'stdio.h'

Adding a path C:\mcc18\h to $(INCDIR) gets me thru all the Executing's and stops at MPLINK with

Error - section '_entry_scn' type is non-overlay and absolute but occurs in more than one input file.

I suspect this is the problem, somehow duplicating includes, but how else does one locate stdio.h?

From the microchip.com forum (via Google), I've found this (lets see if I can do quotes):

Quote:
It's the Linker complaining that: _entry_scn occurs in more than one input file.
_entry_scn is a label in the startup files (c018x.o)
This should only be added in the linker script at the "FILES".

You probaly have this included in somewhere else your project *.mcw which you shouldn't.
I'm not quite sure what the bolded part means (bolding mine). I'd ask there but that thread is a year old. I've only got the usual files in the .mcw -- the *.c and *.h, plus FRC_library_8722.lib and 18f8722.lkr. There are no #include *.c's -- it's the same code between the two subdirectories!

Any suggestions?

Roger.

PS-- At least I'm not getting an error regarding "Generate_Pwms(pwm13,pwm14,pwm15,pwm16);"!
  #8   Spotlight this post!  
Unread 17-01-2007, 12:48
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: _entry_scn error on building

Build all and look at the last line before MPLINK in the output window, is it similar/identical to the following:

Quote:
Executing: "E:\mcc18\bin\mplink.exe" /l"C:\mcc18\lib" "C:\CPrj\2007\Default\18f8722.lkr" "C:\CPrj\2007\Default\main.o" "C:\CPrj\2007\Default\user_routines_fast.o" "C:\CPrj\2007\Default\user_SerialDrv.o" "C:\CPrj\2007\Default\ifi_startup.o" "C:\CPrj\2007\Default\ifi_utilities.o" "C:\CPrj\2007\Default\user_routines.o" "C:\CPrj\2007\Default\FRC_library_8722.lib" /m"FrcCode.map" /o"FrcCode.cof"
In your .mcw project window, find and double click the 18f8722.lkr file to open it. This is the linker file. In it should be the following near the top:

Quote:
//FILES c018i.o
FILES clib.lib
FILES p18f8722.lib
This is what the "FILES" comment refers to. The libraries are pulled from $(LIBDIR), which you can find when you open Project -> Build Options -> Project and select "General" tab. Under the same view, verify that the "Linker-Script Path" which is located at the bottom of the window is blank (see attached figure) - otherwise the project could pull in the default linker file... which as we will get to shortly can cause this error.

NOTE: The ifi provided linker file is different from the default linker file that comes from Microchip - the ifi version has the c018i.o reference commented out. If the line is missing the '//', add them in and rebuild all. If the linker file is ok, take a close look at the "Executing... mplink..." line in the build output window. Is the project picking up the linker file from the project directory or from the Microchip default directory? Referencing the wrong one will cause the problem.

I changed my linker file by uncommenting the "FILES c018i.o" line as follows to force the error in my project:

Quote:
FILES c018i.o
FILES clib.lib
FILES p18f8722.lib
The error message appears, as expected in this case:

Quote:
Copyright (c) 2004 Microchip Technology Inc.
Error - section '_entry_scn' type is non-overlay and absolute but occurs in more than one input file.
Errors : 1
That's because the linker file is now the same as Microchip's which includes the entry section in c018i.o (you can see this in \mcc18\lkr directory).

So the error message is indicating that somewhere in the link procedure it is encountering multiple modules that are defining the _entry_scn, but it only wants one definition. See section 2.9.1.4 of the C18 user guide under reserved section names for a description of this reserved section. Hopefully you haven't attempted to create another section of this name. If you don't think so, then you didn't. You'd have to add pragma statements defining the section name.

I used mplib /t on the libraries, but they look clean. I then looked into the View -> Disassembly Listing of the project and found that this section is declared in ifi_startup.c:

Quote:
27: #pragma code _entry_scn=RESET_VECTOR
28: void _entry (void)
29: {
30: _asm goto _startup _endasm
00800 EF9E GOTO 0x393c
00802 F01C NOP
31:
32: }
00804 0012 RETURN 0
Neither map or listing file will be generated if there are linker errors. So, if you want to trouble shoot this more you can change the ifi_startup.c temporarily by adding "#ifdef NEVER" just before the pragma statement in ifi_startup.c and adding an "#endif" at the end of that file.

Quote:
#ifdef NEVER
#pragma code _entry_scn=RESET_VECTOR
void _entry (void)
{
_asm goto _startup _endasm

}
:
.
#endif
Rebuild all.

Now, View -> Disassembly Listing (this assumes it now builds without errors). In this file do a View->Find for _entry_scn - scroll up and you will find which file is definining this section. Now at least you know which file is causing the problem and you can figure out how the linker is getting this file.

In my example:

Quote:
--- C:\mcc18\src\traditional\startup\c018i.c ---------------------------------------------------
1: /* $Id: c018i.c,v 1.3 2004/07/30 17:28:43 ConnerJ Exp $ */
2:
3: /* Copyright (c)1999 Microchip Technology */
4:
5: /* MPLAB-C18 startup code, including initialized data */
6:
7: /* external reference to the user's main routine */
8: extern void main (void);
9: /* prototype for the startup function */
10: void _entry (void);
11: void _startup (void);
12: /* prototype for the initialized data setup */
13: void _do_cinit (void);
14:
15: extern volatile near unsigned long short TBLPTR;
16: extern near unsigned FSR0;
17: extern near char FPFLAGS;
18: #define RND 6
19:
20: #pragma code _entry_scn=0x000000
21: void
If this doesn't help or there are still problems, then cut and paste the "Executing ... mplink... " line from the mplab output window so we can see what is being linked together.

AND DON'T FORGET to remove the #ifdef NEVER...#endif from the ifi_startup.c file when done troubleshooting!


Bud
Attached Thumbnails
Click image for larger version

Name:	project.JPG
Views:	67
Size:	37.4 KB
ID:	4895  

Last edited by dcbrown : 18-01-2007 at 12:31.
  #9   Spotlight this post!  
Unread 18-01-2007, 07:37
Roger Roger is offline
Registered User
FRC #1153
 
Join Date: Jan 2006
Rookie Year: 1900
Location: Walpole MA
Posts: 685
Roger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond repute
Re: _entry_scn error on building

Wow! dcbrown thanks for your answer. The "//FILES c018i.o" was the final link to success. I've gotten good builds on the "bad" code, a subdirectory copy of a good code, and even on a separate computer. I never even thought to look in 18f872.lkr, let alone think it was a text-readable file. Next step is PROGRAMMING!

I have only one possible nit to pick, in case others are following along.

Quote:
Verify that the "Linker-Script Path" just below the $(LIBDIR) is blank...
Should that be $(LKRDIR)? The picture you have is what I did.

Again, many thanks!

Roger.
  #10   Spotlight this post!  
Unread 18-01-2007, 12:26
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: _entry_scn error on building

Quote:
I have only one possible nit to pick, in case others are following along.

Verify that the "Linker-Script Path" just below the $(LIBDIR) is blank...

Should that be $(LKRDIR)? The picture you have is what I did.

Poor choice of english on my part. I'll go back and edit it.

What I MEANT to say (really!) was to reference the whole linker-script dialog section which is below the libdir dialog which I referenced earlier. It is confusing the way it is currently written - I'll change it.

Bud
  #11   Spotlight this post!  
Unread 18-01-2007, 15:23
Roger Roger is offline
Registered User
FRC #1153
 
Join Date: Jan 2006
Rookie Year: 1900
Location: Walpole MA
Posts: 685
Roger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond repute
Re: _entry_scn error on building

I knew what you meant to say (I think), but it was mostly in case anyone else had the problem. Besides, I was following the pictures!
  #12   Spotlight this post!  
Unread 18-01-2007, 18:41
Roger Roger is offline
Registered User
FRC #1153
 
Join Date: Jan 2006
Rookie Year: 1900
Location: Walpole MA
Posts: 685
Roger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond repute
Re: _entry_scn error on building

Okay, dcbrown (insert #$^#&(*$% smilie here) unfortunately I didn't have access to the robot when I built the code. In the IFIloader, when I open the .HEX code, it pops open with a small window with the message

Quote:
Invalid Address : 0x20 (Correct Range : 0x800-0x7fff)

[OK]
Which, I am guessing, some part of the compiler is giving the wrong starting address. Now what?
  #13   Spotlight this post!  
Unread 18-01-2007, 20:07
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: _entry_scn error on building

In build output window, what does COFF to HEX file converison look like?

Quote:
MP2HEX 3.90, COFF to HEX File Converter
Copyright (c) 2004 Microchip Technology Inc.
Errors : 0

In MpLab, File -> Open, select FrcCode.hex. Once open, it should look something like:

Quote:
:020000040000FA
:060800008AEF1CF012005B
:020806001200DE
:06080800ECEF0DF0120000
:02080E00C250D6
.
.
But in yours the file has an error message? I haven't had any of these problems with the default code.... yet. Which IFI loader version are you using?
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
C18 v2.4 -- Syntax error where there is no syntax error Joel J Programming 7 12-01-2007 17:27
stupid Array error: Error [1300] stack frame too l Validius Programming 7 27-01-2006 10:53
Building material archiver 2000 1 24-06-2002 00:10
Goal Building archiver 2001 0 23-06-2002 22:51


All times are GMT -5. The time now is 01:30.

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