skyflame
2008-06-12 05:54:47 UTC
Hi
I post this question on bluez-user before , But I think here might be the right place , so I put it here again.
My chip is CSR's bc4 A06 Rom which do not have eeprom and need to send pskey to init after power up.
Thanks to attaboyu and henry , They told me a way to do it with following process :
1. add --enable-bccmd feature while configure the bluez-utils
2. use bccmd after hci0 is up:
3. $bccmd -t hci psload -r /csr.psr
But I try it , and meet some problem:
the bluez-utils/tools/example.psr seems not comply with my chip, so I write another one as:
// PSKEY_ANA_FREQ
&01fe = 0FA0
// PSKEY_UART_BAUD_RATE
&01be = 0EBF
And then after hciconfig hci0 up I use
bccmd -t hci psload -r csr.psr
the two key is write successfully , but if I enable the debug I can see the chip continue to receive messages , seems something wrong with the head.
I remove the debug message so that you can see the log more clear:
~ #
~ # bccmd -t hci psload csr.psr
Loading PSKEY_ANA_FREQ ... done
Loading PSKEY_UART_BAUDRATE ... done
if I using -r in psload the result is :
~ # bccmd -t hci psload -r csr.psr
Loading PSKEY_ANA_FREQ ... done
Loading PSKEY_UART_BAUDRATE ... done
~ #
~ # bcsp_recv: Error in BCSP hdr checksum
both one could not work for hcitool scan:
~ # hcitool -i hci0 scan
Scanning ...
Inquiry failed: Connection timed out
and as long as this bcsp_recv: Error in BCSP hdr checksum happen
the bcsp interface seems dead , type bccmd again will show :
~ # bccmd -t hci psload -r csr.psr
Can't read version info for hci0: Connection timed out (110)
seems after warm reset the connection is bad.
So , I wonder, when using hciattach the baudrate is set to 115200
but after the uart_baudrate is set, the baudrate is set to 921600 it might cause the problem
Then I set &01be = 01d8 to keep the baudrate as 115200
But still the same.
Then if I remove the uart_baud_rate setting from the psr file
the warm reboot is ok:
~ # bccmd -t hci psload -r csr.psr
Loading PSKEY_ANA_FREQ ... done
but the chip seems to lost the sync and go back to the tshy state !
~ # hcitool -i hci0 scan
Scanning ...
bcsp_pkt_cull: Peer acked invalid packet
bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
bcsp_pkt_cull: Peer acked invalid packet
bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
bcsp_pkt_cull: Peer acked invalid packet
.
.
.
.
what is the right process ? Can any one help me out ?
Thanks
Raymond
I post this question on bluez-user before , But I think here might be the right place , so I put it here again.
My chip is CSR's bc4 A06 Rom which do not have eeprom and need to send pskey to init after power up.
Thanks to attaboyu and henry , They told me a way to do it with following process :
1. add --enable-bccmd feature while configure the bluez-utils
2. use bccmd after hci0 is up:
3. $bccmd -t hci psload -r /csr.psr
But I try it , and meet some problem:
the bluez-utils/tools/example.psr seems not comply with my chip, so I write another one as:
// PSKEY_ANA_FREQ
&01fe = 0FA0
// PSKEY_UART_BAUD_RATE
&01be = 0EBF
And then after hciconfig hci0 up I use
bccmd -t hci psload -r csr.psr
the two key is write successfully , but if I enable the debug I can see the chip continue to receive messages , seems something wrong with the head.
I remove the debug message so that you can see the log more clear:
~ #
~ # bccmd -t hci psload csr.psr
Loading PSKEY_ANA_FREQ ... done
Loading PSKEY_UART_BAUDRATE ... done
if I using -r in psload the result is :
~ # bccmd -t hci psload -r csr.psr
Loading PSKEY_ANA_FREQ ... done
Loading PSKEY_UART_BAUDRATE ... done
~ #
~ # bcsp_recv: Error in BCSP hdr checksum
both one could not work for hcitool scan:
~ # hcitool -i hci0 scan
Scanning ...
Inquiry failed: Connection timed out
and as long as this bcsp_recv: Error in BCSP hdr checksum happen
the bcsp interface seems dead , type bccmd again will show :
~ # bccmd -t hci psload -r csr.psr
Can't read version info for hci0: Connection timed out (110)
seems after warm reset the connection is bad.
So , I wonder, when using hciattach the baudrate is set to 115200
but after the uart_baudrate is set, the baudrate is set to 921600 it might cause the problem
Then I set &01be = 01d8 to keep the baudrate as 115200
But still the same.
Then if I remove the uart_baud_rate setting from the psr file
the warm reboot is ok:
~ # bccmd -t hci psload -r csr.psr
Loading PSKEY_ANA_FREQ ... done
but the chip seems to lost the sync and go back to the tshy state !
~ # hcitool -i hci0 scan
Scanning ...
bcsp_pkt_cull: Peer acked invalid packet
bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
bcsp_pkt_cull: Peer acked invalid packet
bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
bcsp_pkt_cull: Peer acked invalid packet
.
.
.
.
what is the right process ? Can any one help me out ?
Thanks
Raymond