2.2 Setting Up the Linux Environment
The Linux binaries that run in ATSAMA5D27-SOM1-EK1 are generated using Buildroot (https://buildroot.org/), a tool to generate embedded Linux systems through cross-compilation. Microchip provides its own version of Buildroot which includes kernel, cross compiler and rootfs for ATSAMA5D27-SOM1-EK1. More information can be found at:
- http://www.at91.com/linux4sam/bin/view/Linux4SAM/BuildRootBuild#How_to_build_Buildroot_for_AT91
- https://www.at91.com/linux4sam/bin/view/Linux4SAM/Sama5d27Som1EKMainPage
- ftp://www.at91.com/pub/demo/linux4sam_5.8/
- Install packages not included in
the Linux distribution (For more information about the system requirements, see
buildroot.uclibc.org/downloads/manual/manual.html#requirement.):
$ sudo apt-get install sed make binutils build-essential gcc g++ bash patch $ sudo apt-get install gzip bzip2 perl tar cpio python unzip rsync file bc wget $ sudo apt-get install libncurses5-dev libncursesw5-dev bzr cvs git mercurial $ sudo apt-get install subversion graphviz python-matplotlib
- Download the sources of the
Microchip Buildroot (this application note is based on version
5.8):
$ git clone https://github.com/linux4sam/buildroot-at91.git $ git clone https://github.com/linux4sam/buildroot-external-microchip.git $ cd buildroot-external-microchip $ git checkout linux4sam_5.8 -b buildroot-external-microchip-linux4sam_5.8 $ cd .. $ cd buildroot-at91 $ git checkout linux4sam_5.8 -b buildroot-at91-linux4sam_5.8
- Build the Microchip Buildroot
rootfs
image:
$ BR2_EXTERNAL=../buildroot-external-microchip/ make atmel_sama5d27_som1_ek_mmc_dev_defconfig $ make
- Customize the buildroot and save
the configuration:
$make menuconfig
Enable the following configurations/packages if needed:
- \Target Packages\Networking applications\iputils (BR2_PACKAGE_IPUTILS=y)
- \Target Packages\Networking applications\openssh (BR2_PACKAGE_OPENSSH=y )
- \Target Packages\Databases\sqlite3 (BR2_PACKAGE_SQLITE=y)
- \Target Packages\Text and terminal handling\ncurses (BR2_PACKAGE_NCURSES=y)
- \Target Packages\Text and terminal handling\readline (BR2_PACKAGE_READLINE=y)
- Run the Buildroot
compilation:
$make
Buildroot downloads and compiles all the packages required, so it may take quite a long time. After this point, the kernel, cross-compiler and rootfs are ready to flash your system.
- If a USB serial port is used to
connect the Linux Host to the PRIME BN modem, it is necessary to compile some
additional Linux Drivers. To do that, in the kernel
configuration:
$make linux-menuconfig
If using a PL360G55 board, enable the Atmel USB support as a module:- \Device Drivers\usb\gadget\udc\“atmel_usba_udc"
If using an ATPL360 board, enable the CDC-ACM USB class support as module:- \Device Drivers\usb\class\“cdc-acm”
If using an ATPL230BN board, enable the CP210X USB serial support as module:- \Device Drivers\usb\serial\“cp210x”
$make linux-build
- Create the SD
image:
$make
- After compiling all the binaries
needed, update the SD card image to be mounted on SAMA5D27-SOM1-EK1 with the
correct binaries located
in:
buildroot-at91/output/images/sdcard.img
- Insert the SD card in the MMC/SD card connector (J12)
- Connect the USB Micro-AB cable to connector J10 (JLINK-OB)
- Connect the another end of the cable to a free port of your PC
- Open a terminal (console 115200, N, 8, 1) on your PC
- Reset the baseboard. A start-up message appears on the console
To use the Ethernet connector and easily access the SAMA5D27-SOM1-EK1, configure a new IP address:
$ ip address add 192.168.1.102/24 dev eth0
$ ifconfig eth0 up
So, in this case, <target-ip-address> is 192.168.1.102 .