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.

TMS320F280025: Program Z1OTP-GPREG1 and Z1OTP-GPREG3 through batch file

Part Number: TMS320F280025
Other Parts Discussed in Thread: UNIFLASH

Tool/software:

Dear expert,

My CM customers can burn the two registers Z1OTP-GPREG1 and Z1OTP-GPREG3 through the Uniflash(figure 1). In order to facilitate production line production, they want to implement this function through batch file. How can this be achieved? Thank you.

  • Hi Angela,

    Let me refer you to our UNIFLASH expert.

    Best regards,

    Joseph

  • Hi Angela,

    @echo off
    setlocal
    setlocal ENABLEDELAYEDEXPANSION
    
    REM Path to this batch script
    set UNIFLASH_PATH=%~dp0
    
    REM Path to DebugServer folder
    set DEBUGSERVER_ROOT=%~dp0ccs_base\DebugServer\
    
    set MODE=flash
    set EXECUTABLE="!DEBUGSERVER_ROOT!bin\DSLite"
    
    set GENERATED_COMMAND=-c user_files/configs/f280025c.ccxml -l user_files/settings/generated.ufsettings -s VerifyAfterProgramLoad="No verification" -e -f -v "user_files/images/led_ex1_blinky.out" -a Z1GPREGProgram -a Z1OTPBOOTCTRLProgram
    set ADDITIONALS=
    
    REM list available modes
    if "%1"=="--listMode" (
    	echo.
    	
    	echo Usage: dslite --mode ^<mode^> arg
    	echo.
    	
    	echo Available Modes for UniFlash CLI:
    	echo   * flash [default] - on-chip flash programming
    	echo   * memory          - export memory to a file
    	echo   * load            - simple loader [use default options]
    	echo   * serial          - serial flash programming
    	echo   * noConnectFlash  - bypasses connect sequence during flash; for programming a blank CC23xx device
    if exist !DEBUGSERVER_ROOT!drivers\MSP430Flasher.exe (
    	echo   * mspflasher      - support MSPFlasher command line parameters [deprecated]
    )
    	pause
    	exit /b 0
    )
    
    REM no parameters given, use the default generated command
    if "%1" EQU "" (
    	echo Executing default command:
    	echo ^> dslite --mode !MODE! !GENERATED_COMMAND! !ADDITIONALS!
    	echo.
    	
    	CMD /S /C "%EXECUTABLE% !MODE! !GENERATED_COMMAND! !ADDITIONALS!"
    	pause
    	exit /b !errorlevel!
    )
    
    REM user options parsing
    set USEROPTIONS=%*
    
    REM user options without the --mode
    set "_args=%*"
    set "_args=!_args:*%1 =!"
    set "_args=!_args:*%2 =!"
    
    if "%3"=="" (
    	set USEROPTIONS2=
    ) else (
    	set USEROPTIONS2=!_args!
    )
    
    REM custom mode from users
    if "%1" EQU "--mode" (
    	set MODE=%2
    	set USEROPTIONS=!USEROPTIONS2!
    )
    
    REM default user options if none given
    if "!USEROPTIONS!" EQU "" (
    	set USEROPTIONS=-h
    )
    
    REM mspflasher support
    if "%MODE%" EQU "mspflasher" (
    	set EXECUTABLE=!DEBUGSERVER_ROOT!drivers\MSP430Flasher.exe
    	set MODE=
    )
    
    REM execute with given user parameters
    echo Executing the following command:
    if "!MODE!" EQU "" (
    	echo ^> !EXECUTABLE! !USEROPTIONS! !ADDITIONALS!
    ) else (
    	echo ^> !EXECUTABLE! !MODE! !USEROPTIONS! !ADDITIONALS!
    )
    echo.
    
    echo For more details and examples, please visit https://software-dl.ti.com/ccs/esd/uniflash/docs/latest_qsguide.html#command-line-interface
    echo.
    
    CMD /S /C "%EXECUTABLE% !MODE! !USEROPTIONS! !ADDITIONALS!"
    exit /b !errorlevel!

    Have edited a generated batch file provided through the UniFlash package generation for dslite.bat

    In order to execute the burning for OTP registers, I've included additional parameters in the set GENERATED_COMMAND line:

    -a Z1GPREGProgram -a Z1OTPBOOTCTRLProgram

    Note that these are both post application burn actions. It should also be noted for any GUI action the user wants to do, these are referenced in the Flash Properties XML file as actions:

    uniflash_9.1.0\deskdb\content\TICloudAgent\win\ccs_base\DebugServer\propertyDB\TMS320F28002x_128KB_FlashProperties.xml

    ex.:   <action>DPActiveDebugSession.flash.performOperation("Z1OTPBOOTCTRLProgram")</action>

    with the Z1OTPBOOTCTRLProgram being the action needed for UniFlash CLI interface.

    Have added pause statements to the code snippet in case they want to see the process in steps from command prompt (can remove if not necessary).

    Thanks and regards,

    Charles