Included Examples and Scripts¶
LED Driver¶
The MitySOM-5CSX module features a tri-color (red, green and blue) LED that can be controlled by a user application or script. We have provided an example script that interfaces with the LED driver. Note that for development kits that included "pre-production" silicon you should reference the "leds" script and for newer module/development kits use the "lp5562" script.
80-000640 and 80-000639 Development Kit LED script¶
Uses an LED driver, instead of I2C write commands, to change the color of the LED in a pattern. Create a script titled "lp5562" and paste the contents below inside. Then, run "chmod +x lp5562" to make it executable and run the script.
lp5562 Script Content (cycles through each LED/color)
#!/bin/sh echo 100 > /sys/class/leds/B/brightness echo "BLUE ON" sleep 1 echo 0 > /sys/class/leds/B/brightness echo 100 > /sys/class/leds/R/brightness echo "RED ON" sleep 1 echo 0 > /sys/class/leds/R/brightness echo 100 > /sys/class/leds/G/brightness echo "GREEN ON" sleep 1 echo 0 > /sys/class/leds/G/brightness echo 100 > /sys/class/leds/G1/brightness echo "GREEN1 ON" sleep 1 echo 0 > /sys/class/leds/G1/brightness
The expected output can be seen below. The RGB LED on the SOM should light up in the order presented in the output.
root@mitysom-5csx:~# ./scripts_auto/lp5562 BLUE ON RED ON GREEN ON GREEN1 ON
Depreciated - 80-000615 Development Kit LED script¶
./leds
I2C Power/Current monitor (IC located on baseboard)¶
The MitySOM-5CSX Development Kit Baseboard features a LTC2945 current monitor IC which monitors the current drawn by the modules +5V supply. This allows users to obtain an good approximation of module power consumption instantaneously.
root@mitysom-c5:~# ./scripts_auto/pwr_test.sh Checking power consumption power = 2765 mW Power Test: PASSED: Power = 2765 mW
SoM Thermocouple "tc74"¶
The MitySOM-5CSX module features an on-module thermocouple that can read the current temperature from that location. It is located on the "bottom" side of the module. Unlike the examples above the thermocouple is read by an application that is included on the development kit SD card file system.
For the latest details about using the temperature sensor please visit https://support.criticallink.com/redmine/projects/mityarm-5cs/wiki/SoM_Temperature_Sensor
FPGA DDR Memory Test¶
As a part of the included/pre-built FPGA image that is loaded automatically on startup of the module there is also a test application that writes and reads from the FPGA DDR memory. To execute this test perfrom the following command from the serial port:
root@mitysom-c5:~# ./fpga_ddr_test.sh ______________ STARTING DDR TEST ______________ Pattern Type: PRBS7 mem_check Location: 0xff210000 writing 256000000 bytes to 0 errors to inject: 0 ________________________________________ Writing 32-bit value 0x1 to address 0xFF218004 Writing 32-bit value 0x1 to address 0xFF214004 Writing 32-bit value 0x1 to address 0xFF218000 Writing 32-bit value 0x22 to address 0xFF210064 Creating descriptor for write (0xF424000 Bytes) Writing 32-bit value 0x0 to address 0xFF210044 Writing 32-bit value 0xF424000 to address 0xFF210048 Writing 32-bit value 0x80000000 to address 0xFF21005C Waiting for write to finish and injecting 0 errors Writing 32-bit value 0x1 to address 0xFF214000 Writing 32-bit value 0x22 to address 0xFF210024 Creating descriptor for read Writing 32-bit value 0x0 to address 0xFF210004 Writing 32-bit value 0xF424000 to address 0xFF210008 Writing 32-bit value 0x80000000 to address 0xFF21001C Waiting for read to finish snapshotting counters Writing 32-bit value 0x1 to address 0xFF214008 Disabling/resetting generator/checker Writing 32-bit value 0x0 to address 0xFF214000 Writing 32-bit value 0x0 to address 0xFF218000 Writing 32-bit value 0x2 to address 0xFF214008 Number of bytes written/read: 256000000/255999344 Number of errors injected/read: 0/0: Result: Passed
"eth_test.sh"¶
The included image/pre-built FPGA provides a script to test the network connection. Before running this script, modify the SERVER variable within the file to a known server's IP or something like Google's DNS server (8.8.8.8) to properly carry out a ping test. To do this, 'vi' can be used within the user space to quickly edit the variable which is on line 7 of the script. After completing the modification, perform the command seen below from the serial port while the Ethernet cable is connected (a successful test will look similar to the output below).
root@mitysom-c5:~# ./scripts_auto/eth_test.sh Testing ethernet using server: 10.0.0.123 PING 10.0.0.123 (10.0.0.123) 56(84) bytes of data. 64 bytes from 10.0.0.123: icmp_seq=1 ttl=64 time=0.325 ms --- 10.0.0.123 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.325/0.325/0.325/0.000 ms PING 10.0.0.123 (10.0.0.123) 56(84) bytes of data. 64 bytes from 10.0.0.123: icmp_seq=1 ttl=64 time=0.143 ms 64 bytes from 10.0.0.123: icmp_seq=2 ttl=64 time=0.182 ms 64 bytes from 10.0.0.123: icmp_seq=3 ttl=64 time=0.161 ms 64 bytes from 10.0.0.123: icmp_seq=4 ttl=64 time=0.144 ms 64 bytes from 10.0.0.123: icmp_seq=5 ttl=64 time=0.140 ms --- 10.0.0.123 ping statistics --- 5 packets transmitted, 5 received, 0% packet loss, time 4146ms rtt min/avg/max/mdev = 0.140/0.154/0.182/0.015 ms Verifying output Testing ethernet link speed Settings for eth0: Supported ports: [ TP MII ] Supported link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Full Supported pause frame use: Symmetric Receive-only Supports auto-negotiation: Yes Supported FEC modes: Not reported Advertised link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Full Advertised pause frame use: Symmetric Receive-only Advertised auto-negotiation: Yes Advertised FEC modes: Not reported Link partner advertised link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Full Link partner advertised pause frame use: Symmetric Link partner advertised auto-negotiation: Yes Link partner advertised FEC modes: Not reported Speed: 1000Mb/s Duplex: Full Auto-negotiation: on master-slave cfg: preferred slave master-slave status: slave Port: Twisted Pair PHYAD: 3 Transceiver: external MDI-X: Unknown Supports Wake-on: d Wake-on: d Current message level: 0x0000003f (63) drv probe link timer ifdown ifup Link detected: yes Ethernet test: PASSED: Ping: PASSED Speed: PASSED
Go to top