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++
12599 Discussions

FAT filesystem for compact flash

Altera_Forum
Honored Contributor II
967 Views

I am using a stratix evaluation board. 

I wanted to create a FAT filesystems on the compact flash onboard. 

Can i do this using the present uclinux port . 

If so what are the steps. 

Tell me the procedure as i am a beginner. 

Even a FAT systems without any OS wouls do.
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
303 Views

reju_r, 

 

> Even a FAT systems without any OS wouls do. 

 

If you only need read access to a FAT filesystem, you could try 

the u-boot boot monitor with FAT support enabled. You could 

also check if Redboot supports FAT. 

 

Regards, 

--Scott
0 Kudos
Altera_Forum
Honored Contributor II
303 Views

 

--- Quote Start ---  

originally posted by reju_r@Nov 4 2004, 01:34 AM 

i am using a stratix evaluation board. 

i wanted to create a fat filesystems on the compact flash onboard. 

can i do this using the present uclinux port . 

if so  what are the steps. 

tell me  the procedure as i am a beginner. 

even a fat systems without any os wouls do. 

--- Quote End ---  

 

 

 

 

 

I tried this both on the Altera Stratix board and the Altera Cyclone board with the Quartus project from archive qp.zip. I believe that archive is from Microtronix. It supports pretty much all the hardware on the board. 

 

Assuming that that you built your NIOS with compact flash support: 

 

In the NIOS II IDE you add support for the CF filesystem at compile time. It's an item in "Configure Kernal" - check the box for VFAT support. Then build the Kernal and upload it to flash ROM. 

 

So after you log into uClinux, plug in the CF card. You should get a message similar to this: 

# hda: SanDisk SDCFB-8, CFA DISK drive 

ide0 at 0x80900800-0x80900807,0x80900838 on irq 8 

hda: max request size: 128KiB 

hda: 15680 sectors (8 MB) w/1KiB Cache, CHS=245/2/32 

hda: hda1 

 

uClinux thinks the CF is a disk drive named hda1. Mount it as a VFAT filesystem. I put in under /var: 

 

mkdir /var/cfdir 

mount -t VFAT /dev/hda1 /var/ -n 

 

In theory you could put these commands in your /etc/rc file before you compile the file system to mount an installed CF card at boot. 

 

After that you can cd /var/cfdir and read or write files. 

 

Be sure to unmount the CF before removing it from the board. 

umount /dev/hda1 

 

Somewhere in the documentation there is a caveat against booting with the CF installed and another against writing to the CF at all. It might be prudent to test with a blank CF card.
0 Kudos
Altera_Forum
Honored Contributor II
303 Views

To Leslie, you said you had used the qp.zip which has a companion CFcomponent.zip: 

-Have you been able to compile successfully the CFcomponent zip file's project "cf_ide_test"? 

