WL1100's devices management & testing
From EnneEnneWiki
|
|---|
Contents |
Here some info about management and testing of several WL1100's on-board devices.
The uCs' firmware
To test the on board uC controller you can use the following commands.
First check the C2port support into sysfs:
# ls /sys/class/c2port/c2port0/ access flash_block_size flash_erase rev_id dev_id flash_blocks_num flash_size subsystem/ flash_access flash_data reset uevent
Initially the C2port access is disabled, to get access to the C2port, you need the command:
# echo 1 > /sys/class/c2port/c2port0/access
after that you should read the device ID and revision ID of the connected micro controller:
# cat /sys/class/c2port/c2port0/dev_id 8 # cat /sys/class/c2port/c2port0/rev_id 1
However, for security reasons, the in-system flash access in not enabled yet, to do so you need the command:
# echo 1 > /sys/class/c2port/c2port0/flash_access
After that you can read the whole flash:
# cat /sys/class/c2port/c2port0/flash_data > image
erase it:
# echo 1 > /sys/class/c2port/c2port0/flash_erase
and write it:
# cat image > /sys/class/c2port/c2port0/flash_data
after writing you have to reset the device to execute the new code:
# echo 1 > /sys/class/c2port/c2port0/reset
If you have an HEX file you can reprogram the in-system flash as follow:
# ./hex2image -S $(cat /sys/class/c2port/c2port0/flash_size) < image.hex \ > /sys/class/c2port/c2port0/flash_data
Accelerometer
By using this device we can gather information about user's arm position.
Use the following command in order to get arm position (in degrees) against the perpendicular vector of gravity one:
# cat /proc/sys/wl1100/arm/angle 45
LCD backlight
The LCD backlight is connected with the LCD framebuffer driver so you can manage it from different places.
If everything goes well you should have the entries:
hostname:~# ls /sys/class/backlight/pxabl0/ actual_brightness brightness device max_brightness power subsystem uevent
so you can write/read the backlight level by doing:
hostname:~# echo 10 > /sys/class/backlight/pxabl0/brightness hostname:~# cat /sys/class/backlight/pxabl0/actual_brightness 10
but you should also check that enabling/disabling the LCD panel the backlight do the same:
hostname:~# echo 1 > /sys/class/graphics/fb0/blank hostname:~# cat /sys/class/backlight/pxabl0/actual_brightness 0 hostname:~# echo 0 > /sys/class/graphics/fb0/blank hostname:~# cat /sys/class/backlight/pxabl0/actual_brightness 10
Ambient light sensor
To get the ambient light measurement simply use the command:
# cat /sys/class/i2c-dev/i2c-0/device/0-0039/lux 9
Real time clock
To verify that the real time clock is correctly set up you can use several ways.
The fastest is:
# cat /proc/driver/rtc rtc_time : 20:13:08 rtc_date : 2000-07-20 24hr : yes
or:
# cat /sys/class/rtc/rtc0/{date,time}
2000-07-20
20:14:10
but if you prefere using the hwclock utility first you should verify that you have the real time clock char device into "/dev" directory:
# ln -sf /dev/rtc0 /dev/rtc # hwclock Thu Jul 20 20:17:05 2000 -0.943823 seconds
AC97 sound system
To test sound capabilities you can use several tools.
With alsamixer you can select the mixer settings. So, to hear something be sure you have set the right volume and the master volume (mixer label Master) and the external amplifier (mixer label External) are enabled. Just give the command:
# alsamixer
With madplay you can play an MP3 file:
# madplay <mp3 file>
Also, if you enable the "Debug" kernel option into "Advanced Linux Sound Architecture" menu (.config define CONFIG_SND_DEBUG) you will be able to read/write AC97 registers directly by using the file /proc/asound/AC97/codec97#0/ac97#0-0+regs:
# cat /proc/asound/AC97/codec97#0/ac97#0-0+regs 0:00 = 6150 0:02 = 0000 ... # echo 5c 2400 > /proc/asound/AC97/codec97#0/ac97#0-0+regs
GPS antenna
To enable the GPS antenna you should use the command:
# echo 1 > /proc/sys/wl1100/misc/gps-antenna
then to get GPS data use:
# stty -F /dev/ttyS2 4800 raw # dd if=/dev/ttyS2 bs=1
If everything works ok you should get something like the following:
000.0000,N,00000.0000,E,0,00,0.0,-17.5,M,17.5,M,,*70 $PFST,FOM,-1*49 $GPGSA,A,1,,,,,,,,,,,,,0.0,0.0,0.0*30 $GPRMC,000000.00,V,0000.0000,N,00000.0000,E,0.00,0.0,060180,8.2,W,N*0A $GPGGA,000000.00,0000.0000,N,00000.0000,E,0,00,0.0,-17.5,M,17.5,M,,*70 $PFST,FOM,-1*49 $GPGSA,A,1,,,,,,,,,,,,,0.0,0.0, ...
Bluetooth
To enable the bluetooth module you should use the command:
# echo 1 > /proc/sys/wl1100/misc/bt-module
then to access it use:
# hciattach /dev/ttyS1 any 115200
If everything works ok with the following command you should see your device's info:
# hcitool dev
Devices:
hci0 00:A0:96:10:1F:54
Wireless interface
This device has no driver into the kernel so to enable (and test) it you have to manually load the driver as an external module.
Into your distribution there should be two files into /opt directory named cfio.ko and mcf25.ko (unluckely for you these files are NO open source due to Marvell). If not, you should obtain them in some way and then insert them into the kernel:
# insmod /opt/cfio.ko # insmod /opt/mcf25.ko
After that turn on your preferred AP without any encryption and then ask to the wireless to discover it:
# iwlist eth0 scan
you should obtain something like this:
eth0 Scan completed :
Cell 01 - Address: 00:14:7C:52:7E:71
ESSID:"EnneEnne"
Mode:Managed
Frequency:2.422 GHz (Channel 3)
Quality:0/10 Signal level=-59 dBm Noise level=-96 dBm
Encryption key:off
Bit Rates:54 Mb/s
Ok, at this point you have to connect the wireless with your AP:
# iwconfig eth0 essid EnneEnne
(substitute string "EnneEnne" with your AP's ESSID)
If the connection goes ok you should obtain something as follow:
# iwconfig eth0
eth0 MRVL-CF8385 ESSID:"EnneEnne"
Mode:Managed Frequency:2.422 GHz Access Point: 00:14:7C:52:7E:71
Bit Rate:11 Mb/s Tx-Power=18 dBm
Retry limit:8 RTS thr=2347 B Fragment thr=2346 B
Encryption key:off
Power Management:off
Link Quality:0/10 Signal level:-58 dBm Noise level:-94 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0
Then you have only to configure the interface as normal in Linux, as example on my LAN I do:
# ifconfig eth0 192.168.31.24 # ping 192.168.31.1 PING 192.168.31.1 (192.168.31.1) 56(84) bytes of data. 64 bytes from 192.168.31.1: icmp_seq=1 ttl=64 time=46.0 ms 64 bytes from 192.168.31.1: icmp_seq=2 ttl=64 time=9.55 ms 64 bytes from 192.168.31.1: icmp_seq=3 ttl=64 time=9.58 ms 64 bytes from 192.168.31.1: icmp_seq=4 ttl=64 time=9.55 ms
where 192.168.31.1 is my working PC.

