View previous topic :: View next topic |
Author |
Message |
ELCouz
Joined: 18 Jul 2007 Posts: 427 Location: Montreal,Quebec
|
Increase build number with the v5 compiler? |
Posted: Tue Jul 22, 2014 10:22 pm |
|
|
Dear CCS Fanatics ,
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!
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: 19538
|
|
Posted: Wed Jul 23, 2014 1:35 am |
|
|
Look at #SERIALIZE |
|
|
RF_Developer
Joined: 07 Feb 2011 Posts: 839
|
Re: Increase build number with the v5 compiler? |
Posted: Wed Jul 23, 2014 2:03 am |
|
|
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
|
|
Posted: Wed Jul 23, 2014 9:36 am |
|
|
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
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: 19538
|
|
Posted: Thu Jul 24, 2014 2:08 pm |
|
|
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
|
|
Posted: Thu Jul 24, 2014 4:38 pm |
|
|
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 ???)
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: 1354
|
|
Posted: Thu Jul 24, 2014 6:07 pm |
|
|
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
|
|
Posted: Thu Jul 24, 2014 10:36 pm |
|
|
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
|
|
Posted: Thu Jul 24, 2014 11:42 pm |
|
|
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
|
|
Posted: Fri Jul 25, 2014 2:00 am |
|
|
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: 1354
|
|
Posted: Fri Jul 25, 2014 8:05 am |
|
|
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: 19538
|
|
Posted: Fri Jul 25, 2014 8:45 am |
|
|
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
|
|
Posted: Fri Jul 25, 2014 9:19 am |
|
|
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: 19538
|
|
Posted: Fri Jul 25, 2014 9:29 am |
|
|
Just use the checksum then. |
|
|
ELCouz
Joined: 18 Jul 2007 Posts: 427 Location: Montreal,Quebec
|
|
Posted: Fri Jul 25, 2014 10:12 am |
|
|
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! |
|
|
|