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.

CCS/TMS320C6678: How to determine the length of dat file automatically when using loadData API function?

Genius 13655 points
Part Number: TMS320C6678

Tool/software: Code Composer Studio

Hello Champs,

Customer wanted to use  memory.loadData API to load a dat file to target.

public void loadData(int nPage,
                     long nAddress,
                     java.lang.String sFilename,
                     int nLength)
              throws ScriptingException


But he needed to input the nlength parameter manually every time, is there some API function to read the length of dat file automatically?


Thanks.
Rgds
Shine

  • Hi Shine,
    There is no API that returns the number of samples in a CCS data (*.dat) file. *If* the .dat file has a proper header (no guarantee it does), then you can get the length from there. You would have to parse the file to read the first line with the header, and then get the length.

    For more information on the header, refer to the CCS Help (Help -> Help Contents -> Code Composer Studio Help -> Views and Editors -> Memory View -> Data File Formats)

    Thanks
    ki