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.

Output Both .bin and .hex

Other Parts Discussed in Thread: TM4C1294NCPDT

I have set up the project in CCS v5.2 to output the binary using the script that is in these forums but I also need the hex file output as well.  Is there a post script option that will allow both of these files as outputs?  I seem to be able to only do one or the other.

Thanks.

  • Hi Tim,

    Could you not also add the hex utility as a post build option in the script? The utility comes with your compiler install (check the compiler user's guide)

    Thanks

    ki

  • I am not sure I understand your response.  I have to edit the post-build command to be either:

    ${CG_TOOL_ROOT}/bin/hex470  -i  -memwidth=32  -romwidth=32 ${BuildArtifactFileBaseName}

    "${CCS_INSTALL_ROOT}/utils/tiobj2bin/tiobj2bin.bat" "${BuildArtifactFileName}" "${BuildArtifactFileBaseName}_X_xx.bin" "${CG_TOOL_ROOT}/bin/ofd470.exe" "${CG_TOOL_ROOT}/bin/hex470.exe" "${CCS_INSTALL_ROOT}/utils/tiobj2bin/mkhex4bin.exe"

    The first produces the hex file and the second the binary file.  It looks like the hex file is used to make the binary but it is not an output.  So what do you mean by add the hex utility to the post build as I have tried combining these lines in the command field and it just reports an error and gives me neither file.

  • You can have both commands in the post-build step separated by an ampersand (&).

    ${CG_TOOL_ROOT}/bin/hex470  -i  -memwidth=32  -romwidth=32 ${BuildArtifactFileBaseName} & "${CCS_INSTALL_ROOT}/utils/tiobj2bin/tiobj2bin.bat" .....

  • I have a question about creating a .bin and a .hex on a newer version of CCS. I am using a Tiva TM4C1294NCPDT and using TIRTOS with CCS 6.1.2. I have the compiler producing a .bin file using the post step using the command:

    "${CCS_INSTALL_ROOT}/utils/tiobj2bin/tiobj2bin" "${BuildArtifactFileName}" "App_CIBT_vXX.bxxxxx_.bin" "${CG_TOOL_ROOT}/bin/armofd" "${CG_TOOL_ROOT}/bin/armhex" "${CCS_INSTALL_ROOT}/utils/tiobj2bin/mkhex4bin"


    I would also like to have a hex file output in addition to the .bin file so I changed the post step to:

    "${CG_TOOL_ROOT}/bin/hex470 -i -memwidth=32 -romwidth=32 ${BuildArtifactFileBaseName}" & "${CCS_INSTALL_ROOT}/utils/tiobj2bin/tiobj2bin" "${BuildArtifactFileName}" "App_CIBT_vXX.bxxxxx_.bin" "${CG_TOOL_ROOT}/bin/armofd" "${CG_TOOL_ROOT}/bin/armhex" "${CCS_INSTALL_ROOT}/utils/tiobj2bin/mkhex4bin"

    I have not been able to create a .hex file using the above command.

    I did try using just: "${CG_TOOL_ROOT}/bin/hex470 -i -memwidth=32 -romwidth=32 ${BuildArtifactFileBaseName}" to create the .hex file but it never produced a .hex file.

    What command should I use to produce a .hex file?

    Doug
  • Doug Baker said:
    I did try using just: "${CG_TOOL_ROOT}/bin/hex470 -i -memwidth=32 -romwidth=32 ${BuildArtifactFileBaseName}"

    Use armhex in place of hex470.

    Also in CCS 6.1.2, the "&" is not required for separating commands. You can enter multiple commands in the Post-build steps text box, each on a new line. 

  • I tried just:

    "${CG_TOOL_ROOT}/bin/armhex -i -memwidth=32 -romwidth=32 ${BuildArtifactFileBaseName}"


    and it didn't build a .hex file. The compiler console window output:

    'Finished building target: CIB_TivaApplication.out'
    ' '
    "C:/ccs6p1p2/ccsv6/tools/compiler/ti-cgt-arm_5.2.7/bin/armhex -i -memwidth=32 -romwidth=32 CIB_TivaApplication"
    '"C:/ccs6p1p2/ccsv6/tools/compiler/ti-cgt-arm_5.2.7/bin/armhex -i -memwidth=32 -romwidth=32 CIB_TivaApplication"' is not recognized as an internal or external command,
    operable program or batch file.
    gmake[1]: [post-build] Error 1 (ignored)
    ' '

    **** Build Finished ****
  • Remove the double quotes surrounding the command. 

    The below works for me.

  • Removing the quotes worked. It created a *.i0 file that looks like it's the "hex" file.
    Thanks,
    Doug