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.

problem with BIN file??

Other Parts Discussed in Thread: TMS320C6746

Hi all,

i am using CCSv5 studio and target is TMS320C6746, led toggle application build and out file is generated by using build properties -> steps -> postoperation, binary file is generated.

when i going to use generated binary file its not working, some of the parts are missing in binary file, how to validate generated binary file.

  • Please copy-n-paste, from the Console view, the exact command that invokes the hex utility hex6x to create the BIN file.

    Thanks and regards,

    -George


  • **** Build of configuration Debug for project SS4_TC_Main ****

    C:\ti\ccsv5\utils\bin\gmake -k all
    'Building file: ../Boot_6746_A.asm'
    'Invoking: C6000 Compiler'
    "C:/ti/ccsv5/tools/compiler/c6000_7.3.4/bin/cl6x" -mv6740 -g --define=c6746 --include_path="C:/ti/ccsv5/tools/compiler/c6000_7.3.4/include" --include_path="E:/SS4_MLBv01_06_TestCode_FullVersion/Common" --include_path="E:/SS4_MLBv01_06_TestCode_FullVersion/Common_Include" --display_error_number --diag_warning=225 --abi=coffabi --preproc_with_compile --preproc_dependency="Boot_6746_A.pp"  "../Boot_6746_A.asm"
    "../Boot_6746_A.asm", WARNING! at line 50: [W9999] Placing data in a code
                                                       section (.nor_config_word)
                                                       is discouraged. The data may
                                                       be interpreted as code. This
                                                       section will not be
                                                       compressed.
                nop        5

    No Assembly Errors, 1 Assembly Warning
    'Finished building: ../Boot_6746_A.asm'
    ' '
    'Building file: ../Boot_6746_C.c'
    'Invoking: C6000 Compiler'
    "C:/ti/ccsv5/tools/compiler/c6000_7.3.4/bin/cl6x" -mv6740 -g --define=c6746 --include_path="C:/ti/ccsv5/tools/compiler/c6000_7.3.4/include" --include_path="E:/SS4_MLBv01_06_TestCode_FullVersion/Common" --include_path="E:/SS4_MLBv01_06_TestCode_FullVersion/Common_Include" --display_error_number --diag_warning=225 --abi=coffabi --preproc_with_compile --preproc_dependency="Boot_6746_C.pp"  "../Boot_6746_C.c"
    "../Boot_6746_C.c", line 59: warning #179-D: variable "DDRDataAddr" was declared but never referenced
    "../Boot_6746_C.c", line 60: warning #179-D: variable "DDRCodeAddr" was declared but never referenced
    'Finished building: ../Boot_6746_C.c'
    ' '
    'Building file: ../Boot_6746_Init.c'
    'Invoking: C6000 Compiler'
    "C:/ti/ccsv5/tools/compiler/c6000_7.3.4/bin/cl6x" -mv6740 -g --define=c6746 --include_path="C:/ti/ccsv5/tools/compiler/c6000_7.3.4/include" --include_path="E:/SS4_MLBv01_06_TestCode_FullVersion/Common" --include_path="E:/SS4_MLBv01_06_TestCode_FullVersion/Common_Include" --display_error_number --diag_warning=225 --abi=coffabi --preproc_with_compile --preproc_dependency="Boot_6746_Init.pp"  "../Boot_6746_Init.c"
    'Finished building: ../Boot_6746_Init.c'
    ' '
    'Building file: ../Test_c.c'
    'Invoking: C6000 Compiler'
    "C:/ti/ccsv5/tools/compiler/c6000_7.3.4/bin/cl6x" -mv6740 -g --define=c6746 --include_path="C:/ti/ccsv5/tools/compiler/c6000_7.3.4/include" --include_path="E:/SS4_MLBv01_06_TestCode_FullVersion/Common" --include_path="E:/SS4_MLBv01_06_TestCode_FullVersion/Common_Include" --display_error_number --diag_warning=225 --abi=coffabi --preproc_with_compile --preproc_dependency="Test_c.pp"  "../Test_c.c"
    "../Test_c.c", line 73: warning #179-D: variable "ChipErrRetVal" was declared but never referenced
    "../Test_c.c", line 907: warning #552-D: variable "Adc_Buffer" was set but never used
    "../Test_c.c", line 968: warning #552-D: variable "Adc_Buffer" was set but never used
    'Finished building: ../Test_c.c'
    ' '
    'Building file: ../Timer.c'
    'Invoking: C6000 Compiler'
    "C:/ti/ccsv5/tools/compiler/c6000_7.3.4/bin/cl6x" -mv6740 -g --define=c6746 --include_path="C:/ti/ccsv5/tools/compiler/c6000_7.3.4/include" --include_path="E:/SS4_MLBv01_06_TestCode_FullVersion/Common" --include_path="E:/SS4_MLBv01_06_TestCode_FullVersion/Common_Include" --display_error_number --diag_warning=225 --abi=coffabi --preproc_with_compile --preproc_dependency="Timer.pp"  "../Timer.c"
    'Finished building: ../Timer.c'
    ' '
    'Building file: ../init.c'
    'Invoking: C6000 Compiler'
    "C:/ti/ccsv5/tools/compiler/c6000_7.3.4/bin/cl6x" -mv6740 -g --define=c6746 --include_path="C:/ti/ccsv5/tools/compiler/c6000_7.3.4/include" --include_path="E:/SS4_MLBv01_06_TestCode_FullVersion/Common" --include_path="E:/SS4_MLBv01_06_TestCode_FullVersion/Common_Include" --display_error_number --diag_warning=225 --abi=coffabi --preproc_with_compile --preproc_dependency="init.pp"  "../init.c"
    "../init.c", line 504: warning #225-D: function declared implicitly
    "../init.c", line 502: warning #552-D: variable "TempRegRead" was set but never used
    'Finished building: ../init.c'
    ' '
    'Building file: ../intvecs.asm'
    'Invoking: C6000 Compiler'
    "C:/ti/ccsv5/tools/compiler/c6000_7.3.4/bin/cl6x" -mv6740 -g --define=c6746 --include_path="C:/ti/ccsv5/tools/compiler/c6000_7.3.4/include" --include_path="E:/SS4_MLBv01_06_TestCode_FullVersion/Common" --include_path="E:/SS4_MLBv01_06_TestCode_FullVersion/Common_Include" --display_error_number --diag_warning=225 --abi=coffabi --preproc_with_compile --preproc_dependency="intvecs.pp"  "../intvecs.asm"
    'Finished building: ../intvecs.asm'
    ' '
    'Building file: ../main.c'
    'Invoking: C6000 Compiler'
    "C:/ti/ccsv5/tools/compiler/c6000_7.3.4/bin/cl6x" -mv6740 -g --define=c6746 --include_path="C:/ti/ccsv5/tools/compiler/c6000_7.3.4/include" --include_path="E:/SS4_MLBv01_06_TestCode_FullVersion/Common" --include_path="E:/SS4_MLBv01_06_TestCode_FullVersion/Common_Include" --display_error_number --diag_warning=225 --abi=coffabi --preproc_with_compile --preproc_dependency="main.pp"  "../main.c"
    "../main.c", line 92: warning #179-D: variable "temploop" was declared but never referenced
    'Finished building: ../main.c'
    ' '
    'Building file: E:/SS4_MLBv01_06_TestCode_FullVersion/Common/DSP674x_Gpio.c'
    'Invoking: C6000 Compiler'
    "C:/ti/ccsv5/tools/compiler/c6000_7.3.4/bin/cl6x" -mv6740 -g --define=c6746 --include_path="C:/ti/ccsv5/tools/compiler/c6000_7.3.4/include" --include_path="E:/SS4_MLBv01_06_TestCode_FullVersion/Common" --include_path="E:/SS4_MLBv01_06_TestCode_FullVersion/Common_Include" --display_error_number --diag_warning=225 --abi=coffabi --preproc_with_compile --preproc_dependency="Common/DSP674x_Gpio.pp" --obj_directory="Common"  "E:/SS4_MLBv01_06_TestCode_FullVersion/Common/DSP674x_Gpio.c"
    'Finished building: E:/SS4_MLBv01_06_TestCode_FullVersion/Common/DSP674x_Gpio.c'
    ' '
    'Building file: E:/SS4_MLBv01_06_TestCode_FullVersion/Common/DSP674x_McBSP.c'
    'Invoking: C6000 Compiler'
    "C:/ti/ccsv5/tools/compiler/c6000_7.3.4/bin/cl6x" -mv6740 -g --define=c6746 --include_path="C:/ti/ccsv5/tools/compiler/c6000_7.3.4/include" --include_path="E:/SS4_MLBv01_06_TestCode_FullVersion/Common" --include_path="E:/SS4_MLBv01_06_TestCode_FullVersion/Common_Include" --display_error_number --diag_warning=225 --abi=coffabi --preproc_with_compile --preproc_dependency="Common/DSP674x_McBSP.pp" --obj_directory="Common"  "E:/SS4_MLBv01_06_TestCode_FullVersion/Common/DSP674x_McBSP.c"
    "E:/SS4_MLBv01_06_TestCode_FullVersion/Common/DSP674x_McBSP.c", line 403: warning #552-D: variable "McBSPData" was set but never used
    "E:/SS4_MLBv01_06_TestCode_FullVersion/Common/DSP674x_McBSP.c", line 440: warning #552-D: variable "McBSPData" was set but never used
    'Finished building: E:/SS4_MLBv01_06_TestCode_FullVersion/Common/DSP674x_McBSP.c'
    ' '
    'Building file: E:/SS4_MLBv01_06_TestCode_FullVersion/Common/DSP674x_SystCtrl.c'
    'Invoking: C6000 Compiler'
    "C:/ti/ccsv5/tools/compiler/c6000_7.3.4/bin/cl6x" -mv6740 -g --define=c6746 --include_path="C:/ti/ccsv5/tools/compiler/c6000_7.3.4/include" --include_path="E:/SS4_MLBv01_06_TestCode_FullVersion/Common" --include_path="E:/SS4_MLBv01_06_TestCode_FullVersion/Common_Include" --display_error_number --diag_warning=225 --abi=coffabi --preproc_with_compile --preproc_dependency="Common/DSP674x_SystCtrl.pp" --obj_directory="Common"  "E:/SS4_MLBv01_06_TestCode_FullVersion/Common/DSP674x_SystCtrl.c"
    'Finished building: E:/SS4_MLBv01_06_TestCode_FullVersion/Common/DSP674x_SystCtrl.c'
    ' '
    'Building file: E:/SS4_MLBv01_06_TestCode_FullVersion/Common/Flash.c'
    'Invoking: C6000 Compiler'
    "C:/ti/ccsv5/tools/compiler/c6000_7.3.4/bin/cl6x" -mv6740 -g --define=c6746 --include_path="C:/ti/ccsv5/tools/compiler/c6000_7.3.4/include" --include_path="E:/SS4_MLBv01_06_TestCode_FullVersion/Common" --include_path="E:/SS4_MLBv01_06_TestCode_FullVersion/Common_Include" --display_error_number --diag_warning=225 --abi=coffabi --preproc_with_compile --preproc_dependency="Common/Flash.pp" --obj_directory="Common"  "E:/SS4_MLBv01_06_TestCode_FullVersion/Common/Flash.c"
    'Finished building: E:/SS4_MLBv01_06_TestCode_FullVersion/Common/Flash.c'
    ' '
    'Building file: E:/SS4_MLBv01_06_TestCode_FullVersion/Common/ModbusCRC.c'
    'Invoking: C6000 Compiler'
    "C:/ti/ccsv5/tools/compiler/c6000_7.3.4/bin/cl6x" -mv6740 -g --define=c6746 --include_path="C:/ti/ccsv5/tools/compiler/c6000_7.3.4/include" --include_path="E:/SS4_MLBv01_06_TestCode_FullVersion/Common" --include_path="E:/SS4_MLBv01_06_TestCode_FullVersion/Common_Include" --display_error_number --diag_warning=225 --abi=coffabi --preproc_with_compile --preproc_dependency="Common/ModbusCRC.pp" --obj_directory="Common"  "E:/SS4_MLBv01_06_TestCode_FullVersion/Common/ModbusCRC.c"
    At end of source: warning #97-D: a translation unit must contain at least one declaration
    'Finished building: E:/SS4_MLBv01_06_TestCode_FullVersion/Common/ModbusCRC.c'
    ' '
    'Building target: ../../Out/ss4_main_1.out'
    'Invoking: C6000 Linker'
    "C:/ti/ccsv5/tools/compiler/c6000_7.3.4/bin/cl6x" -mv6740 -g --define=c6746 --display_error_number --diag_warning=225 --abi=coffabi -z -m"SS4_TC_Main.map" --stack_size=0x800 --heap_size=0x800 --warn_sections --display_error_number -i"C:/ti/ccsv5/tools/compiler/c6000_7.3.4/lib" -i"C:/ti/ccsv5/tools/compiler/c6000_7.3.4/include" --reread_libs --entry_point=_flash_prog --rom_model -o "../../Out/ss4_main_1.out"  "./Common/ModbusCRC.obj" "./Common/Flash.obj" "./Common/DSP674x_SystCtrl.obj" "./Common/DSP674x_McBSP.obj" "./Common/DSP674x_Gpio.obj" "./main.obj" "./intvecs.obj" "./init.obj" "./Timer.obj" "./Test_c.obj" "./Boot_6746_Init.obj" "./Boot_6746_C.obj" "./Boot_6746_A.obj" -l"libc.a" "../linker_dsp.cmd"
    <Linking>
    "../linker_dsp.cmd", line 22: warning #10068-D: no matching section
    warning #10063-D: entry-point symbol other than "_c_int00" specified:
       "_flash_prog"
    'Finished building target: ../../Out/ss4_main_1.out'
    ' '
    C:/ti/ccsv5/utils/bin/gmake --no-print-directory post-build
    'Create flash image: TI-TXT'
    C:/ti/ccsv5/tools/compiler/c6000_7.3.4/bin/hex6x.exe -b ../../Out/ss4_main_1.out -o ../../Out/ss4_main_1.bin
    Translating to Binary format...
       "../../Out/ss4_main_1.out"   ==> .nor_config_word
       "../../Out/ss4_main_1.out"   ==> $fill000
       "../../Out/ss4_main_1.out"   ==> Boot_code
       "../../Out/ss4_main_1.out"   ==> $fill001
       "../../Out/ss4_main_1.out"   ==> .text
       "../../Out/ss4_main_1.out"   ==> .const
       "../../Out/ss4_main_1.out"   ==> .cinit
       "../../Out/ss4_main_1.out"   ==> .vecs
       "../../Out/ss4_main_1.out"   ==> .switch
    ' '

    **** Build Finished ****

  • MSR said:
    when i going to use generated binary file its not working, some of the parts are missing in binary file

    What parts are missing?  How do you know they are missing?

    Thanks and regards,

    -George

  • Hi George,

    can you conform me hex utility command in the previous post is it correct or not.

    here am attaching two file taken from flash. one is through secondary boot loader writing all sections into flash through jtag and another bin file writing through application into flash. we capture those file and attaching here please check 7824.appflash.dat4213.flashFU.dat

  • Hi,

    Also to me sometimes the "-b" option of hex6x doesn't correctly generate hole filling between const sections.

    To work around I use gnu objcopy.exe from MinGW (objcopy -I elf32-little -O binary my_elf.out my_bin.bin).

    Comparing the output of hex6x withthe objcopy one, in my case I see the difference correspond to an 4 bytes hole beetwen two sections. The hex6x one miss the hole and don't run, while the objcopy on runs.

  • Using objcopy is a reasonable solution.  Is that a practical solution in this case?

    Thanks and regards,

    -George

  • i trying to use objcopy but it is not generating bin file, some error are listed below, please check it, can you explain usage of objcopy.exe..

    C:/ti/ccsv5/utils/bin/gmake --no-print-directory post-build 'Create flash image: TI-TXT' objcopy.exe -I elf32-little -O binary ../../Out/ss4_main_1.out ../../Out/ss4_main_1.bin process_begin: CreateProcess(NULL, objcopy.exe -I elf32-little -O binary ../../Out/ss4_main_1.out ../../Out/ss4_main_1.bin, ...) failed. make (e=2): The system cannot find the file specified. gmake[1]: [post-build] Error 2 (ignored) ' ' **** Build Finished ****

  • Hi,

    objcopy.exe is not part of the CCS an TI CGT. I take it from the MinGW GNU toolchain (http://www.mingw.org).

    Note that normaly the objcopy (and other minGW bins) will not be directly accesible. You can add the path to MinGW binaries to your path or reference it with full path from your post-build action.

    To be independent on the MinGW installation, I copy the MinGW objcopy.exe into a build_tools directory under my CCS project. I also add a .bat file, postbuild.bat:

    ..\build_tools\objcopy -I elf32-little -O binary %~1.out %~1-.bin

     

    And I use the post-build action "..\postbuild.bat ${ProjName}"

    Note that objcopy is available with other GNU toolchain also, but I prefer the MinGW since it doesn't require additional DLL (like the cywin one)

  • can you please send me the setup...i tried it leads to installing soma things...please send objcopy.exe

  • MSR said:

    can you please send me the setup...i tried it leads to installing soma things...please send objcopy.exe

    You don't need the complete installation. From soruceforge MinGW download page select:

      MinGW->base->binutils->binutils-2.19.1->binutils-2.19.1-mingw32-bin.tar.gz

    Open the archive and extract the objcopy.exe under the directory bin.

    As you'll see I don't use the last version (2.23). I see that the last version is 8Mbytes while the 2.19 is 600K only.

  • i did it but objcopy: doesnot support c6746 device.

  • Alberto,

    this objcopy doesnot support C6746 device, please see below i tried with objectcopy

  • MSR said:

    this objcopy doesnot support C6746 device, please see below i tried with objectcopy

    Sorry, I supose the problem is not the device: I didn't realize you are using coff format. objcopy.exe support only ELF. If you can switch to ELF, otherwise you can use hex6x.exe --image option. It works but,as said in the documentaiton, it produce "a memory image by completely filling all of the mapped ranges specified in the ROMS directive" (so the image is bigger than the "-b" one).

  • if i am creating sections...binary file is no creating as per sections..something is missing...when i am using hex6.hex utility

  • I apologize for failing to notice you are using COFF.  GNU objcopy only works with ELF.

    Another possible solution is to use tiobj2bin from the cg_xml package.  It performs the same task as objcopy.  It can handle TI COFF and ELF object formats.

    Thanks and regards,

    -George

  • George,

    check the log for tiobj2bin utility :

    C:/ti/ccsv5/utils/bin/gmake --no-print-directory post-build
    'Create flash image: TI-TXT'
    "C:/ti/ccsv5/utils/tiobj2bin/tiobj2bin.bat" "../../Out/ss4_main_1.out" "../../Out/ss4_main_1.bin"
    'ofd470' is not recognized as an internal or external command,
    operable program or batch file.
    'mkhex4bin' is not recognized as an internal or external command,
    operable program or batch file.
    'hex470' is not recognized as an internal or external command,
    operable program or batch file.
    ' '

    **** Build Finished ****

  • That's not how you invoke it.  Please edit tiobj2bin.bat and read the comment at the beginning on how to invoke it.

    Thanks and regards,

    -George

  • George,

    this is as per mention in that script but again same log, even if it is don't mention of last two arguments it will take default arguments.

    'Building target: ../../Out/ss4_main_1.out'
    'Invoking: C6000 Linker'
    "C:/ti/ccsv5/tools/compiler/c6000_7.3.4/bin/cl6x" -mv6740 -g --define=c6746 --display_error_number --diag_warning=225 --abi=coffabi -z -m"SS4_TC_Main.map" --stack_size=0x800 --heap_size=0x800 --warn_sections --display_error_number -i"C:/ti/ccsv5/tools/compiler/c6000_7.3.4/lib" -i"C:/ti/ccsv5/tools/compiler/c6000_7.3.4/include" --reread_libs --entry_point=_flash_prog --rom_model -o "../../Out/ss4_main_1.out"  "./Common/ModbusCRC.obj" "./Common/Flash.obj" "./Common/DSP674x_SystCtrl.obj" "./Common/DSP674x_McBSP.obj" "./Common/DSP674x_Gpio.obj" "./main.obj" "./intvecs.obj" "./init.obj" "./Timer.obj" "./Test_c.obj" "./Boot_6746_Init.obj" "./Boot_6746_C.obj" "./Boot_6746_A.obj" -l"libc.a" "../linker_dsp.cmd"
    <Linking>
    "../linker_dsp.cmd", line 22: warning #10068-D: no matching section
    warning #10063-D: entry-point symbol other than "_c_int00" specified:
       "_flash_prog"
    'Finished building target: ../../Out/ss4_main_1.out'
    ' '
    C:/ti/ccsv5/utils/bin/gmake --no-print-directory post-build
    'Create flash image: TI-TXT'
    "C:/ti/ccsv5/utils/tiobj2bin/tiobj2bin.bat" "../../Out/ss4_main_1.out" "../../Out/ss4_main_1.bin" "C:/ti/ccsv5/tools/compiler/c6000_7.3.4/bin/ofd470.exe" "C:/ti/ccsv5/tools/compiler/c6000_7.3.4/bin/hex470.exe" "C:/ti/ccsv5/utils/tiobj2bin/mkhex4bin.exe"
    '"C:/ti/ccsv5/tools/compiler/c6000_7.3.4/bin/ofd470.exe"' 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
    '"C:/ti/ccsv5/tools/compiler/c6000_7.3.4/bin/hex470.exe"' is not recognized as an internal or external command,
    operable program or batch file.
    ' '

    **** Build Finished ****

  • Change ofd470 to ofd6x and hex470 to hex6x.

    Thanks and regards,

    -George

  • Thanks for your information George.

  • George,

    for BIOS project it is creating 3GB bin file...is it right or wrong??..this unable to work with 3GB bin file.

    for Non BIOS project its creating 70KB..it is also working.

  • MSR said:
    for BIOS project it is creating 3GB bin file...is it right or wrong??..this unable to work with 3GB bin file.

    You probably have some large hole in your memory map.  The binary format you are using has no mechanism by which holes can be represented.  Thus holes are filled with 0, without any regard to how big the hole is.  The result can be very large binary files.

    Where to go from here depends on what is causing this hole in your memory map.  I might be able to see it by looking at your linker map file.  Please post it.

    Thanks and regards,

    -George

  • Hi George,

    here i am attaching generated linker file, custmizes linker file and MAP file. please check.8831.linker.rar

  • As I expected, you have a very large hole in your memory map.  In your case, this hole is between the memory ranges IRAM and DDR2_CODE.  

    Does it make sense to split your binary image into two different files?  Is it possible to load and execute that way?  If so, see this thread for how to create those two files.

    Thanks and regards,

    -George

  • George,

    yes there is big hole between IRAM and DDR2_CODE, as you said NOLOAD directive i used but its missing the DDR2_CODE part in Bin file.same with DSECT

  • Well, maybe your execution system cannot support loading multiple binary files.  Can it support loading some other format than these binary files?

    -George

  • Target is TMS320C6746, which format its support, can you please send?

  • That is not enough information.  It depends mostly on the method you use to get the code loaded into the system.  And even if I knew that, it is unlikely I could help you.  My expertise ends with the creation of the binary file.  I am dimly aware that some systems can load multiple binary files, and others cannot.  I do not know the underlying details.

    I suggest you begin a new thread in the C67x forum.

    Thanks and regards,

    -George