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.

CCS/TM4C129ENCPDT: tiobj2bin.bat failed on armofd / armhex when using GNU GCC

Part Number: TM4C129ENCPDT

Tool/software: Code Composer Studio

So at the end of a successful compile and link, I'm getting the tiobj2bin.bat failed on armofd / armhex problem described at this wiki page: processors.wiki.ti.com/.../Tiobj2bin_Failed

As of now, this wiki page describes what tiobj2bin.bat is, what it does, why it does it, and then ends abruptly with "Thus, it is difficult to say how they cannot be found at this point. Likewise, it is hard to say how to fix the problem. Hopefully, the explanation supplied here will be of some use in tracking down the root cause."

Hmmm...

After compiling and linking, the output contains:

"C:/ti/ccsv7/utils/tiobj2bin/tiobj2bin" "SyncTest.out" "SyncTest.bin" "C:/ti/ccsv7/tools/compiler/gcc-arm-none-eabi-4_9-2015q3/bin/armofd" "C:/ti/ccsv7/tools/compiler/gcc-arm-none-eabi-4_9-2015q3/bin/armhex" "C:/ti/ccsv7/utils/tiobj2bin/mkhex4bin"
tiobj2bin.bat failed on C:/ti/ccsv7/tools/compiler/gcc-arm-none-eabi-4_9-2015q3/bin/armofd
Please see processors.wiki.ti.com/.../Tiobj2bin_Failed
tiobj2bin.bat failed on C:/ti/ccsv7/tools/compiler/gcc-arm-none-eabi-4_9-2015q3/bin/armhex
Please see processors.wiki.ti.com/.../Tiobj2bin_Failed
C:/ti/ccsv7/utils/tiobj2bin/mkhex4bin failure occurred. Giving up.
' '
'C:\ti\ccsv7\tools\compiler\gcc-arm-none-eabi-4_9-2015q3\bin\ofd470' is not recognized as an internal or external command,
operable program or batch file.
File does not exist: at XML_TI_OFD.pm line 877.

**** Build Finished ****

After a bit of investigation, I've figured out why this is happening on my particular system:

I'm running CCSv7 version 7.1.0.00016 with several toolchains, including ti-cgt-arm_16.9.3.LTS and gcc-arm-none-eabi-4_9-2015q3.

My project was initially created in some version of CCSv6 and the TI compiler was selected during project creation.

With the original Debug or Release build configuration selected, under project properties -> Build, the third tab over is called Steps. There is a post-build step configured there:

"${CCE_INSTALL_ROOT}/utils/tiobj2bin/tiobj2bin" "${BuildArtifactFileName}" "${BuildArtifactFileBaseName}.bin" "${CG_TOOL_ROOT}/bin/armofd" "${CG_TOOL_ROOT}/bin/armhex" "${CCE_INSTALL_ROOT}/utils/tiobj2bin/mkhex4bin"

I presume this post-build step was created when the project was created.

Subsequently (I don't remember if before or after upgrading to CCSv7) I followed the directions at the following wiki page to add compilation via GCC to the project: processors.wiki.ti.com/.../Using_GCC_with_Tiva_in_CCSv6

The process of adding GCC creates a new build configuration, so if you start with Debug, it creates Debug__GNU and doesn't affect Debug.

The post-build step mentioned above remains configured in Debug__GNU.

When compiling with TI (Debug or Release), everything is fine.

When compiling with GCC (Debug__GNU), everything is still fine, but tiobj2bin fails. Why? Because, it turns out, the post build step shown above is using the path variable CG_TOOL_ROOT (defined under project properties -> Linked Resources). Evidently the value of this variable changes depending on which build configuration (and thus which compiler) is selected. When GCC is selected, the variable is expanded such that it ends up trying to call armofd and armhex under GCC's bin directory (C:/ti/ccsv7/tools/compiler/gcc-arm-none-eabi-4_9-2015q3/bin/) and there are no such programs there. (There ARE such programs under the TI compiler's bin directory. But not under GCC's bin directory.)

Now this begs the question, what incantation is needed to convert the .out to .bin under GNU?

  • Your interpretation of the issue is correct. The post-build step is copied over from the original Debug configuration to the Debug__GNU configuration, however the CG_TOOL_ROOT macro now points to the GCC compiler directory which does not contains the armofd and armhex executables.

    There are a couple of ways to resolve this and convert the .out to .bin with GNU:

    1) Edit the post-build step - change the CG_TOOL_ROOT macro to a hard-coded path to the TI compiler's bin directory so it can still use tiobj2bin for the conversion, or

    2) Delete the post-build step, and instead use the GNU tool's objcopy utility to convert the .out to binary. You can do this via the GUI by going into Project Properties->Build->GNU Objcopy Utility. Enable the utility and then set the option to convert to binary.

  • Thank you for your detailed reply. That is very good news. It's nicely integrated into the GUI rather than requiring a manually-configured post-build step.

    Since the diagnostic message from tiobj2bin.bat points the user to the TI Wiki page I mentioned above, could that page be updated with this information as well? I assume only TI employees can update the wiki. That's this page: processors.wiki.ti.com/.../Tiobj2bin_Failed
  • Thank you for your feedback. That wiki page has been updated with the above information.
  • Thank you so much. The explanation on the wiki is very clear and will certainly help others who encounter this diagnostic.