I am one of those who took the challenge to use the SAMA5D4 from the kit. My take on it is to boot using nfs mounted root file system. This would have the advantage that I would have as much space in the root file system as I need and that I could easily do changes to the rootfs without flashing the board again and again. This should dramatically speed up the development process.

Obtaining the rootfs Image

 

I'd like to use one of the large standard distributions so I look for a debian port to the arm architecture and fortunately it exists. But from there I can only download iso install images. Not exactly what I want. But to my rescue armhf.com provides a rootfs image without kernel (scroll to the bottom of the page). That's important, because in this way I can use the kernel provided by atmel which includes the correct drivers.


NFS Server

 

I have a synology NAS which provides network storage over several protocols which include nfs. So I only have to unpack the rootfs to /volume1/rootfs/SAMA5D4 and tell the server about it. For the NAS a gui is provided.

If you want to use a generic linux server just add a line to /etc/exports:

/volume1/rootfs/SAMA5D4 all(rw,sync,root_squash,no_subtree_check)

After this restart the nfs server (on synology this happens automatically):

exportfs -a

service nfs-kernel-server restart

Now the rootfs is provided via nfs.

 

Das U-Boot

 

(German for "the submarine")

Das U-Boot, the Universal Boot Loader is the boot loader used by the system image with which the SAMA5D4 Xplained board ships. To change anything in the boot process I have to change the configuration of U-Boot. This is done on it's own command line which is reached by interrupting the boot process:

 

Hit any key to stop autoboot: 0

=>

Now it's time to look at the documentation. To mount the rootfs through nfs the kernel parameters have to point to the nfs server.

The relevant kernel parameters are taken from https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt:

root=/dev/nfs nfsroot=[<server-ip>:]<root-dir>[,<nfs-options>] ip=<client-ip>:<server-ip>:<gw-ip>:<netmask>:<hostname>:<device>:<autoconf>:<dns0-ip>:<dns1-ip>

To set this parameters use:

=> printenv bootargs

bootargs=console=ttyS0 <......>

 

=> setenv bootargs 'root=/dev/nfs nfsroot=192.168.1.1:/volume1/rootfs/SAMA5D4 console=ttyS0 <......> ip=dhcp'

Printing the content of the bootargs variable is necessary to append the old value to the new one with cut and paste.

Changes are made permanent by 'saveenv' but this should be done after testing.

Now boot the board with the 'bootd' command.

creating NFS state directory: done

starting statd: done

NFS daemon support not enabled in kernel

The kernel is compiled without nfs support. In order for this to work I would need to compile a new kernel. That's bad since time is allready short. I have to find an other solution. Thanks to peteroakes, clem57 and jancumps there is at least a way to use the board. I'll try this route next.