cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H563 SPI DMA issue

fhu.11
Associate II

Hi All!

I have a issue about SPI DMA communication on NUCLEO-H563 Board. Details are as follows.

My Configuration of STM32CubeMx as shown in the figure1 and 2.

5.png

figure1

6.png

figure2

I call the function of HAL_SPI_TransmitReceive_DMA(), it comes to line 2212 of program and return HAL_ERROR then.

I debug the program and find the value of hspi->hdmarx->Init.DestDataWidth is 0, so it return the error.

1.JPG

Then I back to check the initialization of spi1 dma. I find that the Init.DestDataWidth of handle_GPDMA1_Channel2 is already 0 before execute statement __HAL_LINKDMA() .

So I guess maybe somewhere my configuration of spi dma is wrong somewhere and I can't figure it out.

Please help me for this question.

Thanks!

3.png4.JPG

1 REPLY 1
BarryWhit
Senior III

To me, the code you show seems to be setting the dest width on a linked list node, and there's also a call to set the DMA to circular mode. But your configuration is in standard request mode, and circular mode is disabled.

 

Could you be looking at the wrong place?

 

If you attach the .ioc file it'd be much easier for forum members to double check what your doing.

 

- If a post has answered your question, please acknowledge the help you received by clicking "Accept as Solution".
- Once you've solved your issue, please consider posting a summary of any additional details you've learned. Your new knowledge may help others in the future.