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.

How to flash TMS320F2812 automatically using command line

Other Parts Discussed in Thread: TMS320F2812, UNIFLASH

Hi all,

I'm a new in CCS and TMS320F2812.

I have QQ2812 v1.3 target board and emulator xds100v2. I'm developing uint tests for a firmware. All works perfetly. Tests are flashed to chip and run succsesfully.

I use CCS 3.3 and  F28xx On-Chip Flash Programmer plugin to flash microcontroller F2812 manually. I have a hundred tests and it's necessary to run all of them each time when new firmware released. So it does mannually takes a long time.

So the question is how to automatically flash the chip via command line utility or gel file and detect the moment when test is finished and to start flashing other test?

Thank you,

The best regards,

Alex

  • I would suggest you use the command-line or scripting option for UniFlash:

    http://processors.wiki.ti.com/index.php/UniFlash_Quick_Start_Guide#Command_Line

    http://processors.wiki.ti.com/index.php/UniFlash_Quick_Start_Guide#Scripting

    If you use scripting, you can write complex scripts to fully automate your flashing process.

    Thanks

    ki

  • Hi Ki,

    Thanks for advance. But UniFlash cannot connect to my target. It's installed without any errors. I created a new target configuration with parameters:

    OSCCLK = 30

    PPLCR = 10

    After than select my test.out file under the program item in the tree on the left. Press Program and got the following error:

    [11:48:58] Begin Launching session operation.
    [11:49:30] Operation Launching session returned.
    [11:49:30] Loaded target configuration from: C:\PSPCH\Tests\PSPCH_PROTECT_TEST\Bin\TSM320F2812.ccxml
    [11:50:47] FATAL >> C28xx: Error connecting to the target: (Error -183 @ 0x0) The controller has detected a cable break far-from itself. The user must connect the cable/pod to the target. (Emulation package 5.1.402.0)

    The target boards is connected to XDS100-V2 via JTAG.

    Nevertheless CCS v.3.3 connects succesfully. OS windows xp.

    What do I wrong? Do you have an idea how to fix it?

    UPD 

    I have installed last CCS 6.0.1, but it could not connect too. Here is a jtag diagnostic log.

    [Start: Texas Instruments XDS100v2 USB Emulator_0]
    
    Execute the command:
    
    %ccs_base%/common/uscif/dbgjtag -f %boarddatafile% -rv -o -F inform,logfile=yes -S pathlength -S integrity
    
    [Result]
    
    
    -----[Print the board config pathname(s)]------------------------------------
    
    C:\Users\SMAGI_~1\AppData\Local\TEXASI~1\
        CCS\ti\1\0\BrdDat\testBoard.dat
    
    -----[Print the reset-command software log-file]-----------------------------
    
    This utility has selected a 100- or 510-class product.
    This utility will load the adapter 'jioserdesusb.dll'.
    The library build date was 'May 21 2014'.
    The library build time was '17:19:59'.
    The library package version is '5.1.507.0'.
    The library component version is '35.34.40.0'.
    The controller does not use a programmable FPGA.
    The controller has a version number of '4' (0x00000004).
    The controller has an insertion length of '0' (0x00000000).
    This utility will attempt to reset the controller.
    This utility has successfully reset the controller.
    
    -----[Print the reset-command hardware log-file]-----------------------------
    
    The scan-path will be reset by toggling the JTAG TRST signal.
    The controller is the FTDI FT2232 with USB interface.
    The link from controller to target is direct (without cable).
    The software is configured for FTDI FT2232 features.
    The controller cannot monitor the value on the EMU[0] pin.
    The controller cannot monitor the value on the EMU[1] pin.
    The controller cannot control the timing on output pins.
    The controller cannot control the timing on input pins.
    The scan-path link-delay has been set to exactly '0' (0x0000).
    
    -----[The log-file for the JTAG TCLK output generated from the PLL]----------
    
    There is no hardware for programming the JTAG TCLK frequency.
    
    -----[Measure the source and frequency of the final JTAG TCLKR input]--------
    
    There is no hardware for measuring the JTAG TCLK frequency.
    
    -----[Perform the standard path-length test on the JTAG IR and DR]-----------
    
    This path-length test uses blocks of 512 32-bit words.
    
    The JTAG IR instruction path-length was not recorded.
    
    -----[Perform the Integrity scan-test on the JTAG IR]------------------------
    
    This test will use blocks of 512 32-bit words.
    This test will be applied just once.
    
    Do a test using 0xFFFFFFFF.
    Scan tests: 1, skipped: 0, failed: 0
    
    -----[An error has occurred and this utility has aborted]--------------------
    
    This error is generated by TI's USCIF driver or utilities.
    
    The value is '-183' (0xffffff49).
    The title is 'SC_ERR_CTL_CBL_BREAK_FAR'.
    
    The explanation is:
    The controller has detected a cable break far-from itself.
    The user must connect the cable/pod to the target.
    
    [End: Texas Instruments XDS100v2 USB Emulator_0]
    

  • Alex Smagin said:
    The target boards is connected to XDS100-V2 via JTAG.

    Did you use the same XDS100v2 emulator with CCSv3.3? CCSv3.x only supported the XDS100v1.

  • Yes, I use XDS100-V2 and CCS 3.3.83.20 and it connects successfully.

  • Ok, so you are using the XDS100v2 emulator as an XDS100v1 with CCSv3.3.

    What is the emulator type of the XDS100v2 (vendor and number)? If there is a URL to it where i can see the specs, that would be great.

  • It seems here is a set http://item.taobao.com/item.htm?spm=686.1000925.1000774.80.Qe1rVN&id=17826070254 that I have. Here is XDS100-V2 separately http://item.taobao.com/item.htm?spm=a1z10.1.w4004-4851617699.30.JFOh5M&id=10829223142

    I'm not familiar Chinese. I do not know who manufactured it

  • please try the XDS100v1 option in CCSv6. The error you are seeing is common with people who are trying to use XDS100v1 HW as an XDS100v2. I'm wondering if the emulator in the URL you sent is actually an XDS100v1

  • Bingo! You are right. CCS6.0 connects via XSD100V1 device. It's truly a label does not correspond to inside parts.

    I'll try to automate the my process tomorrow.

    Thank you very much,

    Alex.

  • Hello Ki,

    It's I again. At now I can program my device via uniflash and execute my program on it (-targetOp run) I think so. CCS6 is also conected and allows to debug code.

    My program interacts with my pc via fopen, fprintf and etc. It sends results of checks. If I run it in CCS, It creates a file with results, but when I program it and run via uniflash, doesn't. uniflash doesn't wait until execution is finished.

    So the question is how to get sent data?

  • Alex Smagin said:
    but when I program it and run via uniflash, doesn't. uniflash doesn't wait until execution is finished.

    This by design. UniFlash will run the program asynchronously. Basically it will run the target and then return right away and leave the target running. If you want to run synchronously, then I suppose you can modify the UniFlash DSS scripts in <CCSv6 INSTALL DIR>\ccsv6\ccs_base\scripting\examples\uniflash\cmdLine (command-line UniFlash is just DSS scripts under the hood) and change the runAsynch() to a standard run() call (I believe it is line 247 in uniFlash_operation.js)

    http://processors.wiki.ti.com/index.php/UniFlash_Quick_Start_Guide#Command_Line

    http://processors.wiki.ti.com/index.php/Debug_Server_Scripting

    Thanks

    ki

  • It's clear.

    What about reveciving data from device. How to get stdout and data sent to file? CCS does it via cio section in memory. Why does this way not work with uniflash?

    I've just replaced runAsynch with run, Uniflash freezes and more nothind does.

  • Alex Smagin said:
    What about reveciving data from device. How to get stdout and data sent to file? CCS does it via cio section in memory. Why does this way not work with uniflash?

    This is a limitation of DSS.

    http://e2e.ti.com/support/development_tools/code_composer_studio/f/81/t/347365.aspx

    Alex Smagin said:
    I've just replaced runAsynch with run, Uniflash freezes and more nothind does.

    If you program does not self-terminate, then uniflash will just "hang" since run() is blocking.

  • Ki-Soo Lee said:

    What about reveciving data from device. How to get stdout and data sent to file? CCS does it via cio section in memory. Why does this way not work with uniflash?

    This is a limitation of DSS.

    http://e2e.ti.com/support/development_tools/code_composer_studio/f/81/t/347365.aspx

    [/quote]

    I need to correct my comment. I got confused with cin.

    You can use the DSS beginCIOLogging and endCIOLogging APIs to stream cio stdout to a file. Both APIs can be found in the doc for the DebugSession class.