Downloading image and boot from SD card - Linux

Downloading necessary files

SD card images are available here , however we will be using wget to download them. First we obtain the kernel, rootfs and device tree:

wget ftp://downloads.globalscaletechnologies.com/Downloads/Espressobin/3700_buildroot/kernel.tar.gz
wget ftp://downloads.globalscaletechnologies.com/Downloads/Espressobin/3700_buildroot/rootfs.tar.gz

Clearing and partitioning SD card

Connect the SD card to your Linux PC and hit lsblk to check block devices (although the SD card will most likely be */dev/mmcblk0*):

~$ lsblk
sda           8:0    0 238.5G  0 disk
├─sda1        8:1    0   512M  0 part /boot
└─sda2        8:2    0   238G  0 part /
sr0          11:0    1  1024M  0 rom
*mmcblk0*     179:0    0   478M  1 disk
└─mmcblk0p1 179:1    0   478M  1 part

Next we must clear everything from that SD card:

sudo dd if=/dev/zero of=/dev/mmcblk0 bs=1M count=100

This is followed by creating two partitions on the SD card and formatting the first as FAT32 and the second as ext4. Note that you will need to do this as root:

sudo su
(echo n; echo p; echo 1; echo ''; echo +100M; echo t; echo 6; echo n; echo p; echo 2; echo ''; echo ''; echo w) | fdisk /dev/mmcblk0
mkfs.vfat -F16 /dev/mmcblk0p1
mkfs.ext4 /dev/mmcblk0p2

The next step is, of course, to mount these partitions and copy necessary files into each one. Files from kernel.tar.gz will be extracted to our first partition whereas the device tree from rootfs.tar.gz will be extracted to our second partition:

mkdir /mnt/p1/ && mkdir /mnt/p2
mount /dev/mmcblk0p1 /mnt/p1
tar -xzf kernel.tar.gz -C /mnt/p1
mount /dev/mmcblk0p2 /mnt/p2
tar -xzf rootfs.tar.gz --strip-components=3 -C /mnt/p2

We then synchronize the data on disk with memory, unmount the partitions and exit sudo:

umount /mnt/p1 && rm /mnt/p1 -r
umount /mnt/p2 && rm /mnt/p2 -r

U-Boot environment

Our SD card now has necessary image files on it. We can then plug the SD card into the SD card slot on the ESPRESSObin, plug the adapter and connect via USB serial connection to the board as described in Quick User Guide under Serial connection.

For the ESPRESSObin to boot the image on the SD card, we must configure U-Boot environment variables to do so. When the boot starts, hit any key to stop autoboot and you should get the Marvell prompt:

Hit any key to stop autoboot:
Marvell>> tttt<INTERRUPT>

Here we can set needed U-Boot variables for SD card booting:

setenv get_images 'mmc dev 0;mmc info; fatload mmc 0 $kernel_addr image;
fatload mmc 0 $fdt_addr armada-3720-community.dtb'
setenv root 'root=/dev/mmcblk0p2 rw'
setenv set_bootargs 'setenv bootargs $console $root'
setenv ethact 'neta0'

Using saveenv means that this environment is now saved and will be used on every subsequent booting until it is changed. All that is left is to boot the board with the boot command:

Marvell>> boot