TMS320F280041: Problems adding hex.cmd utility file to C2000 Hex generation tool

Part Number: TMS320F280041
Other Parts Discussed in Thread: UNIFLASH

Tool/software:

Hello TI team,

I'm trying to specify the post-build steps to generate a desired .hex file. For this I followed the tips of the following post: TMS320F28379D: CCS V20 Hex Utility Command-Line pattern - C2000 microcontrollers forum - C2000Tm︎ microcontrollers - TI E2E support forums.

I'm adding the following post-build step: "${CG_TOOL_HEX}" "${BuildArtifactFileName}" @${ProjDirPath}/hexUtility.cmd -o "${BuildArtifactFileBaseName}.hex".

And I created the following hexUtility.cmd file: 

--intel
--fill=0xFFFF
--image
--memwidth=16
--romwidth=16
--diag_wrap=off

ROMS
{
    FLASH: origin=0x80000, length=0x10000, fill=0xFFFF
}
I also made sure that the C2000 Hex Utility was properly disabled on the Project properties.
The hexUtility.cmd is present in the {ProjDirPath}.
The .out build is successful, however when running the C2000 Hex Utility, I get the following error: 
The .out build is successful, however when running the C2000 Hex Utility, I get the following error:


[271]"C:/TI/ccs2020/ccs/tools/compiler/ti-cgt-c2000_22.6.2.LTS/bin/hex2000" "project-name.out" @C:\Users\martin.blocher\workspace_ccstheia\project-name/hexUtility.cmd -o "project-name.hex"

[272]fatal error: cannot open input file
[273] "@C:\Users\martin.blocher\workspace_ccstheia\project-name/hexUtility
[274] .cmd": Invalid argument
[275]gmake[2]: [makefile:275: post-build] Error 1 (ignored)
[276]**** Build Finished ****
Could you have any idea why the error is occurring ? Why can't it open the input file?
Thanks,
Martin
  • I'm adding the following post-build step: "${CG_TOOL_HEX}" "${BuildArtifactFileName}" @${ProjDirPath}/hexUtility.cmd -o "${BuildArtifactFileBaseName}.hex".

    I see an "@" character before the path to the cmd file. Is that a typo?

  • Yeap, exactly, my mistake sorry about that, it is now working. However, I'm facing another trouble problem, I'm trying to generate two .hex files. One will be responsible for the OTP BANK0 the other for the FLASH BANK0. For this I know have two post builds instructions, one responsible for each. The FLASH BANK0 is working perfectly. However, for the OTP, I'm running the following .cmd:

    --intel
    --fill=0xFFFF
    --image
    --memwidth=16
    --romwidth=16
    
    ROMS
    {
        OTP_Z1: origin=0x78000, length=0x400, fill=0xFFFF
    }

    The assembly code responsible for this code flash memory area is the following:

         .sect "dcsm_otp_z1_pswdlock"
          .retain
          .long 0xFB7FFFFF
          .long 0x7FFFFFFF     ;Reserved
          
         .sect "dcsm_otp_z1_crclock"
          .retain
          .long 0x4BFFFFFF
          .long 0x3FFFFFFF     ;Reserved
       
         .sect "dcsm_otp_z1_jtaglock"
          .retain
          .long 0x9FFFFFFF
          .long 0x0FFFFFFF     ;Reserved
         .sect "dcsm_otp_z1_gpreg"
          .retain
          .long 0x5AFFFFFF     ;Z1OTP_BOOTPIN_CONFIG
          .long 0x5AFFFFfF     ;Z1OTP_GPREG2
         .sect "dcsm_otp_z1_bootctrl"
          .retain
          .long 0xFFFFFF03     ;Z1OTP_BOOTDEF_LOW
          .long 0xFFFFFFFF     ;Z1OTP_BOOTDEF_HIGH

    I would like to change my .cmd to only program the sectors: dcsm_otp_z1_pswdlock, dcsm_otp_z1_crclock, dcsm_otp_z1_jtaglock, dcsm_otp_z1_gpreg & dcsm_otp_z1_bootctrl. The rest I would like to leave untouched, unless I get the following error on UNIFLASH: [ERROR] C28xx_CPU1: Error during Flash Programming. Address 0x00078000, FMSTAT (STATCMD on some devices) 0x00000030.

    The assembly code was automatically generated when inserting the following syscfg config:

    Is it possible to generate a .hex which only changes the mentioned sections ? If so how can I achieve it? Maybe through the .cmd?

    Many thanks for the quick response :)

    Greetings,

    Martin 

  • For this question I will defer to the compiler (hex utility) experts. I will bring this thread to their attention.

  • Is it possible to generate a .hex which only changes the mentioned sections ?

    Yes.  Use a SECTIONS directive instead of a ROMS directive.  Please search the C28x assembly tools manual for the phrase hex conversion utility SECTIONS directive.

    Thanks and regards,

    -George