UART Recive not work

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

cross mob
Anonymous
Not applicable

Hello All,

I am working on wiced SDK3.5.2. I  getting the problem with not receive the packet from the terminal. in this i transmit the data from he docklight terminal. in this when i send the data print on the docklight terminal ok.

my code is:

/*------------------------------------------------------------------------------------------------*/

    ring_buffer_init(&rx_buffer, rx_data, RX_BUFFER_SIZE );

    /* Initialise UART. A ring buffer is used to hold received characters */

    wiced_uart_init( STDIO_UART, &uart_config, &rx_buffer );

    /* Send a test string to the terminal */

    wiced_uart_transmit_bytes( STDIO_UART, TEST_STR, sizeof( TEST_STR ) - 1 );

    /* Wait for user input. If received, echo it back to the terminal */

    while ( wiced_uart_receive_bytes( STDIO_UART, &ch, 1 , WICED_NEVER_TIMEOUT ) == WICED_SUCCESS )

    {

       WPRINT_APP_INFO(("UART Rx\r\n"));

     }

/*--------------------------------------------------------------------------------------------------------*/

i execute code it does not enter in the while loop. check from the hardware site it is ok.

i am stuck here help me...

0 Likes
1 Solution
AndrewY_86
Employee
Employee
25 sign-ins 25 replies posted 10 replies posted

It looks like you modified the snip.uart app to print "UART Rx" when data is received. If you look at the makefile,  you should see that WICED_DISABLE_STDIO is defined. This define will disable stdio calls which WPRINT_APP_INFO uses. Try using wiced_uart_transmit_bytes instead of WPRINT_APP_INFO.

View solution in original post

4 Replies
user_2177781
Level 5
Level 5
25 likes received 10 likes received 5 likes given

I assume this problem is related to UART receive problem?

AxLi_1746341
Level 7
Level 7
10 comments on KBA 5 comments on KBA First comment on KBA

Try testing if snip.uart works for you or not.

0 Likes
AndrewY_86
Employee
Employee
25 sign-ins 25 replies posted 10 replies posted

It looks like you modified the snip.uart app to print "UART Rx" when data is received. If you look at the makefile,  you should see that WICED_DISABLE_STDIO is defined. This define will disable stdio calls which WPRINT_APP_INFO uses. Try using wiced_uart_transmit_bytes instead of WPRINT_APP_INFO.

Anonymous
Not applicable

Hello,

Thanks for your valuable answer.

first of all test with the snip.uart it is working ok, then after testing with my code it is working fine.

0 Likes