{{WarningMessage|text=This application technical note was validated against specific versions of hardware and software. It may not work with other versions.}}[[Category:MISC-AN-TN]][[Category:MISC-TN]][[Category:IoT]]
__FORCETOC__
== History ==
{| class="wikitable" border="1"
|July 2019
|First public release
|-
|1.0.1
|October 2019
|Detailed armbian version
|-
|}
==Introduction==
In the last years, Debian-based distributions—which are very widespread in desktop/server environments—have grown in popularity in the embedded world as well. Nowadays, there are several approaches to create such a distribution for embedded targets, however. [https://elbe-rfs.org/ ELBE], [https://github.com/zuka0828/meta-eid meta-eid], and [https://www.armbian.com/ armbian] are just three examples of different tools available today [1].
This Technical Note shows how to run such a distribution on SBCSPG, a product designed and manufactured by DAVE Embedded Systems to build compact IoT gateways for industrial applications. Specifically, this example makes use of '''Armbian Stretch''', which is based on Debian 9.
[1] For more details, please see for instance these presentations:
* [https://events.linuxfoundation.org/wp-content/uploads/2017/12/ELCE2018_Debian-Yocto-State-of-the-Art_r6_Kazuhiro-Hayashi.pdf Debian & Yocto: State of the Art (Oct 23rd, 2018)]
* [https://elinux.org/images/4/42/ELBE-Isar-Deby_jamboree63_r2.pdf Debian + YoctoProject Based Projects: Collaboration Status (Dec 1st, 2017)]
==The hardware platform==
As stated previously, the SBCSPG gateway is suited to implement low-cost edge computing devices.
[[File:Edge-v-cloud-computing-graphic.png|thumb|center|600px|Cloud and Edge computing in a typical IIoT scenario (image source: [https://www.openautomationsoftware.com/wp-content/uploads/2017/04/edge-v-cloud-computing-graphic.png])]]
From an architectural standpoint, SBCSPG is similar to the [[:Category:SBC_Lynx|SBC Lynx]]. As such, it is powered by NXP i.MX6UL system-on-chip (SoC).
It is equipped with three network interfaces—two Ethernet ports and a WiFi—and provides several combinations of serial ports like RS232, RS485, and RS422. It also has two USB ports (host and OTG) and a microSD slot.
==Creating the root file system==
To create the root file system, the procedure described [https://github.com/armbian/build here] was followed. Before starting the actual build process, the following patch was applied in order to add the support for the SBCSPG target.
As <code>root</code>, copy the files from <code>/mnt/tmp/</code> to the desired partition into the microSD card.
After the copy operation is finished, unmount the microSD card and move it to the target.
To configure the SBCSPG to mount the root file system from this partition, several options are available. The following example shows how the U-Boot environment variables were set to retrieve the Linux kernel image and the device tree blob (DTB) via Ethernet, while the file system is mounted from the microSD card. In practice, an ad hoc variable—named <code>net_mmc</code>—was added:
<pre class="board-terminal">
=> print net_mmc
net_mmc=run loadk loadfdt mmcargs addip addcons addmisc; if run configid_fixupfdt; then bootm ${loadaddr} - ${fdtaddr}; fi
=> edit mmcroot
edit: /dev/mmcblk0p4 rootwait rw
</pre>
The following section shows the full boot process.
===Full bootstrap process===
To expand the box, please click on the ''Expand'' link on the right.
[ 11.843132] systemd[1]: dev-hugepages.mount: Couldn't determine result for ConditionVirtualization=!private-users, assuming failed: No such file or directory
[ 11.900340] systemd[1]: Listening on /dev/initctl Compatibility Named Pipe.
[ OK ] Listening on /dev/initctl Compatibility Named Pipe.
[ 11.963804] systemd[1]: Started Dispatch Password Requests to Console Directory Watch.
[ OK ] Started Dispatch Password Requests to Console Directory Watch.
[ 11.993304] systemd[1]: Reached target Paths.
[ OK ] Reached target Paths.
[ 12.013641] systemd[1]: Listening on Syslog Socket.
[ OK ] Listening on Syslog Socket.
[ 12.043481] systemd[1]: Listening on fsck to fsckd communication Socket.
[ OK ] Listening on fsck to fsckd communication Socket.