SBEV-UCMIMX8PLUS: Yocto Linux: How-To Guide

From Compulab Mediawiki
Revision as of 12:54, 7 November 2024 by Igor (talk | contribs) (Created page with "=Device Tree= == Available Device Tree == The current release come with these dtb files: {| class="wikitable" style="text-align:left;" |- | align="center" | '''Device Tree'''...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Device Tree

Available Device Tree

The current release come with these dtb files:

Device Tree Input Components Description
ucm-imx8m-plus-som.dtb

ucm-imx8m-plus-som.dtsi
compulab-imx8m-plus-ldo4.dtsi

som hw only
ucm-imx8m-plus-sbev.dtb

ucm-imx8m-plus-som.dts
ucm-imx8m-plus-pcie.dtsi
sbev-ucmimx8plus.dtsi
sbev-ucmimx8plus-mmc2.dtsi

som
+pcie
+sbev i2c
+sb-card

sbev-ucmimx8plus-headless.dtb

ucm-imx8m-plus-sbev.dtb
sbev-ucmimx8plus-enet1.dtbo
sbev-ucmimx8plus-wm8962.dtbo
sbev-ucmimx8plus-p15_spi.dtbo
sbev-ucmimx8plus-p16_i2c.dtbo
sbev-ucmimx8plus-p17_can.dtbo
sbev-ucmimx8plus-p18_gpio.dtbo
sbev-ucmimx8plus-p19_uart-b.dtbo
sbev-ucmimx8plus-p20_uart-a.dtbo

sbev
+fec
+wm8962
+p15_spi
+p16_i2c
+p17_can
+p18_gpio
+p19_uart-b
+p20_uart-a

sbev-ucmimx8plus.dtb
sbev-ucmimx8plus-lvds.dtb

sbev-ucmimx8plus-headless.dtb
sbev-ucmimx8plus-lvds.dtbo

sbev-headless
+lvds

sbev-ucmimx8plus-hdmi.dtb

sbev-ucmimx8plus-headless.dtb
sbev-ucmimx8plus-hdmi.dtbo

sbev-headless
+hdmi

sbev-ucmimx8plus-dualhead.dtb

sbev-ucmimx8plus-headless.dtb
sbev-ucmimx8plus-lvds.dtbo
sbev-ucmimx8plus-hdmi.dtbo

sbev-headless
+lvds
+hdmi

Available Device Tree Overlays

Admolition note.png The overlay load mode available with run bsp_bootcmd mode only.
DTB Overlay Hardware Configuration and Features Required Jumpers Settings
sbev-ucmimx8plus.dtbo sbev i2c + usb vbus
sbev-ucmimx8plus-enet1.dtbo Enable fec
sbev-ucmimx8plus-wm8962.dtbo Enable Wolfson Audio Codec wm8962
sbev-ucmimx8plus-p15_spi.dtbo Enable spi on p15 header
sbev-ucmimx8plus-p16_i2c.dtbo Enable i2c on p16 header
sbev-ucmimx8plus-p17_can.dtbo Enable can on p17 header
sbev-ucmimx8plus-p18_gpio.dtbo Enable gpio on p18 header
sbev-ucmimx8plus-p19_uart-b.dtbo Enable uart2 on p19 header
sbev-ucmimx8plus-p20_uart-a.dtbo Enable uart1 on p20 header
sbev-ucmimx8plus-csi1-isp0.dtbo Enable csi1 with isp0 (Basler .mc sensor’s support)
sbev-ucmimx8plus-csi2-isp1.dtbo Enable csi2 with isp1 (Basler .mc sensor’s support)
sbev-ucmimx8plus-csi1-isi0.dtbo Enable csi1 with isi0 (Basler .mci sensor’s support)
sbev-ucmimx8plus-csi2-isi1.dtbo Enable csi2 with isi1 (Basler .mci sensor’s support)

Boot Modes

The current release provides two methods to boot up the system:

... Embedded w/out GRUB Desktop with GRUB
U-Boot bootcmd run bsp_booctmd run distro_bootcmd
Boot Menu n/a GNU GRUB version 2.12
*Boot Linux Image-6.6.23-compulab-1.0-g370b4b3f2597
Install NXP i.MX Release Distro 6.6-scarthgap (scarthgap)
Advanced Boot Options
pros/cons pros:
Fast boot
cons:
Install Mode requires to Linux boot 1-st
pros:
Install Mode
Allows changing the device tree for the current session
cons:
Increases the boot time by the GRUB timeout

Set a device tree

The current release 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>
  • GRUB environment (if the image was created with the meta-compulab-uefi layer)
Environment Command/Procedure
GRUB Boot Menu Goto "Advanced Boot Options" and choose a device tree from the provided dtb list.
Linux grub-editenv /boot/EFI/BOOT/grubenv set fdt_file=<fdt_file_name>

U-Boot

Basic commands

  • Restore default boot environment:
env default -a
  • List boot candidates:
printenv bootlist
  • Get/Set device tree:
get set
printenv fdtfile setenv fdtfile sbev-ucmimx8plus-headless.dtb
  • Get/Set device tree overlay:

The lates U-Boot supports device tree file overlays to be loaded after the main file.
The fdtofile can be a list of device tree files.

Admolition note.png The boot process will fail if a file in the fdtofile is not found on the boot device.
get set
printenv fdtofile setenv fdtofile "sbev-ucmimx8plus-hdmi.dtbo sbev-ucmimx8plus-lvds.dtbo"

LDO4 - secondary RGMII voltage control

PMIC LDO4 controls voltage rail that powers secondary RGMII signal group.
By default LDO4 is configured for 1.8V operation. In order to control LDO4 settings and have them passed correctly to the Linux kernel, use the command and device tree described below.

  • ldo4 command:
help ldo4
  • ldo4 modes:
mode commands
1v8 mode ldo4 18; boot
3v3 mode ldo4 33; boot
off mode ldo4 0;boot

U-Boot overlays configuration

  • Overlay load mode example:
command description
setenv fdtfile sbev-ucmimx8plus-headless.dtb set the main device tree w/out any display interface enabled
setenv fdtofile 'sbev-ucmimx8plus-hdmi.dtbo sbev-ucmimx8plus-lvds.dtbo' set the overlay list that enables:
hdmi display
lvds display
setenv bootcmd 'run bsp_bootcmd' set the boot command that allows loading the device tree overlays
saveenv save the environment


setenv fdtfile ucm-imx8m-plus-headless.dtb
setenv fdtofile "sbev-ucmimx8plus-hdmi.dtbo sbev-ucmimx8plus-csi1-isp0.dtbo"
setenv bootcmd 'run bsp_bootcmd'
saveenv

Serial Console

UCM-iMX8M-Plus provides serial console on UART2.
SBEV-UCMIMX8Plus evaluation carrier-board exposes the console UART via CP2104 serial-to-USB bridge on connector P3.

Connecting to a host PC

  1. Use a micro-USB cable to connect the console connector P3 to a USB port on your host PC.
  2. 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
  3. Identify the host PC interface and port number that will be used for communication with the UCM-iMX8M-Plus evaluation kit:
    • 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
  4. Start a terminal emulation program (such as PuTTY on Windows or minicom on Linux).
  5. 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

Display

SBEV-UCMIMX8Plus supports two types of display interfaces: LVDS and HDMI.
All interfaces are enabled in the default sbev-ucmimx8plus-dualhead.dtb device tree file.

LVDS

SBEV-UCMIMX8Plus supports connection with the Startec KD070HDTLA020 7" LVDS LCD panel using the EB-HDRLVDS adapter board (supplied by Compulab with the LCD panel).
Connect the LCD data cable to adapter connector P7. Connect the LCD touch-panel cable to adapter connector P8. Connect the adapter to LVDS and touch headers P14 and P13.

The Linux device node for the LVDS display:

/sys/class/drm/card1/card1-LVDS-1/

This device node contains information about the display, such as its supported modes and its current configuration.

HDMI

SBEV-UCMIMX8Plus supports HDMI output on connector P22. Connect to standard monitor using an HDMI cable.

The Linux device node for the HDMI display:

/sys/class/drm/card1/card1-HDMI-A-1/

This device node contains information about the display, such as its supported modes and its current configuration.

Display Manager

UCM-iMX8M-Plus Yocto uses Weston as the default display manager. It can be configured in /etc/xdg/weston/weston.ini.
For example the transform setting can be set to rotate-90, rotate-180, rotate-270, or commented out.
In order to apply the configuration, you need to restart the weston display manager:

systemctl stop weston
systemctl start weston

USB

SBEV-UCMIMX8MPLUS features two USB3.0 sharable ports that are derived from the i.MX8M Plus USB sub-system:
USB connector J2 is multiplexed with mini-PCIe P3 socket. USB connector J3 is multiplexed with with M.2 key-E P23 that is used for optional WiFi module.

  • The USB Type-A J2 and J3 connectors are enabled by populating jumpers E1 and E4 respectively

USB1 mode switch

  • host
    The device works in a host mode by default.
  • device
    The device works in a device mode when the ucm-imx8m-plus-usbdev.dtbo is in use.
    In this mode the SOM can work in one of the usb device mode:
USB device mode Command/Procedure Test scenario
usb serial device modprobe g_serial
device: systemctl start serial-getty@ttyGS0
Linux PC: sudo minicom -D /dev/ttyACM0 115200
usb network device modprobe g_ether
usb mass storage device modprobe g_mass_storage file=/dev/sdX

SPI bus

SPI2 interface is available on SBEV-UCMIMX8PLUS via header P15. The following example shows the usage of the Linux spidev interface.

spidev

  • Device Tree:
&iomuxc {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_hog>;
	....
	pinctrl_ecspi2: ecspi2grp {
		fsl,pins = <
			MX8MP_IOMUXC_ECSPI2_SCLK__ECSPI2_SCLK		0x82
			MX8MP_IOMUXC_ECSPI2_MOSI__ECSPI2_MOSI		0x82
			MX8MP_IOMUXC_ECSPI2_MISO__ECSPI2_MISO		0x82
		>;
	};

	pinctrl_ecspi2_cs: ecspi2cs {
		fsl,pins = <
			MX8MP_IOMUXC_ECSPI2_SS0__GPIO5_IO13		0x40000
		>;
	};
	....
};

&ecspi2 {
	#address-cells = <1>;
	#size-cells = <0>;
	fsl,spi-num-chipselects = <1>;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_ecspi2 &pinctrl_ecspi2_cs>;
	cs-gpios = <&gpio5 13 GPIO_ACTIVE_LOW>;
	status = "okay";

	spidev1: spi@0 {
		reg = <0>;
		compatible = "rohm,dh2228fv";
		spi-max-frequency = <500000>;
	};
};
  • System board setup:
    short P15.3(MOSI) and P15.2(MISO) pins.
  • Linux command line test:
root@ucm-imx8m-plus:~# spidev_test -p 1234/5678 -v -D /dev/spidev1.0
spi mode: 0x4
bits per word: 8
max speed: 500000 Hz (500 kHz)
TX | 31 32 33 34 2F 35 36 37 38 __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __  |1234/5678|
RX | 31 32 33 34 2F 35 36 37 38 __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __  |1234/5678|

WiFi

SBEV-UCMIMX8PLUS implements 802.11ax WiFi and Bluetooth 5.3 BLE with an Intel AX210 wireless module installed in M.2 socket P23.
To use the wireless functions use antenna cables to connect WiFi antennas (supplied with the eval-kit) to antenna connectors located on the AX210 module.
The NetworkManager can be used to manage WiFi interface.

Enable/Disable WiFi Interface

  • To enable WiFi interface:
nmcli radio wifi on
  • To disable WiFi interface:
nmcli radio wifi off

Network Scanning

  • Sample WiFi scanning:
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:
nmcli device wifi connect <SSID> password <PASSWORD> name WifiCon
  • Disconnect wireless network:
nmcli connection down WifiCon
  • Connect wireless network again:
nmcli connection up WifiCon

Creating Access Point

Admolition note.png Debian 12
ipv4 forwarding must be turned on manually
  • Enable port forwarding:
sed -i 's/^#\(net.ipv[4,6].*forward\)/\1/' /etc/sysctl.conf

In the following example:

  • Replace <SSID> and <PASSWORD> with desired access point parameters:
nmcli device wifi hotspot ssid <SSID> password <PASSWORD> con-name HotspotCon
  • Disable wireless AP:
nmcli connection down HotspotCon
  • Enable wireless AP again:
nmcli connection up HotspotCon

CAN bus

CAN bus interface is available via header P17.
CAN bus on-board termination can be enabled by shorting jumper E6.

CAN interface configuration

It is recommended configure the CAN interface, with the iproute2 utilities.

  • To make sure the right ip utility is used, run:
ip -V
ip utility, iproute2-v5.7.0-77-gb687d1067169 
  • Configure both CAN interface bit-rate to 1 Mbit/sec:
ip link set can0 type can bitrate 1000000
ip link set can1 type can bitrate 1000000
  • Enable the CAN interface:
ip link set can0 up
ip link set can1 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):
cansend can0 111#1122334455667788
  • Send extended CAN frame (on the first device):
