From: "skyflame" <skyflame@21cn.com>
To: "Sanja Kolundzija" <Sanja.Kolundzija@hermes-softlab.com>,
"BlueZ development" <bluez-devel@lists.sourceforge.net>,
<attaboyu@163.com>, "hong zhang" <henryzhang62@yahoo.com>
Subject: Re: [Bluez-devel] How to run up CSR chip without eeprom with BLUEZ ?
Date: Tue, 17 Jun 2008 12:05:12 +0800 [thread overview]
Message-ID: <078501c8d02f$587b1200$0132a8c0@Raymondpc> (raw)
In-Reply-To: 499929A843E2C541A8AD31A881A2B6A2019C136C@hsl-lj-mail.hermes.si
Hi sanja, attaboyu, henry
Thanks for your help, I can do the hcitool scan now!
It's my bad, I set the ANA_FREQ in worng way,
At first I try bccmd -t bcsp way to set the ana_freq, And find it not
work,
and I use bccmd -t bcsp -d /dev/ttyS1 psget -s 0x0 0x1fe to read the
value
but it says
Can't execute command: No such device or address (6)
So I remove it.
And when I do the following test again , I add it back, But ... shame ,
My chip is using 40M crystal , When I calculate the value I put 4000 in calc
to get 0xfa0 , But it should be 40000 and thus 0x9c40
I check my csr.psr and correct it just now it works now.
And I understand now, why bccmd -t bcsp -d /dev/ttyS1 psget -s 0x0 0x1fe
got nothing at the biginning. This pskey unlike the other pskey say 0x1be ,
they have a "psrom" version value, so before you set it, you can read it out
from "psrom" ( which can be done by -s 0x0 say "default" ) , and after you
setting them , you can also read it out from "psram" , this pskey do not
have default value in "psrom" ( strange ? ) and only after you successfully
setting it , it can be read out.
( However, It is really strange here, without setting this value, why
hciattach can connect the chip for the first time, while do a warmreset , it
won't ? Is csr's chip do a self uart baudrate adjustment to match the host
for the first time ? )
Thanks for all of you's help on this issue!
So My process now is :
boot up the fs
insmod bluetooth.ko
insmod hci_uart.ko
insmod l2cap.ko
insmod rfcomm.ko
bccmd -t bcsp -d /dev/ttyS1 psload -r csr.psr
hciattach -s 921600 /dev/ttyS1 bcsp 921600
hciconfig hci0 up
hciconfig hci0 piscan
hcitool -i hci0 scan
Thanks again
Hope I do not get further problems with those bluez daemons 8 )
Raymond
> If I using -r in the bccmd:
>
> ~ # bccmd -t bcsp -d /dev/ttyS1 psload -r csr.psr
> Loading PSKEY_ANA_FREQ ... done
> Loading PSKEY_UART_BAUDRATE ... done
> Loading PSKEY_UART_SEQ_WINSIZE ... done
> Loading PSKEY_BDADDR ... done
> Loading PSKEY_PCM_CONFIG32 ... done
> Loading PSKEY_PCM_FORMAT ... done
> Loading PSKEY_HOSTIO_MAP_SCO_PCM ... done
> Loading PSKEY_HOSTIO_MAP_SCO_CODEC ... done
> Loading PSKEY_CODEC_PIO ... done
> Loading PSKEY_ANA_FTRIM ... done
> ~ #
> ~ # hciattach -s 921600 /dev/ttyS1 bcsp 921600
> BCSP initialization timed out
Which baud rate do you set in your .psr file? You should use the same
speed in hciattach command, otherwise chip will be initialized to one
speed, and hciattach will try to connect using another one.
> I try to use following cmd to see whether the cmd is write in to the
chip,
> but :
>
> ~ # bccmd -t bcsp -d /dev/ttyS1 psget -s 0x0 0x1be
> UART Baud rate: 0x0000 (0)
> ~ #
> ~ # bccmd -t bcsp -d /dev/ttyS1 psset -s 0x0 0x1be 0x0ebf
> ~ #
> ~ # bccmd -t bcsp -d /dev/ttyS1 psget -s 0x0 0x1be
> UART Baud rate: 0x0000 (0)
>
> seems chip just reset it self between two bccmd with bcsp protocol,
and lost
> everything write to it.
Yes, I had the same behaviour, and only if I use -r with first bccmd
things worked. Reading the fault code returned FAULT_HOSTIO_INVALID_ACK
(the chip received a BCSP ACK for a message it has not sent) - based on
this I conclude that repeating bccmd messes the chips state machine
during BCHS protocol initialization.
Regards,
Sanja
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
next prev parent reply other threads:[~2008-06-17 4:05 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-12 5:54 [Bluez-devel] How to run up CSR chip without eeprom with BLUEZ ? skyflame
2008-06-13 8:55 ` Sanja Kolundzija
2008-06-16 1:40 ` skyflame
2008-06-16 19:52 ` Sanja Kolundzija
2008-06-17 1:34 ` skyflame
2008-06-17 4:05 ` skyflame [this message]
2008-06-17 8:18 ` [Bluez-devel] What't the difference between HIDD / HID2HCI / Bluetoothd-service-input ? skyflame
2008-06-17 8:25 ` [Bluez-devel] How to run up CSR chip without eeprom with BLUEZ ? Sanja Kolundzija
[not found] <564535.96437.qm@web57901.mail.re3.yahoo.com>
2008-06-13 1:01 ` skyflame
[not found] <230309.30571.qm@web57914.mail.re3.yahoo.com>
2008-06-13 3:43 ` skyflame
[not found] <348167.64795.qm@web57908.mail.re3.yahoo.com>
2008-06-17 1:38 ` skyflame
[not found] <44771.82692.qm@web57911.mail.re3.yahoo.com>
2008-06-18 0:45 ` skyflame
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='078501c8d02f$587b1200$0132a8c0@Raymondpc' \
--to=skyflame@21cn.com \
--cc=Sanja.Kolundzija@hermes-softlab.com \
--cc=attaboyu@163.com \
--cc=bluez-devel@lists.sourceforge.net \
--cc=henryzhang62@yahoo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox