AnsweredAssumed Answered

Uart variable length

Question asked by withi.mark on Dec 20, 2015
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

Outcomes