2025-06-03 1:07 AM - last edited on 2025-06-03 6:00 AM by mƎALLEm
Hi,
I am experiencing a packet loss issue using Peripheral-to-Peripheral DMA between UARTs.
While Peripheral-to-Peripheral configuration is referenced in the STM32U585's Reference Manual, it is not available in the HAL library. Therefore, the DMA is configured for Peripheral-to-Memory mode, with the destination address set to the UART's Transmit Data Register (TDR). FIFO mode is not used.
The reference setup I am using is based on the B-U585I-IOT02A, where no packet loss occurs.
(MSI Clock)
The packet loss issue occurs on another STM32U5 (u585cit6q) with the same software but different UART configurations.
(HSE Clock)
USART3 is configured to use the RS485 protocol.
The packet loss varies between 0.0025% and 10%, depending on the baud rate, and it is not correlated to an increase in speed.
Is it possible to experience synchronization issues between USART and UART?
Can the addition of the RS85 be the source of the issue ?
Regards,
Loïc
2025-06-03 1:14 AM
Please post your schematic and a minimum but complete example which illustrates the problem
@lotou wrote:Can the addition of the RS85 be the source of the issue ?
Have you tried without it?
Have you tried without DMA?
2025-06-03 5:43 AM
Sure,
here is the application code:
while ((UART_A.Instance->ISR & USART_ISR_TXE) != USART_ISR_TXE);
while ((UART_B.Instance->ISR & USART_ISR_TXE) != USART_ISR_TXE);
HAL_UART_Receive_DMA(&UART_A,(uint8_t *)&UART_B.Instance->TDR,1);
HAL_UART_Receive_DMA(&UART_B,(uint8_t *)&UART_A.Instance->TDR,1);
The main difference is the mcu and its configuration, both done with CubeMX.
STM32U585AII6Q :
- UART_A = USART2
- UART_B = USART3
- MSI Clock
STM32U585CIT6Q:
- UART_A = USART3 - RS485 (PB1 set High)
- UART_B = UART4
- HSE Clock
Test procedure :
Read from UART_A_TX (/dev/ttyUSBx) and store it to result.bin file.
Send a random binary file to UART_B_RX ( /dev/ttyUSBy).
Compared sent file and result.bin: must be exactly the same.
Repeat the test but send to UART_A_RX and read from UART_B_TX
Baudrate: 4M bauds
Test results:
STM32U585AII6Q: OK
STM32U585CIT6Q: NOK - Change baudrate changes the amount of byte loss.
4M bauds: 0.0025% loss
3M bauds: ~0.0025% loss
1M bauds: 10% loss
No and i am not suppose to.
That's also a no.
2025-06-03 6:15 AM
> The packet loss varies between 0.0025% and 10%, depending on the baud rate, and it is not correlated to an increase in speed.
What is the nature of the packet loss? Garbled characters? Missing characters? Do parity or frame or noise errors get triggered?