Embedded module TQMaRZG2x - YOCTO Linux BSP documentation
Starterkit Interfaces and Functions
CAN
The MBaRZG2x provides the CAN interfaces CAN1 and CAN2.
CAN configuration
DIP switch S10 is used to configure the CAN interfaces CAN0 and CAN1.
Function | S1-1 | S1-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
it can be enabled by the following commands in the shell:
ip link set can0 down ip link set can0 up type can bitrate 500000 sample-point 0.75 dbitrate 4000000 dsample-point 0.8 fd on ip link set can1 down ip link set can1 up type can bitrate 500000 sample-point 0.75 dbitrate 4000000 dsample-point 0.8 fd on
Loopback Test CAN Interface
CAN0 -> CAN1
candump can0& cansend can1 5A1#11.2233.44556677.88
CAN1 -> CAN0
candump can1& cansend can0 5A1#11.2233.44556677.88
Ethernet
The STKRZG2X Starterkit provides one 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
The Ethernet interface is activated and configured by systemd-network. The configuration file for the interface are located in /lib/systemd/network/ the 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
HDMI
The STKaRZG2x provides a HDMI interface, the interface is activated by default.
I2C
An overview of the onboard i2c devices is available here
U-Boot
Select i2c bus device
i2c dev 4,7
Show all devices connected to the i2c bus currently selected:
i2c probe
Linux
Detect all devices connected to a i2c bus:
i2cdetect 6,7,8
LVDS
TQ offers an optional LVDS Display kit for the STKRZG2x. An LVDS Display can be used by setting the corresponding device tree in the U-Boot environment. To allow reusage, the support for each display is separated in a separate dtsi fragment.
To bring up the display the U-Boot environment has to be adapted accordingly.
1. Interrupt boot process in U-boot
2. Set U-Boot environment variable fdt_file a specific command has to be used for the differnt types of the TQMaRZG2x:
TQMaRZG2N
setenv fdt_file r8a774b1-tqmarzg2n_b-mbarzg2x-lvds-tm070jvhg33.dtb
TQMaRZG2M-AA
setenv fdt_file r8a774a1-tqmarzg2m_aa-mbarzg2x-lvds-tm070jvhg33.dtb
TQMaRZG2H
setenv fdt_file r8a774e1-tqmarzg2h_c-mbarzg2x-lvds-tm070jvhg33.dtb
3. Save the envrionment by executing the saveenv
command
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 STKaRZG2x has two temperature sensors, one is located on the TQMaRZG2x SOM and the other is locates on the MBaRZG2x baseboard.
Device | I²C Address |
---|---|
TQMaRZG2x | 0x1F |
MBaRZG2x | 0x1F |
Read TQMaRZG2x Temperature Sensor
cat /sys/devices/platform/soc/e60b0000.i2c/i2c-7/7-001f/hwmon/hwmon0/temp1_input
Read MBaRZG2x Temperature Sensor
cat /sys/devices/platform/soc/e66d8000.i2c/i2c-4/4-001f/hwmon/hwmon1/temp1_input
Read CPU internal Temperature Sensor
The RZ/G“ CPU has an internal TMU that supports three thermal zones, all can be read by the commands below:
Thermal zone0
cat /sys/devices/virtual/thermal/thermal_zone0/temp
Thermal zone1
cat /sys/devices/virtual/thermal/thermal_zone1/temp
Thermal zone2
cat /sys/devices/virtual/thermal/thermal_zone2/temp
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
).
User LED
The MBaRZG2x has three user controllable LEDs, the behavior of these LEDs can be selected by several triggers.
User LED Overview
Reference | LED name | color | linux filesystem |
---|---|---|---|
V17 | user_led_1 | green | /sys/class/leds/user_led_1 |
V16 | user_led_2 | green | /sys/class/leds/user_led_2 |
V46 | user_led_3 | green | /sys/class/leds/user_led_3 |
User LED Location
The user LED's are located in /sys/devices/platform/leds/leds/.
To change the behaviour a specific LED, the value in the file trigger must be overwritten.
The following values are valid:
For example set the trigger of user_led_1 to heartbeat
echo heartbeat > /sys/class/leds/user_led_1/trigger
SSH Connection
SSH Connection
The file /etc/ssh/sshd_config is used to configure the SSH service. To be able to login with a password as user root change the following lines in the Authentication section
PermitRootLogin prohibit-password
to
PermitRootLogin yes
and
#PasswordAuthentication yes
to
PasswordAuthentication yes
After altering the SSH configuration, the SSH service must be restarted to apply the new configuration:
systemctl restart sshd.socket
To setup a password for a user,
execute the command passwd <username>
, e.g. passwd root
for the default user root, and set your password. Afterwards execute the login
command to login the user with the new password.
- Last modified: 2022/09/17 13:37