I tried it for 1S40fullfeatured using NIOSII V1.01 but got compile errors (see below); did you have to modify any code (eg# define CF_IDE_BASE , "cf",....) and which version of NIOSII you used? maybe V1.01 is too new?) 

 

-besides this test, does ALtera have any other test to verify the inserted CFcard works or not? 

The "board_diag" project in the installation only test the onboard flash chip, not the CFcard 

Thanks # #################################################### 

 

Error *** [obj/ideutils.o] Error 1 cf_ide_test_0_1s40  

Error # error This IDE utility requires a CompactFlash Interface component named "cf" ideutils.c cf_ide_test_0_1s40 line 16 

Error altera_avalon_cf_regs.h: No such file or directory ideutils.c cf_ide_test_0_1s40 line 29 

Error error: `CF_IDE_BASE' undeclared (first use in this function) ideutils.c cf_ide_test_0_1s40 line 78 

Error error: (Each undeclared identifier is reported only once ideutils.c cf_ide_test_0_1s40 line 78 

Warning implicit declaration of function `IORD_ALTERA_AVALON_CF_IDE_STATUS' ideutils.c cf_ide_test_0_1s40 line 78 

Error error: `CF_CTL_BASE' undeclared (first use in this function) ideutils.c cf_ide_test_0_1s40 line 86 

Warning implicit declaration of function `IORD_ALTERA_AVALON_CF_CTL_STATUS' ideutils.c cf_ide_test_0_1s40 line 86 

Error error: `ALTERA_AVALON_CF_CTL_STATUS_PRESENT_MSK' undeclared (first use in this function) ideutils.c cf_ide_test_0_1s40 line 87 

Error error: `CF_IDE_BASE' undeclared (first use in this function) ideutils.c cf_ide_test_0_1s40 line 120 

Warning implicit declaration of function `IORD_ALTERA_AVALON_CF_IDE_ALTERNATE_STATUS' ideutils.c cf_ide_test_0_1s40 line 120 

Error error: `CF_IDE_BASE' undeclared (first use in this function) ideutils.c cf_ide_test_0_1s40 line 150 

Warning implicit declaration of function `IORD_ALTERA_AVALON_CF_IDE_ERROR' ideutils.c cf_ide_test_0_1s40 line 165 

Error error: `CF_IDE_BASE' undeclared (first use in this function) ideutils.c cf_ide_test_0_1s40 line 195 

Error error: `CF_IDE_BASE' undeclared (first use in this function) ideutils.c cf_ide_test_0_1s40 line 216 

Error error: `CF_IDE_BASE' undeclared (first use in this function) ideutils.c cf_ide_test_0_1s40 line 237 

Error error: `CF_IDE_BASE' undeclared (first use in this function) ideutils.c cf_ide_test_0_1s40 line 257 

Error error: `CF_IDE_BASE' undeclared (first use in this function) ideutils.c cf_ide_test_0_1s40 line 289 

Warning implicit declaration of function `IOWR_ALTERA_AVALON_CF_IDE_DEVICE_HEAD' ideutils.c cf_ide_test_0_1s40 line 289 

Warning implicit declaration of function `IOWR_ALTERA_AVALON_CF_IDE_DEVICE_CONTROL' ideutils.c cf_ide_test_0_1s40 line 293 

Warning implicit declaration of function `IORD_ALTERA_AVALON_CF_IDE_SECTOR_COUNT' ideutils.c cf_ide_test_0_1s40 line 378 

Warning implicit declaration of function `IORD_ALTERA_AVALON_CF_IDE_SECTOR_NUMBER' ideutils.c cf_ide_test_0_1s40 line 379 

Warning implicit declaration of function `IORD_ALTERA_AVALON_CF_IDE_CYLINDER_LOW' ideutils.c cf_ide_test_0_1s40 line 380 

Warning implicit declaration of function `IORD_ALTERA_AVALON_CF_IDE_CYLINDER_HIGH' ideutils.c cf_ide_test_0_1s40 line 381 

Warning implicit declaration of function `IORD_ALTERA_AVALON_CF_IDE_DEVICE_HEAD' ideutils.c cf_ide_test_0_1s40 line 382 

Error error: `CF_IDE_BASE' undeclared (first use in this function) ideutils.c cf_ide_test_0_1s40 line 415 

Error error: `CF_IDE_BASE' undeclared (first use in this function) ideutils.c cf_ide_test_0_1s40 line 495 

Warning implicit declaration of function `IORD_ALTERA_AVALON_CF_IDE_DATA' ideutils.c cf_ide_test_0_1s40 line 513 

Error error: `CF_IDE_BASE' undeclared (first use in this function) ideutils.c cf_ide_test_0_1s40 line 556 

Warning implicit declaration of function `IOWR_ALTERA_AVALON_CF_IDE_SECTOR_COUNT' ideutils.c cf_ide_test_0_1s40 line 556 

Warning implicit declaration of function `IOWR_ALTERA_AVALON_CF_IDE_SECTOR_NUMBER' ideutils.c cf_ide_test_0_1s40 line 557 

Warning implicit declaration of function `IOWR_ALTERA_AVALON_CF_IDE_CYLINDER_LOW' ideutils.c cf_ide_test_0_1s40 line 558 

Warning implicit declaration of function `IOWR_ALTERA_AVALON_CF_IDE_CYLINDER_HIGH' ideutils.c cf_ide_test_0_1s40 line 559 

Warning implicit declaration of function `IOWR_ALTERA_AVALON_CF_IDE_COMMAND' ideutils.c cf_ide_test_0_1s40 line 566 

Error error: `CF_IDE_BASE' undeclared (first use in this function) ideutils.c cf_ide_test_0_1s40 line 591 

Error error: `CF_IDE_BASE' undeclared (first use in this function) ideutils.c cf_ide_test_0_1s40 line 632 

Warning implicit declaration of function `IOWR_ALTERA_AVALON_CF_IDE_DATA' ideutils.c cf_ide_test_0_1s40 line 670 

Error error: `CF_IDE_BASE' undeclared (first use in this function) ideutils.c cf_ide_test_0_1s40 line 810 

Error error: `CF_IDE_BASE' undeclared (first use in this function) ideutils.c cf_ide_test_0_1s40 line 970 

Error error: `CF_IDE_BASE' undeclared (first use in this function) ideutils.c cf_ide_test_0_1s40 line 1080 

Error error: `CF_CTL_BASE' undeclared (first use in this function) ideutils.c cf_ide_test_0_1s40 line 1216 

Error error: `ALTERA_AVALON_CF_CTL_STATUS_PRESENT_MSK' undeclared (first use in this function) ideutils.c cf_ide_test_0_1s40 line 1217 

Error error: `CF_IDE_BASE' undeclared (first use in this function) ideutils.c cf_ide_test_0_1s40 line 1242 

Error error: `ALTERA_AVALON_CF_CTL_STATUS_POWER_MSK' undeclared (first use in this function) ideutils.c cf_ide_test_0_1s40 line 1943 

Error error: `CF_CTL_BASE' undeclared (first use in this function) ideutils.c cf_ide_test_0_1s40 line 1943 

Warning implicit declaration of function `IOWR_ALTERA_AVALON_CF_CTL_CONTROL' ideutils.c cf_ide_test_0_1s40 line 1943 

Error error: `CF_IDE_BASE' undeclared (first use in this function) ideutils.c cf_ide_test_0_1s40 line 1954 

Error error: `CF_CTL_IRQ' undeclared (first use in this function) ideutils.c cf_ide_test_0_1s40 line 1977 

Error error: `ALTERA_AVALON_CF_CTL_STATUS_IRQ_EN_MSK' undeclared (first use in this function) ideutils.c cf_ide_test_0_1s40 line 1979 

Error error: `CF_IDE_IRQ' undeclared (first use in this function) ideutils.c cf_ide_test_0_1s40 line 1982 

Error error: `ALTERA_AVALON_CF_IDE_CTL_IRQ_EN_MSK' undeclared (first use in this function) ideutils.c cf_ide_test_0_1s40 line 1983 

Warning implicit declaration of function `IOWR_ALTERA_AVALON_CF_IDE_CTL' ideutils.c cf_ide_test_0_1s40 line 1983 

Error error: `CF_CTL_BASE' undeclared (first use in this function) ideutils.c cf_ide_test_0_1s40 line 1999 

Error error: `CF_IDE_IRQ' undeclared (first use in this function) ideutils.c cf_ide_test_0_1s40 line 2002 

Error error: `CF_CTL_IRQ' undeclared (first use in this function) ideutils.c cf_ide_test_0_1s40 line 2003
0 Kudos
Reply