2010-11-28 16:12:10

by Brad Midgley

[permalink] [raw]
Subject: wi2wi bluecore4

Hey

The gumstix overo comes with a wi2wi chip with a bluecore4-rom. I have
been unable to switch it to a baud rate other than 115k or to change
its SCO mapping. Any ideas?

I tried using bccmd before hciattaching the device but I can't find
any settings that get past a timeout. Once a timeout is reported, I
have to reset the board to try anything else.

# bccmd -t BCSP -d /dev/ttyS1 psset -r baudrate 0xEBF
Initialization timed out

I can hciattach it first, then use bccmd over hci, but as soon as I
try to change the baud then the chip won't talk to me any more.

# hciattach ttyS1 csr 115200
CSR build ID 0x0C-0x5C
Device setup complete
# bccmd psget baudrate
UART Baud rate: 0x01d8 (472)
# bccmd psset -r baudrate 0xEBF
# killall hciattach
# hciattach ttyS1 csr 921600 # also tried with "-s 115200"
Initialization timed out.

and fwiw, checking the SCO mapping gives me a strange result.

# bccmd psget mapsco
Can't execute command: No such device or address (6)

I tried changing the hardcoded 38k baud to 115k in csr_bsp.c just in
case that was why it won't talk directly to the chip, no luck.

fwiw, the chip reports

# hciconfig hci0 revision
hci0: Type: BR/EDR Bus: UART
BD Address: 00:19:88:0A:77:65 ACL MTU: 310:10 SCO MTU: 64:8
Unified 21e
Chip version: BlueCore4-ROM
Max key size: 128 bit
SCO mapping: PCM

Is there anything else I could try here?

--
Brad Midgley


2010-11-30 05:24:12

by Brad Midgley

[permalink] [raw]
Subject: Re: wi2wi bluecore4

Hey

I think I am a little closer, just wanted to see if anyone has any ideas.

I rebuilt bccmd so it would connect at 115k instead of 38k. Not sure
why it's hardcoded if the chip cares (this chip refuses to respond at
38k). In any case, now bccmd can set and reset the chip apparently:

# cat pskey.psr
// PSKEY_UART_BAUDRATE
&01be = 0ebf
// PSKEY_SCO_MAPPING
&01ab = 0
# bccmd.115 -t H4 -d /dev/ttyS1 psload -r pskey.psr
Loading PSKEY_UART_BAUDRATE ... done
Loading PSKEY_HOSTIO_MAP_SCO_PCM ... done
#

But the hciattach still fails with "Initialization timed out.". The
chip returns a single byte...

# strace -s 64 hciattach ttyS1 csr 921600 noflow
...
open("/dev/ttyS1", O_RDWR|O_NOCTTY) = 3
ioctl(3, TCFLSH, 0x2) = 0
ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, {B115200 -opost -isig -icanon
-echo ...}) = 0
ioctl(3, SNDCTL_TMR_START or TCSETS, {B115200 -opost -isig -icanon
-echo ...}) = 0
ioctl(3, SNDCTL_TMR_START or TCSETS, {B115200 -opost -isig -icanon
-echo ...}) = 0
ioctl(3, TCFLSH, 0x2) = 0
write(3, "\1\0\374\27\302\0\0\t\0\0\0\31(\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 27) = 27
read(3, "\374", 1) = 1
read(3, 0xbed819dc, 1) = ? ERESTARTSYS (To be restarted)
--- SIGALRM (Alarm clock) @ 0 (0) ---

What is the chip saying to us when we read \374? Why is hciattach
initializing at 115k when i told it to use 921k? So I tried setting
the init speed too:

# strace -s 64 hciattach -s 921600 ttyS1 csr 921600 noflow
...
open("/dev/ttyS1", O_RDWR|O_NOCTTY) = 3
ioctl(3, TCFLSH, 0x2) = 0
ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, {B115200 -opost -isig -icanon
-echo ...}) = 0
ioctl(3, SNDCTL_TMR_START or TCSETS, {B115200 -opost -isig -icanon
-echo ...}) = 0
ioctl(3, SNDCTL_TMR_START or TCSETS, {B921600 -opost -isig -icanon
-echo ...}) = 0
ioctl(3, TCFLSH, 0x2) = 0
write(3, "\1\0\374\27\302\0\0\t\0\0\0\31(\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 27) = 27
read(3, 0xbeebf9cc, 1) = ? ERESTARTSYS (To be restarted)
--- SIGALRM (Alarm clock) @ 0 (0) ---

this time it didn't even get one junk byte. Is there anything else I can check?

Brad

2010-11-28 16:22:00

by Brad Midgley

[permalink] [raw]
Subject: Re: wi2wi bluecore4

forgot to mention... just doing the most straightforward hciattach
also won't work

# hciattach -s 115200 ttyS1 csr 921600
CSR build ID 0x0C-0x5C
Device setup complete
root@omap3-multi:~# hciconfig
hci0: Type: BR/EDR Bus: UART
BD Address: 00:00:00:00:00:00 ACL MTU: 0:0 SCO MTU: 0:0
DOWN
RX bytes:0 acl:0 sco:0 events:0 errors:0
TX bytes:4 acl:0 sco:0 commands:1 errors:0

root@omap3-multi:~# hciconfig hci0 up
Can't init device hci0: Connection timed out (110)
root@omap3-multi:~# hciconfig hci0 revision
Can't read version info for hci0: Network is down (100)

--
Brad Midgley