DSPRelated.com
Forums

Re: [c6x] How to prepare a data for use with probe in CCS

Started by Bhooshan Iyer August 23, 2005
The .dat file should have some header info. The header would indicate to the probe, the format of the data stored in the dat file. It can be any one of:  Hexadecimal, Integer, Long and Float.
 
--Bhooshan
 
From CCS user manual:
 

The header information for data files uses the following syntax:

MagicNumber  Format StartingAddress PageNum Length
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: hexadecimal, integer, long, or float.
StartingAddress The starting address of the block that was saved.
PageNum The page number the block was taken from.
Length The number of samples in the block.

All header values are assumed to be TI-style hexadecimal values.
The following is an example of a Code Composer Studio data file:

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


Note that CCS expects 5 digit numbers of information to read in 4-digit values. While  the data is known to be hexadecimal, CCS expects the  first digit to be a zero. CCS does this so that hex numbers beginning  with letters (ie. 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, CCS will actually read  it as:

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

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

00022
00033
018AC
0FC94
00013
00895
00AB9

Note: Header values specify only the default address and length. When you use the File®Data
®Load command to load a file into memory, the Code Composer Studio debugger gives you a chance to override these values. When using the Code Composer Studio data file format with file I/O capabilities, any information you enter in the File I/O dialog box (Address and Length) automatically overrides the Code Composer Studio data file header information. You do not need to set the header information for each file as long as the header includes the following value: 1651 1 0 0 0.



On 8/23/05, Li Bing <l...@stee.stengg.com> wrote:
HI, DSP friends

This is first time I am using probe in my code. A problem confused me.

I want to prepare a data file for my application, and use this file with a
probe point to input data to a buffer. My code will be like following. I
prepared a data set including 8 integer, but by running the code I found
only the secod 2 data and last 2 data is inputted into buffer, the code is
running with 2 loops instead of 4. Anybod can give me some hint?
int in_buffer[2];
static void dataIO( );
void main(void)
{
while (1)
{
  dataIO( ); /*probe point set here */
  /* my other code below */
}
}

static void dataIO( )
{
return;

}
[This e-mail is confidential and may be priviledged. If you are not the
intended recipient, please kindly notify us immediately and delete the message
from your system; please do not copy or use it for any purpose, nor disclose
its contents to any other person. Thank you.]
---ST Electronics Group---



--
-------------------------------
"I've missed more than 9000 shots in my career.
I've lost almost 300 games. 26 times I've been trusted to take the game winning shot and missed.
I've failed over and over again in my life.
And that is why I succeed."
        -- Michael Jordan
--------------------------------
HI, DSP friends

This is first time I am using probe in my code. A problem confused me.

I want to prepare a data file for my application, and use this file with a
probe point to input data to a buffer. My code will be like following. I
prepared a data set including 8 integer, but by running the code I found
only the secod 2 data and last 2 data is inputted into buffer, the code is
running with 2 loops instead of 4. Anybod can give me some hint?
int in_buffer[2];
static void dataIO( );
void main(void)
{
while (1)
{
dataIO( ); /*probe point set here */
/* my other code below */
}
}

static void dataIO( )
{
return;

}


HI, Bhooshan

Thanks for your reply, I have went through CCS manual, but still can not
get the result. My code is as following, and I also attached the .dat. for
you to try.

You can see that the data is 1,2,3,4,5,6,7,8,9,, I expect that each time by
probe point 3 data will be inputted into in_buffer. But the result is
following, very strange. Could you please give me further help? Thank you
again.

This is No.1 data input
in_buffer[0]=2
in_buffer[1]=3
in_buffer[2]=4
This is No.2 data input
in_buffer[0]=8
in_buffer[1]=9
in_buffer[2]=0
This is No.3 data input
in_buffer[0]=0
in_buffer[1]=0
in_buffer[2]=0
This is No.4 data input
in_buffer[0]=0
in_buffer[1]=0
in_buffer[2]=0

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

/*Global declaration */
int in_buffer[3];
int out_buffer[3];
#define TRUE 1

/*Function */

static void dataIO(void); /*----- Main program ----- */
void main()
{

int *input = &in_buffer[0]; /* input pointer */
int *output = &out_buffer[0]; /* output pointer */
int p=0;
int i;

while(TRUE)
{
p++;
dataIO(); /* probe point is set here connected with .dat */
printf("This is No.%d data input\n",p);
for (i=0;i<3;i++)
{
printf("in_buffer[%d]=%d\n",i,in_buffer[i]);
}
} }

/* dataIO - function for data I/O */

static void dataIO ()
{
return;
}
-----Original Message-----
From: Bhooshan Iyer [SMTP:bhooshaniyer@bhoo...]
Sent: Tuesday, August 23, 2005 11:35 PM
To: libing@libi...
Cc: C64x; ccs
Subject: [code-comp] Re: [c6x] How to prepare a data for use with probe in
CCS

The .dat file should have some header info. The header would indicate to
the
probe, the format of the data stored in the dat file. It can be any one of:
Hexadecimal, Integer, Long and Float.
--Bhooshan
From CCS user manual:

The header information for data files uses the following syntax:

MagicNumber Format StartingAddress PageNum Length
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: hexadecimal, integer, long, or
float.
StartingAddress The starting address of the block that was saved.
PageNum The page number the block was taken from.
Length The number of samples in the block.

All header values are assumed to be TI-style hexadecimal values.
The following is an example of a Code Composer Studio data file:

1651 1 800 1 10
0x0000
0x0000
0x0000
0x0000
0x0000
0x0000
0x0000
0x0000
0x0000
0x0000
0x0000
0x0000
0x0000 Note that CCS expects 5 digit numbers of information to read in 4-digit
values. While the data is known to be hexadecimal, CCS expects the first
digit to be a zero. CCS does this so that hex numbers beginning with
letters
(ie. 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, CCS will actually read it as:

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

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

00022
00033
018AC
0FC94
00013
00895
00AB9

Note: Header values specify only the default address and length. When you
use the File(r)Data
(r)Load command to load a file into memory, the Code Composer Studio
debugger
gives you a chance to override these values. When using the Code Composer
Studio data file format with file I/O capabilities, any information you
enter in the File I/O dialog box (Address and Length) automatically
overrides the Code Composer Studio data file header information. You do not
need to set the header information for each file as long as the header
includes the following value: 1651 1 0 0 0. On 8/23/05, Li Bing <libing@libi...> wrote:
>
> HI, DSP friends
>
> This is first time I am using probe in my code. A problem confused me.
>
> I want to prepare a data file for my application, and use this file with
a
> probe point to input data to a buffer. My code will be like following. I
> prepared a data set including 8 integer, but by running the code I found
> only the secod 2 data and last 2 data is inputted into buffer, the code
is
> running with 2 loops instead of 4. Anybod can give me some hint? >
> int in_buffer[2];
> static void dataIO( );
> void main(void)
> {
> while (1)
> {
> dataIO( ); /*probe point set here */
> /* my other code below */ >
> }
> }
>
> static void dataIO( )
> {
> return;
>
> }