sorry above i mentioned wrong actually
//WICED_BT_TRACE(" "); //commanted
Rx data :123456789
fifo false at:1
fifo false at:23456789
here fifo empty at first byte.
WICED_BT_TRACE(" "); //not commanted
Rx data :123456789
fifo false at:123456789
here fifo empty after reading all data
1 of 1 people found this helpful
Since you are coding for PUART communication, I would prefer you to disable the debug traces (WICED_BT_TRACE), Or re-route the debug traces to HCI UART instead of PUART, using wiced_set_debug_uart(). Please check wiced_debug_uart_types_t in wiced_bt_trace.h.
Because, debug traces on PUART can create some errors in the actual data that we want to send via PUART.
hi dheeraj sir,
thanks for your reply.
actually why wiced_hal_puart_rx_fifo_not_empty not filling properly when i am commanting WICED_BT_TRACE
if i use WICED_BT_TRACE then wiced_hal_puart_rx_fifo_not_empty is fillling properly.
Could you please share your code with us where you have implemented the puart functionality. I will to go through the code and try to reproduce the issue.
Are you able to reproduce the issue after disabling all the debug traces in the app as I mentioned in my previous response?
#if defined WICED_BT_TRACE_ENABLE || defined HCI_TRACE_OVER_TRANSPORT
host_trans_pool = wiced_transport_create_buffer_pool(TRANS_UART_BUFFER_SIZE, TRANS_MAX_BUFFERS);
wiced_set_debug_uart( WICED_ROUTE_DEBUG_TO_PUART );
wiced_hal_puart_select_uart_pads( WICED_PUART_RXD, WICED_PUART_TXD, 0, 0);
wiced_hal_puart_set_baudrate( 115200 );
/* Enable receive and the interrupt */
wiced_hal_puart_register_interrupt( spp_rx_data );
wiced_bt_stack_init(app_management_callback, &wiced_bt_cfg_settings, wiced_bt_cfg_buf_pools);
/* Interrupt callback function for UART */
void spp_rx_data( void *data )
WICED_BT_TRACE(" "); // IF WE ENABLE THIS FIFO UPDATING PROPERLY
/* Read one byte from the buffer and (unlike GPIO) reset the interrupt */
wiced_hal_puart_read( &readbyte );
rx_buffer[rx_count++] = readbyte;
if(puart_rxFifoNotEmpty() == FALSE ) //WAITING FOR FIFO EMPTY
if(spp_handle != 0)
wiced_bt_spp_send_session_data(spp_handle, rx_buffer, rx_count);
Q:Are you able to reproduce the issue after disabling all the debug traces in the app as I mentioned in my previous response?
A:YES BUT NOT UPDATING FIFO
2 of 2 people found this helpful
Unfortunately, I couldn't reproduce the issue using the above code snippet which you have provided. PUART is functioning properly.
Two point, I have observed is,
- You are calling wiced_hal_puart_enable_tx( ); two time in the PUART initialization part.
- We have to use wiced_hal_puart_rx_fifo_not_empty() instead of puart_rxFifoNotEmpty().
May i know which IDE & SDK are you using? WICED Studio or Modustoolbox ? And version?
Please confirm the platform/module as well.
Is it possible for you to provide us the project file which include the minimal code for reproducing the issue. Also please let us know the clear steps to reproduce the issue.