2017-04-17 12:01 AM
Does anyone have some example code for the STM32F411VE to allow me to use the function 'HAL_SPI_TransmitReceive_DMA'?
I had a look through the ST examples and none of them seemed to use this code. If someone has some sample code or can point me in the direction of some ST supplied sample code, that would be great. I'm struggling to understand how it is supposed to work, and particularly which callback I'm supposed to grab - and how.
#stm32f411ve #dma2017-04-17 12:37 AM
Did you have a look at the SPI_FullDuplex_ComDMA example available in the CubeF4 package for most of the DISCOVERY boards?
2017-04-17 03:01 AM
I thought I had, I guess I havent! I'll have another look - thanks!
Sorry about the apparently silly question, it has been a long project, particularly being my first with ARM devices.
2017-04-17 03:38 AM
Hey mate,
I remember why I wasn't completely happy with that example. After the DMA command, it polls a flag to identify when the transmission is complete. I was hoping to implement the
HAL_SPI_TxRxCpltCallback function to trigger my code to process the received data.
I have tried to implement it (and Ive also called the IRQ Handler function when the DMA IRQ comes in), however it's not triggering, so I believe I've badly initialised it. Thats why I was hoping to find another example, so I can identify what I'm doing wrong and continue.
I can't currently post my code, as it's on my computer at work, and it's a long block of code. I was hoping to get some code which has that callback implemented already so I can investigate myself.
Sorry I didn't put that in my initial question!