CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Internal Error - Contact CCS Hidden forward reference 315 f

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
nurquhar



Joined: 05 Aug 2006
Posts: 149
Location: Redditch, UK

View user's profile Send private message Visit poster's website

Internal Error - Contact CCS Hidden forward reference 315 f
PostPosted: Tue Feb 19, 2013 11:11 am     Reply with quote

I am getting this error for PCH 4.133. The inclusion of "usb_cdc.h" seems to be the cause in this simple two file project. Sad

The usb_cdc.h is there because I want to use the usb in my application. I have cut it all down to this to demonstrate the problem.

i.e. I can compile it if I remove the second source file (readbat.c) and the reference to test(), or if I comment out the usb_cdc.h include.

Any ideas why it happens. Question I guess I will have to go back to using "one" source file as per v3. Rolling Eyes

Code:
Executing: "C:\Program Files\PICCv4\Ccsc.exe" +FH "bug.c" +EXPORT +DF +LN +T +A +M +Z +Y=9 +EA
>>> Warning 203 "C:\Program Files\PICCv4\drivers\pic18_usb.c" Line 609(1,1): Condition always TRUE
N:\Projects\RonHaselden\Eyes\PIC\demo1\bug.o ===>  0 Errors,  1 Warnings.
Build Successful.
Executing: "C:\Program Files\PICCv4\Ccsc.exe" +FH "readbat.c" +EXPORT +DF +LN +T +A +M +Z +Y=9 +EA
N:\Projects\RonHaselden\Eyes\PIC\demo1\readbat.o ===>  0 Errors,  0 Warnings.
Build Successful.
Executing: "C:\Program Files\PICCv4\Ccsc.exe" +FH LINK="demo1.hex=bug.o,readbat.o" +DF +LN +T +A +M +Z +Y=9 +EA
*** Error 44 "demo1.c" Line 1(0,1): Internal Error - Contact CCS  Hidden forward reference 315 from 249
      1 Errors,  0 Warnings.
Build Failed.
Skipping link step.  Not all sources built successfully.
BUILD FAILED: Tue Feb 19 16:57:58 2013


Bug.c
Code:

#include <18F27J53.h>
#use delay(clock=48M)

#include <readbat.h>

#include <usb_cdc.h>

void main(void)
{
   test();
}


readbat.h
Code:

#ifndef __READBAT_H__
#define __READBAT_H__

void test() ;
//void ReadBGRef() ;
//int ReadBatSense() ;

// __READBAT_H__
#endif


readbat.c
Code:


#include <18F27J53.h>
#use delay(clock=48M)


#include <readbat.h>


void test()
{
   int a, b ;
   a = 1 ;
   b = a ;
}
Ttelmah



Joined: 11 Mar 2010
Posts: 19538

View user's profile Send private message

PostPosted: Tue Feb 19, 2013 1:58 pm     Reply with quote

You are trying to use functions across modules, but have not exported the functions or imported the functions.
Read the linker section of the manual, and look at the examples.

Best Wishes
nurquhar



Joined: 05 Aug 2006
Posts: 149
Location: Redditch, UK

View user's profile Send private message Visit poster's website

PostPosted: Wed Feb 20, 2013 3:59 am     Reply with quote

Ok I have looked at MCU.zip example and there is still something I am not understanding. Confused

I followed the instructions in "Using Multiple Compilation Units Guide.pdf" and built the project setup in MPLAB as per the step by step instructions. I ran build all and succesfully got it compile :

Code:

Executing: "C:\Program Files\PICCv4\Ccsc.exe" +FM "report.c" +EXPORT +DF +LN +T +A +M -Z +Y=9 +EA
C:\Temp\PIC\mcu\Example Files\report.o ===>  0 Errors,  0 Warnings.
Build Successful.
Executing: "C:\Program Files\PICCv4\Ccsc.exe" +FM "filter.c" +EXPORT +DF +LN +T +A +M -Z +Y=9 +EA
C:\Temp\PIC\mcu\Example Files\filter.o ===>  0 Errors,  0 Warnings.
Build Successful.
Executing: "C:\Program Files\PICCv4\Ccsc.exe" +FM "main.c" +EXPORT +DF +LN +T +A +M -Z +Y=9 +EA
C:\Temp\PIC\mcu\Example Files\main.o ===>  0 Errors,  0 Warnings.
Build Successful.
Executing: "C:\Program Files\PICCv4\Ccsc.exe" +FM LINK="MCU.hex=report.o,filter.o,main.o" +DF +LN +T +A +M -Z +Y=9 +EA
      Memory usage:   ROM=14%      RAM=10% - 16%
      0 Errors,  0 Warnings.
Build Successful.
Loaded C:\Temp\PIC\mcu\Example Files\MCU.cof.
BUILD SUCCEEDED: Wed Feb 20 09:08:22 2013


