Reply by dayah nuru March 9, 20082008-03-09
Hi,

This is the program that I run in CCS. May I know what is the header file that I should include in the program ? Thanks.

#include int main() { FILE *f; char s[1000]; f=fopen("infile","r"); if (!f) return 1; while (fgets(s,1000,f)!=NULL) printf("%s",s); fclose(f); return 0; }

Regards,

Dayah
Jeff Brower wrote:
Dayah-

> I just want to know, is it the CCS software don't support the file
> I/O access ? Because I have a program that worked well to access
> a txt file using c compiler but doesn't work when I use the CCS.

CCS supports file I/O. You have to include the correct header files.

Files can be on the host and your DSP program can access them over JTAG emulator.
However, CCS file I/O is very slow and you shouldn't mix that part of your DSP
program with real-time code.

-Jeff

Check Out Industry's First Single-Chip, Multi-Format, Real-Time HD Video Transcoding Solution for Commercial & Consumer End Equipment: www.ti.com/dm6467
Reply by Jeff Brower March 7, 20082008-03-07
Dayah-
> This is the program that I run in CCS. May I know what is the header file that I
> should include in the program ? Thanks.
>
> #include int main() {
>
> FILE *f;
> char s[1000];
>
> f=fopen("infile","r");
>
> if (!f) return 1;
>
> while (fgets(s,1000,f)!=NULL) printf("%s",s);
>
> fclose(f);
>
> return 0;
>
> }
>
How much effort / Googling are you doing on this? Shouldn't be hard. I tried:

fopen include site:ti.com

and the answer is sitting there #1 hit.

-Jeff
> Jeff Brower wrote:
>
> Dayah-
>
> > I just want to know, is it the CCS software don't support the file
> > I/O access ? Because I have a program that worked well to access
> > a txt file using c compiler but doesn't work when I use the CCS.
>
> CCS supports file I/O. You have to include the correct header files.
>
> Files can be on the host and your DSP program can access them over JTAG
> emulator.
> However, CCS file I/O is very slow and you shouldn't mix that part of
> your DSP
> program with real-time code.
>
> -Jeff
>
Reply by Jeff Brower March 7, 20082008-03-07
Dayah-

> I just want to know, is it the CCS software don't support the file
> I/O access ? Because I have a program that worked well to access
> a txt file using c compiler but doesn't work when I use the CCS.

CCS supports file I/O. You have to include the correct header files.

Files can be on the host and your DSP program can access them over JTAG emulator.
However, CCS file I/O is very slow and you shouldn't mix that part of your DSP
program with real-time code.

-Jeff
Check Out Industry's First Single-Chip, Multi-Format, Real-Time HD Video Transcoding Solution for Commercial & Consumer End Equipment: www.ti.com/dm6467
Reply by daya...@yahoo.com March 7, 20082008-03-07
Hi,
I just want to know, is it the CCS software don't support the file I/O access ? Because I have a program that worked well to access a txt file using c compiler but doesn't work when I use the CCS. Thanks.

Regards,
Dayah
Check Out Industry's First Single-Chip, Multi-Format, Real-Time HD Video Transcoding Solution for Commercial & Consumer End Equipment: www.ti.com/dm6467