WWPC1000's devices management & testing
From EnneEnneWiki
|
|---|
Contents |
Here some info about management and testing of several WWPC1000's on-board devices.
The uCs' firmware
To test the on board microcontrollers (uC) firmware you need to enable them at boot time (please, refere to WWPC1000 boot environment to have more info), also you need the tool wwpcattach to set the WWPC line discipline as follow:
# /sbin/wwpcattach /dev/ttyS0 19200 10
I suggest you to define the following script:
# cat /sbin/pgetty #!/bin/sh if [ "$(cat /proc/sys/wwpc1000/uC/enabled)" == "0" ] ; then /sbin/getty $@ else /sbin/wwpcattach /dev/$2 19200 10 fi
and putting it into your init configuration file as follow:
# grep pgetty /etc/inittab T0:23:respawn:/sbin/pgetty -L ttyS0 115200 vt100
in this manner init will start a getty terminal on the serial line or the wwpcattach tool according to the microcontrollers status.
Once the wwpcattach tool is running you can test if the communication with the microcontroller works by using the commands:
# cat /proc/sys/wwpc1000/uC/kb_rev 2.5 # cat /proc/sys/wwpc1000/uC/xy_rev 2.5
Value 2.5 is the firmware's version.
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/wwpc1000/misc/gps-antenna
then to get GPS data use:
# stty -F /dev/ttyS1 4800 raw # cat /dev/ttyS1
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/wwpc1000/misc/bt-module
then to access it use:
# hciattach /dev/ttyS2 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 eth1 scan
you should obtain something like this:
eth1 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 eth1 essid EnneEnne
(substitute string "EnneEnne" with your AP's ESSID)
If the connection goes ok you should obtain something as follow:
# iwconfig eth1
eth1 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 eth1 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.

