View Single Post
  #4 (permalink)  
Old 04-07-2006, 04:21 PM
Jan Panteltje
Guest
 
Posts: n/a
Default Re: Accessing compact flash?????????

On a sunny day (Fri, 07 Apr 2006 09:25:33 -0400) it happened Eli Hughes
<[email protected]> wrote in <e15p8e$1hji$[email protected]>:

>[email protected] wrote:
>> Environment in which system works:
>>
>> Microblaze softcore processor on spartan 3 fpga board
>> compact flash, acting as a mass storage.
>>
>> How to access the compact flash in embedded applications
>> write to and read from the compact flash? how to access the FAT table?
>> to which sector i need to write, which address?
>>
>> which mode of addressing is easy way out
>> CHS or LBA??
>>
>> I got no clue how to access, it would be great help if i could
>> understand in and out of doing tht becoz i need to write a code in C
>>
>> Thanks in advance
>>

>
>
>If you use the SYSTEM Ace controller chip , you can easily get to FAT
>file system access! There is actually a nice piece of IP that comes
>with the EDk that gives you basic file access.


I dunno, but 100 years ago or so when I moved from CP/M to MSDOS
I hacked together a simple file transfer function in C.
It is 'clean room', but then I did have MS floppies to test.
ftp://panteltje.com/pub/ms_fat.bz2

Not even sure that will work with current FAT, have to try some day.
But it has some test routines....
At the center of it it has a routine rwsabs()

rwsabs(sabs,dma,rwf) /*read or write sector abs*/
int sabs;/*absolute sector, starting at 0*/
unsigned dma; // memory address

Could be informative perhaps, ignore the sys14 routine calls.
Now to hope the richest man in the world does not sue me :-)


Reply With Quote