iMX8M Industrial Accessing and Testing Peripherals

From Voipac Wiki
Revision as of 18:45, 27 January 2022 by Voipac-sw (talk | contribs) (→‎Audio)
Jump to navigation Jump to search

Elemental operations of iMX8M Industrial Development Kit interfaces in Max configuration are shown on this page.

Prerequisites

Hardware

  • DC power supply (5V, 8A, 40W)
  • iMX8M Industrial Development Kit Max

Peripherals and Accessories

  • 1x FullHD monitor with Audio output
  • 1x MicroSD card
  • KOE LVDS capacitive display set
  • Newhaven LVDS capacitive display set
  • Digilent MIPI-CSI camera
  • NXP MIPI-CSI camera
  • CANBus module
  • Wifi and Bluetooth antenna set


Cables

  • Ethernet cable
  • HDMI cable
  • Micro USB cable
  • USB to UART cable
  • Headphones

Audio

Input: Search kernel log for wm8904 chip
Output: Audio chip is detected and bound as an input device

[    1.864809] fsl-asoc-card sound-wm8904: failed to find codec device
[    2.155773] wm8904 0-001a: 0-001a supply DCVDD not found, using dummy regulator
[    2.163163] wm8904 0-001a: 0-001a supply DBVDD not found, using dummy regulator
[    2.170561] wm8904 0-001a: 0-001a supply AVDD not found, using dummy regulator
[    2.177846] wm8904 0-001a: 0-001a supply CPVDD not found, using dummy regulator
[    2.185209] wm8904 0-001a: 0-001a supply MICVDD not found, using dummy regulator
[    2.197860] wm8904 0-001a: revision A
[    2.699093] debugfs: Directory '308b0000.sai' with parent 'wm8904-audio' already present!
[    2.707395] fsl-asoc-card sound-wm8904: wm8904-hifi <-> 308b0000.sai mapping ok
[    2.714808] fsl-asoc-card sound-wm8904: ASoC: no DMI vendor name!
[    3.145901]   #1: wm8904-audio

Input: Run amixer command
Output: Controls for card are available

root@imx8mq-voipac:~# amixer -c1
Simple mixer control 'Headphone',0
  Capabilities: volume pswitch
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 63
  Front Left: 46 [73%] [-11.00dB] Playback [on]
  Front Right: 45 [71%] [-12.00dB] Playback [on]
Simple mixer control 'Headphone ZC',0
  Capabilities: pswitch
  Playback channels: Front Left - Front Right
  Mono:
  Front Left: Playback [on]
  Front Right: Playback [on]
Simple mixer control 'Line Output',0
  Capabilities: volume pswitch
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 63
  Front Left: 57 [90%] [0.00dB] Playback [on]
  Front Right: 57 [90%] [0.00dB] Playback [on]
Simple mixer control 'Line Output ZC',0
  Capabilities: pswitch
  Playback channels: Front Left - Front Right
  Mono:
  Front Left: Playback [on]
  Front Right: Playback [on]
...

Input: Boot-up the board with HDMI cable plugged in, connect headphones into HP_OUT connector and plug-in USB flash drive with wav file on it
Output: Sound is played and heard

root@imx8mq-voipac:~# aplay multimedia/sample.wav
Playing WAVE 'multimedia/sample.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
root@imx8mq-voipac:~# #aplay -D sysdefault:CARD=wm8904audio multimedia/sample.wav 
root@imx8mq-voipac:~# aplay -D sysdefault:CARD=wm8904audio multimedia/sample.wav
Playing WAVE 'multimedia/sample.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
root@imx8mq-voipac:~# aplay -D sysdefault:CARD=imxaudiohdmi multimedia/sample.wav 
Playing WAVE 'multimedia/sample.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo

Input: Plug headphones with microphone input into HP_OUT connector
Output: Microphone sound is played in headphones

