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 write the post-build command to generate a .bin file in CCS ?

Other Parts Discussed in Thread: SYSBIOS

I am working with the sys/bios project recently. I want to generate a .bin file from a project then use the MLO file in the Starterware to boot this application. Now, I have trouble in generating the .bin file. I have found the following two sample, but I don't  understand how these work, could anybody explain to me? And how to write the specific command that satisfy my situation ?  The hardware I use is Beaglebone Black. 

example 1   project "gpioLEDBlink" in the Starterware.(Beaglebone)

"${CCS_INSTALL_ROOT}/utils/tiobj2bin/tiobj2bin.bat" 
"../../../../../../../binary/armv7a/cgt_ccs/am335x/beaglebone/gpio/${ConfigName}/${ProjName}.out"
"../../../../../../../binary/armv7a/cgt_ccs/am335x/beaglebone/gpio/${ConfigName}/${ProjName}.bin"
"${CG_TOOL_ROOT}/bin/armofd.exe" "${CG_TOOL_ROOT}/bin/armhex.exe"
"${CCS_INSTALL_ROOT}/utils/tiobj2bin/mkhex4bin.exe" & "../../../../../../../tools/ti_image/tiimage.exe"
"0x80000000" "NONE" "../../../../../../../binary/armv7a/cgt_ccs/am335x/beaglebone/gpio/${ConfigName}/${ProjName}.bin"
"../../../../../../../binary/armv7a/cgt_ccs/am335x/beaglebone/gpio/${ConfigName}/${ProjName}_ti.bin"

example 2   project "profinet_slave_RT" in am335x_sysbios_ind_sdk_1.1.0.8

