Skip to content

Commit 465fb02

Browse files
kbidanierwango
authored andcommitted
stm32cube: stm32h7xx: drivers: Correct DMA source and destination addresses
The source and destination addresses in the HAL_MDMA_Start_IT call were swapped, causing incorrect data transfers. The data buffer (pData) should be the source, and the OSPI data register (DR) should be the destination. This commit fixes the argument order to ensure proper data transmission via DMA. Signed-off-by: Khaoula Bidani <[email protected]>
1 parent a6b2719 commit 465fb02

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

stm32cube/stm32h7xx/README

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,9 @@ Patch List:
7575
Impacted file:
7676
stm32cube/stm32h7xx/drivers/src/stm32h7xx_hal_sdio.c
7777

78+
*Fix an issue in the STM32H7 HAL OSPI by correcting the DMA source and destination
79+
addresses in the HAL_MDMA_Start_IT() call.
80+
Impacted files:
81+
stm32cube/stm32h7xx/drivers/src/stm32h7xx_hal_ospi.c
82+
7883
See release_note.html from STM32Cube

stm32cube/stm32h7xx/drivers/src/stm32h7xx_hal_ospi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1495,7 +1495,7 @@ HAL_StatusTypeDef HAL_OSPI_Transmit_DMA(OSPI_HandleTypeDef *hospi, uint8_t *pDat
14951495
}
14961496

14971497
/* Enable the transmit MDMA Channel */
1498-
if (HAL_MDMA_Start_IT(hospi->hmdma, (uint32_t)&hospi->Instance->DR, (uint32_t)pData, hospi->XferSize, 1) == \
1498+
if (HAL_MDMA_Start_IT(hospi->hmdma, (uint32_t)pData, (uint32_t)&hospi->Instance->DR, hospi->XferSize, 1) == \
14991499
HAL_OK)
15001500
{
15011501
/* Enable the transfer error interrupt */

0 commit comments

Comments
 (0)