Changes

Jump to: navigation, search

MISC-TN-004: Running Debian (armbian) on SBCSPG

2,334 bytes added, 09:55, 14 February 2020
no edit summary
{{InfoBoxTop}}
{{AppliesToSBCSPG}}
{{AppliesToIoT}}
{{InfoBoxBottom}}
{{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
|-
|}
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 '''armbianArmbian Stretch''', which is based on Debian 9.
==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).
==Deploying the root file system onto the target==
This procedure consists of the following steps:
*Mount the <code>.img</code> file
*Copy the root file system to a microSD card
*Move the microSD card to the target
*Configure the target in order to mount the ''armbian'' root file system from the microSD card.
 
It is assumed that there is an ext4 partition on the microSD card large enough to cointain the ''armbian'' root file system, which is about 900MB.
 
To mount the <code>.img</code> file, issue the following commands.
<pre class="board-terminal">
sudo kpartx -v -a Armbian_5.91_Sbcspg_Debian_stretch_default_.img
</pre>
If this operation is completed succesfully, you'll see something like this:
<pre class="board-terminal">
# ll /dev/mapper/
total 0
drwxr-xr-x 2 root root 80 lug 29 11:52 ./
drwxr-xr-x 21 root root 4440 lug 29 15:50 ../
crw------- 1 root root 10, 236 lug 29 11:41 control
lrwxrwxrwx 1 root root 7 lug 29 11:52 loop18p1 -> ../dm-0
</pre>
And then:
<pre class="board-terminal">
sudo mkdir /mnt/tmp
sudo mount /dev/mapper/loop18p1 /mnt/tmp/ -o ro
</pre>
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.
<pre class="board-terminal mw-collapsible mw-collapsed">
U-Boot 2016.03-rialto-1.1.2 (Jan 17 2019 - 15:10:28 +0100), Build: jenkins-Rialto_U-Boot-10
Normal Boot
Hit any key to stop autoboot: 0
=> 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
=> run net_mmc
FEC0 Waiting for PHY auto negotiation to complete...... done
dave_user, Administrators
5,138
edits

Navigation menu