2008-01-29 12:35:36

by Tim Chick

[permalink] [raw]
Subject: Re: [Bluez-users] mx27, csr and bluez: initialisation timed out

> [Bluez-users] mx27, csr and bluez: initialisation timed out
> From: Peter Wurmsdobler <peter@wu...> - 2008-01-22 13:46
>
> The kernel boots, and the bluetooth related facilities printk some
> messages such as HCI UART driver ver 2.2, H4 and BCSP protocol
> initialised. Since the BlueTooth module does not know the clock
> frequency it is using, or the baud rate of the host, I need to
> "configure" the BlueCore and warm-reset it:
>
> mx27# bccmd -t BCSP -d /dev/ttymxc1 psload config.psr warmreset
>

What you actually want is:

bccmd -t BCSP -d /dev/ttymxc1 psload -r config.psr

as bccmd can only perform one command at a time.

> However, the only message I get is: "Initialization timed out",
> which, looking through the code, is generated in
> bluez/tools/csr_bcsp.c in the open function. But why?
>

There appear to be some races in the BCSP, which may not cause a problem
on a PC. I have some changes and will publish to the devel list.

As a work around, the following works reliably for me:

hciattach /dev/ttyS0 bcsp
bccmd -t HCI psload -r my.psr
killall hciattach
hciattach /dev/ttyS0 bcsp

Cheers,
Tim


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users


2008-01-29 18:29:15

by Peter Wurmsdobler

[permalink] [raw]
Subject: Re: [Bluez-users] mx27, csr and bluez: initialisation timed out

Hello,

> hciattach /dev/ttyS0 bcsp
> bccmd -t HCI psload -r my.psr
> killall hciattach
> hciattach /dev/ttyS0 bcsp

When the BC4-ROM is powered up, it does not know the values for certain
keys, such as:

PSKEY_LC_COMBO_DOT11_CHANNEL_PIO_BASE
PSKEY_UART_BAUDRATE
PSKEY_ANA_FREQ

So I connected the apm module (with the BC4-ROM in it) to the WindowsXP
host, powered it up, then used the PStool to convince myself that this
is true. Indeed it is.

Then I downloaded a socalled psr file containing these keys, and indeed,
the values for these keys were differend. So the download must have worked.

Having power cycled the module, I tried once more on Linux:

peter@linuxpc:~$ hciattach /dev/ttyS0 bcsp
peter@linuxpc:~$ hciconfig
hci0: Type: UART
BD Address: 00:02:5B:00:A5:A5 ACL MTU: 310:10 SCO MTU: 64:8
UP RUNNING PSCAN ISCAN
RX bytes:1058 acl:0 sco:0 events:22 errors:0
TX bytes:684 acl:0 sco:0 commands:21 errors:0

peter@linuxpc:~$ bccmd -t HCI psload -r apm6628BT-UART.psr
Loading PSKEY_LC_COMBO_DISABLE_PIO_MASK ... failed
Loading PSKEY_LC_COMBO_DOT11_CHANNEL_PIO_BASE ... failed
Loading PSKEY_LC_ENHANCED_POWER_TABLE ... failed
Loading PSKEY_UART_BAUDRATE ... failed
Loading PSKEY_HOST_INTERFACE ... failed
Loading PSKEY_ANA_FREQ ... failed
Loading PSKEY_USE_EXTERNAL_CLOCK ... failed
Loading PSKEY_CLOCK_REQUEST_ENABLE ... failed
Loading PSKEY_CLOCK_REQUEST_FEATURES ... failed
peter@linuxpc:~$ bccmd -t bcsp psload -r apm6628BT-UART.psr
Initialization timed out

Apparently, on linux I cannot establish a reliable connection and
download the settings.

Any ideas?
peter

--
apm6628BT-UNIF.psr:

// PSKEY_LC_COMBO_DISABLE_PIO_MASK
&0028 = 0200
// PSKEY_LC_COMBO_DOT11_CHANNEL_PIO_BASE
&002a = 0011
// PSKEY_LC_ENHANCED_POWER_TABLE
&0031 = 0400 0000 3f00 4500 e800 0900 0000 3f00 4700 ec00 0f00 0000 3f00
4a00 f000 1600 0000 3f00 4d00 f400 1e00 0000 3f00 5000 f800 2600 0000
3f00 5500 fc00 2e00 0000 3f00 5b00 0000 5000 0000 3f00 6900 0400
// PSKEY_UART_BAUDRATE
&01be = 01d8// 115.2 kbaud
// PSKEY_HOST_INTERFACE
&01f9 = 0001// BCSP link
// PSKEY_ANA_FREQ
&01fe = 4e20
//PSKEY_USE_EXTERNAL_CLOCK
&023b = 0001//true
//PSKEY_CLOCK_REQUEST_ENABLE
&0246 = 0003
// PSKEY_CLOCK_REQUEST_FEATURES
&03b6 = 0000


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

2008-01-29 16:42:40

by Peter Wurmsdobler

[permalink] [raw]
Subject: Re: [Bluez-users] mx27, csr and bluez: initialisation timed out

Thanks for the hints.
> hciattach /dev/ttyS0 bcsp
> bccmd -t HCI psload -r my.psr
> killall hciattach
> hciattach /dev/ttyS0 bcsp
hciattach, most of the time, does not work:

peter@linuxpc:> hciattach /dev/ttyS0 bcsp
Initialization timed out

On one occasion, which I cannot reproduce, hciattach actually worked to
some extent:

peter@linuxpc:> hciattach /dev/ttyS0 bcsp
peter@linuxpc:> hciconfig
hci0: Type: UART
BD Address: 00:00:00:00:00:00 ACL MTU: 0:0 SCO MTU: 0:0
DOWN
RX bytes:15 acl:0 sco:0 events:0 errors:0
TX bytes:8 acl:0 sco:0 commands:0 errors:0

Any subsequent call to download the psr file failed:

peter@linuxpc:> bccmd -t hci psload my.psr
Device not available
peter@linuxpc:> bccmd -t hci -d /dev/ttyS0 psload my.psr
Device not available

I also tried to connect from a Windows PC using BTcli:

btcli (built Jan 17 2007, 15:35:14)
Version 1.24
BSCP on COM1 at 38400 bps
rba
command_complete nhcp:0x01 read_bd_addr success ba 0x00025b00a5a5

Why is it impossible for the Linux host to communicate with the BC4-ROM?
What do I miss?

Thanks for any hints,
peter




-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users