Forum Discussion
Altera_Forum
Honored Contributor
21 years agoMounting usb flash stick
I am developing a USB IP core, and I am now at the stage where I am attempting to create a uClinux driver.
With the new driver compiled into the kernel, and debug messages enabled, I see the following when I insert a flash stick. console text (http://www.base2designs.com/console_text.txt) As far as I can tell, when the flash stick is inserted, it is correctly detected, but then again I'm not too sure what all the messages mean. Could somebody take a look at the console messages, and tell me if there are any problems that I should be investigating. If all is well, and the flash stick is indeed correctly attached, how do I get read write access. I've read in places that I should add a line to my /etc/fstab file, but I cannot find the fstab file. I tried; mount -n /dev/sda /mnt/ide0 but no success.cat /proc/partitions
major minor # blocks name
3 0 62976 hda
3 1 62960 hda1
31 0 4096 mtdblock0
31 1 2048 mtdblock1
31 2 1024 mtdblock2
31 3 1024 mtdblock3
8 0 63488 sda
8 1 63457 sda1# mount -n /dev/sda /mnt/ide0
mount -n /dev/sda /mnt/ide0
mount: special device /dev/sda does not exist14 Replies
- Altera_Forum
Honored Contributor
--- Quote Start --- originally posted by sfielding@Jun 22 2005, 03:38 PM
--- Quote End --- You need to mount the partition, not the device, try# mount -n /dev/sda /mnt/ide0 mount -n /dev/sda /mnt/ide0 mount: special device /dev/sda does not existmount -n -t vfat /dev/sda1 /mnt/usb - Altera_Forum
Honored Contributor
Thanks marc, that helped.
It turned out that I also needed to add some nodes to the filesystem; @sda,b,8,0 @sda1,b,8,1 Hopefully I got this correct? So, now when I mount the USB partition I get
What could cause "FAT: codepage cp437 not found" ? I believe that the formatting is correct;mount -n -t vfat /dev/sda1 /mnt/usb FAT: codepage cp437 not found mount: wrong fs type, bad option, bad superblock on /dev/sda1, or too many mounted file systems#Disk /dev/sda: 65 MB, 65011712 bytes 2 heads, 62 sectors/track, 1024 cylinders Units = cylinders of 124 * 512 = 63488 bytes Device Boot Start End Blocks Id System /dev/sda1 1 1024 63457 b Win95 FAT32 - Altera_Forum
Honored Contributor
--- Quote Start --- originally posted by sfielding+jun 23 2005, 05:49 am--><div class='quotetop'>quote (sfielding @ jun 23 2005, 05:49 am)</div>--- quote start ---
thanks marc, that helped.
it turned out that i also needed to add some nodes to the filesystem;
@sda,b,8,0
@sda1,b,8,1
hopefully i got this correct?[/b]
--- quote end ---
looks right.
$ ls -al /dev/sda* brw-rw---- 1 root disk 8, 0 2002-03-14 22:51 /dev/sda brw-rw---- 1 root disk 8, 1 2002-03-14 22:51 /dev/sda1<!--quotebegin-sfielding@Jun 23 2005, 05:49 AM so, now when i mount the usb partition i get
mount -n -t vfat /dev/sda1 /mnt/usb fat: codepage cp437 not found mount: wrong fs type, bad option, bad superblock on /dev/sda1, or too many mounted file systems#what could cause "fat: codepage cp437 not found" ? --- Quote End --- This looks to my like you either did not compile vfat support in your kernel
(or =y in case you want it compiled in instead of a module), or some NLS settings:$ cat /usr/src/linux-2.6.12/.config |grep VFAT CONFIG_VFAT_FS=m
but since I never actively remember setting them myself, I would assume they are set by selecting the VFAT configuration. --- Quote Start --- originally posted by sfielding@Jun 23 2005, 05:49 AM i believe that the formatting is correct;$ cat /usr/src/linux-2.6.12/.config |grep 437 CONFIG_FAT_DEFAULT_CODEPAGE=437 CONFIG_NLS_DEFAULT="cp437" CONFIG_NLS_CODEPAGE_437=y
--- Quote End --- looks right, at least the default crappy formatting of USB sticks seems already cleared http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/laugh.gifdisk /dev/sda: 65 mb, 65011712 bytes 2 heads, 62 sectors/track, 1024 cylinders units = cylinders of 124 * 512 = 63488 bytes device boot start end blocks id system /dev/sda1 1 1024 63457 b win95 fat32 - Altera_Forum
Honored Contributor
You can find the codepage stuff in the kernel configuration under
File systems ---> Native Language Support ---> Dennis Scott Microtronix Datacom - Altera_Forum
Honored Contributor
It works now!
I added the approprite character set support to the kernel, and all is well. Thanks for your help marc and dennis. It is much appreciated. - Altera_Forum
Honored Contributor
Hello sfielding,
did you make an SOPC Builder USB component ? Is this for commercial use and/or in any kind of open source licensing ? We are looking a USB core for Nios2, and if there is a free (or cheap) way to do it, I would be glad to know :-). Could you give me more info (is this a full USB core, or an IP to connect to an USB chipet, or else ) ? Best regards, pod - Altera_Forum
Honored Contributor
Well, after a few search, I guess it is the opencores project at
http://www.opencores.org/pdownloads.cgi/li...st/usbhostslave (http://www.opencores.org/pdownloads.cgi/list/usbhostslave) regards, pod - Altera_Forum
Honored Contributor
Hello cetic,
I will be updating the Opencores project this week of June 27th. In case you are interested, I will be making the uClinux driver available in the downloads section, of the Opencores project. I may build the SOPC Builder component too, it depends how much time I have. If I don't, the core comes with a top level wrapper, that adapts the Opencores Wishbone bus to the Altera Avalon bus, using the Avalon naming convention, so it is easier to import. - Altera_Forum
Honored Contributor
Hello sfielding,
Thank you for contributing to the opensource community http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/smile.gif . I would be very happy too if you could post the uClinux driver. Thanks a lot, Pod - Altera_Forum
Honored Contributor
One more question, sfielding :
you say in the opencores project that the 50MHz oscillator on the Altera Nios evalboard must be changed by a 48MHz oscillator. I suppose this is because the USB ip in the FPGA must run at a specific frequency that cannot be generated by a PLL from the original 50MHz. Is this true ? If yes, what is that frequency ? Thanks again, Best regards Pod