2024-06-13 08:30 AM
Source and destination parameters are incorrectly placed in the following code:
stm32h7xx_hal_ospi.c
Line 1496
HAL_OSPI_Transmit_DMA function
if (HAL_MDMA_Start_IT(hospi->hmdma, (uint32_t)pData, (uint32_t)&hospi->Instance->DR, hospi->XferSize, 1) == \
HAL_OK)
2024-06-13 11:41 AM - edited 2024-06-13 11:45 AM
Hello,
Sorry I couldn't understand;
HAL_MDMA_Start_IT has the following definition:
HAL_StatusTypeDef HAL_MDMA_Start_IT(MDMA_HandleTypeDef *hmdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t BlockDataLength, uint32_t BlockCount)
So the 2nd input is the source and the 3rd one is the destination.
In stm32h7xx_hal_ospi.c / line 1496:
if (HAL_MDMA_Start_IT(hospi->hmdma, (uint32_t)pData, (uint32_t)&hospi->Instance->DR, hospi->XferSize, 1) == \
So pData is the source which is located in the RAM and the destination hospi->Instance->DR is the data register of the OSPI.
Could you please clarify? or am I missing something?
2024-06-13 11:57 AM
2024-06-13 12:14 PM - edited 2024-06-13 12:27 PM
To send data from a memory to OSPI using DMA you need to call : HAL_OSPI_Transmit_DMA():
Line 1496: if (HAL_MDMA_Start_IT(hospi->hmdma, (uint32_t)pData, (uint32_t)&hospi->Instance->DR, hospi->XferSize, 1) == \
HAL_OK)
To receive data from OSPI to a memory using DMA you need to call : HAL_OSPI_Receive_DMA():
line 1600: if (HAL_MDMA_Start_IT(hospi->hmdma, (uint32_t)&hospi->Instance->DR, (uint32_t)pData, hospi->XferSize, 1) == \
Hope I answered your question!
2024-06-13 12:39 PM
2024-06-13 12:56 PM
So here the issue is on the receive and not on the transmit contrary to what you posted at the beginning.
2024-06-13 01:02 PM
Good you understand it now.