Embedded module TQMa335x - YOCTO Linux BSP documentation


Audio

Audio Connector Overview

Connector Function
X19 Microphone
X20 Line In
X21 Line Out

Audio Connector Location

Play Audio on MBa335x

A simple test sound can be played with the commandline tool speaker-test.
Headphones or active speakers have to be connected to X21 on MBa335x.

speaker-test --channels 2 --test wav

You can also play your own audio files using aplay

aplay <file>

e.g.

aplay test.wav
Please notice that no audio test files are available in the default image.

Record Audio via Line-In on MBa335x

arecord -f cd test.wav
The audio settings can be altered using amixer or alsamixer

Buttons

There are three GPIO buttons on the MBa335x.

GPIO Button Overview

Reference Button
S5 gpio496
S6 gpio497
S7 gpio498

GPIO Button Location

The buttons are available in the sysfs via the device /sys/class/gpio/ and can be tested with the evtest tool.

echo <GPIONR> > /sys/class/gpio/export
(e.g. echo 496 > /sys/class/gpio/export)
echo in > /sys/class/gpio/<Button>/direction
(e.g. echo in > /sys/class/gpio/gpio496/direction)
"Press the associated button, e.g. S5"
cat /sys/class/gpio/<Button>/value
(e.g. cat /sys/class/gpio/gpio496/value)
echo <GPIONR> > /sys/class/gpio/unexport
(e.g. echo 496 > /sys/class/gpio/unexport)

CAN

The MBa335x provides the CAN interfaces CAN0 and CAN1.

CAN is typically not enabled in the current BSP. To enable the CAN interfaces use the following commands:
ip link set can0 up type can bitrate 500000
ip link set can1 up type can bitrate 500000

CAN configuration

DIP switch S3 is used to configure the CAN interfaces CAN0 and CAN1.

Function S3-1 S3-2
CAN-Bus not terminated OFF OFF
not defined (illegal state) OFF ON
not defined (illegal state) ON OFF
CAN-Bus terminated with 120 Ohm ON ON

CAN Loopback

CAN0 -> CAN1

candump can0&
cansend can1 5A1#11.2233.44556677.88

CAN1 -> CAN0

candump can1&
cansend can0 5A1#11.2233.44556677.88

Ethernet

The STKa335x Starterkit provides two Gigabit Ethernet interfaces.

U-Boot

In U-Boot eth0 is configured as default interface. The IP configuration can be done statically or by a DHCP server in the network.

IP configuration via DHCP

For a configuration via a DHCP server, use the dhcp command in U-Boot.

Static IP configuration For a static IP configuration the following, U-Boot environment variables must be set:

setenv ipaddr <ipaddr> 
(e.g.: setenv ipaddr 192.168.100.111)
setenv netmask <netmask> 
(e.g.: setenv netmask 255.255.255.0)

Linux

Both Ethernet interfaces are activated and configured by systemd-network. The configuration file for the eth0 interface is located in /lib/systemd/network/ these configuration file can be altered to customize the default interface configuration. A documentation of the configuration files can be found here.

eth0 10-eth0.network

For a temporary static configuration the ip command can be used, below some useful ip commands are listed:

Activate a specific interface
e.g. eth0

ip link set eth0 up


Disable a specific interace
e.g. eth0

ip link set eth0 down


Show ip address for a specific interface
e.g. eth0

ip addr show eth0


Show statistic for a specific interface
e.g. eth0

 
ip -s link show eth0 


Set ip address for a specific interface
e.g. eth0

ip addr add 192.168.1.100/24 dev eth0


Show statistic of all interfaces

ip -s link


Set default gateway for a specific interfaces
e.g. set gateway ip 192.168.1.1 for eth0

ip route add default via 192.168.1.1 dev eth0

If a DHCP server is available in the network environment the ip configuration can be received from it. To do so execute the udhcpc command, by default eth0 is used.
To configure another interface via dhcp the parameter -i followed by the interface name e.g. eth1 must be given.
e.g. eth1

udhcpc -i eth1 

I2C

An overview of the onboard i2c devices is available here

U-Boot

Select i2c bus device

i2c dev 0

Show all devices connected to the i2c bus currently selected:

i2c probe

Linux

Detect all devices connected to a i2c bus:

i2cdetect 0

RTC

To set the hardware clock to the actual time and date use the following commands:

date -s [YYYY.]MM.DD-hh:mm[:ss]
hwclock -w

Temperature Sensors

The STKa335x has two temperature sensors, one is located on the TQMa335x SOM and the other is locates on the MBa335x baseboard.

Device I²C Address
TQMa335x 0x1F
MBa335x 0x19

Read TQMa335x Temperature Sensor

cat /sys/devices/platform/ocp/44c00000.interconnect/44c00000.interconnect:segment@200000/44e0b000.target-module/44e0b000.i2c/i2c-0/0-001f/hwmon/hwmon0/temp1_input

Read MBa335x Temperature Sensor

cat /sys/devices/platform/ocp/44c00000.interconnect/44c00000.interconnect:segment@200000/44e0b000.target-module/44e0b000.i2c/i2c-0/0-0019/hwmon/hwmon1/temp1_input

USB

With lsusb you can see all connected usb devices. To mount a partition of an usb stick you can excute mount /dev/<partition> <mount dir> (e.g. mount /dev/sdb1 /mnt). This will mount the first partition of sdb to /mnt. To unmount the device execute umount <mount dir> (e.g. umount /mnt).

  • Last modified: 2022/09/17 13:44