Difference between revisions of "iMX8M Industrial Accessing and Testing Peripherals"

From Voipac Wiki
Jump to navigation Jump to search
Line 464: Line 464:
  
 
Check connection:
 
Check connection:
1. edit in  /etc/wpa_supplicant.conf ssid and passphrase fields
+
# edit in  /etc/wpa_supplicant.conf ssid and passphrase fields
  
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
Line 481: Line 481:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
2. start wpa_supplicant
+
# start wpa_supplicant
  
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
Line 498: Line 498:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
3. run udhcpc  
+
# run udhcpc  
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
udhcpc -i wlp1s0
 
udhcpc -i wlp1s0

Revision as of 21:36, 27 January 2022

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 and microphone to MIC
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: Verify Digital microphone
Output: Microphone sound is played in headphones

root@imx8mq-voipac:~# amixer -c1 sset "Capture Input" "DMIC"
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

User buttons

Input: Press Enter/Left/Right/Up/Down buttons
Output: Button events 1 and 0 are generated

root@imx8mq-voipac:~# evtest /dev/input/by-path/platform-gpio-buttons-event 
Input driver version is 1.0.1
Input device ID: bus 0x19 vendor 0x1 product 0x1 version 0x100
Input device name: "gpio-buttons"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 28 (KEY_ENTER)
    Event code 103 (KEY_UP)
    Event code 105 (KEY_LEFT)
    Event code 106 (KEY_RIGHT)
    Event code 108 (KEY_DOWN)
Properties:
Testing ... (interrupt to exit)

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 2020.04-imx_v2020.04_5.4.24_2.1.0+g4979a99482 (May 30 2020 - 06:50:01 +0000)

CPU:   i.MX8MQLite rev2.1 1300 MHz (running at 800 MHz)
CPU:   Industrial temperature grade (-40C to 105C) at 62C
Reset cause: POR
Model: Voipac i.MX8MQ EVK
DRAM:  2 GiB
MMC:   FSL_SDHC: 0, FSL_SDHC: 1
Loading Environment from MMC... OK
[*]-Video Link 0imx8m_hdmi_probe
....

Power button

Input: Press the POWER button
Output: The board will shutdown. By pressing again board should start booting."

[  OK  ] Stopped target Sound Card.
[  OK  ] Stopped target System Time Synchronized.
[  OK  ] Stopped target System Time Set.
[  OK  ] Stopped target Timers.
[  OK  ] Stopped Daily Cleanup of Temporary Directories.
         Stopping Save/Restore Sound Card State...
         Stopping Kernel Logging Service...
         Stopping System Logging Service...
         Stopping Getty on tty1...
         Stopping Serial Getty on ttymxc0...
         Stopping Hostname Service...
         Stopping Load/Save Random Seed...
[  OK  ] Stopped Kernel Logging Service.
[  OK  ] Stopped System Logging Service.
[  OK  ] Stopped Getty on tty1.
[  OK  ] Stopped Serial Getty on ttymxc0.
[  OK  ] Stopped Hostname Service.
[  OK  ] Stopped Save/Restore Sound Card State.
[  OK  ] Stopped Load/Save Random Seed.
[  OK  ] Stopped Session c1 of user root.
[  OK  ] Removed slice system-getty.slice.
[  OK  ] Removed slice system-serial\x2dgetty.slice.
         Stopping Login Service...
         Stopping User Manager for UID 0...
[  OK  ] Stopped User Manager for UID 0.
         Stopping User Runtime Directory /run/user/0...
[  OK  ] Unmounted /run/user/0.
[  OK  ] Stopped User Runtime Directory /run/user/0.
[  OK  ] Removed slice User Slice of UID 0.
         Stopping D-Bus System Message Bus...
         Stopping Permit User Sessions...
[  OK  ] Stopped D-Bus System Message Bus.
[  OK  ] Stopped Login Service.
[  OK  ] Stopped Permit User Sessions.
[  OK  ] Stopped target Basic System.
[  OK  ] Stopped target Network.
[  OK  ] Stopped target Paths.                                             
[  OK  ] Stopped Dispatch Password ��…ts to Console Directory Watch.       
[  OK  ] Stopped Forward Password R��…uests to Wall Directory Watch.       
[  OK  ] Stopped target Remote File Systems.                               
[  OK  ] Stopped target Slices.                                            
[  OK  ] Removed slice User and Session Slice.
[  OK  ] Stopped target Sockets.
[  OK  ] Closed D-Bus System Message Bus Socket.
[  OK  ] Closed dropbear.socket.
[  OK  ] Stopped target System Initialization.
[  OK  ] Closed Syslog Socket.
         Stopping Network Name Resolution...
         Stopping Network Time Synchronization...