"${IA_SDK_HOME}/tools/post_build/post_build.bat" "${CCS_INSTALL_ROOT}" "${CG_TOOL_ROOT}" 
"${PWD}" "${ProjName}" "${IA_SDK_HOME}\tools\isdk_image" "1" "0" "0x80000000" "0x80000000"

 

  • user4437392 said:
    But the CCS told me that system cannot find the specific path. I want to know how to write the command. 

    he reason PWD does not work in this case is because the Starterware examples place the .out file in a different directory than the build directory.
    In the original post-build step, notice the path (within the binary directory):

    "../../../../../../../binary/armv7a/cgt_ccs/am335x/beaglebone/gpio/${ConfigName}/${ProjName}.out" 

    This is different from the build directory that PWD is set to, which would be something like:
    C:\ti\AM335X_StarterWare_02_00_01_01\build\armv7a\cgt_ccs\am335x\beaglebone\gpio\Release

    If you take a look at Project Properties->Build->Variables tab, and check the box for "Show system variables", you can see what the different variables are set to. If you wish to convert the path to use a variable, try BuildArtifactFileBaseName.

    "${CCS_INSTALL_ROOT}/utils/tiobj2bin/tiobj2bin.bat"  "${BuildArtifactFileBaseName}.out"  "${BuildArtifactFileBaseName}.bin"  "${CG_TOOL_ROOT}/bin/armofd.exe"  "${CG_TOOL_ROOT}/bin/armhex.exe"  "${CCS_INSTALL_ROOT}/utils/tiobj2bin/mkhex4bin.exe" & "../../../../../../../tools/ti_image/tiimage.exe" "0x80000000" "NONE" "../../../../../../../binary/armv7a/cgt_ccs/am335x/beaglebone/enet_echo/${ConfigName}/${ProjName}.bin" "../../../../../../../binary/armv7a/cgt_ccs/am335x/beaglebone/enet_echo/${ConfigName}/${ProjName}_ti.bin"

  • Hi, AartiG.
    Maybe the previous question is not quite clear, I've modified the question as above.
    Checking the system variables did solve some of my confusion. But I still can't get the .bin file while I use the command you wrote above. The CCS still told me that system cannot find the specific path.
    I have some questions about the command you gave to me.
    1. Should I add path before the ${BuildArtifactFileBaseName}.out ? I found that ${BuildArtifactFileBaseName} stands for ${ProjName} and in my case it stands for "hello_BeagleBone_Black_CortexA".
    2. Could you please explain the meaning of the "../" ? Does it mean that Return to the upper level directory ? If so, things seem to be strange, because there is not so many directories.
    Thank you very much !
  • user4437392 said:
    1. Should I add path before the ${BuildArtifactFileBaseName}.out ? I found that ${BuildArtifactFileBaseName} stands for ${ProjName} and in my case it stands for "hello_BeagleBone_Black_CortexA".

    In my project (Starterware project for BeagleBone), ${BuildArtifactFileBaseName} includes the relative path as well. Please see the screenshot below.
    It appears that it is different in your project. If that variable resolves to just ${ProjName} in your case, then yes you would need to add the path before it. Same thing for the .bin file as well. You can confirm which directory the .out file is being created in by going into  Project Properties->Build->ARM Linker->Basic Options, and see what is specified under --output_file.

    user4437392 said:
    2. Could you please explain the meaning of the "../" ? Does it mean that Return to the upper level directory ?

    Yes, that is what it means.

     

  • Hi, AartiG

    I still have some trouble. Maybe I haven't expressed clearly. What I'm trying to do is to use the way of Starterware to generate a .bin file for my own project. That is why my ${BuildArtifactFileBaseName} seems to be quite differnet. Inspired by you, I've changed the command as following:

    "${CCS_INSTALL_ROOT}/utils/tiobj2bin/tiobj2bin.bat"  
    "${BuildDirectory}/${BuildArtifactFileBaseName}.out"  
    "${BuildDirectory}/${BuildArtifactFileBaseName}.bin"  
    "${CG_TOOL_ROOT}/bin/armofd.exe"  "${CG_TOOL_ROOT}/bin/armhex.exe"  
    "${CCS_INSTALL_ROOT}/utils/tiobj2bin/mkhex4bin.exe" & "D:/TI/AM335X_StarterWare_02_00_01_01/tools/ti_image/tiimage.exe" 
    "0x80000000" "NONE" "${BuildDirectory}/${ProjName}.bin" "${BuildDirectory}/${ProjName}_ti.bin"

    Where ${BuildDirectory} is a Directory type variable which stands for "D:/YangYu/workspace_v6_1/hello_BeagleBone_Black_CortexA/Debug".

    But still the CCS seems not to output the .bin file. Actually, I didn't find the .bin file in the project directory. Following is the CCS console output:

    It seems that post-build didn't work at all.

    What's the problem ? Could please help me out ?

    Thank you very much.

  • Hi, AartiG

    I've tried a lot and finnally got the .bin file successfully. But I still have a little confusion. The command I used is as following:

    "${CCS_INSTALL_ROOT}/utils/tiobj2bin/tiobj2bin.bat"  "${ProjName}.out"  "${ProjName}.bin"  
    
    "${CG_TOOL_ROOT}/bin/armofd.exe"  "${CG_TOOL_ROOT}/bin/armhex.exe"  
    
    "${CCS_INSTALL_ROOT}/utils/tiobj2bin/mkhex4bin.exe" & "${IA_SDK_HOME}\starterware\tools
    
    \ti_image\tiimage.exe" "0x80000000" "NONE" "${ProjName}.bin" "${ProjName}_ti.bin"

    Previously, in the properties of project --> Build --> Builder, I chose not to "Use default build command" and use the build command:

    ${CCS_UTILS_DIR}/bin/gmake -k -j ${NUMBER_OF_PROCESSORS} -s

    Which is used in the project of starterware. But in such situation the post-build command didn't work.

    Then I chose to "Use default build command" and used the same post-build command. In this situation, I can get the .bin file. I am quite confused, does the builder command influence the post-build command ?

  • user4437392 said:
    I've tried a lot and finnally got the .bin file successfully

    Glad to hear you are now able to generate the .bin file.

    user4437392 said:
    I am quite confused, does the builder command influence the post-build command ?

    It should not. That custom build command is just enabling parallel builds and should not influence the outcome of the post-build step. The Starterware examples also use the same build  command and the post-build step works fine in those examples. I don't really have an explanation for why it would not generate the .bin file.

  • Thanks for your help !