Inconsistent File Reading/writing in binary format using MicroBlaze

---------- Forwarded message ---------- From: Priyantha De Silva Date: Wed, Apr 16, 2008 at 2:26 AM Subject: Inconsistent File Reading/writing in binary format using MicroBlaze To: Shakith Fernando

Hi,

I'm trying to read a file from Compact Flash Card in MPEG-4 file in binary format on MicroBlaze. Then Decode it and write output to CF card in binary format. Although functioning on PC the output on PC is correct, output on Micro-blaze is inconsistent.

A snippet of the code is as follows

SYSACE_FILE *outfile; SYSACE_FILE *writefile; ......

if ((outfile = sysace_fopen("stream.txt", "r")) == NULL) { xil_printf("Couldn't open the file\r\n"); } else{ xil_printf("Testing 1\n"); sysace_fread( (void *) mybuf, 1, 1, outfile); ......

if ((writefile = sysace_fopen("outfile.txt", "w")) == NULL) { xil_printf("Couldn't open the file\r\n"); } else{ xil_printf("Testing 3\n");}

sysace_fwrite((char*)buf[0],1, 2*cw, writefile2); }

}

Specification EDK version:8.2.02i FPGA Board: Virtex II Pro

Is it due to fact as data is read as char? Or Little Endian/ Big Endian issue? Any thoughts on the matter?

Priyantha

Reply to
Bathala
Loading thread data ...

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.