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 support@ccsinfo.com

Increase build number with the v5 compiler?
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
ELCouz



Joined: 18 Jul 2007
Posts: 427
Location: Montreal,Quebec

View user's profile Send private message

Increase build number with the v5 compiler?
PostPosted: Tue Jul 22, 2014 10:22 pm     Reply with quote

Dear CCS Fanatics Smile,

I would like to know if it is possible that the compiler increase the build number in my program code?

It's a neat feature that some compilers have (pc programming) but I don't know for CCS 5.xxx compiler.

Annoying to do by hand.


thank you very much! Smile

Right now i'm using the 5.025 PCWHD version

EDIT: Example what it looks like on Delphi


_________________
Regards,
Laurent

-----------
Here's my first visual theme for the CCS C Compiler. Enjoy!


Last edited by ELCouz on Sun Oct 19, 2014 6:30 pm; edited 2 times in total
Ttelmah



Joined: 11 Mar 2010
Posts: 19369

View user's profile Send private message

PostPosted: Wed Jul 23, 2014 1:35 am     Reply with quote

Look at #SERIALIZE
RF_Developer



Joined: 07 Feb 2011
Posts: 839

View user's profile Send private message

Re: Increase build number with the v5 compiler?
PostPosted: Wed Jul 23, 2014 2:03 am     Reply with quote

ELCouz wrote:
I would like to know if it is possible that the compiler increase the build number in my program code?


In a word, no. #SERIALIZE allows units to have serial numbers to be allocated when being production programmed, there is no support for compiler generated build numbers to identify compilations.

There used to be before- and after-build script capability in later version 4 IDEs, but I can't find the equivalent in my 5.026, and the before-build event didn't work very well as it didn't wait for the script to finish before compiling the project. It if did that could have been used to manage the build number and other stuff by a script. I am still looking for this sort of support.

EDIT: I've found it! Now to see if pre-build script support works and is usable.
ELCouz



Joined: 18 Jul 2007
Posts: 427
Location: Montreal,Quebec

View user's profile Send private message

PostPosted: Wed Jul 23, 2014 9:36 am     Reply with quote

I've contacted CCS tech support and they said no it is not possible at the moment.

But they also said that they will add it in a future release Smile

Thanks guys!

I wonder why nobody ask or use that... I find it very useful for debugging!
You can see the real build number in the PIC (either EEPROM or const inside program flash) while on the "field" when something is wrong.
_________________
Regards,
Laurent

-----------
Here's my first visual theme for the CCS C Compiler. Enjoy!
Ttelmah



Joined: 11 Mar 2010
Posts: 19369

View user's profile Send private message

PostPosted: Thu Jul 24, 2014 2:08 pm     Reply with quote

Actually, you can do it.
I do it....

I use #serialise, use a batch build, and just have this delete the first line from a file containing the serial numbers.
I do it from a command line, but it may be possible using the settings for multi-compile inside the IDE (have not tried this).

It _might_ be possible to cheat it. Haven't tried this either, but if pch.exe is not in the IDE directory, the IDE might accept a pch.bat, that then performs the line removal, and calls the real pch.exe!. Sneaky, but 'possible'....
gpsmikey



Joined: 16 Nov 2010
Posts: 588
Location: Kirkland, WA

View user's profile Send private message

PostPosted: Thu Jul 24, 2014 4:38 pm     Reply with quote

I had spent some time looking for it in the past and concluded it didn't support it, but never brought it up here (or to CCS). Glad to see someone else uses the feature and they are going to add it in a future release (v7 ???) Rolling Eyes

mikey
_________________
mikey
-- you can't have too many gadgets or too much disk space !
old engineering saying: 1+1 = 3 for sufficiently large values of 1 or small values of 3
jeremiah



Joined: 20 Jul 2010
Posts: 1328

View user's profile Send private message

PostPosted: Thu Jul 24, 2014 6:07 pm     Reply with quote

I've never played with this, but the latest versions of CCSLoad appear to have some sort of options for this. It's still kinda a beta version at this point, but normal programming has worked well, so perhaps the serialization will work too:

drolleman



Joined: 03 Feb 2011
Posts: 116

View user's profile Send private message

PostPosted: Thu Jul 24, 2014 10:36 pm     Reply with quote

use __date__ and __time__ in a string that is compiled into the program i have it so i can call it through the serial bus
ELCouz



Joined: 18 Jul 2007
Posts: 427
Location: Montreal,Quebec

