<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to insert version number into C code AND generated filename in Kinetis Design Studio</title>
    <link>https://community.nxp.com/t5/Kinetis-Design-Studio/How-to-insert-version-number-into-C-code-AND-generated-filename/m-p/790156#M9799</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Robert,&lt;/P&gt;&lt;P&gt;Sorry I don't really know your meaning , do you want to rename file with version number ？&lt;/P&gt;&lt;P&gt;If yes, how about the post-build commend:&lt;/P&gt;&lt;P&gt;- Add Build Variable"Newname":&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/70126i629D958E0D0DD8B8/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;- In Post-build, input command:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/70179i3F69FC7BD43D0B20/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;- Build , the new name with version number appeares:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_3.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/70227iD2B7C42357CF0D60/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_3.png" alt="pastedImage_3.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;TIC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 25 Sep 2018 07:52:05 GMT</pubDate>
    <dc:creator>Alice_Yang</dc:creator>
    <dc:date>2018-09-25T07:52:05Z</dc:date>
    <item>
      <title>How to insert version number into C code AND generated filename</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/How-to-insert-version-number-into-C-code-AND-generated-filename/m-p/790154#M9797</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Our project has a standard version numbering system with major, minor and revision numbers.&amp;nbsp; For this discussion, assume they have values 1, 2 and 3 respectively.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd like to define the major, minor and revision number components in a single place but with the following twist: the version number components&amp;nbsp;must be accessible to the C compiler (likely defined by the pre-processor) so I can do something like this:&lt;/P&gt;&lt;PRE&gt;&amp;nbsp; &amp;nbsp; write_to_flash(make_version_number(VERS_MAJOR, VERS_MINOR, VERS_REVISION));&lt;/PRE&gt;&lt;P&gt;AND also accessible to KDS/Eclipse, so I can generate an output filename of the form:&lt;/P&gt;&lt;PRE&gt;&amp;nbsp; &amp;nbsp; myproj-1-2-3.sbin&lt;/PRE&gt;&lt;P&gt;I already have a pre-processor script, so I could clearly use it to take build variables and create a .h file from them, so I'd end up with:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&amp;nbsp; &amp;nbsp; #ifndef SOURCE_VERSION_H
&amp;nbsp; &amp;nbsp; #define SOURCE_VERSION_H

&amp;nbsp; &amp;nbsp; #define VERS_MAJOR 1
&amp;nbsp; &amp;nbsp; #define VERS_MINOR 2
&amp;nbsp; &amp;nbsp; #define VERS_REVISION 3

&amp;nbsp; &amp;nbsp; #endif&lt;/PRE&gt;&lt;P&gt;This way, I only have to define the version numbers (once) in the project's Build Variables.&amp;nbsp; &amp;nbsp;Is this the recommended way to do it?&amp;nbsp; Or is there another preferred technique?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Sep 2018 05:10:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/How-to-insert-version-number-into-C-code-AND-generated-filename/m-p/790154#M9797</guid>
      <dc:creator>robertpoor</dc:creator>
      <dc:date>2018-09-24T05:10:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to insert version number into C code AND generated filename</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/How-to-insert-version-number-into-C-code-AND-generated-filename/m-p/790155#M9798</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Update: Wait a minute!&amp;nbsp; I thought I'd be able to insert Build Variables into the Debug Configurations dialog in order to control the C/C++ application that it looks for:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Screen Shot 2018-09-24 at 04.41.08.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/69596iC06153C7AEEDB630/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2018-09-24 at 04.41.08.png" alt="Screen Shot 2018-09-24 at 04.41.08.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;... but clearly that's not the case.&amp;nbsp; Let me add a follow-on question: How do I tell the debugger to load the C/C++ application with the filename and version #?&amp;nbsp; Is there a way to expand a Build Variable in the Debug Configurations dialog?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Sep 2018 11:45:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/How-to-insert-version-number-into-C-code-AND-generated-filename/m-p/790155#M9798</guid>
      <dc:creator>robertpoor</dc:creator>
      <dc:date>2018-09-24T11:45:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to insert version number into C code AND generated filename</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/How-to-insert-version-number-into-C-code-AND-generated-filename/m-p/790156#M9799</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Robert,&lt;/P&gt;&lt;P&gt;Sorry I don't really know your meaning , do you want to rename file with version number ？&lt;/P&gt;&lt;P&gt;If yes, how about the post-build commend:&lt;/P&gt;&lt;P&gt;- Add Build Variable"Newname":&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/70126i629D958E0D0DD8B8/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;- In Post-build, input command:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/70179i3F69FC7BD43D0B20/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;- Build , the new name with version number appeares:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_3.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/70227iD2B7C42357CF0D60/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_3.png" alt="pastedImage_3.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;TIC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Sep 2018 07:52:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/How-to-insert-version-number-into-C-code-AND-generated-filename/m-p/790156#M9799</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2018-09-25T07:52:05Z</dc:date>
    </item>
  </channel>
</rss>

