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.

MSPM0L1304: How to generate binary (intel format .Hex and binary .bin file)

Genius 3186 points
Part Number: MSPM0L1304
Other Parts Discussed in Thread: UNIFLASH, MSPM0L1306

Hi 

May I have questoion about MSPM0L project on CCS.

My customer trying generate .hex and .bin file for mass production.

but generated file may be wrong,(As this topic)

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1303468/mspm0l1304-after-uniflash-writing-the-swd-port-does-not-work

Is there any guide for generate .hex/.bin file?
we need to set another option? not only "specify output" and output format

Thanks,

GR

  • Hi GR,

    Could you help to clarify below information

    generated file may be wrong

    Does that mean the TI-TXT format image is no problem and hex or bin image file that generate with the same project are not work?

  • Hi Gary,

    Thanks for your supporting.

    Does that mean the TI-TXT format image is no problem and hex or bin image file that generate with the same project are not work?

    Yes,

    TI-TXT (.txt) and .out file works nomally. (If write MSPM0L1306 by uniflash, it works)

    But .bin and .hex file that generated conpleatly same project was not works.

    Best regards,

    GR

  • Ok, could you share me the project? And show me how to monitor it running well not?

  • Hi Gary,

    Thanks for your supporting.

    I will send CCS project, .out/.txt/.bin/.hex file, note of issues in private chat.

    Best regards,

    GR

  • I have put this thread to CCS support team, due to it is the issue to generate the Intel hex format file is not correct. The project as attached. When you generate the hex file by CCS, it is 0 at reset handler interrupt table that is not correct.But when you generate the TI-TXT format there is no issue.

     8611.[CCS project]20231207_i2c_controller_rw_multibyte_fifo_poll_LP_MSPM0L1306_nortos_ticlang.zip

  • The CCS project does not work for me.  So I'm not sure of the entire solution.  But I can see one mistake to correct.  To create the Intel hex file you expect, you have to add the option --romwidth=32.  Make that change in the first screen shot shown in the first post.

    Thanks and regards,

    -George

  • Hi George,

    Thanks for your comments.

    make the change below

    The data will be correct. But the data mode is wrong. As below, the correct data at 0x0 address should be 0x20000800, but it is 0x800002

    Do you know how to make the change?

  • Please show the first few lines of the Intel hex file.  What does it show is at address 0?  Please copy and paste the text, and do not use a screen shot.

    Thanks and regards,

    -George

  • Hi George,

    Thanks for your information.

    I tested --romwidth32 option, however generated hex file was incorrect.

    (I tested M0 SDK gpio_toggle_output example)

    first load was sucess, but after try to load, It was not solved the issue.

    This is generated intel .hex file with --romwidth=32 option.

    gpio_toggle_output_LP_MSPM0L1306_nortos_ticlang.zip

    Best regards,

    GR

  • The hex file as attached

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/908/20231207_5F00_i2c_5F00_controller_5F00_rw_5F00_multibyte_5F00_fifo_5F00_poll_5F00_LP_5F00_MSPM0L1306_5F00_nortos_5F00_ticlang.hex

    The correct TI-TXT file as attached

    @0000
    00 08 00 20 15 05 00 00 9F 02 00 00 9F 02 00 00 
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00 00 00 00 00 00 00 00 00 00 00 00 9F 02 00 00 
    00 00 00 00 00 00 00 00 9F 02 00 00 9F 02 00 00 
    9F 02 00 00 9F 02 00 00 9F 02 00 00 00 00 00 00 
    9F 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00 00 00 00 9F 02 00 00 00 00 00 00 00 00 00 00 
    00 00 00 00 9F 02 00 00 00 00 00 00 9F 02 00 00 
    9F 02 00 00 00 00 00 00 9F 02 00 00 00 00 00 00 
    9F 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    9F 02 00 00 9F 02 00 00 00 00 00 00 00 00 00 00 
    00 00 00 00 00 00 00 00 00 00 00 00 9F 02 00 00 
    82 B0 4A 4E 7D 20 C0 00 01 90 00 F0 06 FA 4C 4F 
    04 E0 00 68 78 71 01 98 00 F0 12 FA 03 22 45 48 
    43 49 00 F0 19 F9 30 46 24 38 01 68 89 06 05 D4 
    01 68 89 06 02 D4 01 68 89 06 F4 D5 35 46 2C 3D 
    29 68 38 4A 11 40 29 60 34 46 28 3C 21 68 36 4A 
    11 40 39 4A 11 43 21 60 01 68 49 06 05 D5 01 68 
    49 06 02 D5 01 68 49 06 F6 D4 01 68 89 06 05 D4 
    01 68 89 06 02 D4 01 68 89 06 F6 D5 01 98 00 F0 
    DF F9 28 68 27 49 08 40 01 21 01 43 29 60 20 68 
    25 49 08 40 29 49 08 43 20 60 30 68 00 07 05 D1 
    30 68 00 07 02 D1 30 68 00 07 F6 D0 30 46 20 38 
    01 68 39 70 31 68 09 07 05 D1 31 68 09 07 02 D1 
    31 68 09 07 F6 D0 01 68 79 70 31 68 09 07 05 D1 
    31 68 09 07 02 D1 31 68 09 07 F6 D0 01 68 B9 70 
    31 68 09 07 05 D1 31 68 09 07 02 D1 31 68 09 07 
    F6 D0 01 68 F9 70 31 68 09 07 05 D1 31 68 09 07 
    02 D1 31 68 09 07 F6 D0 01 68 39 71 31 68 09 07 
    00 D0 7E E7 31 68 09 07 00 D0 7A E7 31 68 09 07 
    F4 D0 76 E7 00 F8 FF FF F8 FF 00 F0 3C 32 0F 40 
    06 00 00 20 00 20 0F 40 07 00 03 00 07 00 06 00 
    00 00 00 20 00 2A 49 D0 84 46 8B 07 1C D1 83 07 
    22 D1 10 2A 08 D3 70 B4 10 3A 78 C9 78 C0 10 3A 
    FB D2 70 BC 10 32 38 D0 04 2A 2C D3 08 2A 05 D3 
    0C 2A 01 D3 08 C9 08 C0 08 C9 08 C0 08 C9 08 C0 
    92 07 2A D0 92 0F 22 E0 0B 78 03 70 49 1C 40 1C 
    52 1E 22 D0 8B 07 F7 D1 C3 07 14 D1 83 07 D8 D0 
    12 1F 12 D3 08 C9 03 80 1B 0C 43 80 00 1D 12 1F 
    F8 D2 0A E0 08 C9 03 70 1B 0A 43 70 1B 0A 83 70 
    1B 0A C3 70 00 1D 12 1F F4 D2 12 1D 05 D0 0B 78 
    03 70 49 1C 40 1C 52 1E F9 D1 60 46 70 47 FE E7 
    F0 B5 44 1C 00 78 00 23 08 2B 30 D0 25 78 C6 07 
    0F D1 66 78 2D 01 37 09 7F 19 0F 25 35 40 ED 1C 
    12 2D 0B D1 02 25 66 57 F5 B2 00 2E 08 D4 E6 1C 
    0C E0 64 1C 4E 1C 0D 70 31 46 15 E0 A6 1C 06 E0 
    26 1D E4 78 7F 22 15 40 E2 01 55 19 12 35 09 4A 
    97 42 0E D0 FC 43 00 2D 05 D0 0A 5D 4F 1C 0A 70 
    6D 1E 39 46 F7 E7 34 46 40 08 5B 1C CC E7 20 46 
    C7 E7 F0 BD FF 0F 00 00 F0 B5 81 B0 00 2A 22 D0 
    91 23 5B 01 C3 18 0F 20 04 02 90 1E 00 90 56 1E 
    00 20 DF 69 27 42 1B D0 0F 5C 1F 60 86 42 10 D0 
    DF 69 27 42 11 D0 0F 18 7D 78 1D 60 00 9D 85 42 
    07 D0 DD 69 25 42 0A D0 BD 78 1D 60 C0 1C 82 42 
    E7 D1 10 46 04 E0 00 20 02 E0 40 1C 00 E0 80 1C 
    80 B2 01 B0 F0 BD 00 00 10 B5 11 49 11 48 00 F0 
    6D F8 11 48 02 46 28 3A 13 68 01 21 0C 02 A3 43 
    13 60 02 46 14 3A 00 23 13 60 02 1F 1F 23 13 60 
    02 69 07 23 9A 43 02 61 02 69 1B 02 9A 43 02 61 
    02 68 04 23 13 43 03 60 02 68 0A 43 02 60 10 BD 
    20 05 00 00 00 20 0F 40 28 32 0F 40 70 B5 0A 48 
    0A 4C 84 42 0C D0 0A 4D 0A 4E B5 42 08 D0 2A 68 
    69 68 50 1C 12 78 92 00 A2 58 90 47 08 35 F4 E7 
    00 BF 00 BF 70 BD C0 46 34 05 00 00 28 05 00 00 
    44 05 00 00 54 05 00 00 80 B5 06 48 06 49 41 60 
    06 4A 51 60 06 49 01 60 11 60 10 20 00 F0 70 F8 
    80 BD C0 46 00 08 0A 40 03 00 00 B1 00 28 0F 40 
    01 00 00 26 08 48 80 F3 08 88 00 BF 00 BF 00 F0 
    6B F8 00 28 01 D0 FF F7 C1 FF 00 20 FF F7 38 FE 
    01 20 00 F0 63 F8 C0 46 00 08 00 20 70 B5 01 22 
    12 03 83 18 0C 78 5D 68 0C 26 B5 43 34 40 2C 19 
    5C 60 49 78 83 58 07 24 A3 43 21 40 59 18 81 50 
    70 BD 00 00 06 48 41 1C 06 4A 51 60 10 60 50 68 
    01 21 49 06 08 43 50 60 10 68 08 43 10 60 70 47 
    83 00 04 00 48 80 42 40 04 48 00 21 01 60 04 48 
    01 68 03 22 91 43 01 60 70 47 C0 46 08 03 0B 40 
    00 01 0B 40 03 22 80 58 00 28 05 D0 40 1E 4A 1C 
    00 23 0B 70 11 46 F7 E7 70 47 80 B5 FF F7 94 FF 
    FF F7 D0 FF FF F7 E0 FF FF F7 46 FF 80 BD 80 B5 
    0B 46 03 21 42 58 C1 1D 18 46 00 F0 07 F8 80 BD 
    80 1E 00 1F 00 BF FC D2 70 47 00 00 80 B5 FF F7 
    79 FE 80 BD 8E E7 70 47 01 20 70 47 00 BF FE E7 
    08 00 00 00 00 00 00 00 A1 02 00 00 EF 04 00 00 
    C5 04 00 00 02 00 00 00 06 00 00 00 00 07 D0 00 
    80 FF F0 00 34 05 00 00 00 00 00 20 3C 05 00 00 
    06 00 00 20 00 00 00 00 
    q
    

  • The TI-TXT format file and the Intel format file have opposite endianness.  I do not know which endianness is correct, or why.

    Earlier in this thread, Gary Gao attached a CCS project.  I was unable to build it.  I did get to see the build log from that project.  The command used to create the binary file is ...

    "C:/ti/ti_cgt_tiarmclang_3.2.0.LTS/bin/tiarmhex.exe" --diag_wrap=off --binary -o "20231207_i2c_controller_rw_multibyte_fifo_poll_LP_MSPM0L1306_nortos_ticlang.bin"  "20231207_i2c_controller_rw_multibyte_fifo_poll_LP_MSPM0L1306_nortos_ticlang.out" 

    Do not use tiarmhex to create a binary file.  Instead, use tiarmobjcopy.  Here is a sample command ...

    tiarmobjcopy -O binary name_of_project.out name_of_project.bin

    Thanks and regards,

    -George

  • I have notice this should be a endianness issue. But when I try to make some endianness configurations below

    It will show the error 

    any comments?

  • Don't use the load image options.  They are not related to this problem.

    In the first post it says ...

    My customer trying generate .hex and .bin file for mass production.

    I've shown how to generate a binary file, an Intel hex file with one endianness, and a TI-TXT hex file of opposite endianness.  With regard this requirement, what is missing?

    Thanks and regards,

    -George

  • Hi George,

    Sorry I am missing there. Could you help to clarify where to put what commands in the CCS? It is better to show a picture for that,thanks.

  • Hi George, Gary,

    Thanks for your supporting.

    Do not use tiarmhex to create a binary file.  Instead, use tiarmobjcopy.  Here is a sample command ...

    By George's advice, I tried to  Arm Objcopy Utility. (ARM hex utility is using tiarmhex.exe)

    Result, the generated intel hex file was correct (I could write using Uniflash and It worked as expected.)

    I understand our issue was the probrem on hex generate tool.

    Thank you very much!

    Best regards,

    GR

  • Hi GR,

    So are you do that using the command window like this?(copy the .out file first into the C:\ti\ccs1250\ccs\tools\compiler\ti-cgt-armllvm_3.2.0.LTS\bin)

  • Hi Gary,

    So are you do that using the command window like this?(copy the .out file first into the C:\ti\ccs1250\ccs\tools\compiler\ti-cgt-armllvm_3.2.0.LTS\bin)

    No,

    I use "arm object Utility" instead of Arm Hex Utility.

    because arm hex utility is using tiarmhex, and arm objcopy utility using tiarmobjcopy.

    Best regards,

    GR

  • Hi GR,

    ok, what's the command and where you put it? Could you give a picture? Thanks

  • Hi Gary,

    My way is not need command.

    If arm object utility using, the command will be auto generate.

    We could see command by build log.

    Best regards,

    GR

  • Ok, got it. I can also generate the hex file that can work. 

    Hi George,

    But it seems hex file is not Intel-hex file, do you know which format of the hex file that generate by the tiarmobjcopy?

  • Hi GR,

    I do not set it, when I add the it, it can generate Intel hex now, great!