UCM-iMX8M-Mini: Yocto Linux: How-To Guide
Contents
Wi-Fi
The operations below requires root access. |
UCM-iMX8M-Mini features certified 802.11ac Wi-Fi interface (Broadcom BCM43353 chipset). Before working with Wi-Fi, please, ensure that Wi-Fi antenna is connected.
For hardware setup and Wi-Fi antenna connection instructions please refer to evaluation kit hardware guide.
To start using Wi-Fi add your network credentials into the following file:
/etc/wpa_supplicant.conf
Add the network name into ssid field, password into psk field and key into the key_mgmt field (if your network uses key management).
The file should have the following content:
ctrl_interface=/var/run/wpa_supplicant ctrl_interface_group=0 update_config=1 network={ ssid="<the name of your internet acces point>" key_mgmt=WPA-PSK psk="<the password of your internet access point>" }
Execute the following commands to connect to the network:
wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf -D nl80211 udhcpc -i wlan0
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
The operation below requires root access. |
UCM-iMX8M-Mini features 1080p60 H.264, VP8 video decoding capabilities. Before starting video playback, please, ensure that the display is connected to the board.
For hardware setup and display connection instructions please refer to evaluation kit hardware guide.
The following command should be used to start video playback:
gst-launch-1.0 -v filesrc location=1.mov ! h264parse ! avdec_h264 ! autovideosink
Where 1.mov is name and extension of the video file.
Video Capturing
The operation below requires root access. |
UCM-iMX8M-Mini features 1080p60 H.264, VP8 video encoding. Before starting video capturing, please, ensure that camera is connected to the board.
For hardware setup and camera connection instructions please refer to evaluation kit hardware guide.
The following command should be used to start video capturing:
gst-launch-1.0 -v v4l2src ! vpuenc_h264 ! filesink location=1.mov
Where 1.mov is name and extension of the file.
Video streaming
The operation below requires root access. |
The following command should be executed on UCM-iMX8M-Mini to start video streaming:
gst-launch-1.0 v4l2src device=/dev/video0 ! 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.
Suspend / Resume
The operation below requires root access. |
UCM-iMX8M-Mini 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 SW5.
CPU frequency
The operation below requires root access. |
CPU frequency can be changed by using one of the following methods:
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
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-Mini 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
Execute the following command to set the date and write it into the RTC:
root@ucm-imx8m-mini:~# date -s "12 SEP 2019 10:00:00" Thu Sep 12 10:00:00 UTC 2019 root@ucm-imx8m-mini:~# /sbin/hwclock --systohc root@ucm-imx8m-mini:~# hwclock –w
Execute the following command to read the RTC time and date:
root@ucm-imx8m-mini:~# hwclock Thu Sep 12 10:00:48 2019 0.000000 seconds