For my current project I want to send out data via the SPI bus using DMA. In my original tests on a prototyping board everything seemed fine. Now I switched to a PCB and somehow everything started breaking.
I attached the full code to the post. Note that I'm using platformio to compile and upload the code.
So in my current code I do 2 steps. The 1st is filling a buffer with the data
The buffer is used as a function argument and copied into the output buffer (in reverse)
But if I look at my scope I get the following output.
If you look in the actual code, there is some more stuff but that is mostly to control the timing or help me isolating the issue.
Any suggestions are appreciated.
I attached the full code to the post. Note that I'm using platformio to compile and upload the code.
So in my current code I do 2 steps. The 1st is filling a buffer with the data
Code:
if(bitPosition % 2 == 0)
memset(buffer, 0, sizeof(buffer));
else
memset(buffer, 0xFF, sizeof(buffer));
The buffer is used as a function argument and copied into the output buffer (in reverse)
Code:
DMAMEM uint8_t outputBuffer[50];
[...]
for (int i = bufferSize - 1; i >= 0; i--)
{
outputBuffer[maxSize - 1 - i] = buffer[i];
}
LOG_TRACE("Size", bufferSize, "data", LOG_AS_ARR(outputBuffer, bufferSize));
SPI1.transfer(outputBuffer, NULL, maxSize, _spiDoneEventResponder);
But if I look at my scope I get the following output.
If you look in the actual code, there is some more stuff but that is mostly to control the timing or help me isolating the issue.
Any suggestions are appreciated.

