Unexpected data change in snprintf output with STM32H743 UART DMA
Hello,
I am using an STM32H743 microcontroller. UART8 is configured at a baud rate of 460800 with DMA enabled. The UART output is logged by a USB logger which creates a FAT32 text file.
The transmitted data contains mixed data types such as integers, characters, strings, floats, and doubles. To combine the data, I format it into a string using snprintf.
I am facing a strange issue:
When I format the string using a comma after the first integer, and the second integer variable is zero, the value recorded in the USB log becomes 8 instead of 0.
When I replace the comma with a semicolon, the value is recorded correctly as 0.
Additional observations:
This issue only occurs when the data is generated by the STM32.
If the same formatted data is sent from a computer or another hardware source, the issue does not occur.
If I log the STM32 UART output directly on a computer terminal, the data is correct.
The problem only appears when using the USB logger with STM32 UART DMA output.
Could you please advise what could cause this behavior? Could it be related to DMA operation, cache coherency, buffer handling, or string formatting on STM32H7?
Any guidance would be appreciated.
Regards,
