Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12606 Discussions

Reading from Compact Flash with NIOS II

Altera_Forum
Honored Contributor II
1,465 Views

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
0 Kudos
4 Replies
Altera_Forum
Honored Contributor II
311 Views

You may use uClinux. It is not difficult. 

http://nioswiki.jot.com/%c2%b5clinux (http://nioswiki.jot.com/%c2%b5clinux)
0 Kudos
Altera_Forum
Honored Contributor II
311 Views

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 ---  

0 Kudos
Altera_Forum
Honored Contributor II
311 Views

Yes, I added the patches to support Nios2.

0 Kudos
Altera_Forum
Honored Contributor II
311 Views

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.
0 Kudos
Reply