cansend can0 11111111#1122334455667788
  • CAN frames (extended mode) generator, random payload, interval between two successive flames 50 msec:
cangen -g 50 -e -D r -v can0

can: raw protocol (rev 20170425)
...
  can0  03FF0983#D7.61.FF.03.C1.F7.C1.34
  can0  19C34D32#F7.5A.C2.73.AD.0E.3F.0B
  can0  0675E391#2B.2D.D3.49
  can0  13091C55#99.32.EC.77.27.81.49.0B
  can0  098D67CF#22.50.AB.48.AD.7F.F4.26
  can0  05263FEC#1B.4C.02.45.6E
  can0  12B30E20#
  can0  1F193DF9#C5
  can0  1EB0B18F#3E.3F.DA.57.C2.FE.73.58
  can0  1E5C64D9#6F.0D.B3.63.6A
  can0  1E1DE3F9#96.48.AC.79.4E.00.27.71
  can0  0E1A11B7#75.81.70.7C.86.79.A7.77
  can0  05F8FD8B#33.F9.9B.1E.77.3D.1F
  can0  1E155FCD#E6.BA.F8.58.ED.6D.C8.10
  can0  1D91DF9E#5D.29.82.7B.97.1D.AB.5C
  can0  11FB3CDA#14.65.C3
  can0  091352C0#2C.ED
