Skip to main content
Kkhan.2
Associate
Jan 6, 2021 11:34 AM UTC
Question

Receiving data in RTOS

Hi, I am using stm32F767zi controller board with STONE 15" display. 

We are having trouble receiving data from the LCD panel. 

When we try to receive registry entry (8 Bytes) the system works fine, but when we try to read the variable register, the received (9 Bytes) are not being received correctly. we are using 2 different integer arrays for receiving 8 bytes and 9 bytes of data. 

Following is the sample code

uint8_t read_var[7]= {0xA5, 0x5A, 0x04, 0x83, 0x00, 0x00}; 

uint8_t read_page[6]= {0xA5, 0x5A, 0x03, 0x81, 0x03, 0x02};  

uint8_t read_sc_rcv[8];

uint8_t buff[9];

 // Register transmit & receive

HAL_UART_Transmit(&huart3, read_page, 6, 100);

HAL_UART_Receive_IT(&huart3, read_sc_rcv,8);

//Variable transmit & receive

HAL_UART_Transmit(&huart3, read_var, 7, 100);

HAL_UART_Receive_IT(&huart3, buff,9);

Thank You

This topic has been closed for replies.

1 reply

MM..1
Super User
Jan 6, 2021 12:20 PM UTC

You dont show what is error , and how you deal receving . IT need wait to complete and then use buff.