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

New Computer at Work, Previous projects won't compile now
Goto page 1, 2  Next
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
stinky



Joined: 05 Mar 2012
Posts: 99
Location: Central Illinois

View user's profile Send private message

New Computer at Work, Previous projects won't compile now
PostPosted: Mon Mar 05, 2012 11:40 am     Reply with quote

The PCM compiler was installed on my work machine before I started working on it so I have never installed the PCM compiler myself.

I've received a new work machine and I have installed MPLAB, the MPLAB CCS Plugin, and CCS.

I had a CD on file that contained the CCS setup program, the pcm.crg file, and a text file that "documents" how to install the program.


I tried my best, and I can open existing mplab workspaces or I can use project wizard to make a new workspace but I cannot get my programs to compile.

At compile time I see these errors:

>>> Warning 207 "720025E-M4.c" Line 1214(44,45): Code has no effect
*** Error 71 "720025E-M4.c" Line 1356(1,2): Out of ROM, A segment or the program is too large MOMENTARY_MODE
Seg 00031-006FF, 0082 left, need 00CB
Seg 00000-00003, 0000 left, need 00CB
Seg 00004-00030, 0000 left, need 00CB

1 Errors, 1 Warnings.


I have changed nothing in the code. It compiles on the previous machine.


UPDATE:
I tried a different project, it successfully compiles however it takes up 69% of my ROM space where as the previous machine only takes up 54%.

Does that mean anything to you guys?

Thanks
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Mon Mar 05, 2012 1:30 pm     Reply with quote

What version is your compiler?
stinky



Joined: 05 Mar 2012
Posts: 99
Location: Central Illinois

View user's profile Send private message

PostPosted: Mon Mar 05, 2012 2:03 pm     Reply with quote

The new machine has 4.107 installed. The old machine has 4.007 installed.
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Mon Mar 05, 2012 2:14 pm     Reply with quote

1- is it possible you have mixed up your DEVICE headers ??
2- when you look at the line number and section of your code that is id'd as doing nothing WHAT IS it actually??

This seems like the core problem is a version difference and you are maybe not using the compiler you think you are.

Of the code that DID compile - what version is implanted in the head of the .LST file ???
stinky



Joined: 05 Mar 2012
Posts: 99
Location: Central Illinois

View user's profile Send private message

PostPosted: Mon Mar 05, 2012 2:38 pm     Reply with quote

asmboy wrote:
1- is it possible you have mixed up your DEVICE headers ??


I don't believe so. The code that did compile successfully programmed onto a pic.

asmboy wrote:
2- when you look at the line number and section of your code that is id'd as doing nothing WHAT IS it actually??


Checking a variable stored in EEPROM, and writing to if necessary:
if(read_eeprom(EE_6_LOCATION) != CSELECT);
WriteToEE(EE_6_LOCATION,CSELECT);

This particular line is in a string of similar functions that did not produce
the same error.


asmboy wrote:
This seems like the core problem is a version difference and you are maybe not using the compiler you think you are.

Of the code that DID compile - what version is implanted in the head of the .LST file ???


The top line of the .LST file reads:
CCS PCM C Compiler, Version 4.107, 52612 05-Mar-12 14:02


I'm inclined to agree with you. But I'm not sure how I can get the 4.007 version back when the only one I have locally is 4.107. Will CCS give me access to the old compiler?
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Mon Mar 05, 2012 2:43 pm     Reply with quote

if i was in your shoes - i would contact CCS support and make the request.
stinky



Joined: 05 Mar 2012
Posts: 99
Location: Central Illinois

View user's profile Send private message

PostPosted: Mon Mar 05, 2012 3:07 pm     Reply with quote

I will take your advice.

I used beyond compare to look at the header files from the different
compilers and there are more differences than I would like to have seen.



Thanks for spending some time with me asmboy!
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Mar 05, 2012 7:38 pm     Reply with quote

Quote:
The new machine has 4.107 installed. The old machine has 4.007 installed.

>>> Warning 207 "720025E-M4.c" Line 1214(44,45): Code has no effect

if(read_eeprom(EE_6_LOCATION) != CSELECT);
WriteToEE(EE_6_LOCATION,CSELECT);

This particular line is in a string of similar functions that did not produce
the same error.

You really don't want to go back to vs. 4.007. It's allowing bugs to
get into your final code by not warning you of common mistakes.