...
  • Dump all received data frames as well as error frames (on the second device):
candump any,0:0,#FFFFFFFF

  can0  111   [8]  11 22 33 44 55 66 77 88
  can0  11111111   [8]  11 22 33 44 55 66 77 88
...
  can0  03FF0983   [8]  D7 61 FF 03 C1 F7 C1 34
  can0  19C34D32   [8]  F7 5A C2 73 AD 0E 3F 0B
  can0  0675E391   [4]  2B 2D D3 49
  can0  13091C55   [8]  99 32 EC 77 27 81 49 0B
  can0  098D67CF   [8]  22 50 AB 48 AD 7F F4 26
  can0  05263FEC   [5]  1B 4C 02 45 6E
  can0  12B30E20   [0] 
  can0  1F193DF9   [1]  C5
  can0  1EB0B18F   [8]  3E 3F DA 57 C2 FE 73 58
  can0  1E5C64D9   [5]  6F 0D B3 63 6A
  can0  1E1DE3F9   [8]  96 48 AC 79 4E 00 27 71
  can0  0E1A11B7   [8]  75 81 70 7C 86 79 A7 77
  can0  05F8FD8B   [7]  33 F9 9B 1E 77 3D 1F
  can0  1E155FCD   [8]  E6 BA F8 58 ED 6D C8 10
  can0  1D91DF9E   [8]  5D 29 82 7B 97 1D AB 5C
  can0  11FB3CDA   [3]  14 65 C3
  can0  091352C0   [2]  2C ED
