UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Explorer
Explorer
6,862 Views
Registered: ‎05-15-2009

How to simply write a file to the Compact Flash (CF) ?

Jump to solution

Hello,

I have a ML402 virtex4 board with sysace controller, and i simply want to write a file to the compact flash, then read the contents using software in EDK. I have added the systemace core to the PLB on the microblaze architecture.

 

1) Can anyone tell the steps to achieve this, i.e., write a txt file to the compact flash? I have searched for days and i found no clear information on this.

 

2) Do i need to use the sysace drivers, or simply the xilfatfs functions like sysace_fopen, sysace_fread etc will do the work?

 

3) Do I need to specify stack, heap sizes? Do I need to initialize the driver even using xilfatfs library functions?

 

 

 

Best,

JM

Message Edited by jmonteiro-dme on 06-08-2009 07:24 AM
Message Edited by jmonteiro-dme on 06-08-2009 07:24 AM
0 Kudos
1 Solution

Accepted Solutions
Explorer
Explorer
8,262 Views
Registered: ‎05-15-2009

Re: How to simply write a file to the Compact Flash (CF) ?

Jump to solution
Solution: format the CF and use the xilfatfs funtions :)
0 Kudos
4 Replies
Xilinx Employee
Xilinx Employee
6,823 Views
Registered: ‎08-07-2007

Re: How to simply write a file to the Compact Flash (CF) ?

Jump to solution

Hi JM,

 

How about start with the reference design ML402 EDK Embedded MicroBlaze Reference Design. it's a bit outdated, but the idea of accessing the CF file system is still the same.

 

-XF

0 Kudos
Explorer
Explorer
6,801 Views
Registered: ‎05-15-2009

Re: How to simply write a file to the Compact Flash (CF) ?

Jump to solution

Hello xiaofeip,

 

I have run into all those examples but i get a hang when i use the sysace_fopen function, that's why I'm asking this. I have included in the EDK project the sysace core, made the changes to WRITE in xilfatfs options under platform software settings, and I get a hang in the following instruction (checked with XMD), which is called under sysace_fopen()

 

while ((Result = XSysAce_Lock(&Ace, XFALSE)) != XST_SUCCESS);

 

What can I possibly be doing wrong? Why does the lock test fails? I'm using the CF that came with our virtex4 FX.

 

Best,

JM

0 Kudos
Explorer
Explorer
6,800 Views
Registered: ‎05-15-2009

Re: How to simply write a file to the Compact Flash (CF) ?

Jump to solution

Hello,

 

I managed to get sysace_fopen passing, however, the sysace_fwrite() hangs when it calls allocate_one_cluster(pi), checked with XMD. Inside, there is a for() cycle that checks for free clusters which I tested but it took to many iterations without leaving.

 

The xillinx comment of this instruction is as follows

/*

 if this is the first byte of the file, then the firstcluster entry for it should be set in its directory entry

*/

 

I'm using the default 32MB CF card that came with the virtex 4 evaluation board ML402.

What can be the problem?

 

Best,

JM

0 Kudos
Explorer
Explorer
8,263 Views
Registered: ‎05-15-2009

Re: How to simply write a file to the Compact Flash (CF) ?

Jump to solution
Solution: format the CF and use the xilfatfs funtions :)
0 Kudos