View user's profile Send private message

PostPosted: Thu Jul 24, 2014 11:42 pm     Reply with quote

jeremiah wrote:
I've never played with this, but the latest versions of CCSLoad appear to have some sort of options for this. It's still kinda a beta version at this point, but normal programming has worked well, so perhaps the serialization will work too:



Looks promising but unfortunately i'm not using their ICD.

I think it should be easy for them to implement that into the compiler.

Quote:
use __date__ and __time__ in a string that is compiled into the program i have it so i can call it through the serial bus


It's a clever idea, however it is more difficult to keep track of the builds because it's not really incremental. (ex:how many builds between 2012-05-01 and 2014-05-01 ??)
_________________
Regards,
Laurent

-----------
Here's my first visual theme for the CCS C Compiler. Enjoy!
RF_Developer



Joined: 07 Feb 2011
Posts: 839

View user's profile Send private message

PostPosted: Fri Jul 25, 2014 2:00 am     Reply with quote

What the programmers do is serialisation: identifying copies of otherwise identical code. Its for making each item of production batch/run/whatever have a different and, if managed correctly, unique serial number. this is done at programming time.

What ELCouz and I want is build identification: making each build/compilation of code uniquely identifiable by having a build number that's managed automatically by the tools, in this case the IDE. This is done at compile/build time.

There is no feature/facility for build number management built-in to the IDE, in indeed any PIC IDE that I've seen, and if its any comfort, the ARM IDE I'm most familiar with, uVision, didn't have it either. Indeed, I've not seen it on any embedded code targetted IDE.

The only facilities that would make it possible to do it by external tools, are pre-build triggering, but as that doesn't wait for the script/external tool to complete, its useless as the tool MUST manage the build number, updating some build number/version header file BEFORE the compilation starts.

So, unless CCS put the facility into the IDE/compiler, presumably by some __BUILD__ macro type thing, we're stuffed. I have asked them previously about this, and also got a warm "yes, we'll look into that for a future version". I hoped, and asked for it as a version 5 feature too. But despite all my best efforts over more than three years, its still not happened. So I'm not holding my breath.
jeremiah



Joined: 20 Jul 2010
Posts: 1328

View user's profile Send private message

PostPosted: Fri Jul 25, 2014 8:05 am     Reply with quote

What trigger would you use to distinguish between the release of the build and just compiling to check something out?
Ttelmah



Joined: 11 Mar 2010
Posts: 19369

View user's profile Send private message

PostPosted: Fri Jul 25, 2014 8:45 am     Reply with quote

Some compilers, that support this directly, switch, when you change from 'debug' to 'release'. Otherwise you don't. This is why I suspect CCS are not terribly 'eager' to bother.
This is why I use the scripted approach. Do my development in the IDE, and have a 'release' script, which compiles again, updates the serial number, and puts the code ready to send out.
It is a doddle with a few lines of script.
gpsmikey



Joined: 16 Nov 2010
Posts: 588
Location: Kirkland, WA

View user's profile Send private message

PostPosted: Fri Jul 25, 2014 9:19 am     Reply with quote

I would not care if it incremented the build each time I ran the compile (even if to only "check something out"). Just having the fact that the code was created with build 2301 of my source is fine with me (and you see it in lots of other places - look in Windows control panel "Programs" and you will often see the build number as the last number in the "version" number - one program I have is listed as version 3.3.10.17762 - 17762 is the build number and if you select "Help" from the program, it indeed says "version 3.3.10 (build 17762)") It doesn't need to be a consecutive number for each release, just having a unique number for each compile is fine - it leaves you with unique versions easily identifiable.

mikey
_________________
mikey
-- you can't have too many gadgets or too much disk space !
old engineering saying: 1+1 = 3 for sufficiently large values of 1 or small values of 3
Ttelmah



Joined: 11 Mar 2010
Posts: 19369

View user's profile Send private message

PostPosted: Fri Jul 25, 2014 9:29 am     Reply with quote

Just use the checksum then.
ELCouz



Joined: 18 Jul 2007
Posts: 427
Location: Montreal,Quebec

View user's profile Send private message

PostPosted: Fri Jul 25, 2014 10:12 am     Reply with quote

I replied that many people are interested in this and hoping it would be release before v6 compiler.

Offical re-reply from CCS:
Quote:
The next release should be within a week.

_________________
Regards,
Laurent

-----------
Here's my first visual theme for the CCS C Compiler. Enjoy!
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