...

Gstreamer

Yocto Linux uses Gstreamer as a default multimedia framework. Here are some useful Gstreamer features:

Execute the following command to check all the source options:

gst-inspect-1.0 | grep source

Execute the following command to check all the sink options:

gst-inspect-1.0 | grep sink

Video Playback

Admolition note.png The operation below requires root access.

UCM-iMX8M-Plus features 1080p60 H.264, VP8 video decoding capabilities. Before starting video playback, please, ensure that the display is connected to the board.

The following commands can be used to start video playback (1.mov is a media file):

  • gst-play
gst-play /path/to/1.mov
  • gplay-1.0
gplay-1.0 /path/to/1.mov
  • gst-launch

This method is for advanced users. Please study this document before the start: i.MX8GStreamerUserGuide.pdf

gst-launch-1.0 -v filesrc location=/path/to/1.mov ! qtdemux name=d.video_0 ! h264parse ! avdec_h264 ! autovideosink

Camera

SBEV-UCMIMX8MPLUS features edge connector that exposes two MIPI-CSI interfaces provided by UCM-iMX8M-Plus.
Use the EB-EVCAMBLR adapter (included with UCM-iMX8M-Plus evaluation kit) to connect the following Basler camera modules:

  • daA4200-30mci/AR1335-3
  • daA3840-30mc/AR0082x-2

