Difference between revisions of "UCM-iMX93: Yocto Linux: How-To Guide"

From Compulab Mediawiki
Jump to: navigation, search
(Created page with "=Device Tree= == Available Device Tree Files == The current release includes the following '''dtb''' files: {| class="wikitable" style="text-align:left;" |- | align="center" |...")
 
Line 53: Line 53:
 
|}
 
|}
  
 +
= Serial Console =
 +
UCM-iMX93 provides serial console on UART1.</br>
 +
SB-UCMIMX93 evaluation carrier-board exposes the console UART via CP2104 serial-to-USB bridge on connector [[UCM-iMX93: Evaluation Kit: Hardware Guide#Connector_Locations | '''P16''']].
 +
== Connecting to a host PC ==
 +
# Use a micro-USB cable to connect the console connector '''P16''' 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 UCM-iMX93 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
 +
# 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>
 +
 +
=Display=
 +
==MIPI-DSI==
 +
The UCM-iMX93 evaluation kit includes the Startec KD050HDFIA 5" MIPI-DSI LCD panel.
 +
 +
Connect the MIPI-DSI display to connectors [[UCM-iMX93: Evaluation Kit: Hardware Guide#Connector_Locations | '''P11''' and '''P12''']] on the SB-UCMIMX93 carrier-board.
 +
 +
The MIPI-DSI display is described in the following device tree include file (included in the default '''ucm-imx93.dtb''' device tree): ''arch/arm64/boot/dts/compulab/ucm-imx93-mipi.dtsi''
 +
<!--
 +
descriptors of hw device for the drivers
 +
* soc side - soc@0/dsi@4ae10000
 +
* display device - soc@0/dsi@4ae10000/panel@0
 +
driver can be found by the compatibility string i.e.
 +
cat /proc/device-tree/soc@0/dsi@4ae10000/compatible
 +
cat /proc/device-tree/soc@0/dsi@4ae10000/panel@0/compatible
 +
-->
 +
The Linux device node for the MIPI-DSI display:
 +
/sys/class/drm/card0/card0-DSI-1/
 +
This device node contains information about the display, such as its supported modes and its current configuration.
 +
 +
==LVDS==
 +
SB-UCMIMX93 supports direct connection with the Startec KD070HDTLA020 7" LVDS LCD panel.
 +
Connect the display data cable to connector [[UCM-iMX93: Evaluation Kit: Hardware Guide#Connector_Locations | '''P7''']].
 +
Connect the display touch-panel cable to connector [[UCM-iMX93: Evaluation Kit: Hardware Guide#Connector_Locations | '''P8''']].
 +
 +
LVDS display requires the following device tree: '''ucm-imx93-lvds.dts'''.
 +
 +
The Linux device node for the display is described in: ''arch/arm64/boot/dts/compulab/ucm-imx93-lvds.dtsi''.
 +
 +
==Display Manager==
 +
UCM-iMX93 Yocto uses Weston as the default display manager. It can be configured in ''/etc/xdg/weston/weston.ini''.</br>
 +
For example the transform setting can be set to rotate-90, rotate-180, rotate-270, or commented out.</br>
 +
In order to apply the configuration, you need to restart the weston display manager:
 +
systemctl stop weston
 +
systemctl start weston
 +
 +
=Camera=
 +
The UCM-iMX93 evaluation kit supports the e-con e-CAM131_CUMI1335_MOD 13MP 4K camera module.</br>
 +
Connect the camera to connector [[UCM-iMX93: Evaluation Kit: Hardware Guide#Connector_Locations | '''P9''']] on the SB-UCMIMX93 carrier-board.
 +
 +
The following device tree file should be used for camera operation: '''ucm-imx93-mipi-csi.dtb'''
 +
 +
Verify that the '''mxc-isi-cap''' driver is registered correctly:
 +
<pre>
 +
root@ucm-imx93:~# v4l2-ctl --list-devices
 +
mxc-isi-cap (platform:4ae40000.isi:cap_devic):
 +
        /dev/video0
 +
 +
FSL Capture Media Device (platform:mxc-md):
 +
        /dev/media0
 +
</pre>
 +
 +
The camera device tree nodes are described in: ''arch/arm64/boot/dts/compulab/ucm-imx93.dtsi''.</br>
 +
<!--
 +
* camera interface: /soc@0/bus@42000000/i2c@42530000/mipi2@42
 +
* soc camera controller /soc@0/bus@42800000/camera/csi@4ae00000
 +
 +
kernel drivers:
 +
* camera side: ar1335_af
 +
* soc side V4L2 Media Controller: imx8_media_dev
 +
-->
 +
The Linux video device node used for capturing: '''/dev/video0'''
 +
 +
==Video Capturing==
 +
Single image capturing:
 +
gst-launch-1.0 v4l2src num-buffers=1 ! jpegenc ! filesink location=single_buffer.jpg
 +
 +
Output to wayland surface:
 +
gst-launch-1.0 v4l2src device=/dev/video0 ! 'video/x-raw,width=1280,height=720,format=BGRA' ! textoverlay text="CLAB UCM-iMX93" ! waylandsink window-width=1280 window-height=720
 +
 +
To find a pipe element run:
 +
gst-inspect-1.0 | grep sink -i
 +
 +
Detailed information on a specific pipe element:
 +
gst-inspect-1.0 <name>
 +
 +
To learn more please refer to:
 +
 +
https://linuxtv.org/wiki/index.php/V4L_capturing
 +
 +
https://en.wikipedia.org/wiki/GStreamer
  
 
= USB =
 
= USB =
 
UCM-IMX93 features two USB2.0 ports that are derived from the i.MX93 USB sub-system.<br>
 
UCM-IMX93 features two USB2.0 ports that are derived from the i.MX93 USB sub-system.<br>
 
On SB-UCMIMX93 evaluation carrier-board USB ports are available on the following connectors:
 
On SB-UCMIMX93 evaluation carrier-board USB ports are available on the following connectors:
 
  
 
{| class="wikitable" style="text-align:left;"
 
{| class="wikitable" style="text-align:left;"
Line 106: Line 200:
 
|}
 
|}
  
=Controller–area network (CAN)=
+
=CAN bus=
 
UCM-iMX93 features two Flexible Controller Area Network (FLEXCAN) modules.
 
UCM-iMX93 features two Flexible Controller Area Network (FLEXCAN) modules.
SB-UCMIMX93 evaluation carrier-board exposes one CAN bus interface on connector '''J21'''.
+
SB-UCMIMX93 evaluation carrier-board exposes one CAN bus interface on connector [[UCM-iMX93: Evaluation Kit: Hardware Guide#Connector_Locations | '''J21''']].
  
 
==CAN interface configuration==
 
==CAN interface configuration==
Line 228: Line 322:
  
 
= Bluetooth =
 
= Bluetooth =
UCM-iMX93 features bluetooth connectivity solution implemented with an NXP 88W8997 module.<br>
+
UCM-iMX93 features Bluetooth connectivity implemented with an NXP 88W8997 module.<br>
  
 
{{Note|Before working with Bluetooth, please ensure that Bluetooth antenna is connected to the SOM.}}
 
{{Note|Before working with Bluetooth, please ensure that Bluetooth antenna is connected to the SOM.}}
Line 262: Line 356:
 
</pre>
 
</pre>
  
 +
=UART=
 +
The following table outlines default UART routing when UCM-iMX93 is used with the SB-UCMIMX93 carrier-board:
 +
{| class="wikitable" style="text-align:left;"
 +
|-
 +
| align="center" | '''UCM-iMX93 port'''
 +
| align="center" | '''Linux device'''
 +
| align="center" | '''on SB-UCMIMX93 carrier-board'''
 +
|-
 +
| align="center" |UART1
 +
| align="center" |/dev/ttyLP0
 +
| align="" |converted to serial-over-USB debug console, micro-USB connector [[UCM-iMX93: Evaluation Kit: Hardware Guide#Connector_Locations | P16]]
 +
|-
 +
| align="center" |UART2
 +
| align="center" |/dev/ttyLP1
 +
| align="" |converted to RS232, DB9 connector [[UCM-iMX93: Evaluation Kit: Hardware Guide#Connector_Locations | P17]]
 +
|-
 +
| align="center" |UART5
 +
| align="center" |/dev/ttyLP4
 +
| align="" |routed to 100-mil header [[UCM-iMX93: Evaluation Kit: Hardware Guide#Connector_Locations | P3]]
 +
|-
 +
| align="center" |UART7
 +
| align="center" |/dev/ttyLP6
 +
| align="" |converted to RS485, terminal block [[UCM-iMX93: Evaluation Kit: Hardware Guide#Connector_Locations | J22]]
 +
|-
 +
|}
 +
 +
'''Example: testing UART5'''
 +
* Short pin P3-1 (UART5-RX) with P3-3 (UART5-TX) on SB-UCMIMX93 to create a loop-back.
 +
* Run the following commands:
 +
# stty -F /dev/ttyLP4 115200
 +
# cat /dev/ttyLP4 &
 +
# echo hello > /dev/ttyLP4
 +
The "hello" string should appear on the terminal.
 
<!--
 
<!--
=Gstreamer=
+
For removing UART devices:
Yocto Linux uses Gstreamer as a default multimedia framework. Here are some useful Gstreamer features:
+
* Open ''arch/arm64/boot/dts/compulab/ucm-imx93.dtsi''
 
+
* Set desired UART device's status to 'disabled'
Execute the following command to check all the source options:
+
* Recompile
gst-inspect-1.0 | grep source
+
* Deploy the new dtb file
 
+
-->
Execute the following command to check all the sink options:
 
gst-inspect-1.0 | grep sink
 
 
 
==Video Capturing==
 
{{note|The operation below requires '''root''' access.}}
 
  
===Requirements===
+
=I2C=
* hw: an ar1335 sensor is connected to either P47 (MIPI_CSI2) or P49+E18 (MIPI_CSI1) port
+
The following I2C buses and devices are present when UCM-iMX93 is used with the SB-UCMIMX93 carrier-board:
* sw: a correct device tree is in use:
 
 
{| class="wikitable" style="text-align:left;"
 
{| class="wikitable" style="text-align:left;"
 
|-
 
|-
| align="" | '''Interface'''  
+
| align="center" | '''Device'''  
| align="" | '''Device Stree'''  
+
| align="center" | '''I2C bus in Linux'''
 +
| align="center" | '''Address'''
 +
| align="center" | '''HW port in UCM-iMX93'''  
 +
|-
 +
| align="" |UCM-iMX93 EEPROM
 +
| align="center" |0
 +
| align="center" |0x50
 +
| align="center" |I2C1 (internal)
 +
|-
 +
| align="" |UCM-iMX93 RTC
 +
| align="center" |0
 +
| align="center" |0x69
 +
| align="center" |I2C1 (internal)
 +
|-
 +
| align="" |UCM-iMX93 PMIC
 +
| align="center" |1
 +
| align="center" |0x25
 +
| align="center" |I2C2 (internal)
 +
|-
 +
| align="" |GPIO extender on SB-UCMIMX93 for on-board control signals
 +
| align="center" |2
 +
| align="center" |0x20
 +
| align="center" |I2C3
 
|-
 
|-
| align="" |MIPI_CSI1
+
| align="" |Camera module control on SB-UCMIMX93 connector P9
| align="" |ucm-imx93_mipi-csi1.dtb
+
| align="center" |2
 +
| align="center" |0x42
 +
| align="center" |I2C3
 +
|-
 +
| align="" |SB-UCMIMX93 EEPROM
 +
| align="center" |2
 +
| align="center" |0x54
 +
| align="center" |I2C3
 +
|-
 +
| align="" |Touch-screen controller of MIPI-DSI or LVDS panel on SB-UCMIMX93 connector P8 or P12
 +
| align="center" |2
 +
| align="center" |0x5d
 +
| align="center" |I2C3
 
|-
 
|-
 
|}
 
|}
* sw: the '''mxc-isi-cap''' is registered:
+
<!--
 +
To list all available buses:
 +
# ls /dev/i2c-*
 +
/dev/i2c-0  /dev/i2c-1  /dev/i2c-2
 +
-->
 +
To list all mapped devices:
 
<pre>
 
<pre>
v4l2-ctl --list-devices
+
# ls /proc/device-tree/soc@0/bus@*/i2c@*/*@* -d -w 1                                                                                                       
 +
/proc/device-tree/soc@0/bus@42000000/i2c@42530000/goodix@5d
 +
/proc/device-tree/soc@0/bus@42000000/i2c@42530000/mipi2@42
 +
/proc/device-tree/soc@0/bus@42000000/i2c@42530000/pca9555@20
 +
/proc/device-tree/soc@0/bus@44000000/i2c@44340000/rtc@69
 +
/proc/device-tree/soc@0/bus@44000000/i2c@44350000/pmic@25
 +
</pre>
 +
Note how:
 +
* each node is appended with its address.
 +
* I2C buses order corresponds to the order of their addresses.
  
  ():
+
e.g. to inspect bus 0, in which we have RTC, run:
        /dev/v4l-subdev0
+
# i2cdetect -y 0
 +
      0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
 +
00:                        -- -- -- -- -- -- -- --
 +
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
 +
  20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
 +
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
 +
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
 +
50: 50 51 52 53 -- -- -- -- -- -- -- -- -- -- -- --
 +
60: -- -- -- -- -- -- -- -- -- UU -- -- -- -- -- --
 +
70: -- -- -- -- -- -- -- --                       
 +
In the above output numbers mark unused devices, UU marks a device that is used by a driver.
  
mxc-isi-cap (platform:32e00000.isi:cap_devic):
+
Indeed we see RTC in use at offset 0x69.
        /dev/video0
 
  
FSL Capture Media Device (platform:mxc-md):
+
An example how to dump EEPROM contents:
        /dev/media0
+
hexdump -C /sys/devices/platform/soc@0/44000000.bus/44340000.i2c/i2c-0/0-0050/eeprom
</pre>
 
  
For hardware setup and camera connection instructions please refer to UCM-iMX93 Hardware Guide.
+
=SPI=
 
+
{| class="wikitable" style="text-align:left;"
===Examples===
+
|-
The following commands should be used to start video capturing:
+
| align="center" | '''port #'''
 
+
| align="center" | '''name'''
* filesink
+
| align="center" | '''pin'''
Write stream to a file. In this example the encoded output gets saved in the '''1.mov''' media file.
+
|-
 +
| align="center" |3
 +
| align="center" |MOSI
 +
| align="center" |p3.14
 +
|-
 +
| align="center" |3
 +
| align="center" |clk
 +
| align="center" |p3.16
 +
|-
 +
|}
 +
This command will list all of the SPI devices on the system:
 
<pre>
 
<pre>
gst-launch-1.0 v4l2src device=/dev/video0 ! 'video/x-raw,width=1280,height=720,format=NV12' ! vpuenc_h264 ! filesink location=/path/to/1.mov
+
root@ucm-imx93:~# find /proc/device-tree/ -name *spi*|grep soc
 +
/proc/device-tree/soc@0/bus@44000000/spi@44370000
 +
/proc/device-tree/soc@0/bus@44000000/spi@44360000
 +
/proc/device-tree/soc@0/bus@42000000/spi@42560000
 +
/proc/device-tree/soc@0/bus@42000000/spi@42700000
 +
/proc/device-tree/soc@0/bus@42000000/spi@425e0000
 +
/proc/device-tree/soc@0/bus@42000000/spi@426f0000
 +
/proc/device-tree/soc@0/bus@42000000/spi@42710000
 +
/proc/device-tree/soc@0/bus@42000000/spi@42720000
 +
/proc/device-tree/soc@0/bus@42000000/spi@42550000
 
</pre>
 
</pre>
  
* waylandsink
+
=GPIO=
Output to wayland surface.
+
The following signals are configured by default as general purpose GPIOs and are accessible on header '''P3''' on the SB-UCMIMX93 carrier-board:
<pre>
+
{| class="wikitable" style="text-align:left;"
gst-launch-1.0 v4l2src device=/dev/video0 ! 'video/x-raw,width=1280,height=720,format=NV12' ! waylandsink window-width=1280 window-height=720
+
|-
</pre>
+
| align="center" | '''Signal Name
* autovideosink
+
| align="center" | '''On SB-UCMIMX93'''
Wrapper video sink for automatically detected video sink.
+
|-
<pre>
+
| align="center" |GPIO_IO01
gst-launch-1.0 v4l2src device=/dev/video0 ! 'video/x-raw,width=1280,height=720,format=NV12' ! autovideosink
+
| align="center" |P3-1
</pre>
+
|-
 +
| align="center" |GPIO_IO00
 +
| align="center" |P3-3
 +
|-
 +
| align="center" |GPIO_IO02
 +
| align="center" |P3-5
 +
|-
 +
| align="center" |GPIO_IO03
 +
| align="center" |P3-7
 +
|-
 +
| align="center" |GPIO_IO04
 +
| align="center" |P3-20
 +
|-
 +
| align="center" |GPIO_IO05
 +
| align="center" |P3-18
 +
|-
 +
| align="center" |GPIO_IO07
 +
| align="center" |P3-6
 +
|-
 +
| align="center" |GPIO_IO14
 +
| align="center" |P5-4
 +
|-
 +
| align="center" |GPIO_IO15
 +
| align="center" |P3-2
 +
|-
 +
| align="center" |GPIO_IO16
 +
| align="center" |P3-4
 +
|-
 +
| align="center" |GPIO_IO17
 +
| align="center" |P3-19
 +
|-
 +
|}
  
* Single Image Capturing
+
Some GPIO signals defined in the default device tree are reserved for peripheral controls.
<pre>
 
gst-launch v4l2src num-buffers=1 ! jpegenc ! filesink location=single_buffer.jpg
 
</pre>
 
  
==Video streaming==
+
You can see these signals by running:
{{note|The operation below requires '''root''' access.}}
+
# cat /sys/kernel/debug/gpio
The following command should be executed on UCM-iMX93 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'''
+
gpiochip1: GPIOs 64-95, parent: platform/43820080.gpio, 43820080.gpio:
'''127.0.0.1''' is the IP address of the host PC, and '''1234''' is the host PC port.
+
  gpio-64  (                    |cd                  ) in  lo IRQ ACTIVE LOW
 +
gpio-71  (                    |regulator-usdhc2    ) out lo
 +
...
 +
how to interpret the above output? in this case, chip name is gpiochip1, each GPIO is described on this format: ''<name> (|<description>) <direction> <current state>''
 +
<!--The libgpiod library provides a way to manipulate GPIOs, see [https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/about/ here]-->
  
The following command should be executed on host PC (Linux) to receive the video stream:
+
To see all IOs of a chip run, e.g.:
  gst-launch-1.0 udpsrc port='''1234''' ! jpegdec ! autovideosink
+
  gpioinfo 3
'''1234''' is the host PC port.
+
The GPIOs definition is marked by "fsl,pins" property in the device tree:
-->
+
arch/arm64/boot/dts/compulab/ucm-imx93-pinctrl.dtsi
  
 
=Suspend / Resume=
 
=Suspend / Resume=
Line 349: Line 577:
 
</pre>
 
</pre>
  
To resume normal operation press shortly the '''Power On''' button '''SW5'''.
+
To resume normal operation press shortly the '''ON/OFF''' button [[UCM-iMX93: Evaluation Kit: Hardware Guide#Connector_Locations | '''SW5''']].
  
 
=CPU temperature=
 
=CPU temperature=
Line 364: Line 592:
  
 
== Internal RTC - rtc0 ==
 
== Internal RTC - rtc0 ==
* System information
+
System information:
 
<pre>
 
<pre>
 
udevadm info -p /sys/class/rtc/rtc0
 
udevadm info -p /sys/class/rtc/rtc0
Line 381: Line 609:
 
</pre>
 
</pre>
  
* Wake up:
+
Wake up:</br>
 
rtc0 can be used as a wake up source, as a result an '''rtcwakeup''' can be used with this device:
 
rtc0 can be used as a wake up source, as a result an '''rtcwakeup''' can be used with this device:
 
<pre>
 
<pre>
Line 388: Line 616:
  
 
== External RTC - rtc1 ==
 
== External RTC - rtc1 ==
* System information
+
System information:</br>
 
<pre>
 
<pre>
 
udevadm info -p /sys/class/rtc/rtc1
 
udevadm info -p /sys/class/rtc/rtc1
Line 401: Line 629:
 
</pre>
 
</pre>
  
* Set the date and write it into the RTC:
+
Set the date and write it into the RTC:</br>
 
<pre>
 
<pre>
 
date -s "16 Jun 2023 12:00:00"
 
date -s "16 Jun 2023 12:00:00"
Line 409: Line 637:
 
</pre>
 
</pre>
  
* Read the RTC time and date:
+
Read the RTC time and date:</br>
 
<pre>
 
<pre>
 
hwclock --show --rtc /dev/rtc1
 
hwclock --show --rtc /dev/rtc1
Line 415: Line 643:
 
2023-06-16 12:01:37.935876+00:00
 
2023-06-16 12:01:37.935876+00:00
 
</pre>
 
</pre>
 +
 +
<!--=Device Serial Number=
 +
The product serial number is a unique identifier that is assigned to each device during manufacturing. It can be used to troubleshoot problems.
 +
 +
To read the product serial number, run:
 +
root@ucm-imx93:~# cat /proc/device-tree/serial-number
 +
-->
  
 
=See Also=
 
=See Also=
*[[UCM-iMX93: Evaluation Kit: Getting Started | UCM-iMX93:Evaluation Kit: Getting Started]] <br>
+
* [[UCM-iMX93: Evaluation Kit: Getting Started|Eval-kit Quick Start Guide]]
 +
* [[UCM-iMX93: Evaluation Kit: Hardware Guide|Eval-Kit Hardware Guide]]
  
 
[[Category:Yocto]]
 
[[Category:Yocto]]
 
[[Category:UCM-iMX93]]
 
[[Category:UCM-iMX93]]

Revision as of 14:52, 28 August 2023

Device Tree

Available Device Tree Files

The current release includes the following dtb files:

DTB Hardware Configuration and Features Jumpers/Connectors Settings
ucm-imx93.dtb default hardware configuration + mipi dsi display P11/P12 mipi iface/touch is in use
ucm-imx93-lvds.dtb default hardware configuration + lvds display P7/P8 lvds iface/touch is in use
ucm-imx93-headless.dtb default hardware configuration w/out any display

Set 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/grub/grubenv set fdtfile=<fdt_file_name>

Serial Console

UCM-iMX93 provides serial console on UART1.
SB-UCMIMX93 evaluation carrier-board exposes the console UART via CP2104 serial-to-USB bridge on connector P16.

Connecting to a host PC

  1. Use a micro-USB cable to connect the console connector P16 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-iMX93 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

MIPI-DSI

The UCM-iMX93 evaluation kit includes the Startec KD050HDFIA 5" MIPI-DSI LCD panel.

Connect the MIPI-DSI display to connectors P11 and P12 on the SB-UCMIMX93 carrier-board.

The MIPI-DSI display is described in the following device tree include file (included in the default ucm-imx93.dtb device tree): arch/arm64/boot/dts/compulab/ucm-imx93-mipi.dtsi The Linux device node for the MIPI-DSI display:

/sys/class/drm/card0/card0-DSI-1/

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

LVDS

SB-UCMIMX93 supports direct connection with the Startec KD070HDTLA020 7" LVDS LCD panel. Connect the display data cable to connector P7. Connect the display touch-panel cable to connector P8.

LVDS display requires the following device tree: ucm-imx93-lvds.dts.

The Linux device node for the display is described in: arch/arm64/boot/dts/compulab/ucm-imx93-lvds.dtsi.

Display Manager

UCM-iMX93 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

Camera

The UCM-iMX93 evaluation kit supports the e-con e-CAM131_CUMI1335_MOD 13MP 4K camera module.
Connect the camera to connector P9 on the SB-UCMIMX93 carrier-board.

The following device tree file should be used for camera operation: ucm-imx93-mipi-csi.dtb

Verify that the mxc-isi-cap driver is registered correctly:

root@ucm-imx93:~# v4l2-ctl --list-devices
mxc-isi-cap (platform:4ae40000.isi:cap_devic):
        /dev/video0

FSL Capture Media Device (platform:mxc-md):
        /dev/media0

The camera device tree nodes are described in: arch/arm64/boot/dts/compulab/ucm-imx93.dtsi.
The Linux video device node used for capturing: /dev/video0

Video Capturing

Single image capturing:

gst-launch-1.0 v4l2src num-buffers=1 ! jpegenc ! filesink location=single_buffer.jpg

Output to wayland surface:

gst-launch-1.0 v4l2src device=/dev/video0 ! 'video/x-raw,width=1280,height=720,format=BGRA' ! textoverlay text="CLAB UCM-iMX93" ! waylandsink window-width=1280 window-height=720

To find a pipe element run:

gst-inspect-1.0 | grep sink -i

Detailed information on a specific pipe element:

gst-inspect-1.0 <name>

To learn more please refer to:

https://linuxtv.org/wiki/index.php/V4L_capturing

https://en.wikipedia.org/wiki/GStreamer

USB

UCM-IMX93 features two USB2.0 ports that are derived from the i.MX93 USB sub-system.
On SB-UCMIMX93 evaluation carrier-board USB ports are available on the following connectors:

USB port# HW setting Connector Mode
1 P21 is not used type-A J5 host
1 P21 connected to USB host micro-USB P21 device
2 jumper E11 is open type-A J6 host
2 jumper E11 is closed mini-PCIe P18 host

USB #1 in device mode

USB #1 port can be operated in device mode when connected to a host machine using connector P21.
Available gadgets for the UBS #1 in device mode:

USB gadget SOM command
usb serial device modprobe g_serial
usb network device modprobe g_ether
usb mass storage device modprobe g_mass_storage file=/dev/sdX

CAN bus

UCM-iMX93 features two Flexible Controller Area Network (FLEXCAN) modules. SB-UCMIMX93 evaluation carrier-board exposes one CAN bus interface on connector J21.

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
  • Enable the CAN interface:
ip link set can0 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
...

WiFi

UCM-iMX93 features 802.11ac wireless connectivity solution implemented with an NXP 88W8997 module.
The NetworkManager can be used to manage WiFi interface.

Admolition note.png Before working with WiFi, please ensure that WiFi antenna is connected to the SOM.

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

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

Bluetooth

UCM-iMX93 features Bluetooth connectivity implemented with an NXP 88W8997 module.


Admolition note.png Before working with Bluetooth, please ensure that Bluetooth antenna is connected to the SOM.


To start bluetoothctl use the following command:

bluetoothctl

To start the scan process use the following commands:

[bluetooth]# default-agent
[bluetooth]# power on
[bluetooth]# scan on

Bluetooth device should be turned on and visible. Its MAC-adress and name should appear in bluetoothctl in following format:

[CHG] Device AA:BB:CC:DD:EE:FF Name: Device_Name

To pair with the Bluetooth device use the following command:

pair AA:BB:CC:DD:EE:FF

Where AA:BB:CC:DD:EE:FF is MAC-adress of the Bluetooth device.

To quit bluetoothctl use the following command:

[Device_Name]# quit

UART

The following table outlines default UART routing when UCM-iMX93 is used with the SB-UCMIMX93 carrier-board:

UCM-iMX93 port Linux device on SB-UCMIMX93 carrier-board
UART1 /dev/ttyLP0 converted to serial-over-USB debug console, micro-USB connector P16
UART2 /dev/ttyLP1 converted to RS232, DB9 connector P17
UART5 /dev/ttyLP4 routed to 100-mil header P3
UART7 /dev/ttyLP6 converted to RS485, terminal block J22

Example: testing UART5

  • Short pin P3-1 (UART5-RX) with P3-3 (UART5-TX) on SB-UCMIMX93 to create a loop-back.
  • Run the following commands:
# stty -F /dev/ttyLP4 115200
# cat /dev/ttyLP4 &
# echo hello > /dev/ttyLP4

The "hello" string should appear on the terminal.

I2C

The following I2C buses and devices are present when UCM-iMX93 is used with the SB-UCMIMX93 carrier-board:

Device I2C bus in Linux Address HW port in UCM-iMX93
UCM-iMX93 EEPROM 0 0x50 I2C1 (internal)
UCM-iMX93 RTC 0 0x69 I2C1 (internal)
UCM-iMX93 PMIC 1 0x25 I2C2 (internal)
GPIO extender on SB-UCMIMX93 for on-board control signals 2 0x20 I2C3
Camera module control on SB-UCMIMX93 connector P9 2 0x42 I2C3
SB-UCMIMX93 EEPROM 2 0x54 I2C3
Touch-screen controller of MIPI-DSI or LVDS panel on SB-UCMIMX93 connector P8 or P12 2 0x5d I2C3

To list all mapped devices:

# ls /proc/device-tree/soc@0/bus@*/i2c@*/*@* -d -w 1                                                                                                         
/proc/device-tree/soc@0/bus@42000000/i2c@42530000/goodix@5d
/proc/device-tree/soc@0/bus@42000000/i2c@42530000/mipi2@42
/proc/device-tree/soc@0/bus@42000000/i2c@42530000/pca9555@20
/proc/device-tree/soc@0/bus@44000000/i2c@44340000/rtc@69
/proc/device-tree/soc@0/bus@44000000/i2c@44350000/pmic@25

Note how:

  • each node is appended with its address.
  • I2C buses order corresponds to the order of their addresses.

e.g. to inspect bus 0, in which we have RTC, run:

# i2cdetect -y 0
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: 50 51 52 53 -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- UU -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         

In the above output numbers mark unused devices, UU marks a device that is used by a driver.

Indeed we see RTC in use at offset 0x69.

An example how to dump EEPROM contents:

hexdump -C /sys/devices/platform/soc@0/44000000.bus/44340000.i2c/i2c-0/0-0050/eeprom

SPI

port # name pin
3 MOSI p3.14
3 clk p3.16

This command will list all of the SPI devices on the system:

root@ucm-imx93:~# find /proc/device-tree/ -name *spi*|grep soc
/proc/device-tree/soc@0/bus@44000000/spi@44370000
/proc/device-tree/soc@0/bus@44000000/spi@44360000
/proc/device-tree/soc@0/bus@42000000/spi@42560000
/proc/device-tree/soc@0/bus@42000000/spi@42700000
/proc/device-tree/soc@0/bus@42000000/spi@425e0000
/proc/device-tree/soc@0/bus@42000000/spi@426f0000
/proc/device-tree/soc@0/bus@42000000/spi@42710000
/proc/device-tree/soc@0/bus@42000000/spi@42720000
/proc/device-tree/soc@0/bus@42000000/spi@42550000

GPIO

The following signals are configured by default as general purpose GPIOs and are accessible on header P3 on the SB-UCMIMX93 carrier-board:

Signal Name On SB-UCMIMX93
GPIO_IO01 P3-1
GPIO_IO00 P3-3
GPIO_IO02 P3-5
GPIO_IO03 P3-7
GPIO_IO04 P3-20
GPIO_IO05 P3-18
GPIO_IO07 P3-6
GPIO_IO14 P5-4
GPIO_IO15 P3-2
GPIO_IO16 P3-4
GPIO_IO17 P3-19

Some GPIO signals defined in the default device tree are reserved for peripheral controls.

You can see these signals by running:

# cat /sys/kernel/debug/gpio
...
gpiochip1: GPIOs 64-95, parent: platform/43820080.gpio, 43820080.gpio:
gpio-64  (                    |cd                  ) in  lo IRQ ACTIVE LOW
gpio-71  (                    |regulator-usdhc2    ) out lo 
...

how to interpret the above output? in this case, chip name is gpiochip1, each GPIO is described on this format: <name> (|<description>) <direction> <current state>

To see all IOs of a chip run, e.g.:

gpioinfo 3

The GPIOs definition is marked by "fsl,pins" property in the device tree:

arch/arm64/boot/dts/compulab/ucm-imx93-pinctrl.dtsi

Suspend / Resume

Admolition note.png The operation below requires root access.

UCM-iMX93 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 ON/OFF button SW5.

CPU temperature

i.MX93 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

UCM-iMX93 features two RTC devices:

  • i.MX93 internal RTC (rtc0) - can be used as wake-up source
  • AB1805 external RTC (rtc1) - can be used for low current battery powered time keeping

Internal RTC - rtc0

System information:

udevadm info -p /sys/class/rtc/rtc0

P: /devices/platform/soc@0/44000000.bus/44440000.bbnsm/44440000.bbnsm:rtc/rtc/rtc0
N: rtc0
L: -100
S: rtc
E: DEVPATH=/devices/platform/soc@0/44000000.bus/44440000.bbnsm/44440000.bbnsm:rtc/rtc/rtc0
E: DEVNAME=/dev/rtc0
E: MAJOR=251
E: MINOR=0
E: SUBSYSTEM=rtc
E: USEC_INITIALIZED=14959708
E: DEVLINKS=/dev/rtc

Wake up:
rtc0 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

External RTC - rtc1

System information:

udevadm info -p /sys/class/rtc/rtc1

N: rtc1
L: 0
E: DEVPATH=/devices/platform/soc@0/44000000.bus/44340000.i2c/i2c-0/0-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 "16 Jun 2023 12:00:00"

Fri 16 Jun 2023 12:00:00
hwclock --systohc --rtc /dev/rtc1

Read the RTC time and date:

hwclock --show --rtc /dev/rtc1

2023-06-16 12:01:37.935876+00:00


See Also