The attached files update the UART peripheral of STM32F4xx and STM32F2xx host MCUs to return number of bytes within a given duration.

 

The below function definition is used for returning the received bytes and number of bytes over the UART within the given time duration. When the patch is applied correctly, the following code should be updated in /include/wiced_platform.h.

 

/** Receive data on a UART interface
*
* @param  uart     : the UART interface
* @param  data     : pointer to the buffer which will store incoming data
* @param  size     : number of bytes to receive
* @param  rcvd_size: number of bytes received
* @param  timeout  : timeout in milisecond
*
* @return    WICED_SUCCESS : on success.
* @return    WICED_ERROR   : if an error occurred with any step
*/
wiced_result_t wiced_uart_return_received( wiced_uart_t uart, void* data, uint32_t size, uint32_t* rcvd_size, uint32_t timeout );
 

 

The attached patch file updates the following files:

     .../include/wiced_platform.h

     .../WICED/platform/MCU/STM32F2xx/peripherals/platform_uart.c

     .../WICED/platform/MCU/STM32F4xx/peripherals/platform_uart.c

     .../WICED/platform/MCU/wiced_platform_common.c

     .../WICED/platform/include/platform_peripheral.h

 

The updated UART snip application (.../apps/snip/uart) is attached to test the updates.

 

The attached updates are for WICED SDK-3.1.2 and WICED SDK-3.5.2 release but they can be merged to other releases as well.