This post is about being able to access the SD card slot on the xplained board.
First off, we need to log into our xplained board, either use the usb cable and follow the connection guide or read my blog post on accessing it using ssh (http://www.element14.com/community/community/designcenter/sama5d3xplained/blog/2014/10/04/sama5d3-xplained-violet--ssh-into-the-sama5d3-xplained-through-network-cable).
Once your at the command prompt of the xplained board:
type:
cat /etc/fstab
this should produce the following
# stock fstab - you probably want to override this with a machine specific one
rootfs / auto defaults 1 1
proc /proc proc defaults 0 0
devpts /dev/pts devpts mode=0620,gid=5 0 0
usbdevfs /proc/bus/usb usbdevfs noauto 0 0
tmpfs /run tmpfs mode=0755,nodev,nosuid,strictatime 0 0
tmpfs /var/volatile tmpfs defaults 0 0
# uncomment this if your device has a SD/MMC/Transflash slot
#/dev/mmcblk0p1 /media/card auto defaults,sync,noauto 0 0
The part we are interested in is the very bottom line, its been commented out. All we need to do is remove the "#" in order to uncomment it.
The /dev/mmcblk0p1 is the actual device. and the /media/card is where then device will mount to and where we will find the files.
Before we uncomment it, lets make the directory where we would like it mounting since it doesn't yet exist.
type
mkdir /media/card
You can mount it elsewhere by changing the location in the fstab file and creating the physical directory elsewhere, but for the time being lets keep things easy.
next is to uncomment the bottom line in your fstab file:
type
vi /etc/fstab
You will now be in a basic text editor, feel free to do a google search to see how to use it, but for our purposes its very simple. move your cursor to the bottom line using the down arrow and delete the "#" hash character highlighted in bold and underlined below. just navigate to it and press the delete button on your keyboard.
# stock fstab - you probably want to override this with a machine specific one
rootfs / auto defaults 1 1
proc /proc proc defaults 0 0
devpts /dev/pts devpts mode=0620,gid=5 0 0
usbdevfs /proc/bus/usb usbdevfs noauto 0 0
tmpfs /run tmpfs mode=0755,nodev,nosuid,strictatime 0 0
tmpfs /var/volatile tmpfs defaults 0 0
# uncomment this if your device has a SD/MMC/Transflash slot
#/dev/mmcblk0p1 /media/card auto defaults,sync,noauto 0 0
then type
:wq
you need to type the colon first then "wq" then press enter. the colon tells it that we are issuing a command. the"wq" says that we would like to quit and save changes.
you should now be back at the command prompt, lets have a quick look at the file to make sure our changes have been saved:
cat /etc/fstab
we should see
# stock fstab - you probably want to override this with a machine specific one
rootfs / auto defaults 1 1
proc /proc proc defaults 0 0
devpts /dev/pts devpts mode=0620,gid=5 0 0
usbdevfs /proc/bus/usb usbdevfs noauto 0 0
tmpfs /run tmpfs mode=0755,nodev,nosuid,strictatime 0 0
tmpfs /var/volatile tmpfs defaults 0 0
# uncomment this if your device has a SD/MMC/Transflash slot
/dev/mmcblk0p1 /media/card auto defaults,sync,noauto 0 0
virtually the same as before only without the "#" at the beginning of the bottom line, this means that line is now active.
If you insert a card into the sdcard slot and type
mount /dev/mmcblk0p1
The sdcard is now mounted and you will find its contents in /media/card just type
ls /media/card
to retrieve a directory listing of the files on your card. From there, use standard commands to copy, execute files etc.. and the umount command to safely unmount the sdcard before you remove it.
***********************************************TODO**************************************************************
Another thing for my todo list: create a script to auto mount the sdcard when one is inserted