cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F103T8 UART ReceiveToIdle trigger issue? & DMA issue

XD
Associate III

Im not sure what is going on...

The goal is to receive an unknown transmission length from the UART. 

Issues:

  1. HAL_UARTEx_ReceiveToIdle_IT(): Event callback is called "incorrectly".
  2. I am unable to get any DMA to function, neither the UART DMA or I2C. Simply nothing happens.

 

HAL_UARTEx_ReceiveToIdle_IT(): Issue

Baudrate: 9600
Reception interval: ~200 ms

The most common amount of bytes to receive is 8 (one packet). The RxEventCallback function is called at the start of the next packet.

Packet 1 is sent -> 200ms of nothing -> Packet 2 is sent -> RxEventCallback is immediately called with the reception size being 9-bytes. All data is correct and no errors are thrown. 

XD_0-1742376240166.png

 

 

Previous working approaches on other processors.
STM32F4:

HAL_UARTEx_ReceiveToIdle_DMA(&huart3, buffer, size);
__HAL_DMA_DISABLE_IT(&hdma_usart3_rx, DMA_IT_HT);
__HAL_UART_ENABLE_IT(&huart3, UART_IT_IDLE);

Handle data in:

void HAL_UARTEx_RxEventCallback(UART_HandleTypeDef *huart, uint16_t Size){

 return;
}

 

Old 8-bit processors:

UART Rx IRQ
Read byte and start & reset timer counting register.

Timer overflows and calls interrupt when data is no longer received. 

 

What is going on with the DMA?

I would prefer the DMA approach for obvious reasons but cannot get it to work. 
I've tested the exact same code and configuration as on other ST processors but i get zero transmission or reception!

 

0 REPLIES 0