2023-05-29 05:15 PM
I have SPI set in Master Receive Mode Only and my code does work when not passing data to DMA.
2023-05-30 04:34 AM
Hello @LMorr.3,
Have you checked the CubeFW example of SPI data buffer transmission and reception with DMA?
It's not with freeRTOS though
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2023-05-30 04:56 AM
Thanks, I'm looking at that sample code now. One issue is that I'm not clear on what libraries I should be using. HAL libraries are discouraged, which leave me with bare-metal. I wish someone would just post a simple explanation on how CMSISV1, CMSISV2, HAL, LL, and all the other 'libraries' work together and which ones are deprecated. Seems like a very messy approach grown over the years by folks who are way to deep to get a new-comer's eye view on getting setup. All official docs recommend HAL but then sample code now shows library usage I've not come across yet ( LL_ ) so I'll have to learn about that before I can proceed. Still not sure if I should now focus on coding with LL instead of bare metal, CMSIS or HAL.
2023-05-30 07:38 AM
To partly answer my own questions: HAL does not seem to support DMA for Master receive only mode. Its functions expect DMA to be setup for tx as well or exits with HAL_ERROR. Will look at using CMSIS to see if that helps.
Also, I think LL is no longer supported.
2023-05-30 01:20 PM
UPDATE:
I always see hdmarx status 'HAL_DMA_STATE_ABORT' in DMA2_Stream0_IRQHandler each time I call HAL_SPI_Receive_DMA(hspi,pData, Size)
Not sure what would cause that.
2023-06-01 02:23 PM
I am all set now, thanks!