[  OK  ] Stopped Network Name Resolution.
[  OK  ] Stopped Network Time Synchronization.
         Stopping Network Service...
[  OK  ] Stopped Create Volatile Files and Directories.
[  OK  ] Stopped target Local File Systems.
         Unmounting Temporary Directory (/tmp)...
         Unmounting /var/volatile...
[  OK  ] Stopped Network Service.
[  OK  ] Unmounted Temporary Directory (/tmp).
[  OK  ] Unmounted /var/volatile.
[  OK  ] Stopped target Local File Systems (Pre).
[  OK  ] Stopped target Swap.
[  OK  ] Reached target Unmount All Filesystems.
[  OK  ] Stopped Remount Root and Kernel File Systems.
[  OK  ] Stopped Apply Kernel Variables.
[  OK  ] Stopped Load Kernel Modules.
[  OK  ] Stopped Create Static Device Nodes in /dev.
[  OK  ] Reached target Shutdown.
[  OK  ] Reached target Final Step.
[  OK  ] Started Power-Off.
[  OK  ] Reached target Power-Off.
[   15.911216] systemd-shutdown[1]: Syncing filesystems and block devices.
[   15.920832] systemd-shutdown[1]: Sending SIGTERM to remaining processes...
[   15.936588] systemd-journald[247]: Received SIGTERM from PID 1 (systemd-shutdow).
[   15.959340] systemd-shutdown[1]: Sending SIGKILL to remaining processes...
[   15.975454] systemd-shutdown[1]: Unmounting file systems.
[   15.982656] [353]: Remounting '/' read-only in with options '(null)'.
[   16.020576] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[   16.031646] systemd-shutdown[1]: All filesystems unmounted.
[   16.037301] systemd-shutdown[1]: Deactivating swaps.
[   16.042421] systemd-shutdown[1]: All swaps deactivated.
[   16.047678] systemd-shutdown[1]: Detaching loop devices.
[   16.055830] systemd-shutdown[1]: All loop devices detached.
[   16.061424] systemd-shutdown[1]: Detaching DM devices.
[   16.066794] systemd-shutdown[1]: All DM devices detached.
[   16.072226] systemd-shutdown[1]: All filesystems, swaps, loop devices and DM devices detached.
[   16.086744] systemd-shutdown[1]: Syncing filesystems and block devices.
[   16.093483] systemd-shutdown[1]: Powering off.
[   16.097961] kvm: exiting hardware virtualization
[   16.097991] imx-sdma 30bd0000.sdma: external firmware not found, using ROM firmware
[   16.098546] cfg80211: failed to load regulatory.db
[   16.101341] imx-sdma 302c0000.sdma: loaded firmware 4.5
[   16.166426] mwifiex_pcie 0000:01:00.0: info: shutdown mwifiex...
[   16.173169] mwifiex_pcie 0000:01:00.0: PREP_CMD: card is removed
[   16.240963] mwifiex_pcie 0000:01:00.0: performing cancel_work_sync()...
[   16.247595] mwifiex_pcie 0000:01:00.0: cancel_work_sync() done
[   16.288309] reboot: Power down

Then pressing POWER button again:

U-Boot 2020.04-imx_v2020.04_5.4.24_2.1.0+g4979a99482 (May 30 2020 - 06:50:01 +0000)

CPU:   i.MX8MQLite rev2.1 1300 MHz (running at 800 MHz)
CPU:   Industrial temperature grade (-40C to 105C) at 62C
Reset cause: POR
Model: Voipac i.MX8MQ EVK
DRAM:  2 GiB
MMC:   FSL_SDHC: 0, FSL_SDHC: 1
Loading Environment from MMC... OK
[*]-Video Link 0imx8m_hdmi_probe
....

CAN

Input: None
Output: Device driver is available

