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 converting out to hex and hex to bin.

Other Parts Discussed in Thread: TMS320F28377D

Hello all!

I write bootloader for tms320f28377d.

I have a programm (writer bin file to flash).

This programm work is fine.

But I have a problem with converting out file to bin.

I use hex2000.exe and FileIOShell.exe

I use bat file to convert :

hex2000.exe -i "flash_programming_cpu01.out" -o "flash_programming_cpu01.hex" -order MS -romwidth 16

FileIOShell.exe -i flash_programming_cpu01.hex -o flash_programming_cpu01.bin

When I compare direct flash(load using CCS6) and bin file I find different:

Where is my mistake?

Please help me!!!

  • Dmitri,

    I am not sure of the answer to your question, but I have some ideas for you to consider and look into.

    Is the 1st symbol stored in Ramfuncs a 16-bit or 32-bit symbol?  I am wondering if the code-gen tools are doing a 32-bit even alignment on a 16-bit storage and filling the whole with 0xFFFF.  Try changing the order of the entries into Ramfuncs and observe the results.  This should help give a better understanding of what is happening, then we can figure out a solution.

    Jeff

  • How to change order?
    I define rum_func in programm and cmd file.
    I use func to copy from flash to SRAM : memcpy(&RamfuncsRunStart, &RamfuncsLoadStart, (size_t)&RamfuncsLoadSize);
  • Do you store any functions in the "ramfuncs" section, such as below ?  If so, change the order.  

    // Functions that will be run from RAM need to be assigned to
    // a different section.  This section will then be mapped using
    // the linker cmd file.
    #pragma CODE_SECTION(epwm1_timer_isr, "ramfuncs");
    #pragma CODE_SECTION(epwm2_timer_isr, "ramfuncs");
    By default the flash initialization code is loaded into "ramfuncs" in the SysCtrl.c file.  
    // Functions that will be run from RAM need to be assigned to
    // a different section.  This section will then be mapped to a load and
    // run address using the linker cmd file.
    //
    //  *IMPORTANT*
    //  IF RUNNING FROM FLASH, PLEASE COPY OVER THE SECTION "ramfuncs"  FROM FLASH
    //  TO RAM PRIOR TO CALLING InitSysCtrl(). THIS PREVENTS THE MCU FROM THROWING 
    //  AN EXCEPTION WHEN A CALL TO DELAY_US() IS MADE. 
    //
    #pragma CODE_SECTION(InitFlash, "ramfuncs");
    If you are not adding anything to "ramfuncs", go ahead and add a function to this section.  The goal is to better understand what is happening with the issue you are seeing by changing what is loaded into the ramfuncs section.
  • Yes,I define rumfunc before func using directive Pragma CODE_SECTION
    If I load using ccs6 utilit the work is fine.
    My mind is: aligned as 32 bit.
    An Bat converting utilite (see higer) do wrong file.
    If I define const as example(added 16 bit to text )
    .text
    .word 1108;

    The work is fine!!!!
    And align is good.
  • Dmitri,

    What we are observing is the linker putting _RamfuncsLoadStart at an even word boundary (0x080E8A) and the hex2000 utility not aligning this section.

    I don't have an answer for you other than the work-around of adding a hole as you did with the ".word" directive.

    Please post this question on the compiler forum:    

    The codegen tool experts will be able to help you.

    Jeff