Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong DMA abort callback function called in HAL_MMC_IRQHandler #22

Open
exelsior87 opened this issue Dec 16, 2022 · 2 comments
Open

Wrong DMA abort callback function called in HAL_MMC_IRQHandler #22

exelsior87 opened this issue Dec 16, 2022 · 2 comments
Assignees
Labels
bug Something isn't working hal HAL-LL driver-related issue or pull-request. internal bug tracker Issue confirmed and logged into the internal bug tracking system mmc Multimedia Card interface

Comments

@exelsior87
Copy link

exelsior87 commented Dec 16, 2022

Describe the set-up

  • Board: custom board (STM32F429BITx)
  • IDE: STM32CubeIDE 1.10.1 12716_20220707_0928 (UTC)
  • HAL: V1.8.1

Describe the bug (skip if none)
Invalid DMA abort function called in HAL_MMC_IRQHandler when error occured during sdio read/write by DMA mode.

How to reproduce the bug (skip if none)
Hello, I am a begginer at STM32.
English is not my first language so I'm not good at English. Please execuse me...
My application firmware code is using FatFS and read/write data from eMMC by DMA mode.
An HAL_MMC_ERROR_DATA_TIMEOUT(SDIO_FLAG_DTIMEOUT) error occurs after a certain period of time after the file read operation is completed.
At this time, the abort callback function is called and the DMA handle is initialized.
However, even though a HAL_MMC_ERROR_DATA_TIMEOUT error occurred during read operation, DMATxAbort callback is called and DMA TX handle initailized to NULL.

Additional context

https://github.com/STMicroelectronics/stm32f4xx_hal_driver/blob/6ea96e3bee7629552b26d92e96c2e64217bebfea/Src/stm32f4xx_hal_mmc.c#L1679-L1698

I think the code should be as follows:

...
if (((context & MMC_CONTEXT_WRITE_SINGLE_BLOCK) != 0) || ((context & MMC_CONTEXT_WRITE_MULTIPLE_BLOCK) != 0)) {
if (hmmc->hdmatx != NULL) {
...
DMA Tx Abort callback
...
}
}
else if (((context & MMC_CONTEXT_READ_SINGLE_BLOCK) != 0) || ((context & MMC_CONTEXT_READ_MULTIPLE_BLOCK) != 0)) {
if (hmmc->hdmarx != NULL) {
...
DMA Rx Abort callback
...
}
}
...

Screenshots
hmmc2
hmmc_instance2

@exelsior87 exelsior87 changed the title dsfsdf Wrong DMA abort callback function called in HAL_MMC_IRQHandler Dec 16, 2022
@TOUNSTM
Copy link
Contributor

TOUNSTM commented May 29, 2023

hello @exelsior87,

Thank you for this report. We will get back to you as soon as we analyze it further. This may take some time. Thank you for your comprehension.

With regards,

@TOUNSTM TOUNSTM added the hal HAL-LL driver-related issue or pull-request. label May 29, 2023
@KRASTM KRASTM self-assigned this Nov 21, 2024
@KRASTM KRASTM added bug Something isn't working mmc Multimedia Card interface labels Nov 21, 2024
@KRASTM
Copy link
Contributor

KRASTM commented Nov 21, 2024

ST Internal Reference: 196756

@KRASTM KRASTM added the internal bug tracker Issue confirmed and logged into the internal bug tracking system label Nov 21, 2024
@TOUNSTM TOUNSTM moved this from To do to In progress in stm32cube-mcu-hal-dashboard Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working hal HAL-LL driver-related issue or pull-request. internal bug tracker Issue confirmed and logged into the internal bug tracking system mmc Multimedia Card interface
Projects
Status: In progress
Development

No branches or pull requests

3 participants