Uart reciever
I have to recieve a frame from a bldc controller , this frame as follows
START CMD LENGTH BAT CUROLD TSNS STATE USER VOL CUR
| 0x66 | 0x42 | 0x?? | 1 byte | 1 byte | 2 bytes | 1 byte | 2 bytes | 2 bytes | 2 bytes |
but i didn't receive anything , the problem with how to manage the lengh of every values 's frame(byte ,2byte)could you help me please? i'm using nucleo F446RE
uint8_t buffer[14];
void SystemClock_Config(void);
static void MX_GPIO_Init(void);
static void MX_USART1_UART_Init(void);
/* USER CODE BEGIN 0 */
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
{
HAL_UART_Receive_IT(&huart1,buffer, 10);
}
int main(void)
{
HAL_Init();
SystemClock_Config();
MX_GPIO_Init();
MX_USART1_UART_Init();
HAL_UART_Receive_IT(&huart1,buffer, 10);
/
while (1)
{
}
