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.

Postbuild step batch file: accessing path variables (CG_TOOL_ROOT etc)

Hi all.

I am using the following batch file as a post-build step:

---

@ECHO OFF
set HexUtil=C:\TI\ccsv5\tools\compiler\c2000_6.1.9\bin\hex2000.exe
set CCSOutFile=Project.out
@ECHO ON
md App
%HexUtil% -o App\app.bin -boot -b -sci8 %CCSOutFile%
--

How can I automatically change the variable HexUtil as the compiler version is changed. For example, can I access the code composer studio path variable CG_TOOL_ROOT= C:\TI\ccsv5\tools\compiler\c2000_6.1.9 from the windows batch file?

Many thanks,

Christian

  • Christian L said:

    How can I automatically change the variable HexUtil as the compiler version is changed. For example, can I access the code composer studio path variable CG_TOOL_ROOT= C:\TI\ccsv5\tools\compiler\c2000_6.1.9 from the windows batch file?

    You cannot directly access CCS variables from within the batch file, but you could pass it as an argument to the batch file.

    So something like this:

    @ECHO OFF
    set HexUtil=%1%
    set CCSOutFile=Project.out

    and invoke the post build step as:

    build.bat "${CG_TOOL_HEX}"

     

  • Thank you,

    Good idea.

    I ended up using the following:

    ${PROJECT_LOC}/postBuildStep.bat "${CG_TOOL_ROOT}/bin/hex2000.exe"


    Best regards,

    Christian