2024-09-29 10:03 AM - edited 2024-09-29 10:04 AM
Hi,
Facing an issue on the STM32L4A6ZG. Trying to transmit 255 bytes through the SPI DMA at 12MHz. Correct data transmitted out on the MOSI till byte number 203, then the next 4 bytes are transmitted incorrectly and the 209th byte onwards it's correct again. Is there some sort of limitation with the number of bytes that can be transmitted continuously ?
Scope image at the bottom shows the inconsistent data - after 0xDF, expected data was 0xE0, 0xE1, 0xE2 and 0xE3 which was not transmitted out correctly. 0xE4 onwards it's correct.
2024-09-29 10:34 AM
Hi,
> Is there some sort of limitation with the number of bytes that can be transmitted continuously ?
If using DMA : yes ->
After 200 bytes -> the problem is in your program. :)
2024-09-29 01:15 PM
So 4 bytes are off. Probably due to an out of bounds write. You can set a hardware watchpoint at that location to find out what is modifying the data. Unlikely to be a DMA issue, more likely due to a bug in your program.
2024-09-29 10:23 PM
If it was out of bounds, wouldn't all the following bytes be out of bound ?
2024-09-29 10:25 PM
but then data after those 4 bytes are correct.
2024-09-30 05:33 AM
No, a single out of bounds write will only corrupt what is written, not everything after that as well.
2024-09-30 06:03 AM
4 bytes = 1 int32 ; So a single "wrong" write to an INT pointer is enough.