cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Adventurer
Adventurer
2,283 Views
Registered: ‎01-15-2013

Xilinx Memory File System problem

Hi,

 

I have generated a MFS file using MFSGEN with the following command. 

 

mfsgen -cvbf try.mfs 75 test.txt       

 

I also wrote a code which reads file from 0x9FFF0000

Code

....

....

 

int fd=5;

mfs_init_genimage(39904, (char *)(0x9FFF0000), MFSINIT_IMAGE);
fd = mfs_file_open("akiyo.qcif.264", MFS_MODE_READ);

if(fd==-1)
          xil_printf("input_open: file already opened\n");

 

char r;
long i=-2;
i=mfs_file_lseek (fd, 1, SEEK_SET);
int a=mfs_file_read(fd,&r,1);

......

.....

 

 

I download the executable and the data qith the following commands. 

 

dow executable.elf

dow -data try.mfs 0x9FFF0000

 

Its gives me that msgen has being complete and shows me the block size. number of bytes etc.

 

In my case, "mfs_file_open" function in the code returns a success but "mfs_file_lseek" and  "mfs_file_read" both returns a failure. Could anyone tell me why there is a failure for read if the file is already opened? 

 

Thank you. 

 

 

0 Kudos