root@imx8mq-voipac:~# #arecord -D sysdefault:CARD=wm8904audio -t wav -f cd | aplay -D sysdefault:CARD=wm8904audio
root@imx8mq-voipac:~# arecord -D sysdefault:CARD=wm8904audio -t wav -f cd | aplay -D sysdefault:CARD=wm8904audio

Input: Plug headphones with microphone input into HP_OUT connector
Output: Sound is recorded and played afterwards

root@imx6-openrexultra:~# #arecord -D sysdefault:CARD=imxaudiosgtl500 -t wav -f cd -d 10 multimedia/recorded.wav
root@imx6-openrexultra:~# arecord -D sysdefault:CARD=sgtl5000audio -t wav -f cd -d 10 multimedia/recorded.wav 
Recording WAVE 'multimedia/recorded.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
root@imx6-openrexultra:~# #aplay -D sysdefault:CARD=imxaudiosgtl500 multimedia/recorded.wav
root@imx6-openrexultra:~# aplay -D sysdefault:CARD=sgtl5000audio multimedia/recorded.wav
Playing WAVE 'multimedia/recorded.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo

User button

Input: Press Home/Back-/Menu+ buttons
Output: Button events 1 and 0 are generated

root@imx6-openrexultra:~# evtest /dev/input/by-path/platform-gpio-keys*-event
Input driver version is 1.0.1
Input device ID: bus 0x19 vendor 0x1 product 0x1 version 0x100
Input device name: "gpio-keys"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 102 (KEY_HOME)
    Event code 139 (KEY_MENU)
    Event code 158 (KEY_BACK)
Properties:
Testing ... (interrupt to exit)
Event: time 1473952105.010541, type 1 (EV_KEY), code 102 (KEY_HOME), value 1
Event: time 1473952105.010541, -------------- SYN_REPORT ------------
Event: time 1473952105.140569, type 1 (EV_KEY), code 102 (KEY_HOME), value 0
Event: time 1473952105.140569, -------------- SYN_REPORT ------------
Event: time 1473952106.320588, type 1 (EV_KEY), code 158 (KEY_BACK), value 1
Event: time 1473952106.320588, -------------- SYN_REPORT ------------
Event: time 1473952106.440540, type 1 (EV_KEY), code 158 (KEY_BACK), value 0
Event: time 1473952106.440540, -------------- SYN_REPORT ------------
Event: time 1473952109.630544, type 1 (EV_KEY), code 139 (KEY_MENU), value 1
Event: time 1473952109.630544, -------------- SYN_REPORT ------------
Event: time 1473952109.760589, type 1 (EV_KEY), code 139 (KEY_MENU), value 0
Event: time 1473952109.760589, -------------- SYN_REPORT ------------

Alternative test

Input: Press Home/Back-/Menu+ buttons
Output: Button events 1 and 0 are generated

