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.

UniFlash C2000 Command Line

Other Parts Discussed in Thread: TMS320F28335, UNIFLASH

Hello,

I want to program my TMS320F28335 with UniFlash via the command line. This works. But how can I erase and program only the first sector (Flash A) to save time in the production.

I have found an example like this:

uniflash -ccxml TMS320F28335.ccxml -setOptions FlashEraseSelection="Selected Sectors Only" FlashBank0Sector0=0 FlashBank0Sector1=true -operation Erase

but this example doesn't work with the TMS320F28335.

So what can I do to erase and program only Flash A?

Best regards

AWG

  • AWG,

    Unfortunately, the "Selected Sectors Only" option is not available on the F28335.

    If you know that your program only writes to Sector A, you can use the GUI to configure the settings first, and export the session to be used in command line.

    Configure for the F28335, then deselect Sectors B to H, and leave Sector A checked, and save your current session (Session -> Save). This saved file can now be used with the command line using the -loadSettings parameter.

    For example:
    uniflash -ccxml TMS320F28335.ccxml -loadSettings <pathToSessionFile> -program <pathToProgramFile>

    Please let me know if this works for you.

    Thanks,
    Ricky
  • Hi Ricky,

    thank you. It works. But I have another question.

    My batchfile calls now the uniflash.bat in this way:

    uniflash -ccxml XDS100v2_10-241-03.ccxml -loadSettings XDS100v2_10-241-03.uniflashsession -program P241A03_Release.out -verify P241A03_Release.out

    The uniflash.bat is, I think, another process and my batchfile is finished before the uniflash.bat.

    So how can I check a return value (errorlevel) of the uniflash.bat?

    Thank you, Best regards

    AWG

  • AWG,

    I'm not sure if this will fit your requirements or not, but UniFlash command line also has the following command:

    -programStatusOutput <fileToOutput> <successStr> <failStr>

    If you specify the -programStatusOutput parameters, UniFlash will either write the successStr or failStr to the provided file path, depending on if the operation was successful or not.

    This way, you can check the contents of the file with your batch file, or check it manually after the operation is completed.

    Thanks,
    Ricky
  • Hi Ricky,

    I have tested the -programStatusOutput command:

    uniflash -programStatusOutput ProgResult.txt passed failed -ccxml XDS100v2_10-241-03.ccxml -loadSettings XDS100v2_10-241-03.uniflashsession -program P241A03_Release.out -verify P241A03_Release.out

    The ProgResult.txt file was created and the passed string is also in the file - ok.

    But my Problem is, how can I detect when the programming operation is finished? For example:

    uniflash -programStatusOutput ProgResult.txt passed failed ....

    rem I want to wait here until the programming operation is finished.
    rem then check the resultstring in the ProgResult.txt file


    FINDSTR passed ProgResult.txt

    if %ERRORLEVEL% EQU 0 echo ok

    ...

    pause

    the FINDSTR and all other commands will not be executed.

    What can I do to achieve this?

    Thanks an best regards

    AWG

  • AWG,

    The command line script is synchronous and should return only after the operation is completed. So you should be able to run a UniFlash command, check the output, run another UniFlash command, and so on.

    > uniflash -programStatusOutput ProgResult.txt -operation <1>
    > read ProgResult.txt, if success continue, otherwise stop
    > uniflash -programStatusOutput ProgResult.txt -operation <2>
    > ...

    This approach will configure and deconfigure the device between the operations. If you want to avoid that, you will need to enhance the UniFlash command line to match your requirements.

    Thanks,
    Ricky