[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bluetooth-dev] Stack freezes with CSR in BCSP ?



On Thu, 14 Feb 2002 17:58:02 +0100
Peter Kjellerstedt <peter.kjellerstedt@xxxxxxx.com> wrote:

> csr_waitcmdnum() waits for the module to send an event telling
> us that there is now one HCI command buffer free. Sometimes
> this does not occur as the stack expects and then it hangs.
> In the current code in CVS there is a timeout to prevent 
> this from happening. So either you can upgrade to the lastest
> code in CVS, or you can comment out the entire csr_waitcmdnum()
> function.

Thank you for these explanation. I think I've a recent enough code, because the function csr_waitcmdnum() already has timeouts implemented.
I tried to comment out the function csr_waitcmdnum content. Ok, the stack doesn't stop any more. But I've the error "bcsp_signal_rxack: ERROR  winspace > WINSIZE [8]" a bit later. So I think this was perhaps not a good idea.

What seems very special now is that some times, the stack manages to get buffers size. Result :

HW module contains...
8 ACL buffers at 192 bytes
8 SCO buffers at 64 bytes


But I never manage to have a response to command "HCI: hci_read_firmware_rev_info [CSR] BuildID/ChipVer/ChipRev".
I think the stack is well done, but this is my module that  could have some problems. Does someone experienced the same behavior with CSR chip bc01b ?

There is one thing that I don't understand. After it recieved a timeout for its command to read firmware_rev_info, the stack always send the same sequence (about 19 times) :

bcsp_write_lower (28):
0xc0 0x92 0x62 0x01 0x0a 0x00 0x00 0x00 0x0b 0x00 0x01 0x28 0x1a 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xc0 

And the stack doesn't recieve anyhing back until it recieve next thing :

bcsp_receive_lower (20):
0xc0 0x00 0x41 0x00 0xbe 0xda 0xdc 0xed 0xed 0xc0 0xc0 0x00 0x41 0x00 0xbe 0xda 0xdc 0xed 0xed 0xc0 

Why does the stack always send this packet ? Is this because it hasn't any feed back, so it send it again and again until it gets an acknowledge ?

> 
> //Peter
> 
> > -----Original Message-----
> > From: Alain Paschoud [mailto:alain.paschoud@xxxxxxx.ch]
> > Sent: 14 February 2002 17:34
> > To: bluetooth-dev@xxxxxxx.com
> > Subject: [bluetooth-dev] Stack freezes with CSR in BCSP ?
> > 
> > 
> > Hello,
> > 
> > I have a problem using the stack with the CSR module from my 
> > embedded device. I had from time to time the same problem 
> > when I used the chip from the PC. But on my embedded system, 
> > I always have this problem.
> > The BCSP synchronisation succeed, but it stops after it 
> > indicates a "HCI: csr_waitcmdnum" in the logs.
> > 
> > Does someone already experienced something like that ? If 
> > yes, what could be the reason ?
> > 
> > -- Here are the logs (with I think enough debug) --
> > 
> > BT SYS: Initialising Bluetooth Stack
> > BT SYS: Current HW: CSR
> > BT SYS: Initialising BTMEM [2500 bytes]
> > BT SYS: Initializing BCSP
> > BCSP:      bcsp_write_lower: Outgoing data:
> > 
> > bcsp_write_lower (10):
> > 0xc0 0x00 0x41 0x00 0xbe 0xda 0xdc 0xed 0xed 0xc0 
> > BCSP:      bcsp_receive_lower: Incoming data:
> > 
> > bcsp_receive_lower (30):
> > 0xc0 0x00 0x41 0x00 0xbe 0xda 0xdc 0xed 0xed 0xc0 0xc0 0x00 
> > 0x41 0x00 0xbe 0xda 
> > 0xdc 0xed 0xed 0xc0 0xc0 0x00 0x41 0x00 0xbe 0xac 0xaf 0xef 0xee 0xc0 
> > BCSP:      bcsp_write_lower: Outgoing data:
> > 
> > bcsp_write_lower (10):
> > 0xc0 0x00 0x41 0x00 0xbe 0xac 0xaf 0xef 0xee 0xc0 
> > BCSP:      bcsp_receive_lower: So far handled: 10 bytes
> > BCSP:      bcsp_write_lower: Outgoing data:
> > 
> > bcsp_write_lower (10):
> > 0xc0 0x00 0x41 0x00 0xbe 0xac 0xaf 0xef 0xee 0xc0 
> > BCSP:      bcsp_receive_lower: So far handled: 20 bytes
> > BT SYS: BCSP initialized and syncronized
> > BCSP:      bcsp_receive_lower: So far handled: 30 bytes
> > BCSP:      bcsp_receive_lower: Incoming data:
> > 
> > bcsp_receive_lower (12):
> > 0xc0 0x80 0x65 0x00 0x1a 0x0f 0x04 0x00 0x01 0x00 0x00 0xc0 
> > BCSP:      bcsp_write_lower: Outgoing data:
> > 
> > bcsp_write_lower (6):
> > 0xc0 0x08 0x00 0x00 0xf7 0xc0 
> > HCI: release_cmd_timer
> > HCI: process_event: COMMAND_STATUS
> > BCSP:      bcsp_receive_lower: So far handled: 12 bytes
> > HCI: csr_waitcmdnum
> > BCSP:      bcsp_receive_lower: Incoming data:
> > 
> > bcsp_receive_lower (10):
> > 0xc0 0x00 0x41 0x00 0xbe 0xad 0xef 0xac 0xed 0xc0 
> > BCSP:      bcsp_receive_lower: So far handled: 10 bytes
> > BCSP:      bcsp_receive_lower: Incoming data:
> > 
> > bcsp_receive_lower (10):
> > 0xc0 0x00 0x41 0x00 0xbe 0xad 0xef 0xac 0xed 0xc0 
> > BCSP:      bcsp_receive_lower: So far handled: 10 bytes
> > 
> > -- End of the logs ---
> > 
> > And then, nothing more happen. I have of course to reboot my 
> > device to use the bt driver again.
> > 
> > -- 
> > Alain Paschoud                      SMARTDATA SA
> > alain.paschoud@xxxxxxx.ch         PSE-A
> > http://www.smartdata.ch             1015 Lausanne
> > Phone +41-21-693'84'98              
> > Fax   +41-27-693'84'91              
> > -
> > To unsubscribe from this list: send the line "unsubscribe 
> > bluetooth-dev" in
> > the body of a message to majordomo@xxxxxxx.com
> > 
> -
> To unsubscribe from this list: send the line "unsubscribe bluetooth-dev" in
> the body of a message to majordomo@xxxxxxx.com
> 


-- 
Alain Paschoud                      SMARTDATA SA
alain.paschoud@xxxxxxx.ch         PSE-A
http://www.smartdata.ch             1015 Lausanne
Phone +41-21-693'84'98              
Fax   +41-27-693'84'91              
-
To unsubscribe from this list: send the line "unsubscribe bluetooth-dev" in
the body of a message to majordomo@xxxxxxx.com