Video Capturing

Admolition note.png The operation below requires root access.

ISP Sensors

Admolition note.png imx8-isp.service must be disabled
systemctl disable imx8-isp.service; reboot
  • Hardware setup: Basler daA4200-30mci/AR1335-3
  • Software setup: csiX-isiY device tree overlays:
Interface Device tree, overlays and bootcmd
MIPI_CSI1/MIPI_CSI2 fw_setenv fdtfile sbev-ucmimx8plus-headless.dtb
fw_setenv fdtofile "sbev-ucmimx8plus-lvds.dtbo sbev-ucmimx8plus-csi1-isi0.dtbo sbev-ucmimx8plus-csi2-isi1.dtbo"
fw_setenv bootcmd "run bsp_bootcmd"
  • sw: the mxc-isi-cap is registered:
v4l2-ctl --list-devices
 ():
	/dev/v4l-subdev0

 ():
	/dev/v4l-subdev1

FSL Capture Media Device (platform:32c00000.bus:camera):
	/dev/media0

mxc-isi-cap_v1 (platform:32e00000.isi:cap_devic):
	/dev/video2

mxc-isi-cap_v1 (platform:32e02000.isi:cap_devic):
	/dev/video3

vsi_v4l2dec (platform:vsi_v4l2dec):
	/dev/video1

vsi_v4l2enc (platform:vsi_v4l2enc):
	/dev/video0

gst examples

The following commands should be used to start video capturing:

  • Default playback pipe line:
gst-launch-1.0 pylonsrc ! videoconvert ! autovideosink

If more that one sensor is in use then the command returns:

At least 2 devices match the specified criteria, use "device-index", "device-serial-number" or "device-user-name" to select one from the following list:
[0]: 40121115   daA4200-30mci
[1]: 40121116   daA4200-30mci
  • Provide a device-index parameter to specify a device:
gst-launch-1.0 pylonsrc device-index=0 ! videoconvert ! autovideosink

ISI Sensors

Admolition note.png imx8-isp.service must be enabled
systemctl enable imx8-isp.service; reboot
  • Hardware setup: Basler daA3840-30mc/AR0082x-2
  • Software setup: csiX-ispY device tree overlays:
Interface Device tree, overlays and bootcmd
MIPI_CSI1/MIPI_CSI2 fw_setenv fdtfile sbev-ucmimx8plus-headless.dtb
fw_setenv fdtofile "sbev-ucmimx8plus-lvds.dtbo sbev-ucmimx8plus-csi1-isp0.dtbo sbev-ucmimx8plus-csi2-isp1.dtbo"
fw_setenv bootcmd "run bsp_bootcmd"
  • sw: the platform:viv is registered:
v4l2-ctl --list-devices
 ():
	/dev/v4l-subdev0
	/dev/v4l-subdev4
	/dev/v4l-subdev5

 ():
	/dev/v4l-subdev1
	/dev/v4l-subdev6
	/dev/v4l-subdev7

 (csi0):
	/dev/v4l-subdev3

 (csi1):
	/dev/v4l-subdev2

FSL Capture Media Device (platform:32c00000.bus:camera):
	/dev/media0

VIV (platform:viv0):
	/dev/video2

VIV (platform:viv1):
	/dev/video3

vsi_v4l2dec (platform:vsi_v4l2dec):
	/dev/video1

vsi_v4l2enc (platform:vsi_v4l2enc):
	/dev/video0

viv_media (platform:vvcam-video.0):
	/dev/media1


For hardware setup and camera connection instructions please refer to UCM-iMX8M-Plus Hardware Guide.

gst examples

The following commands should be used to start video capturing:

  • filesink

Write stream to a file. In this example the encoded output gets saved in the 1.mov media file.

