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导出的.dat文件格式说明

网上找到的CCS .dat文件中的第二位数据格式的说明,都是说数据格式是1-4,没有9的说明,这是我的CCS帮助文档中找到的最新说明。

Code Composer data file

A text file that contains one line of header information and stores the data as one sample per line. The legacy file format supported these formats :

  • Hexadecimal

  • Integer

  • Long

  • Float

The new scheme which is backwards compatible supports a larger set of data types. GEL_MemoryListSupportedTypes() GEL API could be used to list complete set of supported data types in the new scheme

The header information for data files uses this syntax:

MagicNumber  Format StartingAddress PageNum Length [NewFormat]
 
  • MagicNumber—fixed at 1651.

  • Format—a number from 1 to 4, indicating the format of the samples in the file.
    This number represents a data format: (1) hexadecimal, (2) integer, (3) long, (4) float, or (9) Use new scheme

  • StartingAddress—starting address of the block that was saved.

  • PageNum—page number the block was taken from.

  • Length—number of samples in the block.

  • NewFormat—Format (9); the new scheme. This is optional when usign the legacy formats 1 - 4

Format 9) indicates usage of the new scheme. This was added to achieve consistency in the formats available in the memory browser and the formats available with load/save feature. The memory browser supports a larger set of data formats which vary slightly across each target. The old load/save header is based on a fixed set of data formats. In order to maintain backwards compatibility the existing fixed data format is still supported. However, an additional data format ( 9) was introduced which acts as a switch to use the new scheme. The last extra parameter (NewFormat) is the actual format chosen in the new scheme .

All header values are assumed to be TI-style hexadecimal values.

This is an example of a Code Composer data file:

1651 1 800 1 10
0x0000
0x0000
0x0000
0x0000
0x0000
0x0000
0x0000
0x0000
0x0000
0x0000
0x0000
0x0000
0x0000

Note: Code Composer expects five-digit numbers of information to read in 4-digit values. While the data is known to be hexadecimal, Code Composer expects the  first digit to be a zero. Code Composer does this so that hexadecimal numbers beginning with letters (that is, F800) are not misread as labels. For example, when reading data in hexadecimal format from a data file, the first digit may be truncated.

Look at this input data:

0022
0022
0033
8AC  
FC94
13
895
AB9 ...

When reading this data, Code Composer actually reads data as:

0022
0033
08AC
0C94
0003
0095
00B9 ...

But if you test Code Composer IDE with five-digit data input, (by adding zeroes at the beginning where necessary), the output is consistent with the input:

00022
00033
018AC
0FC94
00013
00895
00AB9