{{WarningMessage|text=This application note was validated against specific versions of the kit only. It may not work with other versions. Supported versions are listed in the ''History'' section.}}
== History ==
{| class="wikitable" border="1"
|}
==Introduction==
By default, [[AXEL_ULite_and_SBC_Lynx_Embedded_Linux_Kit_(XUELK)|AXEL ULite and SBC Lynx Embedded Linux Kit (XUELK)]] comes with a Yocto distribution. Nevertheless, other distributions can be used as well. This application note shows how to run one of them, [https://openwrt.org OpenWrt].
Generally speaking, OpenWrt is particularly suited for networking devices such as routers and access points. As such, it can be very useful when used in combination with SBC Lynx , to address similar networking-related use cases.
An exhaustive discussion of OpenWrt is beyond the scope of this application note. For more information, please refer to [https://openwrt.org the project's home page].
The test bed used for this application note is composed of the same hardware/software platform delivered along with the XUELK. The only relevant difference is related to the root file system. The default one will be replaced with the one generated by the OpenWrt build process, as described in the follwing sections.
==Donwloading, configuring and building==
This process is straightforward. Once the The following commands can be used to generate a root file [https://buildroot.org/downloads/buildrootsystem for ARM Cortex-2016.11.2.tar.gz <code>buildroot-2016.11.2.tar.gz</code>] is downloaded and decompressed on your Linux host machine, get into the Buildroot directoryA7 target, and run <code>make menuconfig</code>such as SBC Lynx.
Then enter First of all, download the required files:<codepre>Target optionsgit clone https://github.com/openwrt/openwrt.gitcd openwrt/./scripts/feeds update -a./scripts/feeds install -a</codepre> Enter the configuration menu and in order to select:*the proper <code>ARM (little endian)Target System</code> for and <code>Target ArchitectureSubtarget</code>*<codepre>cortex-A7make menuconfig</code> for <code>Target Architecture Variant</codepre>as shown in the following picture.[[File:Buildroot-cortex-A7pictures.png|thumb|center|600px|]]
That's it[[File: after saving your configuration, and exiting Openwrt-menuconfig1.png|thumb|center|600px|<code>menuconfigTarget System</code>, you can start the build process by simply issuing the <code>make</code> command.selection]]
==Mounting the Buildroot file system on the target==Once the build process is completed, in the <code>output/images</code> subdirectory the file [[File:Openwrt-menuconfig2.png|thumb|center|600px|<code>rootfs.tarSubtarget</code> is available. This file contains the root file system for the target.selection]]
In this example, this file was untarred on a NFS server, in order to mount it via NFS protocol by Start the target. The following dump shows the serial console messages, printed out by the target during the boot build process:<pre>make defconfigmake V=s</pre>
Once the build process is completed, the root file system is available in the <pre class="mwcode>openwrt/build_dir/target-collapsible mwarm_cortex-collapsed">Ua7+neon-Boot 2015.04-xuelkvfpv4_musl-1.1.016_eabi/root-00004-g007c1d7 (Feb 03 2017 - 15:39:12)brcm2708</code> subdirectory.
CPU: Freescale i.MX6UL rev1.1 at 396 MHzCPU: Temperature 39 CReset cause: POREnvironment: SPI FlashI2C: readyDRAM: WARNING: SOM ConfigID on block 0 is UNLOCKEDWARNING: SOM ConfigID ==Mounting the OpenWrt file system on block 0 is UNLOCKED512 MiBWARNING: SOM ConfigID on block 0 is UNLOCKEDWARNING: SOM ConfigID on block 0 is UNLOCKEDPMIC: PFUZE300 DEV_IDthe target=0x30 REV_ID=0x11NAND: 1024 MiBMMC: WARNING: SOM ConfigID on block 0 is UNLOCKEDWARNING: SOM ConfigID on block 0 is UNLOCKEDFSL_SDHC: 0SF: Detected S25FL256S_64K with page size 256 BytesIt seems that the OpenWrt file system does not work if mounted [[AXEL_ULite_and_SBC_Lynx_Embedded_Linux_Kit_(XUELK)#Target_configuration_for_the_development_stage_.28net_nfs.29|over NFS]]. To overcome this hurdle, erase size 64 KiB, total 32 MiBIn: serialOut: serialErr: serialMMC: no we can copy the file system to the <code>ext3</code> partition of the microSD card presentWARNING: SOM ConfigID on block 0 is UNLOCKEDSOM ConfigID#: 00000010SOM UniqueID#: e6b3f362:3f3b61d4WARNING: SOM ConfigID on block 0 is UNLOCKEDWARNING: SOM ConfigID on block 0 is UNLOCKEDBoard: MX6UL SBCEXWARNING: SOM ConfigID on block 0 is UNLOCKED.
WARNING: SOM ConfigID on block 0 On host side, make the OpenWrt file system available for the NFS mount. In the following example, the <code>/opt/nfsroot</code> directory - and its subdirectories - is UNLOCKEDexported.Net: WARNING: SOM ConfigID on block 0 is UNLOCKEDWARNING: SOM ConfigID on block 0 is UNLOCKEDFEC0Normal BootHit any key to stop autoboot: 0=<pre> run net_nfsUsing FEC0 devicemkdir /opt/nfsroot/openwrt/root-brcm2708TFTP from server 192.168.0.23; our IP address is 192.168.0.81Filename 'lynxsudo cp -aRv build_dir/linux/xuelktarget-arm_cortex-a7+neon-vfpv4_musl-1.1.0_uImage'.Load address: 0x80800000Loading: #################################################################16_eabi/root-brcm2708/* /opt/nfsroot/openwrt/root-brcm2708/ ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ############## 2 MiB</spre>doneBytes transferred = 6723656 Boot the target using Yocto root file system as root file system, mounted over NFS (669848 hex)Using FEC0 deviceTFTP from server 192.168.0.23; our 80 is the IP address is 192of the NFS server).168Once they target has completed the boot process, mount the directory including OpenWrt root file system.0.81Filename 'lynx/linux/xuelk-1.1.0_imx6ul-lynx-som0010<pre>.dtb'.Load address: 0x83000000Loading: ####### 1.6 MiB/sdoneBytes transferred = 31663 (7baf hex)FDT: override 'som_uniqueid' with 'e6b3f362:3f3b61d4'FDT: override 'cb_uniqueid' with '00000000:00000000'## Booting kernel from Legacy Image at 80800000 Freescale i... Image Name: Linux-MX Release Distro 3.14.52-xuelk-1.1.0 Image Type: ARM Linux Kernel Image (uncompressed) Data Size: 6723592 Bytes = 6.4 MiB Load Address: 80008000 Entry Point: 80008000 Verifying Checksum ... OK## Flattened Device Tree blob at 83000000 Booting using the fdt blob at 0x83000000 Loading Kernel Image ... OK reserving fdt memory region: addr=83000000 size=8000 Using Device Tree in place at 83000000, end 8300afff1 sbc-lynx /dev/ttymxc0
As we used Copy the default configuration, files of the resulting root OpenWrt file system is very small:systems into the <code>ext4</code> partition of the microSD card.
In real world applications, additional packages are usually added by selecting them under the <code>Target packages</code> item of the configuration menu. Just look at the <code>packages</code> directory to see which ones are available out of the box. To add further packages, please refer to [https://buildroot.org/downloads/manual/manual.html#adding-packages this link].
==Booting with OpenWrt root file system==
That target can be rebooted with the [[AXEL_ULite_and_SBC_Lynx_Embedded_Linux_Kit_(XUELK)#Target_setup_and_first_boot|default configuration]], in order to mount the root file system from the <code>ext3</code> partition of the microSD card: