CYW20819 RFCOMM (SPP) Isuue

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
ToKo_4602001
Level 4
Level 4
50 sign-ins 25 replies posted 25 sign-ins

I have been facing the problem that spp_scb.flow_control_on never revert back to FALSE on high-load operation.
It occurs in rare cases when receiving and transmitting are performed at same time.
In this case I cannot transmits data any more.

I'd like to get the information about how to fix it or how to poll flow status.

spp_scb.flow_control_on is set in the following callback.
Is there a possibility that the callback vanishes into nothing?

void spp_port_event_cback(wiced_bt_rfcomm_port_event_t event, uint16_t handle){

if(event & PORT_EV_RXCHAR){
<*snip*>
}
if(event & PORT_EV_FC){
spp_scb.flow_control_on = !(event & PORT_EV_FCS) ? WICED_TRUE : WICED_FALSE;
}
if(event & PORT_EV_TXEMPTY){
spp_scb.flow_control_on = WICED_FALSE;
}

spp_scb.event_error = (event & PORT_EV_ERR) ? 1 : 0;

return;
}

0 Likes
1 Solution
DheerajPK_41
Moderator
Moderator
Moderator
750 replies posted 500 likes received 500 replies posted

Hi,

We couldn't reproduce the issue. In my testing the flow control is working good even when I tried two way transmission of 1 MB data with packet length 1 byte. Could you please let us know how wiced_bt_spp_rx_flow_enable()? What is the logic used?

 

It would be great if you can share your code where you see the issue so that we can debug the same version of code.

Thanks,

-Dheeraj

View solution in original post

0 Likes
3 Replies
DheerajPK_41
Moderator
Moderator
Moderator
750 replies posted 500 likes received 500 replies posted

Hi,

It would be great if you can share us the way how to reproduce the issue? 

We will try to reproduce the issue at our side and try to find out a solution.

Thanks,

-Dheeraj

0 Likes

Thank you for your reply and sorry for my late reply.

By limiting the data packet buffered to 1 and applying some delay, the problem has been improved to some extent.

----------------------------------------

return(
(GKI_poolfreecount(SPP_BUFFER_POOL) > GKI_poolcount(SPP_BUFFER_POOL) / 2) &&
!status.out_queue_size &&
!fcl_spp_scb.flow_control_on);

--------------------------------------------------------

However,  still sometimes data transmitting stops.

In this case error returns from PORT_Write() and status.out_queue_size from wiced_bt_rfcomm_port_get_queue_status() does not turn to zero.  flow_control_on is false.

 

This can be reproduced with the following conditions.

 -Data is transmitted from both side same time.

 -Frequently bt_spp_rx_flow_enable(WICED_TRUE) and bt_spp_rx_flow_enable(WICED_FALSE) are issued for flow control (air).

 -Packet size send to PORT_Write() is small (1 ~ 5 bytes) and PORT_Write() is frequently issued. (Because P_UART baudrate is 9600 bps when this problem occurs.)

 

 

 

 

0 Likes
DheerajPK_41
Moderator
Moderator
Moderator
750 replies posted 500 likes received 500 replies posted

Hi,

We couldn't reproduce the issue. In my testing the flow control is working good even when I tried two way transmission of 1 MB data with packet length 1 byte. Could you please let us know how wiced_bt_spp_rx_flow_enable()? What is the logic used?

 

It would be great if you can share your code where you see the issue so that we can debug the same version of code.

Thanks,

-Dheeraj

0 Likes