2025-04-12 8:59 AM - edited 2025-04-12 9:16 AM
Hi, I have a strange situation I can't figure out. I'm new at DMA so I just follow directions as best I can without a full understanding. Right now, my setup is more or less working for a few months. But today I encountered a problem. I am using UCPD with DMA. Somehow UCPD starts sending data that is equivalent to all 0s. Basically, the data being sent to UCPD by the DMA is all 0s. UCPD encodes this and sends it out over the data channel. Its the correct number of bytes. Also, the preamble and header which are made by UCPD are both correct. I've checked with a scope to verify what is going out. And I've checked with a debugger to verify what is going into the DMA.
Can you think of any reason why the DMA would transfer just 0s to the peripheral? Or why the peripheral would receive 0s? Does the DMA buffer need to be volatile? Makes sense that it would need to be but following the STM example code for UCPD their DMA buffers were not volatile..
Also I should point out this isn't just one time. Once it starts this it is continuously transmitting 0s. My program is requesting the transmissions on purpose. The point is, they are all wrong.