gst-launch-1.0 v4l2src device=/dev/video2 ! 'video/x-raw,width=1280,height=720,format=NV12' ! vpuenc_h264 ! filesink location=/path/to/1.mov
  • waylandsink

Output to wayland surface.

gst-launch-1.0 v4l2src device=/dev/video2 ! 'video/x-raw,width=1280,height=720,format=NV12' ! waylandsink window-width=1280 window-height=720
  • autovideosink

Wrapper video sink for automatically detected video sink.

gst-launch-1.0 v4l2src device=/dev/video2 ! 'video/x-raw,width=1280,height=720,format=NV12' ! autovideosink
  • Single Image Capturing
gst-launch v4l2src num-buffers=1 ! jpegenc ! filesink location=single_buffer.jpg

Video streaming

Admolition note.png The operation below requires root access.

The following command should be executed on UCM-iMX8M-Plus to start video streaming:

gst-launch-1.0 v4l2src device=/dev/video2 ! video/x-raw, width=640, height=480 ! jpegenc ! udpsink host=127.0.0.1 port=1234

127.0.0.1 is the IP address of the host PC, and 1234 is the host PC port.

The following command should be executed on host PC (Linux) to receive the video stream:

gst-launch-1.0 udpsrc port=1234 ! jpegdec ! autovideosink

1234 is the host PC port.

Analog Audio

SBEV-UCMIMX8PLUS carrier-board features an on-board WM8962 audio codec with stereo line output and line input.

Interface Device tree, overlays and bootcmd
Audio Interfaces fw_setenv fdtfile sbev-ucmimx8plus-headless.dtb
fw_setenv fdtofile "sbev-ucmimx8plus-hdmi.dtbo sbev-ucmimx8plus-lvds.dtbo sbev-ucmimx8plus-wm8962.dtbo"
fw_setenv bootcmd "run bsp_bootcmd"

List of available sound cards

  • aplay
aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: audiohdmi [audio-hdmi], device 0: i.MX HDMI i2s-hifi-0 [i.MX HDMI i2s-hifi-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: wm8962audio [wm8962-audio], device 0: HiFi wm8962-0 [HiFi wm8962-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
  • procfs
cat /proc/asound/cards
 0 [audiohdmi      ]: audio-hdmi - audio-hdmi
                      audio-hdmi
 1 [wm8962audio    ]: fsl-asoc-card - wm8962-audio
                      wm8962-audio

Switch between the available output

  • cl-oselect allows select an output device:
cl-oselect
1) alsa_output.platform-sound-hdmi.stereo-fallback
2) alsa_output.platform-sound-wm8962.stereo-fallback
3) <<
Sound sink [ alsa_output.platform-sound-hdmi.stereo-fallback ] >2

Audio playback

  • gplay-1.0 allows playing back media files:
gplay-1.0 /path/to/media.file

Suspend / Resume

Admolition note.png The operation below requires root access.

UCM-iMX8M-Plus features suspend mode, which allows to minimize power consumption.

The following command should be used to enter suspend mode:

echo mem >/sys/power/state

To resume normal operation press shortly the Power On button SW4.

CPU frequency

Admolition note.png The operation below requires root access.

CPU frequency current settings

Execute the following command to get the current settings:

grep -ir . /sys/devices/system/cpu/cpufreq/policy0/ 2>/dev/null

