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

cross mob
Manoj_Kumar
Level 3
Level 3
50 sign-ins 25 replies posted 10 questions asked

Am trying to write and read through UART, but while reading from UART the length automatically becomes 0. So the cyhal_uart_read() function is failing to read the data. Here is the code am using for reading the data.

len=7;
result=cyhal_uart_writable(&obj);
result = cyhal_uart_write(&obj, buff, &len);
vTaskDelay(100);
result=cyhal_uart_readable(&obj);
result = cyhal_uart_read(&obj, readbuff1, &len);
vTaskDelay(500);
vTaskDelay(100);

0 Likes
1 Solution
Andri-setyabudi
Level 5
Level 5
50 likes received 50 sign-ins 25 solutions authored

Hi, 

Have you set the RX_BUFFER_SIZE of FIFO?
because cyhal_uart_read() will take the UART RX data from FIFO. 
Could you please share your project or describe more ? 

Warm regards,
Andri

View solution in original post

0 Likes
1 Reply
Andri-setyabudi
Level 5
Level 5
50 likes received 50 sign-ins 25 solutions authored

Hi, 

Have you set the RX_BUFFER_SIZE of FIFO?
because cyhal_uart_read() will take the UART RX data from FIFO. 
Could you please share your project or describe more ? 

Warm regards,
Andri

0 Likes