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.

Compiler: Inner working of Flash burn Utility(ies)

Tool/software: TI C/C++ Compiler

Hi,

This question is linked to my previous thread. I am unable to find the proper solution for programming ROM off-board and then assembling it into Board i.e. the given thread link. I am here to dig out how exactly flash utilities read .hex file? Do they consider address information embedded in .hex files (Example: www.elproducts.com/understanding-hex-files.html ) and places the information at respective address in ROM? I mean the inner working of flash burn Software?

2- How can i remap the address of various sections in .hex file to solve the problem burning ROM off-board as mentioned in above e2e-thread link.

Regards,

kowalski

  • What output format do you need from hex6x?

    Thanks and regards,

    -George

  • Ascii hex or Intel Hex
  • You need to use a hex utility command file.  And this command file needs to contain a SECTIONS directive that uses the paddr feature to set the address of each section in the output.  I'll illustrate with a very simple example.

    Here is an assembly file ...

            ; file.asm
    
            .data
    
            ; This directive prevents the linker from removing the section
            ; Normally, this is used only for interrupt vector tables
            .retain
    
            .word   0x11111111
            .word   0x22222222
            .word   0x33333333
            .word   0x44444444

    And here is a linker command file ...

    /* link.cmd */
    
    MEMORY
    {
        INTERNAL : o = 0x10000000, l = 0x10000000
        EXTERNAL : o = 0x90000000, l = 0x10000000
    }
    
    SECTIONS
    {
        .data : run = INTERNAL, load = EXTERNAL
    }

    Here is a command to create an executable named file.out from those inputs.

    C:\work\dir>cl6x  file.asm -z -o file.out -m file.map link.cmd
    <Linking>
    warning: no suitable entry-point found; setting to 0

    Here is a way to convert that to ASCII-Hex, using the addresses in the executable.

    C:\work\dir>hex6x -a file.out --romwidth=32
    Translating to ASCII-Hex format...
       "file.out" .data ==> .data

    A hex file is yet another text file.  You can view it with your favorite text editor.  The file created in this case is named file.a0.  Here are the key lines from that file ...

    $A90000000,
    11 11 11 11 22 22 22 22 33 33 33 33 44 44 44 44

    Line 1 shows the address.  Line 2 is the raw data.  

    You can control the address in the hex utility output by using a hex utility command file with contents like this one ...

    /* roms.cmd */
    
    SECTIONS
    {
       .data : paddr = 0x2000
    }

    That paddr = 0x2000 says the .data output section has address 0x2000 in the hex output.  The address from the executable file is not used.

    So, create the hex file with that command file ...

    C:\work\dir>hex6x -a file.out --romwidth=32 roms.cmd
    Translating to ASCII-Hex format...
       "file.out" .data ==> .data

    Now, here are the same lines from the hex utility output ...

    $A2000,
    11 11 11 11 22 22 22 22 33 33 33 33 44 44 44 44

    Notice how the address changed.  You need to do something similar.

    Please read more about it in the section titled Controlling the ROM Device Address in the C6000 assembly language tools manual.

    Thanks and regards,

    -George

  • Wow. I mean this is great. Let me give it a try... will get back to you soon.
  • First of all, sorry for my late reply... i was testing your soultion. Thanks George, it totally worked for me.