Forum Discussion
Altera_Forum
Honored Contributor
21 years agoHow to use Compact Flash in eCos?
Hi. I'm having problems accessing the compact flash card in eCos. I tried a program that mount the filesystem to / and write a file to it. But the program hangs when I try to open a file. I have ...
Altera_Forum
Honored Contributor
21 years agoThe compact flash driver uses polled IDE accesses rather than the faster DMA modes (since these are unsupported in the hardware). This means that you won't be able to achieve the advertised fastest access rates for a given compact flash cards, however I have seen rates in the order of 600 Kbytes/s for a similar system to the one you're describing.
Obvious things to watch out for are: 1. turn on optimisisation in the compiler (this is on by default). 2. not being starved out by other activities, i.e. higher priority threads, ISR's and DSR's. In particular make sure that your system clock tick rate is not too high. There is an overhead to each call to an access function, so the bigger the blocks you transfer - the better. Best performance is obtained using the lowest level function that you can get away with, i.e. it is better to use read() rather than fprintf().