Solved
waclawek.janBest answer
Super User
April 3, 2023
From reading the code it appears to be OK, but maybe I'm overlooking something.
However, the mcu does not work out of source code but out of the registers. Read out and check/post content of DMA registers after the error occurs.
JW
PS. sylistics:
- don't reinvent the wheel: where available, use symbols from CMSIS-mandated header. Makes things easier to read by others, and helps avoiding errors like
// PSIZE 1 byte
DMA1->DMA_S6CR &= ~(3 << 12);
- don't assemble bitfields into a single register by successive RMW - write an expression assembling those values and assign (or RMW, but that's rarely needed in initialization, usually only in runtime and that's relatively rare either) into given register
