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/TMS320F28069: How to program code to flash memory when code is taken byte-by-byte from a hex-file?

Part Number: TMS320F28069

Tool/software: Code Composer Studio

Hi team,

hex files (Intel-Hex or S-Record files) are organized byte-wise whereas RAM and flash on chip have
a 16-bit structure.

This results in following question concerning the transfer to flash, using TI's compiled flash library:

What must I do:

   1. transferring every byte in one 16-bit word, OR

   2. Putting each "pair" of 2 bytes into one word (1st byte ==> highbyte; 2nd byte ==> lowbyte) OR

   3. Putting each "pair" of 2 bytes into one word (1st byte ==> lowbyte; 2nd byte ==> highbyte)

before transferring that word to flash?

Unfortunately, the flashlib example contains just 16-bit data transfers so that nothing
can be inferred about writing code to flash (more comprehensive documentation is urgently recommended!!).

Is there anyone who has experience with this topic???



Thanks & best regards,
Goetz

  • Hi Goetz,

    How are you trying to program the flash? What tool?

    sal
  • ----------------------------- cited: --------------------------------
    Hi Goetz,

    How are you trying to program the flash? What tool?

    sal
    ----------------------------------------------------------------------

    Hi sal,

    ok, I should explain what I'm working on:

    Currently I'm implementing a *** bootloader *** which resides on up to 2 flash sectors of the target
    and shall be able to download an application to remaining free sectors.

    -- Initially, both application and the bootloader will be downloaded by the manufacturer,
    using CCS' ".out" file together with JTAG. --

    -- Later on, the bootloader shall download updates to the application, i.e. overwrite the
    existing application. -- An SD card shall be used as a transfer medium for the new appl. version.

    Since the structure of an .out file as generated by CCS/compiler/linker is unknown, I cannot
    use it to extract an executable image from it which could be downloaded directly.
    So, I intend to generate a hex file (S-Record file), then to convert it to binary data which
    can be directly written to flash.

    *** hex2000.exe *** is used make a hex file from the .out file. After (or better: along with) conversion to binary,
    the hex file shall be downloaded to the target. So,
    (1.) Hex-to-binary conversion as well as
    (2.) downloading, i.e. writing to flash
    !!!! shall be done by my bootloader. !!!!

    **** The actual problem arises from writing the code to flash: ****
    Normally, the controller's memory as well as the hex file are both byte-oriented.
    But in our case (i.e. TMS320F28069) the target's memory *** is word-oriented and -adressable ***.

    The question I sent with my last posting results from this inconsistency:

    For better convenience, I repeat it here:
    -----------------------------------------------------------------
    This results in following question concerning the transfer to flash,
    using TI's compiled flash library:

    What must I do:

    1. transferring each byte in one 16-bit word, OR
    2. Putting each "pair" of 2 bytes into one word (1st byte ==> highbyte; 2nd byte ==> lowbyte) OR
    3. Putting each "pair" of 2 bytes into one word (1st byte ==> lowbyte; 2nd byte ==> highbyte)

    before transferring that word to flash?

    --------------------------------------------------------------------

    Best regards
    Goetz
  • Hi,

    I believe the low byte is sent first and then the upper byte. You can see the SCI flash kernel for this. and the serial flash programmer.

    The address should be correct.

    www.ti.com/.../sprabv4b.pdf

    Hope this helps,
    sal
  • Good morning Sal,

    your reply actually did not meet exactly what I asked (but this was due to my way to express my question),
    ***but anyway it gave me the very right idea*** how to find it out... ;-)))

    Thus, thanks a lot and have a nice day!
    Goetz