Look closely at your if() statement above. What does it have on the end
of it ? What will this do to the if() statement ? Hint: The warning in
vs. 4.107 is correct. You really need to be using vs. 4.107 or later.
Or you need to run a lint program on your source code.

Quote:

I used beyond compare to look at the header files from the different
compilers and there are more differences than I would like to have seen.

That's because they added more features to the built-in functions in
the 100 versions between 4.007 and 4.107. They also have corrected
a lot of bugs.
stinky



Joined: 05 Mar 2012
Posts: 99
Location: Central Illinois

View user's profile Send private message

PostPosted: Tue Mar 06, 2012 8:24 am     Reply with quote

Hey PCM programmer!

Good catch. That line of code has been in use on v 4.007 for at least 16 months and the compiler never caught it.

Any thoughts on why v 4.107 is consuming more space to compile the same code?
Ttelmah



Joined: 11 Mar 2010
Posts: 19477

View user's profile Send private message

PostPosted: Tue Mar 06, 2012 8:41 am     Reply with quote

Without knowing what libraries you used, no.

However I'm astonished you had a project so large that actually worked with .007. This was so far before almost any feature of the compiler worked 'right', that it is quite amazing....

I's suspect the most likely thing is that more stuff is being 'inlined'. The compiler now tends to do this to give better speed, unless space is getting short.

Best Wishes
stinky



Joined: 05 Mar 2012
Posts: 99
Location: Central Illinois

View user's profile Send private message

PostPosted: Tue Mar 06, 2012 9:20 am     Reply with quote

Ttelmah:


I didn't know the state of 4.007 was so bad.
I don't believe I've got anything fancy in here as far as libraries. I have my own header file that sets the #fuses, maps constants to pin numbers, and defines some macros. Aside of that, just the standard PIC header file.


I tried using the #separate command on a handful of functions and when I go to build I did not see a change in the amount of space needed.


re: astonishment.
I have another program, compiled under 4.007, that hit 91%. Works well.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Mar 06, 2012 5:24 pm     Reply with quote

Quote:
I don't believe I've got anything fancy in here as far as libraries

In this case, "libraries" means #use statements, and also it means
any CCS driver files (.c and/or .h) that are in #include statements
in your program.
Quote:

c:\program files\picc\drivers

Post all the #use statements, and post a list of the driver files that you're using.

Also, tell us if you are using any special control statements such as #build, #org, and #rom.
stinky



Joined: 05 Mar 2012
Posts: 99
Location: Central Illinois

View user's profile Send private message

PostPosted: Thu Mar 08, 2012 12:59 pm     Reply with quote

PCM programmer:

"#use" statements:
Code:
  #use fast_io(A)
  #use fast_io(B)
  #use delay (clock=8000000)

"#include" and misc:
Code:
  #include "720025E.h"
  #ID CHECKSUM
  #include <16F819.h>
  #device adc=8

"#ROM" statement:
Code:
  #ROM 0x2100 = {LOCKOUT,2,2,2,2,0,2,0}

And some "#ASM" in my main line:
Code:

//setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
   #ASM                     
   movlw  0x01
   movwf  0x10
   #ENDASM

There is only one .C file that contains the Mainline and routines.
The 720025.h file is the one that contains my #fuses, constants,
and macros.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Mar 08, 2012 1:41 pm     Reply with quote

I don't see anything there that would cause your code size to increase
greatly between versions. What about other CCS functions ? Do you
use any of these compiler features:

Flash memory:
write_program_memory()
read_program_memory()
write_program_eeprom()
read_program_eeprom()

Floating point:
Do you use floating point math ? Do you have any floating point
variables declared ? Do you have printf statements that print floating point ? What floating point operators do you use ?

The compiler error message refers to, I assume, a function called
momentary_mode(). What's in that function ?
Quote:

A segment or the program is too large MOMENTARY_MODE
stinky



Joined: 05 Mar 2012
Posts: 99
Location: Central Illinois

View user's profile Send private message

PostPosted: Fri Mar 09, 2012 10:49 am     Reply with quote

I'm not using any of those compiler features you mentioned.

I've stuck to all integer math.


The only things in the function momentary_mode() are looking
at user pressed switches and performing logic with them.


I just went for a shotgun approach. I added a #separate command
to each function in the program and it successfully compiled.

All I've read about this is that it saves space at the sacrifice of speed.
I will begin testing the code like this but do you have any words of wisdom or warnings about what this could do?
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
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