VAR-SOM-AM43 Linux Unit Testing: Difference between revisions

From Variscite Wiki
No edit summary
Line 1: Line 1:
{{PageHeader|Unit Testing}}
__toc__
= CPU info =
= CPU info =
<pre>
<pre>
Line 17: Line 21:
Linux version 3.14.26-gde9decc-dirty (am43@ubuntu) (gcc version 4.7.3 20130226 (prerelease) (crosstool-NG linaro-1.13.1-4.7-2013.03-20130313 - Linaro GCC 2013.03) ) #1 Tue Jan 20 02:46:07 PST 2015
Linux version 3.14.26-gde9decc-dirty (am43@ubuntu) (gcc version 4.7.3 20130226 (prerelease) (crosstool-NG linaro-1.13.1-4.7-2013.03-20130313 - Linaro GCC 2013.03) ) #1 Tue Jan 20 02:46:07 PST 2015
root@varsomam43:~#
root@varsomam43:~#
</pre>
= RTC<br>  =
To set the RTC first set the date from Linux shell, type:<br>
<pre>$ date 2013.08.27-15:43
</pre>
Then set the real time clock from Linux shell, type:<br>
<pre>$ hwclock --systohc
</pre>
Power down your board wait 15 seconds and power up. Check your system with date and the time should be up to date.<br>
= Audio record/play  =
<pre>
$ aplay /usr/share/sounds/alsa/Front_Center.wav
$ arecord -f cd -d 10 -D hw:0,0 test.wav
$ aplay test.wav
</pre>
= WLAN  =
''' VAR-SOM-AM33 V2.X only:''' <br>
When using VAR-SOM-AM33 v2.x, SOM has a WL183x module. In that case you should configure the WL183x module as follows (only in the first boot):
<pre>$ cd /usr/bin/wlconf/
$ ./configure-device.sh [WL18xx chip]
Then choose the correct number of antennas on board and choose (n) to generate a clean configuration file from .ini
For example:
root@varsomam33:/usr/bin/wlconf# ./configure-device.sh wl1835
Device is capable of supporting 2 antenna in 2.4Ghz band
how many antennae are fitted? [1/2] : 1
Error: Module wlcore_sdio is not currently loaded
A wl18xx-conf.bin file already exists, do you want to modify it (y) or generate a clean one from .ini (n)
modify it? [y/n] : n
</pre>
'''General usage:''' <br>
List SSIDs, from Linux shell type:
<pre>$&nbsp;ifconfig wlan0 up
$&nbsp;iw wlan0 scan
</pre>
'''Connecting to an encrypted network:'''<br>
Find your network from the above scan command.<br>
<pre>$ wpa_passphrase &lt;YourAP&gt; &lt;YourPassword&gt; &gt;wpa.conf
$ ps | grep wpa_supplicant
*kill the wpa_supplicant process if exist.
$ wpa_supplicant -Dnl80211 -iwlan0 -c./wpa.conf -B
$ udhcpc -iwlan0
$ ifconfig
</pre>
* WL12xx calibration tool
Calibration of TI WL12xx wireless device is required and is saved into the NVS file. The NVS file is then used by the wl12xx driver.
For more details please read [http://processors.wiki.ti.com/index.php/WL12xx_NLCP_Calibration_Process NLCP Calibration Process]
= 100Mbit Ethernet =
On Target:
<pre>$ ifconfig
$ iperf -s -u
</pre>
On Host:
<pre>$ iperf -c 192.168.1.189 -u -b100M -w4KB
</pre>
= Gbit Ethernet =
On Target:
<pre>$ ifconfig
$ iperf -s -u
</pre>
On Host:
<pre>$ iperf -c 192.168.1.189 -u -b1000M -w4KB
</pre>
= OpenGL demo (supported CPUs) =
Run the demo script at Linux command prompt after the VAR-DVK-AM33 EVB boots up
<pre>
/etc/init.d/335x-demo
</pre>
= ADC controller =
please follow TI wiki pages:
http://processors.wiki.ti.com/index.php/AM335x_ADC_Driver%27s_Guide
= USB OTG as host  =
By default the OTG is configure to be "peripheral". You can switch it to  "host" if you change the dr_mode in the device tree.
Please see details on the Wiki page below:
http://variwiki.com/index.php?title=VAR-SOM-AM33_Linux_SDK_7_Configurations
Once the USB-OTG port has been configured as host, simply connect a USB Mouse or DOK to the OTG port.
= USB OTG as device =
Plug a USB cable to a Linux or a Windows host.<br>
Follow [http://www.linux-usb.org/gadget/file_storage.html www.linux-usb.org/gadget/file_storage.html] and build the backing_file.<br>
On the Target:<br>
<pre>$ modprobe g_mass_storage file=./backing_file
</pre>
On the Host:<br>
Wait for a mass-storage device to be detected.
= Bluetooth =
* Bring BT device up:
<pre>
$ hciconfig hci0 up
</pre>
* Scan for BT devices and ping:
<pre>
$ hcitool scan
$ l2ping 98:03:D8:C7:1A:96
</pre>
Then work with any other standard bluetooth API and commands.
= CAN Bus =
*Connect CANL, CANH and GND pins of two VAR-SOM-AM33 boards (located on J17).
*Power-up both boards.
*Type the following into the shell of both boards for configuration the CAN bus device:
<pre>$ ip link set can0 type can bitrate 50000 triple-sampling on
$ ip link set can0 up
</pre>
*Type the following to the shell of board 1 (which is used for testing receiving over can0 device):
<pre>$ candump can0
</pre>
*Type the following to the shell of board 2 (which is used for testing sending data packets over can0 device):
<pre>$ cansend can0 0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88</pre>
*At this point, board 1 will receive the data packet sent from board 2:
<pre><0x001> [8] 11 22 33 44 55 66 77 88
</pre>
= RS-232 port =
*Enable RS232 UART ttyO1 I/F on the VAR-SOM-AM33:
<pre>
echo 20 > /sys/class/gpio/export
echo "out" > /sys/class/gpio/gpio20/direction
echo 0 > /sys/class/gpio/gpio20/value
</pre>
*Start minicom and connect to a UART device:
<pre>
minicom -D/dev/ttyO1 -b115200 -8
</pre>
</pre>

Revision as of 22:40, 26 January 2015

Unit Testing

CPU info

root@varsomam43:~# cat /proc/cpuinfo
processor       : 0
model name      : ARMv7 Processor rev 10 (v7l)
Features        : swp half thumb fastmult vfp edsp thumbee neon vfpv3 tls vfpd32
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x2
CPU part        : 0xc09
CPU revision    : 10

Hardware        : Generic AM43 (Flattened Device Tree)
Revision        : 0000
Serial          : 0000000000000000
root@varsomam43:~# cat /proc/version
Linux version 3.14.26-gde9decc-dirty (am43@ubuntu) (gcc version 4.7.3 20130226 (prerelease) (crosstool-NG linaro-1.13.1-4.7-2013.03-20130313 - Linaro GCC 2013.03) ) #1 Tue Jan 20 02:46:07 PST 2015
root@varsomam43:~#

RTC

To set the RTC first set the date from Linux shell, type:

$ date 2013.08.27-15:43

Then set the real time clock from Linux shell, type:

$ hwclock --systohc

Power down your board wait 15 seconds and power up. Check your system with date and the time should be up to date.

Audio record/play

$ aplay /usr/share/sounds/alsa/Front_Center.wav
$ arecord -f cd -d 10 -D hw:0,0 test.wav
$ aplay test.wav 

WLAN

VAR-SOM-AM33 V2.X only:
When using VAR-SOM-AM33 v2.x, SOM has a WL183x module. In that case you should configure the WL183x module as follows (only in the first boot):

$ cd /usr/bin/wlconf/
$ ./configure-device.sh [WL18xx chip]
Then choose the correct number of antennas on board and choose (n) to generate a clean configuration file from .ini


For example:

root@varsomam33:/usr/bin/wlconf# ./configure-device.sh wl1835
Device is capable of supporting 2 antenna in 2.4Ghz band
how many antennae are fitted? [1/2] : 1
Error: Module wlcore_sdio is not currently loaded
A wl18xx-conf.bin file already exists, do you want to modify it (y) or generate a clean one from .ini (n)
modify it? [y/n] : n

General usage:
List SSIDs, from Linux shell type:

$ ifconfig wlan0 up
$ iw wlan0 scan

Connecting to an encrypted network:

Find your network from the above scan command.

$ wpa_passphrase <YourAP> <YourPassword> >wpa.conf
$ ps | grep wpa_supplicant
*kill the wpa_supplicant process if exist.
$ wpa_supplicant -Dnl80211 -iwlan0 -c./wpa.conf -B
$ udhcpc -iwlan0
$ ifconfig
  • WL12xx calibration tool

Calibration of TI WL12xx wireless device is required and is saved into the NVS file. The NVS file is then used by the wl12xx driver. For more details please read NLCP Calibration Process

100Mbit Ethernet

On Target:

$ ifconfig
$ iperf -s -u

On Host:

$ iperf -c 192.168.1.189 -u -b100M -w4KB

Gbit Ethernet

On Target:

$ ifconfig
$ iperf -s -u

On Host:

$ iperf -c 192.168.1.189 -u -b1000M -w4KB

OpenGL demo (supported CPUs)

Run the demo script at Linux command prompt after the VAR-DVK-AM33 EVB boots up

/etc/init.d/335x-demo 

ADC controller

please follow TI wiki pages: http://processors.wiki.ti.com/index.php/AM335x_ADC_Driver%27s_Guide

USB OTG as host

By default the OTG is configure to be "peripheral". You can switch it to "host" if you change the dr_mode in the device tree.

Please see details on the Wiki page below: http://variwiki.com/index.php?title=VAR-SOM-AM33_Linux_SDK_7_Configurations

Once the USB-OTG port has been configured as host, simply connect a USB Mouse or DOK to the OTG port.

USB OTG as device

Plug a USB cable to a Linux or a Windows host.

Follow www.linux-usb.org/gadget/file_storage.html and build the backing_file.

On the Target:

$ modprobe g_mass_storage file=./backing_file

On the Host:
Wait for a mass-storage device to be detected.

Bluetooth

  • Bring BT device up:
$ hciconfig hci0 up
  • Scan for BT devices and ping:
$ hcitool scan 
$ l2ping 98:03:D8:C7:1A:96

Then work with any other standard bluetooth API and commands.

CAN Bus

  • Connect CANL, CANH and GND pins of two VAR-SOM-AM33 boards (located on J17).
  • Power-up both boards.
  • Type the following into the shell of both boards for configuration the CAN bus device:
$ ip link set can0 type can bitrate 50000 triple-sampling on
$ ip link set can0 up
  • Type the following to the shell of board 1 (which is used for testing receiving over can0 device):
$ candump can0
  • Type the following to the shell of board 2 (which is used for testing sending data packets over can0 device):
$ cansend can0 0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88
  • At this point, board 1 will receive the data packet sent from board 2:
<0x001> [8] 11 22 33 44 55 66 77 88

RS-232 port

  • Enable RS232 UART ttyO1 I/F on the VAR-SOM-AM33:
echo 20 > /sys/class/gpio/export
echo "out" > /sys/class/gpio/gpio20/direction
echo 0 > /sys/class/gpio/gpio20/value
  • Start minicom and connect to a UART device:
minicom -D/dev/ttyO1 -b115200 -8