Difference between revisions of "IOT-GATE-IMX8PLUS and SBC-IOT-IMX8PLUS: Yocto Linux: How-To Guide"
(Created page with "= Overview = The example run-time Yocto Linux image for the CompuLab IOT-GATE-IMX8PLUS and SBC-IOT-IMX8PLUS was generated with Kirkstone Yocto build. The image includes the ne...") |
|||
(4 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
= Overview = | = Overview = | ||
− | The example run-time Yocto Linux image for the CompuLab IOT-GATE-IMX8PLUS and SBC-IOT-IMX8PLUS was generated with | + | The example run-time Yocto Linux image for the CompuLab IOT-GATE-IMX8PLUS and SBC-IOT-IMX8PLUS was generated with Scarthgap Yocto build. |
The image includes the needed drivers and utilities to operate the hardware components of the IOT-GATE-IMX8PLUS/SBC-IOT-IMX8PLUS. | The image includes the needed drivers and utilities to operate the hardware components of the IOT-GATE-IMX8PLUS/SBC-IOT-IMX8PLUS. | ||
− | The default | + | The default Scarthgap Yocto image includes many software packages. Among them: |
* Core system | * Core system | ||
* SSH server and client | * SSH server and client | ||
− | * | + | * PulseAudio configuration and usage utilities |
+ | * NetworkManager | ||
* ModemManager | * ModemManager | ||
* Bluez5 Bluetooth tools and daemons | * Bluez5 Bluetooth tools and daemons | ||
− | * | + | |
− | * | + | = Serial Console = |
+ | IOT-GATE-IMX8PLUS / SBC-IOT-IMX8PLUS provides a serial console on the front panel micro-USB '''Console''' connector.</br> | ||
+ | == Connecting to a host PC == | ||
+ | # Use a micro-USB cable to connect the Console connector to a USB port on your host PC. | ||
+ | # Make sure the CP2104 driver is available with your operating system, otherwise install CP2104 driver onto the host PC from https://www.silabs.com/documents/public/software/CP210x_Windows_Drivers_with_Serial_Enumeration.zip | ||
+ | # Identify the host PC interface and port number that will be used for communication with the device: | ||
+ | #* In most Linux PCs, the serial port will be denoted as one of the following (where n is a positive integer): /dev/ttyUSB0, /dev/ttyUSB1 ... /dev/ttyUSBn | ||
+ | #* In Windows PCs, the serial port usually will be denoted as one of the following (where n is a positive integer): COM1, COM2 ... COMn | ||
+ | # Start a terminal emulation program (such as [https://www.putty.org/ PuTTY] on Windows or minicom on Linux). | ||
+ | # In the port configuration section of the terminal emulation program select the port identified in previous step and set the following serial port parameters: | ||
+ | <blockquote> | ||
+ | {{:SB-SOM: serial port parameters table}} | ||
+ | </blockquote> | ||
= Connection and Login = | = Connection and Login = | ||
Line 20: | Line 33: | ||
{{Important|The following examples assume '''root''' user.}} | {{Important|The following examples assume '''root''' user.}} | ||
− | = | + | To login into the Linux system, use a terminal emulator as described [[IOT-GATE-IMX8PLUS: Getting Started#Quick_Setup|here]], or connect through the network (ssh). |
− | IOT-GATE-IMX8PLUS / SBC-IOT-IMX8PLUS | + | |
− | + | = Device Serial Number and Configuration = | |
− | + | Product information is stored in on-board EEPROM.<br> | |
− | + | * To read the product serial number, issue the folowing command: | |
+ | <pre> | ||
+ | root@iot-gate-imx8plus:~$ cat /proc/device-tree/baseboard-sn | ||
+ | </pre> | ||
+ | * To read the product configuration part number, issue the following command: | ||
+ | <pre> | ||
+ | root@iot-gate-imx8plus:~$ cat /proc/device-tree/baseboard-options | ||
+ | </pre> | ||
+ | |||
+ | = Device Tree = | ||
+ | == Available Device Tree Files == | ||
+ | IOT-GATE-iMX8PLUS Yocto package includes the following dtb files: | ||
+ | {| class="wikitable" style="text-align:left;" | ||
+ | |- | ||
+ | | align="center" | '''''<fdt_file_name>''''' | ||
+ | | align="center" | '''Description''' | ||
+ | | align="center" | '''Remarks''' | ||
+ | |- | ||
+ | | align="" |''iot-gate-imx8plus.dtb'' | ||
+ | | align="" |default hardware configuration | ||
+ | | align="" | | ||
+ | |- | ||
+ | | align="" |''iot-gate-imx8plus-m2tpm.dtb'' | ||
+ | | align="" |default hardware configuration + TPM add-on board | ||
+ | | align="" |TPM add-on uses the M.2 expansion socket ('''P19''').<br>Cannot be combined with any other add-on board | ||
+ | |- | ||
+ | | align="" |''iot-gate-imx8plus-brkout_pwm_gpio.dtb'' | ||
+ | | align="" |default hardware configuration + break-out add-on board (2x PWMs, 4x GPIOs) | ||
+ | | align="" |Break-out add-on uses the M.2 expansion socket ('''P19''').<br>Cannot be combined with any other add-on board | ||
+ | |- | ||
+ | | align="" |''iot-gate-imx8plus-m2emmc.dtb'' | ||
+ | | align="" |default hardware configuration + eMMC/TPM add-on board | ||
+ | | align="" |eMMC/TPM add-on uses the M.2 expansion socket ('''P19''').<br>Cannot be combined with any other add-on board | ||
+ | |- | ||
+ | | align="" |''iot-gate-imx8plus-m2adc.dtb'' | ||
+ | | align="" |default hardware configuration + ADC/TPM add-on board | ||
+ | | align="" |ADC/TPM add-on uses the M.2 expansion socket ('''P19''').<br>Cannot be combined with any other add-on board | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | == Set a device tree == | ||
+ | IOT-GATE-iMX8PLUS Yocto provides two methods to switch between dtb files: | ||
+ | * U-Boot environment | ||
+ | The U-boot '''fdtfile''' variable contains the device tree name that will be loaded into the RAM. | ||
+ | This variable can be changed by: | ||
+ | {| class="wikitable" style="text-align:left;" | ||
+ | |- | ||
+ | | align="" | '''Environment''' | ||
+ | | align="" | '''Command''' | ||
+ | |- | ||
+ | | align="" |U-Boot | ||
+ | | align="" |<code>setenv fdtfile <fdt_file_name>; saveenv;</code> | ||
+ | |- | ||
+ | | align="" |Linux | ||
+ | | align="" |<code>fw_setenv fdtfile <fdt_file_name></code> | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | = Cellular Modem = | ||
+ | IOT-GATE-IMX8PLUS / SBC-IOT-IMX8PLUS cellular interface is implemented with a mini-PCIe cellular modem module and a | ||
+ | nano-SIM socket. To set up IOT-GATE-IMX8PLUS / SBC-IOT-IMX8PLUS for cellular functionality, [[IOT-GATE-IMX8PLUS: Getting Started#SIM card installation|install]] an active SIM card into | ||
+ | the [[IOT-GATE-IMX8PLUS: Getting Started#Front panel|front panel]] nano-SIM socket (U10).<br> | ||
+ | Cellular module should be installed into [[IOT-GATE-IMX8PLUS: Getting Started#Service bay|mini-PCIe]] socket P3. | ||
+ | |||
+ | == Cellular Connection == | ||
+ | The [https://manpages.debian.org/testing/modemmanager/mmcli.8 ModemManager] can be used to log into almost any Internet Service Provider with simple configuration setup. | ||
+ | |||
+ | In the following example: | ||
+ | * Replace '''ISP-APN''' with the APN name of the cellular provider. | ||
+ | <pre> | ||
+ | root@iot-gate-imx8plus:~$ nmcli connection add type gsm ifname '*' con-name CellularCon apn <ISP-APN> | ||
+ | </pre> | ||
+ | * Connect cellular network | ||
+ | <pre> | ||
+ | root@iot-gate-imx8plus:~$ nmcli connection up CellularCon | ||
+ | </pre> | ||
+ | * Disconnect cellular network | ||
+ | <pre> | ||
+ | root@iot-gate-imx8plus:~$ nmcli connection down CellularCon | ||
+ | </pre> | ||
− | + | = GPS = | |
− | < | + | IOT-GATE-IMX8PLUS features an optional GPS interface implemented with the cellular modem module.</br> |
+ | == GPS antenna == | ||
+ | GPS antenna is required for GPS operation. GPS antenna is not included with IOT-GATE-IMX8PLUS. Any active GPS antenna with a male SMA connector can be used with IOT-GATE-IMX8PLUS.</br> | ||
+ | GPS antenna should be attached to the '''AUX''' SMA connector on the gateway.<br> | ||
+ | {{Note|GPS antenna should be positioned at least 1m away from the gateway}} | ||
− | + | == Using GPS == | |
+ | The [https://manpages.debian.org/jessie/gpsd-clients/cgps.1.en.html cgps] client can be used to display the GPS information. <br> | ||
+ | The [https://manpages.debian.org/testing/modemmanager/mmcli.8 ModemManager] can be used to check the modem status. | ||
+ | For example, the following command shows the presence of the modem and the id of its interfaces. | ||
<pre> | <pre> | ||
− | root@iot-gate-imx8plus:~# | + | root@iot-gate-imx8plus:~# mmcli -m 0 |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
</pre> | </pre> | ||
− | + | The cgps client utility depends on the gpsd daemon (starts automatically after the initialization command is performed). | |
− | + | * Initialization of the GPS interface: | |
− | * | + | <pre> |
− | + | root@iot-gate-imx8plus:~# sed -i "/^DEVICES=.*/c\DEVICES=\"/dev/ttyUSB1\"" /etc/default/gpsd | |
− | * | + | </pre> |
− | |||
− | + | * Enable the GPS with the following AT commands: | |
− | + | <pre> | |
− | + | root@iot-gate-imx8plus:~# echo AT+QGPS= 1 | socat - /dev/ttyUSB2,crnl | |
− | + | </pre> | |
− | + | * Full power cycle is required before using GPS. Shut down the gateway, remove main DC power for at least 20 sec and restart. | |
− | + | * Start the cgps client to display GPS information. | |
− | |||
− | + | The synchronization process might take a few minutes. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | <pre> | |
− | + | root@iot-gate-imx8plus:~# cgps | |
− | + | ┌───────────────────────────────────────────┐┌─────────────────────────────────┐ | |
− | + | │ Time: 2022-05-04T14:13:30.000Z ││PRN: Elev: Azim: SNR: Used: │ | |
− | + | │ Latitude: 32.65985123 N ││ 71 29 123 22 Y │ | |
− | : | + | │ Longitude: 35.10027205 E ││ 85 27 047 22 Y │ |
+ | │ Altitude: 102.700 m ││ │ | ||
+ | │ Speed: 0.00 kph ││ │ | ||
+ | │ Heading: 128.7 deg (true) ││ │ | ||
+ | │ Climb: 6.00 m/min ││ │ | ||
+ | │ Status: 3D FIX (53 secs) ││ │ | ||
+ | │ Longitude Err: n/a ││ │ | ||
+ | │ Latitude Err: n/a ││ │ | ||
+ | │ Altitude Err: +/- 18 m ││ │ | ||
+ | │ Course Err: n/a ││ │ | ||
+ | │ Speed Err: n/a ││ │ | ||
+ | │ Time offset: -3.682 ││ │ | ||
+ | │ Grid Square: KM72np ││ │ | ||
+ | └───────────────────────────────────────────┘└─────────────────────────────────┘ | ||
+ | </pre> | ||
− | + | * Disable the GPS with the following AT commands: | |
− | + | <pre> | |
− | + | root@iot-gate-imx8plus:~# echo AT+QGPSEND | socat - /dev/ttyUSB2,crnl | |
− | + | </pre> | |
− | |||
− | |||
− | + | = WiFi = | |
− | + | IOT-GATE-IMX8PLUS / SBC-IOT-IMX8PLUS features an optional 802.11ax WiFi interface, implemented with the Intel WiFi 6 AX210 module.<br> | |
− | + | The [https://manpages.debian.org/stretch/network-manager/nmcli.1.en.html NetworkManager] can be used to manage WiFi interface. | |
− | |||
− | + | == Enable/Disable WiFi Interface == | |
− | |||
* To enable WiFi interface: | * To enable WiFi interface: | ||
− | :<pre>root@iot-gate-imx8plus:~ | + | :<pre>root@iot-gate-imx8plus:~$ nmcli radio wifi on</pre> |
* To disable WiFi interface: | * To disable WiFi interface: | ||
− | :<pre>root@iot-gate-imx8plus:~ | + | :<pre>root@iot-gate-imx8plus:~$ nmcli radio wifi off</pre> |
− | + | == Network Scanning == | |
* Sample WiFi scanning: | * Sample WiFi scanning: | ||
− | :<pre>root@iot-gate-imx8plus:~ | + | :<pre>root@iot-gate-imx8plus:~$ nmcli dev wifi list</pre> |
− | + | :The output will show the list of Access Points and Ad-Hoc cells in range. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | == Connecting to Access Point == | |
− | In the following example | + | In the following example: |
− | + | * Replace <SSID> and <PASSWORD> with the actual access point parameters: | |
− | :<pre>root@iot-gate-imx8plus:~ | + | :<pre>root@iot-gate-imx8plus:~$ nmcli device wifi connect <SSID> password <PASSWORD> name WifiCon</pre> |
* Disconnect wireless network: | * Disconnect wireless network: | ||
− | :<pre>root@iot-gate-imx8plus:~ | + | :<pre>root@iot-gate-imx8plus:~$ nmcli connection down WifiCon</pre> |
+ | * Connect wireless network again: | ||
+ | :<pre>root@iot-gate-imx8plus:~$ nmcli connection up WifiCon</pre> | ||
− | == | + | == Creating Access Point == |
− | + | {{Note|Yocto Scarthgap<br>ipv4 forwarding must be turned on manually}} | |
+ | * Enable port forwarding: | ||
+ | :<pre>root@iot-gate-imx8plus:~$ sed -i 's/^#\(net.ipv[4,6].*forward\)/\1/' /etc/sysctl.conf</pre> | ||
− | + | * Enable wireless AP (replace ''<SSID>'' and ''<PASSWORD>'' with desired access point parameters): | |
− | * | + | :<pre> nmcli device wifi hotspot ssid <SSID> password <PASSWORD> con-name HotspotCon</pre> |
− | + | * Disable wireless AP: | |
− | + | :<pre>root@iot-gate-imx8plus:~$ nmcli connection down HotspotCon</pre> | |
− | + | * Enable wireless AP again: | |
− | + | :<pre>root@iot-gate-imx8plus:~$ nmcli connection up HotspotCon</pre> | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | :<pre> | ||
− | |||
− | |||
− | |||
− | |||
− | * | ||
− | |||
− | |||
− | :<pre>root@iot-gate-imx8plus:~ | ||
− | * | ||
− | :<pre>root@iot-gate-imx8plus:~ | ||
− | = CAN = | + | = CAN bus = |
− | IOT-GATE-IMX8PLUS / SBC-IOT-IMX8PLUS features | + | IOT-GATE-IMX8PLUS / SBC-IOT-IMX8PLUS features up to two CAN 2.0B ports implemented with i.MX8M Plus CAN controllers.<br> |
− | CAN | + | * '''canE''': permanent: always enabled and accessible |
+ | * '''canC''': optional: always enabled, but can be accessed only when [[IOT-GATE-IMX8PLUS_and_SBC-IOT-IMX8PLUS:_Yocto_Linux:_How-To_Guide#CAN|CAN I/O module]] is installed | ||
+ | {{Note|IOT-GATE-IMX8PLUS / SBC-IOT-IMX8PLUS CAN signals are routed to industrial I/O connector (P8)}} | ||
+ | The following example demonstrates how to configure and use the permanent CAN interface '''canE'''. | ||
== CAN interface configuration == | == CAN interface configuration == | ||
* Configure the CAN interface bit-rate to 1 Mbits/sec: | * Configure the CAN interface bit-rate to 1 Mbits/sec: | ||
<pre> | <pre> | ||
− | root@iot-gate-imx8plus:~ | + | root@iot-gate-imx8plus:~$ ip link set canE type can bitrate 1000000 |
</pre> | </pre> | ||
* Enable the CAN interface: | * Enable the CAN interface: | ||
<pre> | <pre> | ||
− | root@iot-gate-imx8plus:~ | + | root@iot-gate-imx8plus:~$ ip link set canE up |
</pre> | </pre> | ||
Line 181: | Line 231: | ||
* Send standard CAN frame (on the first device): | * Send standard CAN frame (on the first device): | ||
<pre> | <pre> | ||
− | root@iot-gate-imx8plus:~ | + | root@iot-gate-imx8plus:~$ cansend canE 111#1122334455667788 |
</pre> | </pre> | ||
* Send extended CAN frame (on the first device): | * Send extended CAN frame (on the first device): | ||
<pre> | <pre> | ||
− | root@iot-gate-imx8plus:~ | + | root@iot-gate-imx8plus:~$ cansend canE 11111111#1122334455667788 |
</pre> | </pre> | ||
* CAN frames (extended mode) generator, random payload, interval between two successive flames 50 msec: | * CAN frames (extended mode) generator, random payload, interval between two successive flames 50 msec: | ||
<pre> | <pre> | ||
− | root@iot-gate-imx8plus:~ | + | root@iot-gate-imx8plus:~$ cangen -g 50 -e -D r -v canE |
... | ... | ||
+ | canE 1E5137F4#0F.4D.8B.7A.25.4D.DB.21 | ||
+ | canE 1B6C965C#8C.DE.96.58.69.5F.D5.26 | ||
+ | canE 1BD23086#8D.DB.C4.3E.81.57.BA.34 | ||
+ | canE 127B2322#F4.16.31.2E.34.04.62 | ||
+ | canE 1A6366DB#A8.73.C0.37.D8 | ||
+ | canE 03620EE4# | ||
+ | canE 023AC34D#C6.08.BD.2A.04.B3.BF.43 | ||
+ | canE 1C19AD2E#09.C1.B3.26.23.E5.6A.5A | ||
+ | canE 02BCA994#48.32.46.7C.F0.3F.29.1E | ||
+ | canE 08104C67#59.9F.FE.44 | ||
+ | canE 1C280582#6F.D4.9C.38.A5.28.A3 | ||
+ | canE 0BC219EE#D9.2C.05 | ||
+ | canE 04AA80B8#A1.93 | ||
+ | canE 1A3E2392#AD.98 | ||
+ | canE 0025950E#E3.99.38 | ||
... | ... | ||
</pre> | </pre> | ||
Line 198: | Line 263: | ||
* Dump all received data frames as well as error frames: | * Dump all received data frames as well as error frames: | ||
<pre> | <pre> | ||
− | root@iot-gate-imx8plus:~ | + | root@iot-gate-imx8plus:~$ candump any,0:0,#FFFFFFFF |
... | ... | ||
+ | canE 0CC89C1A [1] 51 | ||
+ | canE 0A097EFB [0] | ||
+ | canE 02B59BD5 [5] 68 6F 47 64 D9 | ||
+ | canE 03743A1E [7] FA BF E4 38 3E BF C8 | ||
+ | canE 13C9B644 [8] 30 FB 60 6F E1 FC 55 65 | ||
+ | canE 018A8975 [0] | ||
+ | canE 0C9C8179 [0] | ||
+ | canE 011F5D90 [6] 65 DB DD 5A AA F9 | ||
+ | canE 07B7FD18 [6] CC 96 26 1D 13 7C | ||
+ | canE 1FBD7177 [8] 69 BF 8D 1E 4C 0D 73 02 | ||
+ | canE 107A7E2D [2] 25 D3 | ||
+ | canE 12B9E279 [8] 89 77 B7 54 BD 98 83 06 | ||
+ | canE 112A44EA [8] 9E 95 D9 6B 60 CE B4 52 | ||
+ | canE 0ADF9869 [3] C8 A0 27 | ||
+ | canE 1580C274 [5] B2 7A F7 43 04 | ||
+ | canE 06DDDBCC [7] AF 19 88 04 E4 D8 95 | ||
+ | canE 127FA5CE [8] F7 54 57 20 45 17 3D 12 | ||
+ | canE 09A37893 [0] | ||
+ | canE 01BA4332 [6] 0B AF 0C 2E AB 25 | ||
+ | canE 180A8AD5 [5] 68 BE F7 5A C0 | ||
+ | canE 06DC994E [7] 20 9E E9 7B B8 31 BC | ||
... | ... | ||
</pre> | </pre> | ||
Line 211: | Line 297: | ||
* RS485 (half duplex) | * RS485 (half duplex) | ||
* Digital I/O (4x DI + 4x DO) | * Digital I/O (4x DI + 4x DO) | ||
+ | * CAN 2.0B | ||
{{Note|IOT-GATE-IMX8PLUS / SBC-IOT-IMX8PLUS industrial I/O signals are routed to Industrial I/O Connector (P8)}} | {{Note|IOT-GATE-IMX8PLUS / SBC-IOT-IMX8PLUS industrial I/O signals are routed to Industrial I/O Connector (P8)}} | ||
Line 220: | Line 307: | ||
RS232 function is implemented with MAX3221 (or compatible) transceiver interfaced with i.MX8M Plus UART ports. | RS232 function is implemented with MAX3221 (or compatible) transceiver interfaced with i.MX8M Plus UART ports. | ||
− | RS232 modules can be installed into I/O slots A, B and C. Up to three RS232 modules can be installed simultaneously. | + | RS232 modules can be installed into I/O slots A, B and C (configuration options '''FARS2''', '''FBRS2''', '''FCRS2'''). Up to three RS232 modules can be installed simultaneously. |
=== Configuration and Access === | === Configuration and Access === | ||
Line 228: | Line 315: | ||
RS485 function is implemented with MAX13488 (or compatible) transceiver interfaced with i.MX8M Plus UART ports. | RS485 function is implemented with MAX13488 (or compatible) transceiver interfaced with i.MX8M Plus UART ports. | ||
− | RS485 modules can be installed in I/O slots A, B and C. Up to three RS485 modules can be installed simultaneously. | + | RS485 modules can be installed in I/O slots A, B and C (configuration options '''FARS4''', '''FBRS4''', '''FCRS4'''). Up to three RS485 modules can be installed simultaneously. |
=== Configuration and Access === | === Configuration and Access === | ||
Once properly installed on a specific I/O slot, RS485 interface can be accessed in Linux via '''ttyRS485_X''' tty device, where '''X''' is a slot name: A, B, C. | Once properly installed on a specific I/O slot, RS485 interface can be accessed in Linux via '''ttyRS485_X''' tty device, where '''X''' is a slot name: A, B, C. | ||
+ | |||
+ | RS485 has an optional software-enabled termination. Please note that the termination is disabled each time the device goes through power-cycle. <BR> | ||
+ | Linux commands to switch termination state: | ||
+ | {| class="wikitable" style="font-family:Arial, Helvetica, sans-serif !important;" | ||
+ | |- style="font-weight:bold;" | ||
+ | ! SLOT | ||
+ | ! Enable termination | ||
+ | ! Disable termination | ||
+ | |- | ||
+ | | A | ||
+ | | GPIOSET 5 12=0 | ||
+ | | GPIOSET 5 12=1 | ||
+ | |- | ||
+ | | B | ||
+ | | GPIOSET 5 13=0 | ||
+ | | GPIOSET 5 13=1 | ||
+ | |- | ||
+ | | C | ||
+ | | GPIOSET 5 14=0 | ||
+ | | GPIOSET 5 14=1 | ||
+ | |} | ||
=== Modbus RS485 === | === Modbus RS485 === | ||
Line 240: | Line 348: | ||
Download and install ''modpoll'' - a command line based Modbus master simulator and test utility. | Download and install ''modpoll'' - a command line based Modbus master simulator and test utility. | ||
<pre> | <pre> | ||
− | root@iot-gate-imx8plus:~ | + | root@iot-gate-imx8plus:~$ wget https://www.modbusdriver.com/downloads/modpoll.tgz -P /tmp/ |
... | ... | ||
− | root@iot-gate-imx8plus:~ | + | root@iot-gate-imx8plus:~$ tar -xvf /tmp/modpoll.tgz -C /opt/ |
... | ... | ||
</pre> | </pre> | ||
Line 268: | Line 376: | ||
* Read temperature once: | * Read temperature once: | ||
<pre> | <pre> | ||
− | root@iot-gate-imx8plus:~ | + | root@iot-gate-imx8plus:~$ /opt/modpoll/arm-linux-gnueabihf/modpoll -b 9600 -p none -t 3 -c 1 -r 2 -1 /dev/ttyRS485_A |
modpoll 3.10 - FieldTalk(tm) Modbus(R) Master Simulator | modpoll 3.10 - FieldTalk(tm) Modbus(R) Master Simulator | ||
Copyright (c) 2002-2021 proconX Pty Ltd | Copyright (c) 2002-2021 proconX Pty Ltd | ||
Line 284: | Line 392: | ||
* Poll temperature: | * Poll temperature: | ||
<pre> | <pre> | ||
− | root@iot-gate-imx8plus:~ | + | root@iot-gate-imx8plus:~$ /opt/modpoll/arm-linux-gnueabihf/modpoll -b 9600 -p none -t 3 -c 1 -r 2 /dev/ttyRS485_A |
modpoll 3.10 - FieldTalk(tm) Modbus(R) Master Simulator | modpoll 3.10 - FieldTalk(tm) Modbus(R) Master Simulator | ||
Copyright (c) 2002-2021 proconX Pty Ltd | Copyright (c) 2002-2021 proconX Pty Ltd | ||
Line 305: | Line 413: | ||
* Read humidity once: | * Read humidity once: | ||
<pre> | <pre> | ||
− | root@iot-gate-imx8plus:~ | + | root@iot-gate-imx8plus:~$ /opt/modpoll/arm-linux-gnueabihf/modpoll -b 9600 -p none -t 3 -c 1 -r 3 -1 /dev/ttyRS485_A |
modpoll 3.10 - FieldTalk(tm) Modbus(R) Master Simulator | modpoll 3.10 - FieldTalk(tm) Modbus(R) Master Simulator | ||
Copyright (c) 2002-2021 proconX Pty Ltd | Copyright (c) 2002-2021 proconX Pty Ltd | ||
Line 321: | Line 429: | ||
* Poll humidity: | * Poll humidity: | ||
<pre> | <pre> | ||
− | root@iot-gate-imx8plus:~ | + | root@iot-gate-imx8plus:~$ /opt/modpoll/arm-linux-gnueabihf/modpoll -b 9600 -p none -t 3 -c 1 -r 3 /dev/ttyRS485_A |
modpoll 3.10 - FieldTalk(tm) Modbus(R) Master Simulator | modpoll 3.10 - FieldTalk(tm) Modbus(R) Master Simulator | ||
Copyright (c) 2002-2021 proconX Pty Ltd | Copyright (c) 2002-2021 proconX Pty Ltd | ||
Line 342: | Line 450: | ||
* Read temperature & humidity once: | * Read temperature & humidity once: | ||
<pre> | <pre> | ||
− | root@iot-gate-imx8plus:~ | + | root@iot-gate-imx8plus:~$ /opt/modpoll/arm-linux-gnueabihf/modpoll -b 9600 -p none -t 3 -c 2 -r 2 -1 /dev/ttyRS485_A |
modpoll 3.10 - FieldTalk(tm) Modbus(R) Master Simulator | modpoll 3.10 - FieldTalk(tm) Modbus(R) Master Simulator | ||
Copyright (c) 2002-2021 proconX Pty Ltd | Copyright (c) 2002-2021 proconX Pty Ltd | ||
Line 359: | Line 467: | ||
* Poll temperature & humidity: | * Poll temperature & humidity: | ||
<pre> | <pre> | ||
− | root@iot-gate-imx8plus:~ | + | root@iot-gate-imx8plus:~$ /opt/modpoll/arm-linux-gnueabihf/modpoll -b 9600 -p none -t 3 -c 2 -r 2 /dev/ttyRS485_A |
modpoll 3.10 - FieldTalk(tm) Modbus(R) Master Simulator | modpoll 3.10 - FieldTalk(tm) Modbus(R) Master Simulator | ||
Copyright (c) 2002-2021 proconX Pty Ltd | Copyright (c) 2002-2021 proconX Pty Ltd | ||
Line 383: | Line 491: | ||
* Read slave address, baudrate, temperature & humidity corrections: | * Read slave address, baudrate, temperature & humidity corrections: | ||
<pre> | <pre> | ||
− | root@iot-gate-imx8plus:~ | + | root@iot-gate-imx8plus:~$ /opt/modpoll/arm-linux-gnueabihf/modpoll -b 9600 -p none -t 4 -c 4 -r 258 -1 /dev/ttyRS485_A |
modpoll 3.10 - FieldTalk(tm) Modbus(R) Master Simulator | modpoll 3.10 - FieldTalk(tm) Modbus(R) Master Simulator | ||
Copyright (c) 2002-2021 proconX Pty Ltd | Copyright (c) 2002-2021 proconX Pty Ltd | ||
Line 401: | Line 509: | ||
== Digital I/O == | == Digital I/O == | ||
− | Digital I/O module features 4 digital inputs and 4 digital outputs and can be installed into slot D. | + | Digital I/O module features 4 digital inputs and 4 digital outputs and can be installed into slot D (configuration option '''FDIO''').<br> |
Four digital inputs are implemented with the CLT3-4B digital termination following EN 61131-2. | Four digital inputs are implemented with the CLT3-4B digital termination following EN 61131-2. | ||
Four digital outputs are implemented with the VNI4140K solid-state relay following EN 61131-2.<br> | Four digital outputs are implemented with the VNI4140K solid-state relay following EN 61131-2.<br> | ||
Line 412: | Line 520: | ||
* Drive OUT2 pin HI: | * Drive OUT2 pin HI: | ||
<pre> | <pre> | ||
− | root@iot-gate-imx8plus:~ | + | root@iot-gate-imx8plus:~$ iotg-imx8plus-dio -o 2 1 |
</pre> | </pre> | ||
* Read IN3 pin state (LO): | * Read IN3 pin state (LO): | ||
<pre> | <pre> | ||
− | root@iot-gate-imx8plus:~ | + | root@iot-gate-imx8plus:~$ iotg-imx8plus-dio -i 3 |
0 | 0 | ||
</pre> | </pre> | ||
+ | |||
+ | == CAN == | ||
+ | CAN function is implemented with i.MX8M Plus Flexible Controller Area Network (FlexCAN) communication controller.<br> | ||
+ | CAN module can be installed into I/O slot C (configuration option '''FCCAN'''). | ||
+ | |||
+ | === Configuration and Access === | ||
+ | Once properly installed, CAN I/O module can be accessed in Linux via '''canC''' network interface. | ||
+ | Refer to the [[IOT-GATE-IMX8PLUS_and_SBC-IOT-IMX8PLUS:_Yocto_Linux:_How-To_Guide#CAN_bus|CAN bus]] section for configuration and usage example. | ||
+ | |||
+ | = Add-on boards = | ||
+ | IOT-GATE-IMX8PLUS / SBC-IOT-IMX8PLUS features expansion interface via M.2 Key-E socket P19. The expansion | ||
+ | connector allows integration of custom add-on boards into IOT-GATE-IMX8PLUS / SBC-IOT-IMX8PLUS. The expansion | ||
+ | connector features embedded interfaces such as I2C, SPI, PWM, GPIO, etc. | ||
+ | {{Note|Please refer to Expansion Connector pin-out for more details.}} | ||
+ | |||
+ | Available add-on boards: | ||
+ | * [[IOT-GATE-IMX8PLUS_and_SBC-IOT-IMX8PLUS:_Yocto_Linux:_How-To_Guide#TPM|TPM]] 2.0: implemented with Infineon SLB9670 | ||
+ | * [[IOT-GATE-IMX8PLUS_and_SBC-IOT-IMX8PLUS:_Yocto_Linux:_How-To_Guide#Break-out|Break-out]]: exposes expansion connector signals on 100-mil headers | ||
+ | * [[IOT-GATE-IMX8PLUS_and_SBC-IOT-IMX8PLUS:_Yocto_Linux:_How-To_Guide#eMMC|eMMC/TPM]]: provides additional storage volume as well as TPM 2.0 | ||
+ | * [[IOT-GATE-IMX8PLUS_and_SBC-IOT-IMX8PLUS:_Yocto_Linux:_How-To_Guide#ADC|ADC/TPM]]: provides four single-ended analog input channels (0-3) as well as TPM 2.0 | ||
+ | |||
+ | == TPM == | ||
+ | IOT-GATE-IMX8PLUS / SBC-IOT-IMX8PLUS can be optionally (configuration option '''FXTPM''') assembled with a TPM 2.0 add-on board implemented with Infineon SLB9670.<br> | ||
+ | * Install TPM add-on board into M.2 Socket ('''P19''') if required | ||
+ | * Boot Linux kernel with ''iot-gate-imx8plus-m2tpm.dtb'' [[IOT-GATE-IMX8PLUS_and_SBC-IOT-IMX8PLUS:_Yocto_Linux:_How-To_Guide#Set_a_device_tree|device tree]] | ||
+ | === Accessing TPM === | ||
+ | * Verify that the TPM device was created: | ||
+ | :<pre>root@iot-gate-imx8plus:~$ ls -lh /dev/tpm*</pre> | ||
+ | * Otherwise load TPM kernel object: | ||
+ | :<pre>root@iot-gate-imx8plus:~$ modprobe tpm_tis_spi</pre> | ||
+ | * Install the '''tpm2-tools''' package: | ||
+ | :<pre>root@iot-gate-imx8plus:~$ apt-get update && apt-get install tpm2-tools</pre> | ||
+ | * Validate basic functionality | ||
+ | :<pre>root@iot-gate-imx8plus:~$ tpm2_getrandom 16</pre> | ||
+ | |||
+ | == Break-out == | ||
+ | [https://www.compulab.com/wp-content/uploads/2022/09/IOTG-ACC-BRKOUT-datasheet.pdf Break-out] add-on board exposes expansion connector signals on 100-mil headers.<br> | ||
+ | The IOT-GATE-IMX8PLUS / SBC-IOT-IMX8PLUS [[IOT-GATE-IMX8PLUS_and_SBC-IOT-IMX8PLUS_Yocto_Linux|Yocto Linux]] image contains ''iot-gate-imx8plus-brkout_pwm_gpio.dtb'' [[IOT-GATE-IMX8PLUS_and_SBC-IOT-IMX8PLUS:_Yocto_Linux:_How-To_Guide#Available_Device_Tree|device tree]]. | ||
+ | It provides break-out add-on board usage example by configuring: | ||
+ | * 2x PWMs | ||
+ | * 4x GPIOs | ||
+ | * 1x I2C | ||
+ | |||
+ | {| class="wikitable" style="text-align:left;" | ||
+ | |- | ||
+ | | align="center" | '''Interface/Bus''' | ||
+ | | align="center" | '''Name in Linux''' | ||
+ | | align="center" | '''Signal Name''' | ||
+ | | align="center" | '''Channel/Offset''' | ||
+ | | align="center" | '''Header-Offset''' | ||
+ | |- | ||
+ | |PWM3 | ||
+ | |''pwmchip0'' | ||
+ | |PWM3_OUT | ||
+ | |align="center" |''0'' | ||
+ | |align="center" |P5-09 | ||
+ | |- | ||
+ | |PWM4 | ||
+ | |''pwmchip1'' | ||
+ | |PWM4_OUT | ||
+ | |align="center" |''0'' | ||
+ | |align="center" |P5-07 | ||
+ | |- | ||
+ | |rowspan="4" |GPIO5 | ||
+ | |rowspan="4" |''gpiochip4'' | ||
+ | |GPIO5_IO10 | ||
+ | |align="center" |''10'' | ||
+ | |align="center" |P5-13 | ||
+ | |- | ||
+ | |GPIO5_IO11 | ||
+ | |align="center" |''11'' | ||
+ | |align="center" |P5-11 | ||
+ | |- | ||
+ | |GPIO5_IO12 | ||
+ | |align="center" |''12'' | ||
+ | |align="center" |P5-14 | ||
+ | |- | ||
+ | |GPIO5_IO13 | ||
+ | |align="center" |''13'' | ||
+ | |align="center" |P5-15 | ||
+ | |- | ||
+ | |rowspan="2" |I2C5 | ||
+ | |rowspan="2" |''i2c-4'' | ||
+ | |I2C5_SDA | ||
+ | | | ||
+ | |align="center" |P5-08 | ||
+ | |- | ||
+ | |I2C5_SCL | ||
+ | | | ||
+ | |align="center" |P5-10 | ||
+ | |} | ||
+ | |||
+ | === PWM === | ||
+ | The following example demonstrates how to use pwmchip0 from Linux shell. | ||
+ | * Boot Linux kernel with ''iot-gate-imx8plus-brkout_pwm_gpio.dtb'' [[IOT-GATE-IMX8PLUS_and_SBC-IOT-IMX8PLUS:_Yocto_Linux:_How-To_Guide#Set_a_device_tree|device tree]] | ||
+ | * Export PWM channel 0 on pwmchip0: | ||
+ | :<pre>echo "0" | tee -a /sys/class/pwm/pwmchip0/export</pre> | ||
+ | * Setup PWM signal period of 100usec and duty cycle of 30%: | ||
+ | :<pre>echo 100000 | tee -a /sys/class/pwm/pwmchip0/pwm0/period</pre> | ||
+ | :<pre>echo 30000 | tee -a /sys/class/pwm/pwmchip0/pwm0/duty_cycle</pre> | ||
+ | * Enable PWM signal: | ||
+ | :<pre>echo 1 | tee -a /sys/class/pwm/pwmchip0/pwm0/enable</pre> | ||
+ | * Disable PWM signal: | ||
+ | :<pre>echo 0 | tee -a /sys/class/pwm/pwmchip0/pwm0/enable</pre> | ||
+ | * Un-export PWM channel 0 on pwmchip0: | ||
+ | :<pre>echo "0" | tee -a /sys/class/pwm/pwmchip0/unexport</pre> | ||
+ | |||
+ | == eMMC == | ||
+ | IOT-GATE-IMX8PLUS / SBC-IOT-IMX8PLUS can be optionally (configuration option '''FXADC''') assembled with eMMC/TPM add-on board implemented with: | ||
+ | :* 32/64/128GB eMMC flash secondary storage device<br> | ||
+ | :* Infineon SLB9670 TPM 2.0<br> | ||
+ | * Install ADC add-on board into M.2 Socket ('''P19''') if required | ||
+ | * Boot Linux kernel with ''iot-gate-imx8plus-m2emmc.dtb'' [[IOT-GATE-IMX8PLUS_and_SBC-IOT-IMX8PLUS:_Yocto_Linux:_How-To_Guide#Set_a_device_tree|device tree]] | ||
+ | === Accessing eMMC Secondary Storage === | ||
+ | * Verify that the ''mmcblk1'' block device was created | ||
+ | :<pre>root@iot-gate-imx8plus:~$ lsblk /dev/mmcblk1</pre> | ||
+ | |||
+ | {{Note|For TPM functionality refer to [[IOT-GATE-IMX8PLUS_and_SBC-IOT-IMX8PLUS:_Yocto_Linux:_How-To_Guide#Accessing_TPM|Accessing TPM]] section}} | ||
+ | |||
+ | == ADC == | ||
+ | IOT-GATE-IMX8PLUS / SBC-IOT-IMX8PLUS can be optionally (ordering option '''FXADC''') assembled with ADC/TPM add-on board implemented with: | ||
+ | :* TI ADS1015 analog-to-digital converter (ADC) that provides four single-ended analog input channels (0-3). Inputs operate between 0-10V or 4-20mA ranges for use with industrial sensors. The add-on can be set into current or voltage input mode via wire jumper | ||
+ | :* Infineon SLB9670 TPM 2.0<br> | ||
+ | * The ADC add-on board should be installed into expansion socket ('''P19''') | ||
+ | * Boot Linux kernel with ''iot-gate-imx8plus-m2adc.dtb'' [[IOT-GATE-IMX8PLUS_and_SBC-IOT-IMX8PLUS:_Yocto_Linux:_How-To_Guide#Set_a_device_tree|device tree]] | ||
+ | === Accessing Analog Inputs === | ||
+ | * Verify that the ADC device was created correctly | ||
+ | :<pre>root@iot-gate-imx8plus:~$ ls -lh /sys/bus/iio/devices/iio:device0</pre> | ||
+ | * Read a detected value of channels '''AIN0''' - '''AIN3''':<br> | ||
+ | <pre> | ||
+ | root@iot-gate-imx8plus:~$ for i in {0..3} ; do cat /sys/bus/iio/devices/iio:device0/in_voltage${i}_raw ; done | ||
+ | </pre> | ||
+ | |||
+ | {{Note|For TPM functionality refer to [[IOT-GATE-IMX8PLUS_and_SBC-IOT-IMX8PLUS:_Yocto_Linux:_How-To_Guide#Accessing_TPM|Accessing TPM]] section}} | ||
+ | |||
+ | = RTC = | ||
+ | |||
+ | IOT-GATE-IMX8PLUS / SBC-IOT-IMX8PLUS RTC is implemented with the AM1805 real-time clock (RTC) chip.</br> | ||
+ | Back-up battery keeps the RTC running to maintain clock and time information whenever the main power supply is not present. | ||
+ | |||
+ | == Accessing and setting the RTC == | ||
+ | * To access the RTC time and date run: | ||
+ | <pre> | ||
+ | root@iot-gate-imx8plus:~$ hwclock | ||
+ | 2022-08-04 12:38:10.577874+00:00 | ||
+ | </pre> | ||
+ | |||
+ | * To set the date and write it into the RTC do the following: | ||
+ | <pre> | ||
+ | root@iot-gate-imx8plus:~$ date -s "31 Dec 2021 10:00:00" | ||
+ | Fri Dec 31 10:00:00 IST 2021 | ||
+ | root@iot-gate-imx8plus:~$ hwclock -w | ||
+ | root@iot-gate-imx8plus:~$ hwclock | ||
+ | 2021-12-31 10:00:08.317403+02:00 | ||
+ | </pre> | ||
+ | |||
+ | = Watchdog = | ||
+ | IOT-GATE-IMX8PLUS / SBC-IOT-IMX8PLUS watchdog function is implemented with the i.MX8M Plus watchdog.</br> | ||
+ | By default watchdog is not configured. | ||
+ | :<pre>root@iot-gate-imx8plus:~$ systemctl show | grep RuntimeWatchdog</pre> | ||
+ | :<pre>RuntimeWatchdogUSec=0</pre> | ||
+ | The value '''RuntimeWatchdogUSec=0''' means watchdog logic is disabled: no watchdog device is opened, configured, or pinged | ||
+ | |||
+ | == Watchdog configuration == | ||
+ | * Edit ''/etc/systemd/system.conf'' file to configure watchdog related parameters, in particular '''RuntimeWatchdogSec''' and '''ShutdownWatchdogSec'''. | ||
+ | :'''RuntimeWatchdogSec''' - specifies the watchdog timeout for runtime services, meaning services that are actively running during normal system operation. The value is in seconds and should be set to a positive integer.<br> | ||
+ | :'''ShutdownWatchdogSec''' - specifies the watchdog timeout for the shutdown process, insuring the system doesn't hang indefinitely during the shutdown. The value is in seconds and should be set to a positive integer.<br> | ||
+ | |||
+ | * Reboot the device | ||
+ | * Verify watchdog configuration | ||
+ | :<pre>root@iot-gate-imx8plus:~$ systemctl show | grep RuntimeWatchdog</pre> | ||
+ | :<pre>RuntimeWatchdogUSec=10s</pre> | ||
+ | |||
+ | == Watchdog testing == | ||
+ | * Run the following command to simulate kernel panic: | ||
+ | :<pre>root@iot-gate-imx8plus:~$ su</pre> | ||
+ | :<pre>root@iot-gate-imx8plus:/home/compulab# echo "c" > /proc/sysrq-trigger</pre> | ||
+ | * As a result, the watchdog is not fed and the system reboots after 10 sec. | ||
+ | |||
+ | = Low Power Modes = | ||
+ | IOT-GATE-IMX8PLUS supports the following low-power modes: | ||
+ | * Sleep mode - RAM content is preserved, and the system can quickly wake up into the operating system. Power consumption in sleep mode is ~0.25W. | ||
+ | * Power-off mode - RAM content is not preserved, and the system will restart into a clean boot. Power consumption in power-off mode is ~0.02W. | ||
+ | IOT-GATE-IMX8PLUS supports two wake-up sources: | ||
+ | * Short press on the power button | ||
+ | * Timer alarm set in internal RTC (rtc1) | ||
+ | {{Important|Only the internal RTC (rtc1) can be used for the wake-up alarm. Main DC power must be present to preserve alarm settings.}} | ||
+ | ==== Low power mode examples ==== | ||
+ | {{Note|Make sure that power button press is ignored and does not cause machine power-off: uncomment and set '''HandlePowerKey''' field to '''ignore''' value in the ''/etc/systemd/logind.conf''}} | ||
+ | |||
+ | * Sleep mode with exit by power button press: | ||
+ | :<pre>root@compulab-imx8mp:~$ echo mem | tee -a /sys/power/state</pre> | ||
+ | * Sleep mode with exit by RTC wake-up call or power button press: | ||
+ | :<pre>root@compulab-imx8mp:~$ rtcwake --device /dev/rtc1 -s 60 -m mem</pre> | ||
+ | * Power-off mode with boot on RTC wake-up call: | ||
+ | :<pre>root@compulab-imx8mp:~$ rtcwake --device /dev/rtc1 -s 60 -m off</pre> | ||
+ | :In this example system reboots after 60 seconds. | ||
= LEDs = | = LEDs = | ||
Line 427: | Line 732: | ||
* LEDs are referred to as ''Green_1'', ''Red_1'', ''Green_2'' and ''Red_2'' | * LEDs are referred to as ''Green_1'', ''Red_1'', ''Green_2'' and ''Red_2'' | ||
* Choose a LED (LED2 Red in this example): | * Choose a LED (LED2 Red in this example): | ||
− | :<pre>root@iot-gate-imx8plus:~ | + | :<pre>root@iot-gate-imx8plus:~$ LED=Red_2</pre> |
* Turn the LED ON | * Turn the LED ON | ||
− | :<pre>root@iot-gate-imx8plus:~ | + | :<pre>root@iot-gate-imx8plus:~$ echo "1" | tee -a /sys/class/leds/${LED}/brightness</pre> |
* Turn the LED OFF | * Turn the LED OFF | ||
− | :<pre>root@iot-gate-imx8plus:~ | + | :<pre>root@iot-gate-imx8plus:~$ echo "0" | tee -a /sys/class/leds/${LED}/brightness</pre> |
* Set LED's trigger | * Set LED's trigger | ||
− | :<pre>root@iot-gate-imx8plus:~ | + | :<pre>root@iot-gate-imx8plus:~$ echo "heartbeat" | tee -a /sys/class/leds/${LED}/trigger</pre> |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | [[Category:Linux]] | |
− | + | [[Category:IOT-GATE-IMX8PLUS]] | |
− | : | + | [[Category:SBC-IOT-IMX8PLUS]] |
Latest revision as of 10:28, 28 August 2024
Contents
Overview
The example run-time Yocto Linux image for the CompuLab IOT-GATE-IMX8PLUS and SBC-IOT-IMX8PLUS was generated with Scarthgap Yocto build. The image includes the needed drivers and utilities to operate the hardware components of the IOT-GATE-IMX8PLUS/SBC-IOT-IMX8PLUS.
The default Scarthgap Yocto image includes many software packages. Among them:
- Core system
- SSH server and client
- PulseAudio configuration and usage utilities
- NetworkManager
- ModemManager
- Bluez5 Bluetooth tools and daemons
Serial Console
IOT-GATE-IMX8PLUS / SBC-IOT-IMX8PLUS provides a serial console on the front panel micro-USB Console connector.
Connecting to a host PC
- Use a micro-USB cable to connect the Console connector to a USB port on your host PC.
- Make sure the CP2104 driver is available with your operating system, otherwise install CP2104 driver onto the host PC from https://www.silabs.com/documents/public/software/CP210x_Windows_Drivers_with_Serial_Enumeration.zip
- Identify the host PC interface and port number that will be used for communication with the device:
- In most Linux PCs, the serial port will be denoted as one of the following (where n is a positive integer): /dev/ttyUSB0, /dev/ttyUSB1 ... /dev/ttyUSBn
- In Windows PCs, the serial port usually will be denoted as one of the following (where n is a positive integer): COM1, COM2 ... COMn
- Start a terminal emulation program (such as PuTTY on Windows or minicom on Linux).
- In the port configuration section of the terminal emulation program select the port identified in previous step and set the following serial port parameters:
Baud Rate Data Bits Stop Bits Parity Flow Control 115200 8 1 none none
Connection and Login
This Yocto rootfs comes with an empty root password. No password is required for login.
To login into the Linux system, you may use a terminal emulator as described here, or connect through the network (ssh).
The following examples assume root user. |
To login into the Linux system, use a terminal emulator as described here, or connect through the network (ssh).
Device Serial Number and Configuration
Product information is stored in on-board EEPROM.
- To read the product serial number, issue the folowing command:
root@iot-gate-imx8plus:~$ cat /proc/device-tree/baseboard-sn
- To read the product configuration part number, issue the following command:
root@iot-gate-imx8plus:~$ cat /proc/device-tree/baseboard-options
Device Tree
Available Device Tree Files
IOT-GATE-iMX8PLUS Yocto package includes the following dtb files:
<fdt_file_name> | Description | Remarks |
iot-gate-imx8plus.dtb | default hardware configuration | |
iot-gate-imx8plus-m2tpm.dtb | default hardware configuration + TPM add-on board | TPM add-on uses the M.2 expansion socket (P19). Cannot be combined with any other add-on board |
iot-gate-imx8plus-brkout_pwm_gpio.dtb | default hardware configuration + break-out add-on board (2x PWMs, 4x GPIOs) | Break-out add-on uses the M.2 expansion socket (P19). Cannot be combined with any other add-on board |
iot-gate-imx8plus-m2emmc.dtb | default hardware configuration + eMMC/TPM add-on board | eMMC/TPM add-on uses the M.2 expansion socket (P19). Cannot be combined with any other add-on board |
iot-gate-imx8plus-m2adc.dtb | default hardware configuration + ADC/TPM add-on board | ADC/TPM add-on uses the M.2 expansion socket (P19). Cannot be combined with any other add-on board |
Set a device tree
IOT-GATE-iMX8PLUS Yocto provides two methods to switch between dtb files:
- U-Boot environment
The U-boot fdtfile variable contains the device tree name that will be loaded into the RAM. This variable can be changed by:
Environment | Command |
U-Boot | setenv fdtfile <fdt_file_name>; saveenv;
|
Linux | fw_setenv fdtfile <fdt_file_name>
|
Cellular Modem
IOT-GATE-IMX8PLUS / SBC-IOT-IMX8PLUS cellular interface is implemented with a mini-PCIe cellular modem module and a
nano-SIM socket. To set up IOT-GATE-IMX8PLUS / SBC-IOT-IMX8PLUS for cellular functionality, install an active SIM card into
the front panel nano-SIM socket (U10).
Cellular module should be installed into mini-PCIe socket P3.
Cellular Connection
The ModemManager can be used to log into almost any Internet Service Provider with simple configuration setup.
In the following example:
- Replace ISP-APN with the APN name of the cellular provider.
root@iot-gate-imx8plus:~$ nmcli connection add type gsm ifname '*' con-name CellularCon apn <ISP-APN>
- Connect cellular network
root@iot-gate-imx8plus:~$ nmcli connection up CellularCon
- Disconnect cellular network
root@iot-gate-imx8plus:~$ nmcli connection down CellularCon
GPS
IOT-GATE-IMX8PLUS features an optional GPS interface implemented with the cellular modem module.
GPS antenna
GPS antenna is required for GPS operation. GPS antenna is not included with IOT-GATE-IMX8PLUS. Any active GPS antenna with a male SMA connector can be used with IOT-GATE-IMX8PLUS.
GPS antenna should be attached to the AUX SMA connector on the gateway.
GPS antenna should be positioned at least 1m away from the gateway |
Using GPS
The cgps client can be used to display the GPS information.
The ModemManager can be used to check the modem status.
For example, the following command shows the presence of the modem and the id of its interfaces.
root@iot-gate-imx8plus:~# mmcli -m 0
The cgps client utility depends on the gpsd daemon (starts automatically after the initialization command is performed).
- Initialization of the GPS interface:
root@iot-gate-imx8plus:~# sed -i "/^DEVICES=.*/c\DEVICES=\"/dev/ttyUSB1\"" /etc/default/gpsd
- Enable the GPS with the following AT commands:
root@iot-gate-imx8plus:~# echo AT+QGPS= 1 | socat - /dev/ttyUSB2,crnl
- Full power cycle is required before using GPS. Shut down the gateway, remove main DC power for at least 20 sec and restart.
- Start the cgps client to display GPS information.
The synchronization process might take a few minutes.
root@iot-gate-imx8plus:~# cgps ┌───────────────────────────────────────────┐┌─────────────────────────────────┐ │ Time: 2022-05-04T14:13:30.000Z ││PRN: Elev: Azim: SNR: Used: │ │ Latitude: 32.65985123 N ││ 71 29 123 22 Y │ │ Longitude: 35.10027205 E ││ 85 27 047 22 Y │ │ Altitude: 102.700 m ││ │ │ Speed: 0.00 kph ││ │ │ Heading: 128.7 deg (true) ││ │ │ Climb: 6.00 m/min ││ │ │ Status: 3D FIX (53 secs) ││ │ │ Longitude Err: n/a ││ │ │ Latitude Err: n/a ││ │ │ Altitude Err: +/- 18 m ││ │ │ Course Err: n/a ││ │ │ Speed Err: n/a ││ │ │ Time offset: -3.682 ││ │ │ Grid Square: KM72np ││ │ └───────────────────────────────────────────┘└─────────────────────────────────┘
- Disable the GPS with the following AT commands:
root@iot-gate-imx8plus:~# echo AT+QGPSEND | socat - /dev/ttyUSB2,crnl
WiFi
IOT-GATE-IMX8PLUS / SBC-IOT-IMX8PLUS features an optional 802.11ax WiFi interface, implemented with the Intel WiFi 6 AX210 module.
The NetworkManager can be used to manage WiFi interface.
Enable/Disable WiFi Interface
- To enable WiFi interface:
root@iot-gate-imx8plus:~$ nmcli radio wifi on
- To disable WiFi interface:
root@iot-gate-imx8plus:~$ nmcli radio wifi off
Network Scanning
- Sample WiFi scanning:
root@iot-gate-imx8plus:~$ nmcli dev wifi list
- The output will show the list of Access Points and Ad-Hoc cells in range.
Connecting to Access Point
In the following example:
- Replace <SSID> and <PASSWORD> with the actual access point parameters:
root@iot-gate-imx8plus:~$ nmcli device wifi connect <SSID> password <PASSWORD> name WifiCon
- Disconnect wireless network:
root@iot-gate-imx8plus:~$ nmcli connection down WifiCon
- Connect wireless network again:
root@iot-gate-imx8plus:~$ nmcli connection up WifiCon
Creating Access Point
Yocto Scarthgap ipv4 forwarding must be turned on manually |
- Enable port forwarding:
root@iot-gate-imx8plus:~$ sed -i 's/^#\(net.ipv[4,6].*forward\)/\1/' /etc/sysctl.conf
- Enable wireless AP (replace <SSID> and <PASSWORD> with desired access point parameters):
nmcli device wifi hotspot ssid <SSID> password <PASSWORD> con-name HotspotCon
- Disable wireless AP:
root@iot-gate-imx8plus:~$ nmcli connection down HotspotCon
- Enable wireless AP again:
root@iot-gate-imx8plus:~$ nmcli connection up HotspotCon
CAN bus
IOT-GATE-IMX8PLUS / SBC-IOT-IMX8PLUS features up to two CAN 2.0B ports implemented with i.MX8M Plus CAN controllers.
- canE: permanent: always enabled and accessible
- canC: optional: always enabled, but can be accessed only when CAN I/O module is installed
IOT-GATE-IMX8PLUS / SBC-IOT-IMX8PLUS CAN signals are routed to industrial I/O connector (P8) |
The following example demonstrates how to configure and use the permanent CAN interface canE.
CAN interface configuration
- Configure the CAN interface bit-rate to 1 Mbits/sec:
root@iot-gate-imx8plus:~$ ip link set canE type can bitrate 1000000
- Enable the CAN interface:
root@iot-gate-imx8plus:~$ ip link set canE up
Send/Receive packets
Use cansend and candump utilities to send and receive packets via CAN interface.
- Send standard CAN frame (on the first device):
root@iot-gate-imx8plus:~$ cansend canE 111#1122334455667788
- Send extended CAN frame (on the first device):
root@iot-gate-imx8plus:~$ cansend canE 11111111#1122334455667788
- CAN frames (extended mode) generator, random payload, interval between two successive flames 50 msec:
root@iot-gate-imx8plus:~$ cangen -g 50 -e -D r -v canE ... canE 1E5137F4#0F.4D.8B.7A.25.4D.DB.21 canE 1B6C965C#8C.DE.96.58.69.5F.D5.26 canE 1BD23086#8D.DB.C4.3E.81.57.BA.34 canE 127B2322#F4.16.31.2E.34.04.62 canE 1A6366DB#A8.73.C0.37.D8 canE 03620EE4# canE 023AC34D#C6.08.BD.2A.04.B3.BF.43 canE 1C19AD2E#09.C1.B3.26.23.E5.6A.5A canE 02BCA994#48.32.46.7C.F0.3F.29.1E canE 08104C67#59.9F.FE.44 canE 1C280582#6F.D4.9C.38.A5.28.A3 canE 0BC219EE#D9.2C.05 canE 04AA80B8#A1.93 canE 1A3E2392#AD.98 canE 0025950E#E3.99.38 ...
- Dump all received data frames as well as error frames:
root@iot-gate-imx8plus:~$ candump any,0:0,#FFFFFFFF ... canE 0CC89C1A [1] 51 canE 0A097EFB [0] canE 02B59BD5 [5] 68 6F 47 64 D9 canE 03743A1E [7] FA BF E4 38 3E BF C8 canE 13C9B644 [8] 30 FB 60 6F E1 FC 55 65 canE 018A8975 [0] canE 0C9C8179 [0] canE 011F5D90 [6] 65 DB DD 5A AA F9 canE 07B7FD18 [6] CC 96 26 1D 13 7C canE 1FBD7177 [8] 69 BF 8D 1E 4C 0D 73 02 canE 107A7E2D [2] 25 D3 canE 12B9E279 [8] 89 77 B7 54 BD 98 83 06 canE 112A44EA [8] 9E 95 D9 6B 60 CE B4 52 canE 0ADF9869 [3] C8 A0 27 canE 1580C274 [5] B2 7A F7 43 04 canE 06DDDBCC [7] AF 19 88 04 E4 D8 95 canE 127FA5CE [8] F7 54 57 20 45 17 3D 12 canE 09A37893 [0] canE 01BA4332 [6] 0B AF 0C 2E AB 25 canE 180A8AD5 [5] 68 BE F7 5A C0 canE 06DC994E [7] 20 9E E9 7B B8 31 BC ...
Industrial Interfaces
IOT-GATE-IMX8PLUS / SBC-IOT-IMX8PLUS implements industrial interfaces with four I/O slots (IE) that can be fitted with up-to four different I/O modules. Slots are referred to as A, B, C and D.
Available I/O modules types:
- RS232 (2-wire)
- RS485 (half duplex)
- Digital I/O (4x DI + 4x DO)
- CAN 2.0B
IOT-GATE-IMX8PLUS / SBC-IOT-IMX8PLUS industrial I/O signals are routed to Industrial I/O Connector (P8) |
Please refer to Industrial I/O Connector pin-out for more details.
So far industrial I/O modules do not require any special configuration.
RS232
RS232 function is implemented with MAX3221 (or compatible) transceiver interfaced with i.MX8M Plus UART ports.
RS232 modules can be installed into I/O slots A, B and C (configuration options FARS2, FBRS2, FCRS2). Up to three RS232 modules can be installed simultaneously.
Configuration and Access
Once properly installed on a specific I/O slot, RS232 interface can be accessed in Linux via ttyRS232_X tty device, where X is a slot name: A, B, C.
RS485
RS485 function is implemented with MAX13488 (or compatible) transceiver interfaced with i.MX8M Plus UART ports.
RS485 modules can be installed in I/O slots A, B and C (configuration options FARS4, FBRS4, FCRS4). Up to three RS485 modules can be installed simultaneously.
Configuration and Access
Once properly installed on a specific I/O slot, RS485 interface can be accessed in Linux via ttyRS485_X tty device, where X is a slot name: A, B, C.
RS485 has an optional software-enabled termination. Please note that the termination is disabled each time the device goes through power-cycle.
Linux commands to switch termination state:
SLOT | Enable termination | Disable termination |
---|---|---|
A | GPIOSET 5 12=0 | GPIOSET 5 12=1 |
B | GPIOSET 5 13=0 | GPIOSET 5 13=1 |
C | GPIOSET 5 14=0 | GPIOSET 5 14=1 |
Modbus RS485
The following example demonstrates how to use RS485 module installed into industrial I/O slot A in a Modbus RS485 Network. IOTG-IMX8PLUS performs as a Master device and queries XY-MD02 temperature and humidity sensor.
Software installation
Download and install modpoll - a command line based Modbus master simulator and test utility.
root@iot-gate-imx8plus:~$ wget https://www.modbusdriver.com/downloads/modpoll.tgz -P /tmp/ ... root@iot-gate-imx8plus:~$ tar -xvf /tmp/modpoll.tgz -C /opt/ ...
Device connection
- Connect XY-MD02 sensor to appropriate Industrial I/O connector pins as below:
- A+: XY-MD02 A+ to IOT-GATE-iMX8PLUS / SBC-IOT-IMX8PLUS P8-01
- B-: XY-MD02 B- to IOT-GATE-iMX8PLUS / SBC-IOT-IMX8PLUS P8-03
-------------------- ------------------------- | | | | | *--(+)---< <------------- 5V-30V | IOTG-IMX8PLUS | | | | (SBC-IOT-IMX8PLUS) | | *--(-)---< <-------------- GND |------ ------------ | | XY-MD02 (RS485) | | |==| IE-RS485 | | | *--(A+)--< <---...---> >---(1)---*-| | ------------ | | | | P8 | Slot A | | *--(B-)--< <---...---> >---(3)---*-| | | | | |------ | -------------------- -------------------------
Read data
- Read temperature once:
root@iot-gate-imx8plus:~$ /opt/modpoll/arm-linux-gnueabihf/modpoll -b 9600 -p none -t 3 -c 1 -r 2 -1 /dev/ttyRS485_A modpoll 3.10 - FieldTalk(tm) Modbus(R) Master Simulator Copyright (c) 2002-2021 proconX Pty Ltd Visit https://www.modbusdriver.com for Modbus libraries and tools. Protocol configuration: Modbus RTU, FC4 Slave configuration...: address = 1, start reference = 2, count = 1 Communication.........: /dev/ttyRS485_A, 9600, 8, 1, none, t/o 1.00 s, poll rate 1000 ms Data type.............: 16-bit register, input register table -- Polling slave... [2]: 250
- Poll temperature:
root@iot-gate-imx8plus:~$ /opt/modpoll/arm-linux-gnueabihf/modpoll -b 9600 -p none -t 3 -c 1 -r 2 /dev/ttyRS485_A modpoll 3.10 - FieldTalk(tm) Modbus(R) Master Simulator Copyright (c) 2002-2021 proconX Pty Ltd Visit https://www.modbusdriver.com for Modbus libraries and tools. Protocol configuration: Modbus RTU, FC4 Slave configuration...: address = 1, start reference = 2, count = 1 Communication.........: /dev/ttyRS485_A, 9600, 8, 1, none, t/o 1.00 s, poll rate 1000 ms Data type.............: 16-bit register, input register table -- Polling slave... (Ctrl-C to stop) [2]: 254 -- Polling slave... (Ctrl-C to stop) [2]: 254 -- Polling slave... (Ctrl-C to stop) [2]: 254 ...
- Read humidity once:
root@iot-gate-imx8plus:~$ /opt/modpoll/arm-linux-gnueabihf/modpoll -b 9600 -p none -t 3 -c 1 -r 3 -1 /dev/ttyRS485_A modpoll 3.10 - FieldTalk(tm) Modbus(R) Master Simulator Copyright (c) 2002-2021 proconX Pty Ltd Visit https://www.modbusdriver.com for Modbus libraries and tools. Protocol configuration: Modbus RTU, FC4 Slave configuration...: address = 1, start reference = 3, count = 1 Communication.........: /dev/ttyRS485_A, 9600, 8, 1, none, t/o 1.00 s, poll rate 1000 ms Data type.............: 16-bit register, input register table -- Polling slave... [3]: 515
- Poll humidity:
root@iot-gate-imx8plus:~$ /opt/modpoll/arm-linux-gnueabihf/modpoll -b 9600 -p none -t 3 -c 1 -r 3 /dev/ttyRS485_A modpoll 3.10 - FieldTalk(tm) Modbus(R) Master Simulator Copyright (c) 2002-2021 proconX Pty Ltd Visit https://www.modbusdriver.com for Modbus libraries and tools. Protocol configuration: Modbus RTU, FC4 Slave configuration...: address = 1, start reference = 3, count = 1 Communication.........: /dev/ttyRS485_A, 9600, 8, 1, none, t/o 1.00 s, poll rate 1000 ms Data type.............: 16-bit register, input register table -- Polling slave... (Ctrl-C to stop) [3]: 894 -- Polling slave... (Ctrl-C to stop) [3]: 895 -- Polling slave... (Ctrl-C to stop) [3]: 896 ...
- Read temperature & humidity once:
root@iot-gate-imx8plus:~$ /opt/modpoll/arm-linux-gnueabihf/modpoll -b 9600 -p none -t 3 -c 2 -r 2 -1 /dev/ttyRS485_A modpoll 3.10 - FieldTalk(tm) Modbus(R) Master Simulator Copyright (c) 2002-2021 proconX Pty Ltd Visit https://www.modbusdriver.com for Modbus libraries and tools. Protocol configuration: Modbus RTU, FC4 Slave configuration...: address = 1, start reference = 2, count = 2 Communication.........: /dev/ttyRS485_A, 9600, 8, 1, none, t/o 1.00 s, poll rate 1000 ms Data type.............: 16-bit register, input register table -- Polling slave... [2]: 263 [3]: 606
- Poll temperature & humidity:
root@iot-gate-imx8plus:~$ /opt/modpoll/arm-linux-gnueabihf/modpoll -b 9600 -p none -t 3 -c 2 -r 2 /dev/ttyRS485_A modpoll 3.10 - FieldTalk(tm) Modbus(R) Master Simulator Copyright (c) 2002-2021 proconX Pty Ltd Visit https://www.modbusdriver.com for Modbus libraries and tools. Protocol configuration: Modbus RTU, FC4 Slave configuration...: address = 1, start reference = 2, count = 2 Communication.........: /dev/ttyRS485_A, 9600, 8, 1, none, t/o 1.00 s, poll rate 1000 ms Data type.............: 16-bit register, input register table -- Polling slave... (Ctrl-C to stop) [2]: 263 [3]: 545 -- Polling slave... (Ctrl-C to stop) [2]: 263 [3]: 543 -- Polling slave... (Ctrl-C to stop) [2]: 263 [3]: 542 ...
- Read slave address, baudrate, temperature & humidity corrections:
root@iot-gate-imx8plus:~$ /opt/modpoll/arm-linux-gnueabihf/modpoll -b 9600 -p none -t 4 -c 4 -r 258 -1 /dev/ttyRS485_A modpoll 3.10 - FieldTalk(tm) Modbus(R) Master Simulator Copyright (c) 2002-2021 proconX Pty Ltd Visit https://www.modbusdriver.com for Modbus libraries and tools. Protocol configuration: Modbus RTU, FC3 Slave configuration...: address = 1, start reference = 258, count = 4 Communication.........: /dev/ttyRS485_A, 9600, 8, 1, none, t/o 1.00 s, poll rate 1000 ms Data type.............: 16-bit register, output (holding) register table -- Polling slave... [258]: 1 [259]: 9600 [260]: 0 [261]: 0
Digital I/O
Digital I/O module features 4 digital inputs and 4 digital outputs and can be installed into slot D (configuration option FDIO).
Four digital inputs are implemented with the CLT3-4B digital termination following EN 61131-2.
Four digital outputs are implemented with the VNI4140K solid-state relay following EN 61131-2.
Digital I/O module requires an external voltage supply up to 24V to be properly connected. Please refer to Industrial I/O Connector pin-out for more details. |
Configuration and Access
Use iotg-imx8plus-dio utility to access digital inputs and outputs.
The example below shows how to access Digital inputs and outputs.
- Drive OUT2 pin HI:
root@iot-gate-imx8plus:~$ iotg-imx8plus-dio -o 2 1
- Read IN3 pin state (LO):
root@iot-gate-imx8plus:~$ iotg-imx8plus-dio -i 3 0
CAN
CAN function is implemented with i.MX8M Plus Flexible Controller Area Network (FlexCAN) communication controller.
CAN module can be installed into I/O slot C (configuration option FCCAN).
Configuration and Access
Once properly installed, CAN I/O module can be accessed in Linux via canC network interface. Refer to the CAN bus section for configuration and usage example.
Add-on boards
IOT-GATE-IMX8PLUS / SBC-IOT-IMX8PLUS features expansion interface via M.2 Key-E socket P19. The expansion connector allows integration of custom add-on boards into IOT-GATE-IMX8PLUS / SBC-IOT-IMX8PLUS. The expansion connector features embedded interfaces such as I2C, SPI, PWM, GPIO, etc.
Please refer to Expansion Connector pin-out for more details. |
Available add-on boards:
- TPM 2.0: implemented with Infineon SLB9670
- Break-out: exposes expansion connector signals on 100-mil headers
- eMMC/TPM: provides additional storage volume as well as TPM 2.0
- ADC/TPM: provides four single-ended analog input channels (0-3) as well as TPM 2.0
TPM
IOT-GATE-IMX8PLUS / SBC-IOT-IMX8PLUS can be optionally (configuration option FXTPM) assembled with a TPM 2.0 add-on board implemented with Infineon SLB9670.
- Install TPM add-on board into M.2 Socket (P19) if required
- Boot Linux kernel with iot-gate-imx8plus-m2tpm.dtb device tree
Accessing TPM
- Verify that the TPM device was created:
root@iot-gate-imx8plus:~$ ls -lh /dev/tpm*
- Otherwise load TPM kernel object:
root@iot-gate-imx8plus:~$ modprobe tpm_tis_spi
- Install the tpm2-tools package:
root@iot-gate-imx8plus:~$ apt-get update && apt-get install tpm2-tools
- Validate basic functionality
root@iot-gate-imx8plus:~$ tpm2_getrandom 16
Break-out
Break-out add-on board exposes expansion connector signals on 100-mil headers.
The IOT-GATE-IMX8PLUS / SBC-IOT-IMX8PLUS Yocto Linux image contains iot-gate-imx8plus-brkout_pwm_gpio.dtb device tree.
It provides break-out add-on board usage example by configuring:
- 2x PWMs
- 4x GPIOs
- 1x I2C
Interface/Bus | Name in Linux | Signal Name | Channel/Offset | Header-Offset |
PWM3 | pwmchip0 | PWM3_OUT | 0 | P5-09 |
PWM4 | pwmchip1 | PWM4_OUT | 0 | P5-07 |
GPIO5 | gpiochip4 | GPIO5_IO10 | 10 | P5-13 |
GPIO5_IO11 | 11 | P5-11 | ||
GPIO5_IO12 | 12 | P5-14 | ||
GPIO5_IO13 | 13 | P5-15 | ||
I2C5 | i2c-4 | I2C5_SDA | P5-08 | |
I2C5_SCL | P5-10 |
PWM
The following example demonstrates how to use pwmchip0 from Linux shell.
- Boot Linux kernel with iot-gate-imx8plus-brkout_pwm_gpio.dtb device tree
- Export PWM channel 0 on pwmchip0:
echo "0" | tee -a /sys/class/pwm/pwmchip0/export
- Setup PWM signal period of 100usec and duty cycle of 30%:
echo 100000 | tee -a /sys/class/pwm/pwmchip0/pwm0/period
echo 30000 | tee -a /sys/class/pwm/pwmchip0/pwm0/duty_cycle
- Enable PWM signal:
echo 1 | tee -a /sys/class/pwm/pwmchip0/pwm0/enable
- Disable PWM signal:
echo 0 | tee -a /sys/class/pwm/pwmchip0/pwm0/enable
- Un-export PWM channel 0 on pwmchip0:
echo "0" | tee -a /sys/class/pwm/pwmchip0/unexport
eMMC
IOT-GATE-IMX8PLUS / SBC-IOT-IMX8PLUS can be optionally (configuration option FXADC) assembled with eMMC/TPM add-on board implemented with:
- 32/64/128GB eMMC flash secondary storage device
- Infineon SLB9670 TPM 2.0
- 32/64/128GB eMMC flash secondary storage device
- Install ADC add-on board into M.2 Socket (P19) if required
- Boot Linux kernel with iot-gate-imx8plus-m2emmc.dtb device tree
Accessing eMMC Secondary Storage
- Verify that the mmcblk1 block device was created
root@iot-gate-imx8plus:~$ lsblk /dev/mmcblk1
For TPM functionality refer to Accessing TPM section |
ADC
IOT-GATE-IMX8PLUS / SBC-IOT-IMX8PLUS can be optionally (ordering option FXADC) assembled with ADC/TPM add-on board implemented with:
- TI ADS1015 analog-to-digital converter (ADC) that provides four single-ended analog input channels (0-3). Inputs operate between 0-10V or 4-20mA ranges for use with industrial sensors. The add-on can be set into current or voltage input mode via wire jumper
- Infineon SLB9670 TPM 2.0
- The ADC add-on board should be installed into expansion socket (P19)
- Boot Linux kernel with iot-gate-imx8plus-m2adc.dtb device tree
Accessing Analog Inputs
- Verify that the ADC device was created correctly
root@iot-gate-imx8plus:~$ ls -lh /sys/bus/iio/devices/iio:device0
- Read a detected value of channels AIN0 - AIN3:
root@iot-gate-imx8plus:~$ for i in {0..3} ; do cat /sys/bus/iio/devices/iio:device0/in_voltage${i}_raw ; done
For TPM functionality refer to Accessing TPM section |
RTC
IOT-GATE-IMX8PLUS / SBC-IOT-IMX8PLUS RTC is implemented with the AM1805 real-time clock (RTC) chip.
Back-up battery keeps the RTC running to maintain clock and time information whenever the main power supply is not present.
Accessing and setting the RTC
- To access the RTC time and date run:
root@iot-gate-imx8plus:~$ hwclock 2022-08-04 12:38:10.577874+00:00
- To set the date and write it into the RTC do the following:
root@iot-gate-imx8plus:~$ date -s "31 Dec 2021 10:00:00" Fri Dec 31 10:00:00 IST 2021 root@iot-gate-imx8plus:~$ hwclock -w root@iot-gate-imx8plus:~$ hwclock 2021-12-31 10:00:08.317403+02:00
Watchdog
IOT-GATE-IMX8PLUS / SBC-IOT-IMX8PLUS watchdog function is implemented with the i.MX8M Plus watchdog.
By default watchdog is not configured.
root@iot-gate-imx8plus:~$ systemctl show | grep RuntimeWatchdog
RuntimeWatchdogUSec=0
The value RuntimeWatchdogUSec=0 means watchdog logic is disabled: no watchdog device is opened, configured, or pinged
Watchdog configuration
- Edit /etc/systemd/system.conf file to configure watchdog related parameters, in particular RuntimeWatchdogSec and ShutdownWatchdogSec.
- RuntimeWatchdogSec - specifies the watchdog timeout for runtime services, meaning services that are actively running during normal system operation. The value is in seconds and should be set to a positive integer.
- ShutdownWatchdogSec - specifies the watchdog timeout for the shutdown process, insuring the system doesn't hang indefinitely during the shutdown. The value is in seconds and should be set to a positive integer.
- Reboot the device
- Verify watchdog configuration
root@iot-gate-imx8plus:~$ systemctl show | grep RuntimeWatchdog
RuntimeWatchdogUSec=10s
Watchdog testing
- Run the following command to simulate kernel panic:
root@iot-gate-imx8plus:~$ su
root@iot-gate-imx8plus:/home/compulab# echo "c" > /proc/sysrq-trigger
- As a result, the watchdog is not fed and the system reboots after 10 sec.
Low Power Modes
IOT-GATE-IMX8PLUS supports the following low-power modes:
- Sleep mode - RAM content is preserved, and the system can quickly wake up into the operating system. Power consumption in sleep mode is ~0.25W.
- Power-off mode - RAM content is not preserved, and the system will restart into a clean boot. Power consumption in power-off mode is ~0.02W.
IOT-GATE-IMX8PLUS supports two wake-up sources:
- Short press on the power button
- Timer alarm set in internal RTC (rtc1)
Only the internal RTC (rtc1) can be used for the wake-up alarm. Main DC power must be present to preserve alarm settings. |
Low power mode examples
Make sure that power button press is ignored and does not cause machine power-off: uncomment and set HandlePowerKey field to ignore value in the /etc/systemd/logind.conf |
- Sleep mode with exit by power button press:
root@compulab-imx8mp:~$ echo mem | tee -a /sys/power/state
- Sleep mode with exit by RTC wake-up call or power button press:
root@compulab-imx8mp:~$ rtcwake --device /dev/rtc1 -s 60 -m mem
- Power-off mode with boot on RTC wake-up call:
root@compulab-imx8mp:~$ rtcwake --device /dev/rtc1 -s 60 -m off
- In this example system reboots after 60 seconds.
LEDs
IOT-GATE-IMX8PLUS / SBC-IOT-IMX8PLUS features two user Bi-Color (Red + Green) LEDs found on front panel.
LEDs are controlled via GPIO pins and can be accessed via sysfs interface.
- LEDs are referred to as Green_1, Red_1, Green_2 and Red_2
- Choose a LED (LED2 Red in this example):
root@iot-gate-imx8plus:~$ LED=Red_2
- Turn the LED ON
root@iot-gate-imx8plus:~$ echo "1" | tee -a /sys/class/leds/${LED}/brightness
- Turn the LED OFF
root@iot-gate-imx8plus:~$ echo "0" | tee -a /sys/class/leds/${LED}/brightness
- Set LED's trigger
root@iot-gate-imx8plus:~$ echo "heartbeat" | tee -a /sys/class/leds/${LED}/trigger