Peripheral UART reception missing bytes (Data loss)

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

cross mob
pghole
Level 3
Level 3
First like received 10 replies posted 25 sign-ins

On CYBT-483056 Eval I have created UART bridge which reads data from BlueTooth virtual COM port and transfer to PUART and other way round.

For reading I have use below task function. For 115200 baud rate I am misssing some of the byte chunks.

My initial guess is wiced sdk has some limitation on internal UART buffer which may get overwritten due to delay in reading or shorter buffer length. Not having access to wiced sdk I am not able to change the buffer size.

 

Please let me know if similar issue has been faced by anybody and any suggested fix will be appreciated.

 

#define MAX_BUFFER_SIZE 48
	static uint8_t readbyte[MAX_BUFFER_SIZE];
	static uint8_t toggle = 0;
	uint32_t recvcount = 0;

	while(1)
	{
		recvcount = wiced_hal_puart_rx_fifo_not_empty();

		if((recvcount > 0) && (recvcount < MAX_BUFFER_SIZE))
		{
			wiced_hal_puart_synchronous_read(&readbyte[0], recvcount);

			wiced_bt_spp_send_session_data(spp_handle, &readbyte[0], recvcount);
			WICED_BT_TRACE("%s handle:%d len:%d %c-%c, \n", __FUNCTION__, spp_handle, recvcount, readbyte[0], readbyte[recvcount - 1]);
		}

		wiced_rtos_delay_milliseconds(1, ALLOW_THREAD_TO_SLEEP);
	}

 

0 Likes
1 Solution
advait_kulkarni
Moderator
Moderator
Moderator
25 likes received 250 sign-ins 100 solutions authored

Hi @pghole ,

Can you check if you are getting this issue on Modustoolbox 3.0?  We no longer have support for wiced sdk.

Thanks and regards,

Advait Kulkarni

View solution in original post

0 Likes
3 Replies
advait_kulkarni
Moderator
Moderator
Moderator
25 likes received 250 sign-ins 100 solutions authored

Hi @pghole ,

Can you check if you are getting this issue on Modustoolbox 3.0?  We no longer have support for wiced sdk.

Thanks and regards,

Advait Kulkarni

0 Likes

I am executing this on Modustoolbox 3.0. I think nomenclature used in shared library still use wiced_ as prefix for various library functions. 

 

0 Likes
advait_kulkarni
Moderator
Moderator
Moderator
25 likes received 250 sign-ins 100 solutions authored

Hi @pghole ,

Yes, the APIs used in MTB do have wiced prefix. Since you mentioned wiced sdk, hence I asked if you are using wiced studios. Can you please give us more details about your application or share your project?

Thanks and regards,

Advait Kulkarni

0 Likes