root@imx6-openrexultra:~# hexdump -C /dev/input/by-path/platform-gpio-keys-event
00000000  ef e7 da 57 ca 8e 0a 00  01 00 66 00 01 00 00 00  |...W......f.....|
00000010  ef e7 da 57 ca 8e 0a 00  00 00 00 00 00 00 00 00  |...W............|
00000020  ef e7 da 57 9f b1 0c 00  01 00 66 00 00 00 00 00  |...W......f.....|
00000030  ef e7 da 57 9f b1 0c 00  00 00 00 00 00 00 00 00  |...W............|
00000040  f0 e7 da 57 28 70 06 00  01 00 9e 00 01 00 00 00  |...W(p..........|
00000050  f0 e7 da 57 28 70 06 00  00 00 00 00 00 00 00 00  |...W(p..........|
00000060  f0 e7 da 57 18 93 08 00  01 00 9e 00 00 00 00 00  |...W............|
00000070  f0 e7 da 57 18 93 08 00  00 00 00 00 00 00 00 00  |...W............|
00000080  f1 e7 da 57 69 78 02 00  01 00 8b 00 01 00 00 00  |...Wix..........|
00000090  f1 e7 da 57 69 78 02 00  00 00 00 00 00 00 00 00  |...Wix..........|
000000a0  f1 e7 da 57 68 9b 04 00  01 00 8b 00 00 00 00 00  |...Wh...........|
000000b0  f1 e7 da 57 68 9b 04 00  00 00 00 00 00 00 00 00  |...Wh...........|

Reset button

Input: Press the RESET button
Output: The board will execute bootloader immediately with "Reset cause: POR"
Note: iMX8M Industrial Development Kit should never freeze or hang after the reset button was pressed. Testing the operation 10 times gives a reliable result

U-Boot 2015.10+fslc+g7d8ddd7 (Dec 15 2016 - 18:52:24 +0100)

CPU:   Freescale i.MX6QUAD rev1.1 996 MHz (running at 792 MHz)
CPU:   Extended Commercial temperature grade (-20C to 105C) at 44C
Reset cause: POR
Board: iMX6-OpenRex
I2C:   ready
DRAM:  512 MiB
MMC:   FSL_SDHC: 0
SF: Detected SST26VF032B with page size 256 Bytes, erase size 4 KiB, total 4 MiB
In:    serial
Out:   serial
Err:   serial
Net:   FEC [PRIME]
Hit any key to stop autoboot:  0 
OpenRex U-Boot>

CAN

Input: None
Output: Device driver is available

root@imx6-openrexultra:~# ip addr show dev can0
2: can0: <NOARP,ECHO> mtu 16 qdisc noop state DOWN group default qlen 10
    link/can 
root@imx6-openrexultra:~# ip addr show dev can1
3: can1: <NOARP,ECHO> mtu 16 qdisc noop state DOWN group default qlen 10
    link/can

Camera Input

Input: Connect RPi camera module into CSI interface and check if it is detected on I2C bus
Output: I2C address 0x36 is occupied and under use
Note: HDMI monitor may cause I2C communication issues

root@imx6-openrexultra:~# i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- UU -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- UU -- -- -- -- -- -- -- -- -- 
40: UU -- -- -- -- -- -- -- UU -- -- -- -- -- -- -- 
50: UU -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --

Input: Connect RPi camera into CSI interface and check kernel modules
Output: Device driver ov5647_camera_mipi_int(or ov5647_camera_mipi) is loaded

root@imx6-openrexultra:~# lsmod
Module                  Size  Used by
mxc_v4l2_capture       27362  1
ipu_bg_overlay_sdc      5230  1 mxc_v4l2_capture
ipu_still               2304  1 mxc_v4l2_capture
ipu_prp_enc             5864  1 mxc_v4l2_capture
ipu_csi_enc             3807  1 mxc_v4l2_capture
ipu_fg_overlay_sdc      6056  1 mxc_v4l2_capture
lm75                    4768  0
sht21                   2126  0
ov5647_camera_mipi_int    30415  0
v4l2_int_device         2897  3 ov5647_camera_mipi_int,ipu_csi_enc,mxc_v4l2_capture
at24                    5488  0
fxas2100x               6680  0
fxos8700                9014  0
mxc_dcic                6536  0
iwl4965                88394  0
iwlegacy               62850  1 iwl4965
galcore               226429  2

Input: Connect RPi camera module into CSI interface and capture image
Output: The image is displayed on HDMI monitor

root@imx6-openrexultra:~# echo 2 > /sys/bus/i2c/devices/1-0036/ov5647_mode 
root@imx6-openrexultra:~# gst-launch-1.0 v4l2src device="/dev/video0" ! video/x-bayer,width=1920,height=1080,framerate=30/1 ! queue ! bayer2rgb ! videoconvert ! fbdevsink
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
ERROR: v4l2 capture: unsupported ioctrl!
ERROR: v4l2 capture: unsupported ioctrl!
WARNING: from element /GstPipeline:pipeline0/GstFBDEVSink:fbdevsink0: A lot of buffers are being dropped.
Additional debug info:
/home/marek/workdir/imx6/yocto/fsl-release-bsp-4.1/build-x11/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/gstreamer1.0/1.6.0-r0/gstreamer-1.6.0/libs/gst/base/gstbasesink.c(2846): gst_base_sink_is_too_la:
There may be a timestamping problem, or this computer is too slow.
mxc_hdmi 20e0000.hdmi_video: Read EDID again
mxc_hdmi 20e0000.hdmi_video: create default modelist
EVENT plugin
WARNING: from element /GstPipeline:pipeline0/GstFBDEVSink:fbdevsink0: A lot of buffers are being dropped.
Additional debug info:
/home/marek/workdir/imx6/yocto/fsl-release-bsp-4.1/build-x11/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/gstreamer1.0/1.6.0-r0/gstreamer-1.6.0/libs/gst/base/gstbasesink.c(2846): gst_base_sink_is_too_la:
There may be a timestamping problem, or this computer is too slow.
^Chandling interrupt.
Interrupt: Stopping pipeline ...
Execution ended after 0:00:27.103901670
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
power_down_callback: ipu0/csi1

Alternative test

Input: Connect RPi camera module into CSI interface and capture image
Output: The image is displayed on HDMI monitor

root@imx6-openrexultra:~# echo 1 > /sys/bus/i2c/devices/1-0036/ov5647_mode
root@imx6-openrexultra:~# gst-launch-1.0 v4l2src device="/dev/video0" ! video/x-bayer,width=1280,height=720,framerate=30/1 ! queue ! bayer2rgb ! videoconvert ! fbdevsink
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
ERROR: v4l2 capture: unsupported ioctrl!
ERROR: v4l2 capture: unsupported ioctrl!
WARNING: from element /GstPipeline:pipeline0/GstFBDEVSink:fbdevsink0: A lot of buffers are being dropped.
Additional debug info:
/home/marek/workdir/imx6/yocto/fsl-release-bsp-4.1/build-x11/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/gstreamer1.0/1.6.0-r0/gstreamer-1.6.0/libs/gst/base/gstbasesink.c(2846): gst_base_sink_is_too_la:
There may be a timestamping problem, or this computer is too slow.
^Chandling interrupt.
Interrupt: Stopping pipeline ...
Execution ended after 0:00:06.514209667
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
root@imx6-openrexultra:~# power_down_callback: ipu0/csi1

Software integration and additional commands or settings of CSI camera interface are available on separate iMX6 OpenRex Camera page.

Ethernet

Input: None
Output: Device driver is available
Note: MAC address should be identical with the address on the sticker placed on the board

root@imx6-openrexultra:~# ip addr show dev eth0
4: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:0d:15:00:d1:75 brd ff:ff:ff:ff:ff:ff

Input: Plug Ethernet cable into connector and issue DHCP command
Output: IPv4 address is assigned

root@imx6-openrexultra:~# dmesg | tail
...
fec 2188000.ethernet eth0: Link is Down
fec 2188000.ethernet eth0: Link is Up - 100Mbps/Full - flow control off
root@imx6-openrexultra:~# udhcpc -i eth0
udhcpc (v1.23.2) started
Sending discover...
Sending discover...
Sending select for 192.168.1.39...
Lease of 192.168.1.39 obtained, lease time 600
/etc/udhcpc.d/50default: Adding DNS 192.168.1.1
/etc/udhcpc.d/50default: Adding DNS 192.168.1.2

HDMI Output

Input: Connect LCD monitor to the SBC
Output: Desktop UI is displayed correctly
iMX6 TinyRex Development Kit-HDMI terminal.png

User LED

Input: None
Output: Script switches User LED ON and OFF in one second intervals

root@imx6-openrexultra:~#
for LED in /sys/devices/soc0/leds*/leds/*
do
	echo Testing ${LED}
	echo -n "1" > ${LED}/brightness
	sleep 1
	echo -n "0" > ${LED}/brightness
	sleep 1
done

Input: None
Output: User LED is set to heartbeat blinking sequence

root@imx6-openrexultra:~# echo -n "heartbeat" >  /sys/devices/soc0/leds*/leds/module-led/trigger