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.

TMS320F28075: extract version number from source code and use it to rename object file

Part Number: TMS320F28075
Other Parts Discussed in Thread: C2000WARE

Hi Team,

My customer want to extract the version number from the source code, and use the number to rename the object file.

Now they're using bat script + CCS Post-build steps to achieve it.

They use bat instruction 'tokens' to extract the version number and give this value to a variable str1 they named. Then transfer this value to name 'new' which represent the object file. 

The issue they encountered is: after executed, the file name still be 'new', not the version number.

Here is their bat script:

@echo off
setlocal enabledelayedexpansion
for /f "tokens=2,3" %%i in (CFG_SysParaInit.h) do (
if %%i==DSP_VERSION (
set str1=%%j
set str2=TPaa!str1!
echo !str2!
)
)
for /f "tokens=2,3" %%i in (CFG_SysParaInit.h) do (
if %%i==DSP_DEBUG_VERSION (
set str3=%%j
set str4=_D!str3!
set new1=!str2!!str4!_075
echo !new1!
)
)
for /f "tokens=2,3" %%i in (CFG_SysParaInit.h) do (
if %%i==DSP_VERSION2 (
set str5=%%j
set str6=TPaa!str5!
echo !str6!
set new2=!str6!!str4!_075
echo !new2!
)
)
for /f "tokens=2,3" %%i in (CFG_SysParaInit.h) do (
if %%i==HIL_TEST (
set str=%%j
if "!str!"=="0" (
cd "../../.././CPU1_FLASH"
copy WIS215KW_TL3_inv_f28075.hex WIS215KW_TL3_inv_f28075bak.hex
ren WIS215KW_TL3_inv_f28075bak.hex !new2!.hex
)
if "!str!"=="1" (
cd "../../.././CPU1_FLASH"
copy WIS215KW_TL3_inv_f28075.hex WIS215KW_TL3_inv_f28075bak.hex
ren WIS215KW_TL3_inv_f28075bak.hex !new1!.hex
)
)
)
pause

Could you please provide us some help?

--

Thanks & Regards

Yale

  • Hello Yale,

    To clarify, is the issue they're getting on the side of the CCS post-build steps or their batch script. We don't have any experts that actively support this topic, so unless they're having trouble extracting the information from CCS or C2000Ware (I'm not sure if this is what they're doing), it might be better to ask this on another forum that answers more general programming/scripting questions.

    Best regards,

    Omer Amir