root@imx8mq-voipac:~# ip addr show dev can0
1: can0: <NOARP,ECHO> mtu 16 qdisc noop state DOWN group default qlen 10
    link/can

To setup can interface to 500kB bitrate use following command:

ip link set can0 type can bitrate 500000

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@imx8mq-voipac:~# ip addr show dev eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:0d:15:01:50:92 brd ff:ff:ff:ff:ff:ff
    inet 192.168.10.122/24 brd 192.168.10.255 scope global dynamic eth0
       valid_lft 86103sec preferred_lft 86103sec
    inet6 fe80::20d:15ff:fe01:5092/64 scope link 
       valid_lft forever preferred_lft forever

Input: Plug Ethernet cable into connector
Output: IPv4 address is assigned

root@imx6-openrexultra:~# dmesg | tail
...
[  348.300585] fec 30be0000.ethernet eth0: Link is Down
[  350.350853] fec 30be0000.ethernet eth0: Link is Up - 100Mbps/Full - flow control off

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@imx8mq-voipac:~#
for LED in /sys/class/leds/user
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@imx8mq-voipac:~# echo heartbeat > /sys/class/leds/user/trigger

Wifi

Input: None
Output: Device driver is available

root@imx8mq-voipac:~# dmesg | grep mwifiex
[    5.145232] mwifiex_pcie 0000:01:00.0: enabling device (0000 -> 0002)
[    5.166217] mwifiex_pcie: PCI memory map Virt0: (____ptrval____) PCI memory map Virt2: (____ptrval____)
[    6.133666] mwifiex_pcie 0000:01:00.0: info: FW download over, size 632240 bytes
[    7.004061] mwifiex_pcie 0000:01:00.0: WLAN FW is active
[    7.049670] mwifiex_pcie 0000:01:00.0: Unknown api_id: 3
[    7.055024] mwifiex_pcie 0000:01:00.0: Unknown api_id: 4
[    7.060385] mwifiex_pcie 0000:01:00.0: Unknown GET_HW_SPEC TLV type: 0x217
[    7.075700] mwifiex_pcie 0000:01:00.0: info: MWIFIEX VERSION: mwifiex 1.0 (16.68.1.p179) 
[    7.080505] mwifiex_pcie 0000:01:00.0 wlp1s0: renamed from mlan0
[    7.083959] mwifiex_pcie 0000:01:00.0: driver_version = mwifiex 1.0 (16.68.1.p179)

Chek if interface is present

root@imx8mq-voipac:~# ip addr show dev wlp1s0
3: wlp1s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 78:c4:0e:a0:32:16 brd ff:ff:ff:ff:ff:ff

Check connection:

  1. edit in /etc/wpa_supplicant.conf ssid and passphrase fields
root@imx8mq-voipac:~# cat /etc/wpa_supplicant.conf 
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
update_config=1

network={
        ssid="AAA"
        scan_ssid=1
        key_mgmt=WPA-PSK
        psk="BBB"
}
  1. start wpa_supplicant
root@imx8mq-voipac:~# wpa_supplicant -i wlp1s0 -c/etc/wpa_supplicant.conf &
root@imx8mq-voipac:~# Successfully initialized wpa_supplicant
rfkill: Cannot open RFKILL control device
wlp1s0: Trying to associate with 40:a5:ef:c0:70:62 (SSID='CPE_C0[  188.254851] mwifiex_pcie 0000:01:00.0: info: trying 
to associate to 'CPE_C07061' bssid 40:a5:ef:c0:70:62
7061' freq=2462 MHz)
[  188.334475] mwifiex_pcie 0000:01:00.0: info: associated to bssid 40:a5:ef:c0:70:62 successfully
wlp1s0: Associated with 40:a5:ef:c0:70:62
wlp1s0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
[  188.351598] IPv6: ADDRCONF(NETDEV_CHANGE): wlp1s0: link becomes ready
wlp1s0: WPA: Key negotiation completed with 40:a5:ef:c0:70:62 [PTK=CCMP GTK=CCMP]
wlp1s0: CTRL-EVENT-CONNECTED - Connection to 40:a5:ef:c0:70:62 completed [id=0 id_str=]
  1. run udhcpc
udhcpc -i wlp1s0

Bluetooth