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.

TMS320F28335: uniflash cli exit errorcode from dslite batch file

Part Number: TMS320F28335
Other Parts Discussed in Thread: UNIFLASH

I develop tms28F335 mass production test. I did uniflash cli batch file for processor programming i success to program device. but i want to know how can i exit with errorcode from batch file dslite if i get any fault like programmer not connected or some fault in erase or program of cpu.

 

  • Kirill,

    I'm not sure if I fully understood your question.

    The default UniFlash CLI (dslite.bat) sets the errorcode variable on exit, so that you can query for it on the next command (for example, "echo %errorlevel%". A value of 0 indicates that the operation succeeded; any other value indicates that there was an error in the operation.

    Read more about it here:
    processors.wiki.ti.com/.../UniFlash_v4_Quick_Guide

    Please let me know if this is what you are asking about.

    Thanks,
    Ricky

  • Hi Ricky

    Then i tried to do as you recommend me i print error level at fail state than cable not connected and at success programming i get same %errorlevel% of "0".

    *************************************************************************************************************************************

    success: 

    Executing default command:
    > dslite flash -c user_files/configs/f28335.ccxml -l user_files/settings/generat
    ed.ufsettings -e -f -v user_files/images/BootApp.hex

    DSLite version 7.0.0.1716
    Configuring Debugger (may take a few minutes on first launch)...
    Initializing Register Database...
    Initializing: C28xx
    Executing Startup Scripts: C28xx
    Connecting...
    Loading Program: user_files/images/BootApp.hex
    Preparing ...
    0 of 36986 at 0x338000
    Erasing Flash Sectors.
    Erasing Sector A
    Erasing Sector B: 12%
    Erasing Sector C: 25%
    Erasing Sector D: 37%
    Erasing Sector E: 50%
    Erasing Sector F: 62%
    Erasing Sector G: 75%
    Erasing Sector H: 87%
    32752 of 36986 at 0x338000: 84%
    0 of 1528 at 0x33c83e: 95%
    0 of 256 at 0x33ff80: 99%
    Finished: 99%
    Setting PC to entry point.: 99%
    Verifying Program: user_files/images/BootApp.hex
    Preparing ...
    0 of 36986 at 0x338000
    32752 of 36986 at 0x338000: 84%
    0 of 1528 at 0x33c83e: 95%
    0 of 256 at 0x33ff80: 99%
    Finished: 99%
    info: C28xx: Program verification successful for user_files/images/BootApp.hex
    Running...
    Success
    ----------------------------------------
    Success output errorlevel: 0
    ----------------------------------------
    Press any key to continue . . .

    *******************************************************************************************************************************************

    Fail : 

    Executing default command:
    > dslite flash -c user_files/configs/f28335.ccxml -l user_files/settings/generat
    ed.ufsettings -e -f -v user_files/images/BootApp.hex

    DSLite version 7.0.0.1716
    Configuring Debugger (may take a few minutes on first launch)...
    Initializing Register Database...
    Initializing: C28xx
    Executing Startup Scripts: C28xx
    Connecting...
    fatal: C28xx: Error connecting to the target: (Error -180 @ 0x0) The controller
    has detected a target power loss. The user must turn-on or connect the power sup
    ply for the target. (Emulation package 6.0.407.3)
    Failed: Operation was aborted
    ----------------------------------------
    Not connect output errorlevel: 0
    ----------------------------------------
    Press any key to continue . . .

    **************************************************************************************************************************************************

    code as dispatched by uniflash with addition of echo %errorlevel%

    if "%1" EQU "" (
    echo Executing default command:
    echo ^> dslite flash -c user_files/configs/f28335.ccxml -l user_files/settings/generated.ufsettings -e -f -v user_files/images/BootApp.hex
    echo.
    CMD /C "!DEBUGSERVER_ROOT!bin\DSLite" flash -c user_files/configs/f28335.ccxml -l user_files/settings/generated.ufsettings -e -f -v user_files/images/BootApp.hex
    echo ----------------------------------------
    echo Not connect output errorlevel: %errorlevel%
    echo ----------------------------------------
    pause

    exit /b 0
    )

    so i cant know if it output by some error or if it success programming.

    Thanks,
    Kirill

  • Kirill,

    It looks like you are calling DSLite.exe directly ("!DEBUGSERVER_ROOT!bin\DSLite"). Instead, please call dslite via dslite.bat in the UniFlash install directory. This is the script that sets the correct errorlevel.

    In this case, you don't need the 'flash' argument.

    So, if running from UniFlash install directory:

    CMD /C dslite.bat -c user_files/configs/f28335.ccxml -l user_files/settings/generated.ufsettings -e -f -v user_files/images/BootApp.hex
    echo Not connect output errorlevel: %errorlevel%

    Thanks,
    Ricky
  • Tnx Ricky

    i did it as you recommended i run  dslite.bat from another batch and i get right error response.