cancel
Showing results for 
Search instead for 
Did you mean: 

Uart variable length

cyrildufoing
Associate II
Posted on December 20, 2015 at 14:56

Hi ! 

I need to implement a Rx-uart at 250k bauds with variable length but the problem is that I'm with the CubeMX configurator and I don't know how to do it.

I was also trying to receive the data in DMA but when I call HAL_UART_Receive_DMA, I receive a 0x00 at the first byte but when I call HAL_UART_Receive_IT at the same place, I receive the byte I need. (0xCC)

If someone can help me... 

Here is some code :

void HAL_TIM_IC_CaptureCallback(TIM_HandleTypeDef *htim)

{

if (htim->Instance==TIM2)

{

if(HAL_TIM_ReadCapturedValue(&htim2,TIM_CHANNEL_2) >= 176)

{

HAL_UART_Receive_DMA(&huart1,data_rdm_discovery,38);

}

}

} /*when I have a break of 176 us I call HAL_UART_Receive_DMA(&huart1,data_rdm_discovery,38)*/

Then I analyze the packet with the rxcplt_callback

#hal #uart #!stm32 #stmf1
0 REPLIES 0