Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
20 years ago

Reading from Compact Flash with NIOS II

Hi all,

I have a general question about the compact Flash Card reader wich is on most of the NIOSII Boards.

I´ve Buld a System with the SOPC Builder and I´ve a Software writte in C wich uses standart C Libs to access a file!

How is it possible to read the File from the Compact Flash card! Is it necessary to run a OS for that? And if yes, which OS is easy to handle, also for a newbie?

BEST REGARDS,

http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/biggrin.gif http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/laugh.gif http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/smile.gif http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/tongue.gif

4 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    are you sure that ucLinux supports Altera? In the Manual altera is not listet

    <div class='quotetop'>QUOTE </div>

    --- Quote Start ---

    [PC ~/uClinux-dist]$ make config config/mkconfig > config.in# # No defaults found# * * Vendor/Product Selection * * * Select the Vendor you wish to target * Vendor (3com, ADI, Akizuki, Apple, Arcturus, Arnewsh, AtmarkTechno, Atmel, Avnet, Cirrus, Cogent, Conexant, Cwlinux, CyberGuard, Cytek, Exys, Feith, Future, GDB, Hitachi, Imt, Insight, Intel, KendinMicrel, LEOX, Mecel, Midas, Motorola, NEC, NetSilicon, Netburner, Nintendo, OPENcores, Promise, SNEHA, SSV, SWARM, Samsung, SecureEdge, Signal, SnapGear, Soekris, Sony, StrawberryLinux, TI, TeleIP, Triscend, Via, Weiss, Xilinx, senTec) [SnapGear] (NEW) AtmarkTechno[/b]

    --- Quote End ---

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Or you can use the HAL and some FAT C code like this:

    http://www.zws.com/products/dosfs/index.html (http://www.zws.com/products/dosfs/index.html)

    or this:

    http://elm-chan.org/fsw/ff/00index_e.html (http://elm-chan.org/fsw/ff/00index_e.html)

    Both of which is C code that you provide with the read sector and write sector functions.

    Then you can use the code to open files, create directories, read/write data, etc.

    I have gotten the DOSFS to work although it was too slow for my application. I am having trouble with reading the boot sector though so there is something wonky with my CF interface or code.

    The credit for this should go to some other guy that posted on this forum though. I can&#39;t find the post. I did find ELM Chan&#39;s FAT stuff.