BEAGLEBONE BLACK: ACCESSING uSD AND USB STORAGE
ACCESSING THE uSD CARD
Once the operating system is flashed to the internal eMMC, the uSD card can be used as storage and it is a convenient means to store music tracks.
The command “fdisk -l” will list all the storage devices seen by the operating system:
Here is without any devices in the uSD slot. Listed is the internal eMMC storage device (listing only relevant parts):
After inserting a 32MB uSD card we see this additional device:
After inserting a 2 GB uSD card we see this device instead:
We realize that the any card inserted in the uSD slot is characterized by “/dev/mmcblk1p1”. “mmc” stands for “multimedia card” -both SD cards and eMMC devices conform to the “multimedia card” specification. “blk1” I think represents “block device 1” and “p1” is “partition 1”
However, if the uSD card is already inserted during, we see the following:
The device is assigned /dev/mmcblk0p1. It appears the the order the device numbers are assigned at boot time is uSD card first, then internal eMMC.
Mounting the uSD card
In order to access the contents on the uSD card, the device must be first mounted. First create a “mount point” (a folder). Here I use the directory /media which is already present. Under /media create a directory to mount the uSD card. I created /media/card, /media/usb and /media/nas to represent the 3 different places where music tracks can be stored.
Use the command “mount”
The “-v” flag in “mount” is optional. Means “verbose”. Notice that after mounting the uSD card, I can see the “smallmusic” directory and 1 mp3 track.
Keep in mind that if the uSD card is already inserted at boot time, it is assigned “mmcblk0p1” instead of “mmcblk1p1”
ACCESSING USB MEMORY STICK
If digital audio is transmitted through the I2S interface, then the USB host can also be used for a USB memory device.
The same procedure can be used to mount a usb memory stick:
- Insert a USB storage to the USB host connector
- Type “fdisk -l” to identify the device. Notice that it is /dev/sda1
- Type mount /dev/sda1 /”mount point” in my case, mount /dev/sda1 /media/usb
Inserting a USB storage device will show up as:
Since there is only one usb host port, a USB memory device will always appear as /dev/sda1 whether it is present during boot or not.
AUTOMATING THE MOUNT PROCESS
It becomes cumbersome to have to access the board through the command line in order to mount a storage device. For a music device, the ideal is to have these storage devices mounted automatically.
I tried different ways to auto-mount the devices when they are inserted:
- Autofs: looks like the most promising but did not work in my installation while following this excellent guide [link]
- usbmount: works well with uSD cards and USB storage at any time after boot, but when deleting the X11 package, it wound fail to mount uSD cards. usbmount was last updated in 2007 and is currently unmaintained.
- Add mount instructions in /etc/fstab which is invoked only during boot time.
For now the “best” option in my environment seems using /etc/fstab and ensuring the storage devices are present during boot. This seems a reasonable configuration for an audio player: Insert the storage devices and turn-on the device. Even if switching to another storage device requiring a reboot, the booting process is very short.
usbmount has better functionality because it works after boot. I didn’t like the fact that it stopped working for SD cards after I removed the X11 package (which I do not need). I’ll wait for more help on autofs and then I think I’ll switch to autofs.
For USB I added the following line to the /etc/fstab file.
Note the following:
- Add the “nofail” option. Without it the board will not be able to boot if no USB memory is present in the USB port.
- Ensure that the USB memory has a single partition since we are assuming it is always /dev/sda1. A newly formatted USB memory device will have a single partition
For the uSD Card and assuming that the card is inserted prior to boot, I added the following line:
Insert a uSD card and a USB memory device, boot the board and they will be mounted under /media/card and /media/usb (or whatever directory you had specified in /etc/fstab.
Leave a comment Cancel reply
Recent Posts
- 10-Year old SMPS design still an excellent performer
- New Review and In-Depth Analysis of Hypex UCD-180HG
- Alpair 12p In Cabinets
- Firmware v 0.99
- Soekris DAC: Modding VRef
- R2R DAC Benchmark Filters (for now)
- dam 1021 R2R More Mods…
- Digital Filters for Soekris R-2R DAC
- Soekris dam 1021 R-2R DAC ILLUSTRATED GUIDE
- BBB DAC DEVELOPMENTS
- dam1021 R-2R DAC MODs
- Soekris dam1021 Build
- Raspberry Pi 2
- The Soekris R-2R DAC: Technical Details
- INSIDE MARANTZ AV RECEIVER
Latest Comments
Arduino
Theory
- Choosing and Using Bypass Caps
- Complete List of Linear Tech Application Notes
- Decoupling, Bypassing, Layout
- FIR Filter Tutorial
- Grounding Data Converters
- Intro to FIR Digital Filters
- Intuitive Guide to Principles of Communications
- Rakon Jitter Whitepaper
- Reduce EMI, RFI
- Successful PCB grounding with mixed-signal chips
- The Scientist and Engineer's Guide to Digital Signal Processing
- Tutorials and other Resources
- USB Power
Tools for DIYaudio
- % to dB Calculator
- Audio Equipment Database
- Best Solder
- Circuit simulation
- Generate DSD128 and DSD256
- Hex<->Binary<->Decimal Converter
- IC Manufacturer's LOGOs
- Inductor markings
- Inside Audio Equipment
- Jitter Calculator
- LOTs of Calculators
- Schematics
- Service Manuals
- SMD Codebook
- SMD Marking Code Search
- SMD Markings
- Tantalum Capacitor Markings
Just to know, in the hope to be not useless, each time you would need to mount agn a unmounted data disk that wasn’t there at the boot time do it with:
root# mount -a
The same will work if you have exchanged any data unmountable disk, doing at first, i.e.
root#umount /media/usb
Then the next command after you have inserted a new one media card/key (even the same you had umounted BTW) will be easy and clever:
root# mount -a
Maybe it is like mount automate, reads the /etc/fstab and mount any valid entry found
Almost the same as at the boot time. This would mean that on each bout /etc/fstab will be read and all the disk partitions – mount points are to be mounted exactly in the same order and in the same places for the OS at the specified boot level.
Maybe also the ‘df’ command, with all its switches …, will work.
That’s much easy than using ‘fdisk -l’ … on my poor mind.
That’s since BSD, mount, the first. I don’t remember about ‘df’. Several UNIX flavours have had changes for that last.
Ciao.
Salvo
PS TU for all UR work, that’s really interesting from several points of view.
Thanks for sharing.
My concern is that as a music player, I would set it up totally headless. (of course in order to play a track, I would have to use the command line, but I have not thought of this part yet :-)). I did try autofs but couldn’t figure out why it would not work, so I gave up…
Another great post! you mentioned “low noise power supplies”. Can you prove some links?
errr….provide some links 🙂
For the moment I am using a linear 5V, 1A supply that came with an old ZIP drive. A linear supply (those bigger and heavier transformer-based) are lower noise than the newer switching types.
buffalo web design
izmir beydag escort bayan sitesi
escorte timisoara
mspy reviews
Can someone please tell me how i can transfer the data from the USB onto the BBB?