/sys/devices/system/cpu/cpufreq/policy0/scaling_min_freq:1200000
/sys/devices/system/cpu/cpufreq/policy0/scaling_available_governors:conservative ondemand userspace powersave performance schedutil 
/sys/devices/system/cpu/cpufreq/policy0/cpuinfo_cur_freq:1200000
/sys/devices/system/cpu/cpufreq/policy0/scaling_governor:ondemand
/sys/devices/system/cpu/cpufreq/policy0/cpuinfo_max_freq:1600000
/sys/devices/system/cpu/cpufreq/policy0/scaling_available_frequencies:1200000 1600000 
/sys/devices/system/cpu/cpufreq/policy0/related_cpus:0 1 2 3
/sys/devices/system/cpu/cpufreq/policy0/scaling_cur_freq:1200000
/sys/devices/system/cpu/cpufreq/policy0/scaling_setspeed:<unsupported>
/sys/devices/system/cpu/cpufreq/policy0/stats/trans_table:   From  :    To
/sys/devices/system/cpu/cpufreq/policy0/stats/trans_table:         :   1200000   1600000 
/sys/devices/system/cpu/cpufreq/policy0/stats/trans_table:  1200000:         0        65 
/sys/devices/system/cpu/cpufreq/policy0/stats/trans_table:  1600000:        65         0 
/sys/devices/system/cpu/cpufreq/policy0/stats/total_trans:130
/sys/devices/system/cpu/cpufreq/policy0/stats/time_in_state:1200000 643
/sys/devices/system/cpu/cpufreq/policy0/stats/time_in_state:1600000 474
/sys/devices/system/cpu/cpufreq/policy0/affected_cpus:0 1 2 3
/sys/devices/system/cpu/cpufreq/policy0/scaling_max_freq:1600000
/sys/devices/system/cpu/cpufreq/policy0/cpuinfo_transition_latency:182000
/sys/devices/system/cpu/cpufreq/policy0/scaling_driver:cpufreq-dt
/sys/devices/system/cpu/cpufreq/policy0/cpuinfo_min_freq:1200000

Changing the scaling governor

Execute the following command to change the scaling governor:

echo performance > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor

Where perfomance is name of the scaling governor.

Execute the following command to see available scaling governors:

cat /sys/devices/system/cpu/cpufreq/policy0/scaling_available_governors

Execute the following command to see current scaling governor:

cat /sys/devices/system/cpu/cpufreq/policy0/scaling_governor

Changing CPU frequency

Admolition note.png CPU frequency can be changed only when the scaling governoris set to userspace.

Execute the following command to set CPU frequency:

echo 1200000 > /sys/devices/system/cpu/cpufreq/policy0/scaling_setspeed

1200000 is one of the available CPU frequencies.

Execute the following command to see available CPU frequencies:

cat /sys/devices/system/cpu/cpufreq/policy0/scaling_available_frequencies

Execute the following command to see current CPU frequency:

cat /sys/devices/system/cpu/cpufreq/policy0/cpuinfo_cur_freq

CPU temperature

i.MX8M-Plus SoC features an internal temperature sensor which allows to measure the SoC temperature. Execute the following command to read the current CPU temperature:

cat /sys/class/thermal/thermal_zone0/temp

RTC

There two rtc on the device:

rtc0 (snvs-rtc-lp)

  • System information
udevadm info -p /sys/class/rtc/rtc0

P: /devices/platform/soc@0/30000000.bus/30370000.snvs/30370000.snvs:snvs-rtc-lp/rtc/rtc0
N: rtc0
L: -100
S: rtc
E: DEVPATH=/devices/platform/soc@0/30000000.bus/30370000.snvs/30370000.snvs:snvs-rtc-lp/rtc/rtc0
E: DEVNAME=/dev/rtc0
E: MAJOR=251
E: MINOR=0
E: SUBSYSTEM=rtc
E: USEC_INITIALIZED=8188223
E: DEVLINKS=/dev/rtc
  • Wake up:

This rtc can be used as a wake up source, as a result an rtcwakeup can be used with this device:

rtcwake --device /dev/rtc0 -s 5 -m mem

rtc1 (ab1805)

  • System information
udevadm info -p /sys/class/rtc/rtc1

P: /devices/platform/soc@0/30800000.bus/30a30000.i2c/i2c-1/1-0069/rtc/rtc1
N: rtc1
L: 0
E: DEVPATH=/devices/platform/soc@0/30800000.bus/30a30000.i2c/i2c-1/1-0069/rtc/rtc1
E: DEVNAME=/dev/rtc1
E: MAJOR=251
E: MINOR=1
E: SUBSYSTEM=rtc
  • Set the date and write it into the RTC:
date -s "12 SEP 2019 10:00:00"

Thu Sep 12 10:00:00 UTC 2019
hwclock --systohc --rtc /dev/rtc1
  • Read the RTC time and date:
hwclock --show --rtc /dev/rtc1

Thu Sep 12 10:00:48 2019  0.000000 seconds


Device Serial Number

Product information is stored in on-board EEPROM.

  • To read the product serial number, issue the folowing command:
cat /proc/device-tree/product-sn
  • To read the product configuration part number, issue the following command:
cat /proc/device-tree/product-options

See Also