The model for this adapter is wt11-a-hci from semiconductorstore.com. Note that the data sheet referenced from semiconductorstore is old. Go directly to bluegiga for updated docs.
The first thing to do after getting this module is to wire it up and try to reconfigure it from a PC so the module will use the uart/h4 interface.
| Bluegiga | pxa | Description |
|---|---|---|
| 1 | gnd | |
| 2 | 3.3v regulated typical 200mA max 220mA | |
| 21 | 3.3v to disable spi? (I left this unconnected) | |
| 8 | usb d+ for programming | |
| 9 | usb d- for programming | |
| 5 rts | gpio50 hwcts | module uart rts->hwcts (asserted by module) |
| 10 cts | gpio51 hwrts | module uart cts<-hwrts (asserted by gumstix) |
| 26 tx | gpio49 hwrxd | module uart tx->hwrxd (asserted by module) |
| 6 rx | gpio48 hwtxd | module uart rx<-hwtxd (asserted by gumstix) |
| 17 reset | gpio16 "PW[M]0" | reset (active high) |
bccmd can "brick" your adapter if you make a mistake! To test things without risking this, connect both usb to a pc and the uart connected to the gumstix. (I power the gumstix from usb when doing this.) Then run
bccmd psset -r 0x3cd 4To set the adapter to use the uart and do a soft reset. I had to do this twice before it would actually disconnect from usb and reconnect on the uart.
Then attach to the adapter on the gumstix:
# shut down internal bluetooth
/etc/init.d/S30bluetooth stop
# switch the built-in bluetooth to BTUART for now
echo "AF1 in" >/proc/gpio/GPIO42
echo "AF2 out" >/proc/gpio/GPIO43
echo "AF1 in" >/proc/gpio/GPIO44
echo "AF2 out" >/proc/gpio/GPIO45
# make the "HWUART" labeled pads on the audiostix actually carry HWUART
echo "AF1 out" >/proc/gpio/GPIO48
echo "AF1 in" >/proc/gpio/GPIO49
echo "AF1 in" >/proc/gpio/GPIO50
echo "AF1 out" >/proc/gpio/GPIO51
# bring it up
echo "GPIO out set" >/proc/gpio/GPIO16
sleep 1
echo clear >/proc/gpio/GPIO16
sleep 1
# attach the adapter
/usr/sbin/hciattach -s 115200 ttyS3 csr 921600
# check for the adapter
hciconfig
Once you are satisfied that works, cold boot everything and this time
make it permanent from the pc:
bccmd psset -s default 0x3cd 4
HCIATTACH_TYPE=csr HCIATTACH_START_SPEED=115200
echo "AF1 in" >/proc/gpio/GPIO42 echo "AF2 out" >/proc/gpio/GPIO43 echo "AF1 in" >/proc/gpio/GPIO44 echo "AF2 out" >/proc/gpio/GPIO45
echo clear >/proc/gpio/GPIO7 echo "GPIO in" >/proc/gpio/GPIO42 echo "GPIO out" >/proc/gpio/GPIO43 echo "GPIO in" >/proc/gpio/GPIO44 echo "GPIO out" >/proc/gpio/GPIO45 echo "GPIO out" >/proc/gpio/GPIO12
echo "AF1 out" >/proc/gpio/GPIO48
echo "AF1 in" >/proc/gpio/GPIO49
echo "AF1 in" >/proc/gpio/GPIO50
echo "AF1 out" >/proc/gpio/GPIO51
echo "GPIO out set" >/proc/gpio/GPIO16 sleep 1 echo clear >/proc/gpio/GPIO16 sleep 1
It's working (woohoo)
# hciconfig hci0 revision
hci0: Type: UART
BD Address: 00:07:80:81:BC:3E ACL MTU: 384:8 SCO MTU: 64:8
Build 2810
Chip version: BlueCore4-External
Max key size: 56 bit
SCO mapping: HCI
# hciconfig -a hci0
hci0: Type: UART
BD Address: 00:07:80:81:BC:3E ACL MTU: 384:8 SCO MTU: 64:8
UP RUNNING PSCAN ISCAN
RX bytes:4577 acl:95 sco:0 events:289 errors:0
TX bytes:2735 acl:95 sco:0 commands:80 errors:0
Features: 0xff 0xff 0x8f 0xfe 0x9b 0xf9 0x00 0x80
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy: RSWITCH HOLD SNIFF PARK
Link mode: SLAVE ACCEPT
Name: 'Gumstix (0)'
Class: 0x820116
Service Classes: Networking
Device Class: Computer, Palm
HCI Ver: 2.0 (0x3) HCI Rev: 0xafa LMP Ver: 2.0 (0x3) LMP Subver: 0xafa
Manufacturer: Cambridge Silicon Radio (10)
fwiw... S30bluetooth runs echo AF1 out > /proc/gpio/GPIO12 on start but has no corresponding action in stop. This sends out a clock signal that the infineon needs apparently.