H743zit6, Abnormal data reception using SPIDMA mode?
All data received in normal mode is 0, but some correct data can be received in debug mode?
cubemx configurations are as follows:



- Part of the code is as follows:
uint8_t pData[128] = {0x00};
HAL_SPI_Receive_DMA(&hspi1,pData,128);
while(HAL_SPI_GetState(&hspi1) != HAL_SPI_STATE_READY);
while(CDC_Transmit_FS(pData,128) != USBD_OK);
while(CDC_Transmit_FS(TestData,1) != USBD_OK); //0xff- In normal mode, SPIDMA receives 128 bytes of data and returns it to the host computer using a usb virtual serial port (the host computer displays a column of 20 bytes). At this time, no matter how many times it is received, it is all zero, but the waveform is correct.
- Debug mode receives partially correct data (data format is 128 bytes of data consisting of two identical 64 bytes). The first 64 bytes received are correct, the last 64 bytes are not sure where the error occurred), and the last 0xff is used to test whether the USB is normal. The following figure (where DOUT is the slave output waveform) :


- In normal mode, it's all zero.

- In debug mode, some correct data can be received.

The monitor variable is indeed the same as displayed after receiving by the upper computer, again proving that the upper computer has no problem with USB transmission.
Questions:
- Why is there a difference between debug mode and normal mode?
- How can SPI+DMA fully receive 128 bytes?
Thanks for your suggestions and reply.
There is original address:https://shequ.stmicroelectronics.cn/thread-640472-1-1.html