So I now try to use "usb_cdc.h" in the main.c. To do this I make the following changes :

1. Change "configure" to use device "PIC18F27J52"
2. Add "#include <usb_cdc.h> " to main.c
3. Comment out "#include <16F877A.h>" and add #include <18F27J53.h> to project.h
4. Comment out #fuses in project.h

main.c :
Code:

#include "project.h"

#include "report.h"
#include "filter.h"

#include <stdlib.h>
#include <input.c>

#include <usb_cdc.h>


extern long report_line_number;

void main(void) {
..............

project.h
Code:

//#include <16F877A.h>
#include <18F27J53.h>

//#fuses HS,NOWDT,NOPROTECT,NOLVP

#use delay(clock=20mhz)
#use rs232(BAUD=9600, UART1, STREAM=PC)

enum errors { err_range, err_too_far, err_too_many };


OUTPUT
Code:

Clean: Deleting intermediary and output files.
Clean: Done.
Executing: "C:\Program Files\PICCv4\Ccsc.exe" +FH "report.c" +EXPORT +DF +LN +T +A +M -Z +Y=9 +EA
C:\Temp\PIC\mcu\Example Files\report.o ===>  0 Errors,  0 Warnings.
Build Successful.
Executing: "C:\Program Files\PICCv4\Ccsc.exe" +FH "filter.c" +EXPORT +DF +LN +T +A +M -Z +Y=9 +EA
C:\Temp\PIC\mcu\Example Files\filter.o ===>  0 Errors,  0 Warnings.
Build Successful.
Executing: "C:\Program Files\PICCv4\Ccsc.exe" +FH "main.c" +EXPORT +DF +LN +T +A +M -Z +Y=9 +EA
>>> Warning 203 "C:\Program Files\PICCv4\drivers\pic18_usb.c" Line 609(1,1): Condition always TRUE
C:\Temp\PIC\mcu\Example Files\main.o ===>  0 Errors,  1 Warnings.
Build Successful.
Executing: "C:\Program Files\PICCv4\Ccsc.exe" +FH LINK="MCU.hex=report.o,filter.o,main.o" +DF +LN +T +A +M -Z +Y=9 +EA
*** Error 44 "MCU.c" Line 1(0,1): Internal Error - Contact CCS  Hidden forward reference 620 from 554
      1 Errors,  0 Warnings.
Build Failed.
Skipping link step.  Not all sources built successfully.
BUILD FAILED: Wed Feb 20 09:19:22 2013


Still the same compiler error Exclamation

I also tried the command line "buildall.bat" method after changing +FM to +FH so it uses PCH. Still get the "ERROR". Exclamation

buildall.bat
Code:

C:\Temp\PIC\mcu\Example Files>cbuildall.bat

C:\Temp\PIC\mcu\Example Files>"C:\Program Files\PICCv4\CCSC.exe" +FH +EXPORT rep
ort.c

C:\Temp\PIC\mcu\Example Files>"C:\Program Files\PICCv4\CCSC.exe" +FH +EXPORT fil
ter.c

C:\Temp\PIC\mcu\Example Files>"C:\Program Files\PICCv4\CCSC.exe" +FH +EXPORT mai
n.c

C:\Temp\PIC\mcu\Example Files>"C:\Program Files\PICCv4\CCSC.exe" +FH LINK="proje
ct.hex=report.o,filter.o,main.o"

C:\Temp\PIC\mcu\Example Files>
C:\Temp\PIC\mcu\Example Files>
C:\Temp\PIC\mcu\Example Files>type *.err

filter.err


No Errors
C:\Temp\PIC\mcu\Example Files\filter.o ===>  0 Errors,  0 Warnings.
Build Successful.

main.err


No Errors
C:\Temp\PIC\mcu\Example Files\main.o ===>  0 Errors,  0 Warnings.
Build Successful.

project.err


Error[44]   project.c 1 : Internal Error - Contact CCS  Hidden forward reference
 620 from 554
      1 Errors,  0 Warnings.
Build Failed.

report.err


No Errors
C:\Temp\PIC\mcu\Example Files\report.o ===>  0 Errors,  0 Warnings.
Build Successful.

C:\Temp\PIC\mcu\Example Files>
nurquhar



Joined: 05 Aug 2006
Posts: 149
Location: Redditch, UK

View user's profile Send private message Visit poster's website

PostPosted: Wed Feb 20, 2013 4:12 am     Reply with quote

Ok I have looked at MCU.zip example and there is still something I am not understanding. Confused

I followed the instructions in "Using Multiple Compilation Units Guide.pdf" and built the project setup in MPLAB as per the step by step instructions. I ran build all and succesfully got it compile :

Code:

Executing: "C:\Program Files\PICCv4\Ccsc.exe" +FM "report.c" +EXPORT +DF +LN +T +A +M -Z +Y=9 +EA
C:\Temp\PIC\mcu\Example Files\report.o ===>  0 Errors,  0 Warnings.
Build Successful.
Executing: "C:\Program Files\PICCv4\Ccsc.exe" +FM "filter.c" +EXPORT +DF +LN +T +A +M -Z +Y=9 +EA
C:\Temp\PIC\mcu\Example Files\filter.o ===>  0 Errors,  0 Warnings.
Build Successful.
Executing: "C:\Program Files\PICCv4\Ccsc.exe" +FM "main.c" +EXPORT +DF +LN +T +A +M -Z +Y=9 +EA
C:\Temp\PIC\mcu\Example Files\main.o ===>  0 Errors,  0 Warnings.
Build Successful.
Executing: "C:\Program Files\PICCv4\Ccsc.exe" +FM LINK="MCU.hex=report.o,filter.o,main.o" +DF +LN +T +A +M -Z +Y=9 +EA
      Memory usage:   ROM=14%      RAM=10% - 16%
      0 Errors,  0 Warnings.
Build Successful.
Loaded C:\Temp\PIC\mcu\Example Files\MCU.cof.
BUILD SUCCEEDED: Wed Feb 20 09:08:22 2013


So I now try to use "usb_cdc.h" in the main.c. To do this I make the following changes :

1. Change "configure" to use device "PIC18F27J52"
2. Add "#include <usb_cdc.h> " to main.c
3. Comment out "#include <16F877A.h>" and add #include <18F27J53.h> to project.h
4. Comment out #fuses in project.h

main.c :
Code:

#include "project.h"

#include "report.h"
#include "filter.h"

#include <stdlib.h>
#include <input.c>

#include <usb_cdc.h>


extern long report_line_number;

void main(void) {
..............

project.h
Code:

//#include <16F877A.h>
#include <18F27J53.h>

//#fuses HS,NOWDT,NOPROTECT,NOLVP

#use delay(clock=20mhz)
#use rs232(BAUD=9600, UART1, STREAM=PC)

enum errors { err_range, err_too_far, err_too_many };


OUTPUT
Code:

Clean: Deleting intermediary and output files.
Clean: Done.
Executing: "C:\Program Files\PICCv4\Ccsc.exe" +FH "report.c" +EXPORT +DF +LN +T +A +M -Z +Y=9 +EA
C:\Temp\PIC\mcu\Example Files\report.o ===>  0 Errors,  0 Warnings.
Build Successful.
Executing: "C:\Program Files\PICCv4\Ccsc.exe" +FH "filter.c" +EXPORT +DF +LN +T +A +M -Z +Y=9 +EA
C:\Temp\PIC\mcu\Example Files\filter.o ===>  0 Errors,  0 Warnings.
Build Successful.
Executing: "C:\Program Files\PICCv4\Ccsc.exe" +FH "main.c" +EXPORT +DF +LN +T +A +M -Z +Y=9 +EA
>>> Warning 203 "C:\Program Files\PICCv4\drivers\pic18_usb.c" Line 609(1,1): Condition always TRUE
C:\Temp\PIC\mcu\Example Files\main.o ===>  0 Errors,  1 Warnings.
Build Successful.
Executing: "C:\Program Files\PICCv4\Ccsc.exe" +FH LINK="MCU.hex=report.o,filter.o,main.o" +DF +LN +T +A +M -Z +Y=9 +EA
*** Error 44 "MCU.c" Line 1(0,1): Internal Error - Contact CCS  Hidden forward reference 620 from 554
      1 Errors,  0 Warnings.
Build Failed.
Skipping link step.  Not all sources built successfully.
BUILD FAILED: Wed Feb 20 09:19:22 2013


Still the same compiler error Exclamation

I also tried the command line "buildall.bat" method after changing +FM to +FH so it uses PCH. Still get the "ERROR". Exclamation

buildall.bat
Code:

C:\Temp\PIC\mcu\Example Files>cbuildall.bat

C:\Temp\PIC\mcu\Example Files>"C:\Program Files\PICCv4\CCSC.exe" +FH +EXPORT rep
ort.c

C:\Temp\PIC\mcu\Example Files>"C:\Program Files\PICCv4\CCSC.exe" +FH +EXPORT fil
ter.c

C:\Temp\PIC\mcu\Example Files>"C:\Program Files\PICCv4\CCSC.exe" +FH +EXPORT mai
n.c

C:\Temp\PIC\mcu\Example Files>"C:\Program Files\PICCv4\CCSC.exe" +FH LINK="proje
ct.hex=report.o,filter.o,main.o"

C:\Temp\PIC\mcu\Example Files>
C:\Temp\PIC\mcu\Example Files>
C:\Temp\PIC\mcu\Example Files>type *.err

filter.err


No Errors
C:\Temp\PIC\mcu\Example Files\filter.o ===>  0 Errors,  0 Warnings.
Build Successful.

main.err


No Errors
C:\Temp\PIC\mcu\Example Files\main.o ===>  0 Errors,  0 Warnings.
Build Successful.

project.err


Error[44]   project.c 1 : Internal Error - Contact CCS  Hidden forward reference
 620 from 554
      1 Errors,  0 Warnings.
Build Failed.

report.err


No Errors
C:\Temp\PIC\mcu\Example Files\report.o ===>  0 Errors,  0 Warnings.
Build Successful.

C:\Temp\PIC\mcu\Example Files>
Ttelmah



Joined: 11 Mar 2010
Posts: 19538

View user's profile Send private message

PostPosted: Wed Feb 20, 2013 10:16 am     Reply with quote

I've just done the same. Took the MCU example, modified it for your chip (you need fuses....). Added usb_cdc.h, and calls to usb_init, usb_task, and usb putc.
Compiled it with 4.118, 4.137, and 4.140, and all happily compiled it. Tried both with the batch files, and from the IDE. I'd suspect part of your install is corrupt. Haven't got 4.134, maybe there was a problem with that release.

Best Wishes
nurquhar



Joined: 05 Aug 2006
Posts: 149
Location: Redditch, UK

View user's profile Send private message Visit poster's website

PostPosted: Wed Feb 20, 2013 11:06 am     Reply with quote

Well it must be some snafu with 4.133 rather than something I didn't know about multi unit compiling.

I install 4.129, buildall.bat works correctly :
Code:


C:\Temp\PIC\mcu\Example Files>"C:\Program Files\PICCv4\CCSC.exe" +V

C:\Temp\PIC\mcu\Example Files>cbuildall

C:\Temp\PIC\mcu\Example Files>"C:\Program Files\PICCv4\CCSC.exe" +FH +EXPORT rep
ort.c

C:\Temp\PIC\mcu\Example Files>"C:\Program Files\PICCv4\CCSC.exe" +FH +EXPORT filter.c

C:\Temp\PIC\mcu\Example Files>"C:\Program Files\PICCv4\CCSC.exe" +FH +EXPORT mai
n.c

C:\Temp\PIC\mcu\Example Files>"C:\Program Files\PICCv4\CCSC.exe" +FH LINK="proje
ct.hex=report.o,filter.o,main.o"

C:\Temp\PIC\mcu\Example Files>type *.err

filter.err


No Errors
C:\Temp\PIC\mcu\Example Files\filter.o ===>  0 Errors,  0 Warnings.
Build Successful.

main.err


No Errors
C:\Temp\PIC\mcu\Example Files\main.o ===>  0 Errors,  0 Warnings.
Build Successful.

project.err


No Errors
      0 Errors,  0 Warnings.
Build Successful.

report.err


No Errors
C:\Temp\PIC\mcu\Example Files\report.o ===>  0 Errors,  0 Warnings.
Build Successful.

C:\Temp\PIC\mcu\Example Files>

CCS PCH C Compiler, Version 4.129, 61227               20-Feb-13 16:48

               Filename: C:\Temp\PIC\mcu\Example Files\project.lst

               ROM used: 6328 bytes (5%)
                         Largest free fragment is 65528
               RAM used: 454 (12%) at main() level
                         498 (13%) worst case
               Stack:    12 worst case (3 in main + 9 for interrupts)



Re-installing 4.133 :
Code:


C:\Temp\PIC\mcu\Example Files>cbuildall

C:\Temp\PIC\mcu\Example Files>"C:\Program Files\PICCv4\CCSC.exe" +FH +EXPORT rep
ort.c

C:\Temp\PIC\mcu\Example Files>"C:\Program Files\PICCv4\CCSC.exe" +FH +EXPORT fil
ter.c

C:\Temp\PIC\mcu\Example Files>"C:\Program Files\PICCv4\CCSC.exe" +FH +EXPORT mai
n.c

C:\Temp\PIC\mcu\Example Files>"C:\Program Files\PICCv4\CCSC.exe" +FH LINK="proje
ct.hex=report.o,filter.o,main.o"

C:\Temp\PIC\mcu\Example Files>type *.err

filter.err


No Errors
C:\Temp\PIC\mcu\Example Files\filter.o ===>  0 Errors,  0 Warnings.
Build Successful.

main.err


No Errors
C:\Temp\PIC\mcu\Example Files\main.o ===>  0 Errors,  0 Warnings.
Build Successful.

project.err


Error[44]   project.c 1 : Internal Error - Contact CCS  Hidden forward reference
 620 from 554
      1 Errors,  0 Warnings.
Build Failed.

report.err


No Errors
C:\Temp\PIC\mcu\Example Files\report.o ===>  0 Errors,  0 Warnings.
Build Successful.

C:\Temp\PIC\mcu\Example Files>
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group