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.

TMS320F28386D: Hex directive

Expert 2390 points
Part Number: TMS320F28386D
Other Parts Discussed in Thread: C2000WARE

Tool/software:

What is the meaning of use a 128-bit aligned length?

How to implemented in the ROMS directive?

  • Hi.

    Please refer to section 12.4 - "ROMS Directive" and related sections of this document: https://www.ti.com/lit/ug/spru513w/spru513w.pdf 

    The CMAC key needs to be stored in a flash location and needs to be 128-bit aligned.

    -Kedar

  • I already read that document,but did not find how to realize the 128-bit aligned in the document.

  • I need help that how to make 128-bit aligned happen. Does it need special symbol written in the above cmd file?Do TI have the exmaple how to make it?

  • Please take a look at this : https://software-dl.ti.com/ccs/esd/documents/sdto_cgt_Linker-Command-File-Primer.html 

    The section "Allocate an Input Section from a Library to Different Load and Run Addresses" has details of how the "ALIGN" keyword works.

    -Kedar

  • Sorry, I checked the part, but still not get the wanted information to guide how to implement the 128-bit aligned

  • You need to use "ALIGN (8)". This will align the data in size of 8 words.

  • I tried before,but it resulted with build error.

    "C:/ti/ccs1271/ccs/tools/compiler/ti-cgt-c2000_22.6.1.LTS/bin/cl2000" -v28 -ml -mt --cla_support=cla2 --float_support=fpu64 --idiv_support=idiv0 --tmu_support=tmu0 --vcu_support=vcrc -Ooff --define=_FLASH --define=DEBUG --define=CPU1 --diag_suppress=10063 --diag_warning=225 --diag_wrap=off --display_error_number --gen_func_subsections=on --abi=eabi -z -m"boot_ex1_cpu1_cpu2_cm_secure_flash_cpu1.map" --heap_size=0x200 --stack_size=0x100 --warn_sections -i"C:/ti/ccs1271/ccs/tools/compiler/ti-cgt-c2000_22.6.1.LTS/lib" -i"C:/ti/ccs1271/ccs/tools/compiler/ti-cgt-c2000_22.6.1.LTS/include" --reread_libs --diag_wrap=off --display_error_number --xml_link_info="boot_ex1_cpu1_cpu2_cm_secure_flash_cpu1_linkInfo.xml" --entry_point=code_start --rom_model -o "boot_ex1_cpu1_cpu2_cm_secure_flash_cpu1.out" "./boot_ex1_cpu1_cpu2_cm_secure_flash_cpu1.obj" "./device/device.obj" "./device/f2838x_codestartbranch.obj" "../2838x_FLASH_lnk_cpu1.cmd" "C:/ti/c2000/C2000Ware_5_02_00_00/libraries/boot_rom/f2838x/revA/rom_symbol_libs/cpu1/secureZoneCode/F2838xCPU1_SecureZoneCode_Symbols_fpu32.lib" "C:/ti/c2000/C2000Ware_5_02_00_00/driverlib/f2838x/driverlib/ccs/Debug/driverlib.lib" -llibc.a
    <Linking>
    Finished building target: "boot_ex1_cpu1_cpu2_cm_secure_flash_cpu1.out"

    Building secondary target: "boot_ex1_cpu1_cpu2_cm_secure_flash_cpu1.hex"
    Invoking: C2000 Hex Utility
    "C:/ti/ccs1271/ccs/tools/compiler/ti-cgt-c2000_22.6.1.LTS/bin/hex2000" --cmac="C:/WorkspaceCyberSecurity/boot_ex1_cpu1_cpu2_cm_secure_flash_cpu1/boot_ex1_user_cmac_key.txt" --image --memwidth=16 --romwidth=16 "C:/WorkspaceCyberSecurity/boot_ex1_cpu1_cpu2_cm_secure_flash_cpu1\boot_ex1_flash_hex_lnk_cpu1.cmd" --zero --diag_wrap=off --boot --sci8 --ascii -o "boot_ex1_cpu1_cpu2_cm_secure_flash_cpu1.hex" "boot_ex1_cpu1_cpu2_cm_secure_flash_cpu1.out"
    FLASH_SECTOR0_13: o=0x00080000 l=0x00040000, fill = 0xFFFF, ALIGN
    ^
    makefile:154: recipe for target 'boot_ex1_cpu1_cpu2_cm_secure_flash_cpu1.hex' failed
    error: syntax error
    gmake[1]: *** [boot_ex1_cpu1_cpu2_cm_secure_flash_cpu1.hex] Error 1
    gmake[1]: Target 'secondary-outputs' not remade because of errors.
    makefile:143: recipe for target 'all' failed
    gmake: *** [all] Error 2

    **** Build Finished ****

  • Is the command placed in the CMD file? Can you please share your command file?

  • There are two cmd in the example project, boot_ex1_cpu1_cpu2_cm_secure_flash_cpu1

    0363.CMD.zip

  • The "ALIGN" keyword is typically used in the SECTIONS part of the CMD file.

    /* CPU1 Flash sectors */

    /* HEX directive required by HEX utility to generate the golden CMAC tag */
    /* with one entry that represents all the allocated flash memory */
    ROMS
    {
        FLASH_SECTOR0_13: o=0x00080000 l=0x00040000, fill = 0xFFFF /* If fill not specified, then default is all 0s */
    }

    SECTIONS
    {
        flash_sector_0_13 :> FLASH_SECTOR0_13 , ALIGN(8)
    }
     
    And in your C file use the pragma to place the data at the section:
    #pragma CODE_SECTION(MyConst, "flash_sector_0_13 ");
    const unsigned long MyConst = 0x0000000;
  • I also tried this way before, it aslo resulted with build error

    Building target: "boot_ex1_cpu1_cpu2_cm_secure_flash_cpu1.out"
    Invoking: C2000 Linker
    "C:/ti/ccs1271/ccs/tools/compiler/ti-cgt-c2000_22.6.1.LTS/bin/cl2000" -v28 -ml -mt --cla_support=cla2 --float_support=fpu64 --idiv_support=idiv0 --tmu_support=tmu0 --vcu_support=vcrc -Ooff --define=_FLASH --define=DEBUG --define=CPU1 --diag_suppress=10063 --diag_warning=225 --diag_wrap=off --display_error_number --gen_func_subsections=on --abi=eabi -z -m"boot_ex1_cpu1_cpu2_cm_secure_flash_cpu1.map" --heap_size=0x200 --stack_size=0x100 --warn_sections -i"C:/ti/ccs1271/ccs/tools/compiler/ti-cgt-c2000_22.6.1.LTS/lib" -i"C:/ti/ccs1271/ccs/tools/compiler/ti-cgt-c2000_22.6.1.LTS/include" --reread_libs --diag_wrap=off --display_error_number --xml_link_info="boot_ex1_cpu1_cpu2_cm_secure_flash_cpu1_linkInfo.xml" --entry_point=code_start --rom_model -o "boot_ex1_cpu1_cpu2_cm_secure_flash_cpu1.out" "./boot_ex1_cpu1_cpu2_cm_secure_flash_cpu1.obj" "./device/device.obj" "./device/f2838x_codestartbranch.obj" "../2838x_FLASH_lnk_cpu1.cmd" "C:/ti/c2000/C2000Ware_5_02_00_00/libraries/boot_rom/f2838x/revA/rom_symbol_libs/cpu1/secureZoneCode/F2838xCPU1_SecureZoneCode_Symbols_fpu32.lib" "C:/ti/c2000/C2000Ware_5_02_00_00/driverlib/f2838x/driverlib/ccs/Debug/driverlib.lib" -llibc.a
    <Linking>
    Finished building target: "boot_ex1_cpu1_cpu2_cm_secure_flash_cpu1.out"

    Building secondary target: "boot_ex1_cpu1_cpu2_cm_secure_flash_cpu1.hex"
    Invoking: C2000 Hex Utility
    "C:/ti/ccs1271/ccs/tools/compiler/ti-cgt-c2000_22.6.1.LTS/bin/hex2000" --cmac="C:/WorkspaceCyberSecurity/boot_ex1_cpu1_cpu2_cm_secure_flash_cpu1/boot_ex1_user_cmac_key.txt" --image --memwidth=16 --romwidth=16 "C:/WorkspaceCyberSecurity/boot_ex1_cpu1_cpu2_cm_secure_flash_cpu1\boot_ex1_flash_hex_lnk_cpu1.cmd" --zero --diag_wrap=off --boot --sci8 --ascii -o "boot_ex1_cpu1_cpu2_cm_secure_flash_cpu1.hex" "boot_ex1_cpu1_cpu2_cm_secure_flash_cpu1.out"
    flash_sector0_13 :> FLASH_SECTOR0_13 , ALIGN(8
    ^
    makefile:154: recipe for target 'boot_ex1_cpu1_cpu2_cm_secure_flash_cpu1.hex' failed
    error: illegal input character: 0x3E
    error: syntax error
    gmake[1]: *** [boot_ex1_cpu1_cpu2_cm_secure_flash_cpu1.hex] Error 1
    gmake[1]: Target 'secondary-outputs' not remade because of errors.
    makefile:143: recipe for target 'all' failed
    gmake: *** [all] Error 2

    **** Build Finished ****

  • Could you please let me know any update? Due to we are on urgent case.

  • Any update?

  • I am following this topic, could you please let me know if have any update?

  • This topic has no TI expert follow for two weeks. Anyone could help?