This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to add the version of the release to the binary and .tar names

Hi,

I have an issue with changing .bin and .tar names according to the version of the release. I have defined a string macro in some header file. Can I add this macro as a build variable so I can access it later over BuildArtifactFileBaseName? So my generated binary name had to be according to the version. Are there some other methods of handling my case? Like adding some python/bash script to the build system or adding some commands to the make file? My main goal is to do what I described above automatically after I click the build button. I am using the latest CCS 12.6.

BR,

Alex

  • Hi Alex,

    The best option in your case is to use a post-build step to run some custom script to rename the files as needed. 

    https://software-dl.ti.com/ccs/esd/documents/users_guide/ccs_project-management.html#pre-and-post-build-steps

    Thanks

    ki

  • Hi Ki,

    I have tried this method and it had no profit for me, cause even if I add a post-build step to my project, Bin conversion from .out type file is activated after my post-build script. My script crashes with the error no such file. So it did not help me. The script I wrote only renames the already generated bin file according to the version. What should I do in this case?

    BR,

    Alex

  • I think I am misunderstanding something here. What is the process for generating the bin and tar file? Can you detail your current flow from CCS project build to bin/tar generation?

  • It's the same as default, but for now, let's focus on generating/renaming .bin file with the certain template. As I said before I had tried the post-build step before you even mentioned it. You know the result, tiarmobjcopy build step(second target) is executing after my post-build one. The first target is generating .out file in the Arm Linker phase. What are your suggestions?

    BR,

    Alex

  • tiarmobjcopy build step

    Ok, now it is coming together. That is where you are getting BuildArtifactFileBaseName. You want a way to somehow get the version number defined in that header file in your code so that you can then use it when passing in the BuildArtifactFileBaseName for when you call tiarmobjcopy in your post build step.

    The way you are doing it now, there is not a way.

    I would recommend a different post build step. Instead of calling tiarmobjcopy directly as your post build step, can you call some script (could be python or whatever) that can parse the contents of the header file use to build the application and get the version string. Then the same script would call tiarmobjcopy and can pass in the BuildArtifactFileBaseName with the version number that it got earlier.  

  • Thanks, Ki, that was a very wise suggestion, and it worked.

    BR,

    Alex

  • I was in a hurry, so I completely forgot about the generating .tar file with the project version. syscfg create_image command from SLImageCreater tool doesn't have the flag to choose the name of the image. I guess the tool does it implicitly. What can I do?

  • project version. syscfg create_image command from SLImageCreater tool doesn't have the flag to choose the name of the image. I guess the tool does it implicitly. What can I do?

    I suggest starting a new thread in the WiFi forum. The experts there can answer more questions regarding Image Creator.

    Thanks

    ki