Skip to main content
Visitor II
December 20, 2022
Solved

STM32MP1-CortexA7 SDMMC1 TxUnderrun Error

  • December 20, 2022
  • 1 reply
  • 875 views

Hi, community.

I am trying the SD UHS-I mode on your evaluation board(STM32MP157F-EV1), but it does not work.

Q1. Does HAL support UHS-I?​

Q2. Is it necessary to enable SDMMC_CLKCR_SELCLKRX_1? (when using STM32MP157F-EV1 board)

Q3. What is the reason why it works in 1Bit mode but not in 4Bit mode?

​​

Additional Information

Evaluation board: STM32MP157F-EV1

HAL library: STM32MP1xx HAL Driver(v1.5)

File system: FatFs(exFat)

Port used: SDMMC1

CPU: Cortex A7

RTOS: No (Baremetal) Not use OpenSTLinux

SDMMC1 clock source: PLL4 (100MHz)

Instance = SDMMC1

ClockEdge = Falling

ClockPowerSave = Enable

HardwaraFlowControl = Enable

BusWide = 1Bit or 4Bit

ClockDiv = 1 (50MHz)

UHS-I Speed Mode = SDR25

HAL Customization

#define USE_SD_TRANSCEIVER (1)

#define USE_SD_DIRPOL

Best regards,​

    This topic has been closed for replies.
    Best answer by Kevin HUBER

    Hello @TSens.1​ ,

    By looking quickly at the HAL code 1.5.0, we can see in the file "Src/stm32mp1xx_hal_sd.c"

    > Src/stm32mp1xx_hal_sd.c:2338: * @arg SDMMC_BUS_WIDE_4B: 4-bit data transfer

    > Src/stm32mp1xx_hal_sd.c:2359: else if(WideMode == SDMMC_BUS_WIDE_4B)

    and in "Src/stm32mp1xx_ll_sdmmc.c"

    > (+) Full compliance with SD memory card specifications version 4.1.

    > (SDR104 SDMMC_CK speed limited to maximum allowed IO speed, SPI mode and

    > UHS-II mode not supported).

    Which implicitly says that USH-I mode is supported.

    I was not able to find the SD memory card specifications version 4.1, but since we are fully compliant, it surely supports it.

    Unfortunately, ST doesn't provide Bare metal support for MP15, so I will not be able to help you more.

    There is an existing project on the community that can maybe help you (made by community member). This community project is also visible in the "Project" part of the community.st:

    https://community.st.com/s/project/a8g3W000000fxc1QAA/stm32mp1-baremetal-example-projects

    But I don't know if there is example using the UHS mode.

    Best Regards,

    Kevin

    In order to give better visibility on the answered topics, please click on 'Select as Best' on the reply which solved your issue or answered your question. See also 'Best Answers'

    1 reply

    Technical Moderator
    January 26, 2023

    Hello @TSens.1​ ,

    By looking quickly at the HAL code 1.5.0, we can see in the file "Src/stm32mp1xx_hal_sd.c"

    > Src/stm32mp1xx_hal_sd.c:2338: * @arg SDMMC_BUS_WIDE_4B: 4-bit data transfer

    > Src/stm32mp1xx_hal_sd.c:2359: else if(WideMode == SDMMC_BUS_WIDE_4B)

    and in "Src/stm32mp1xx_ll_sdmmc.c"

    > (+) Full compliance with SD memory card specifications version 4.1.

    > (SDR104 SDMMC_CK speed limited to maximum allowed IO speed, SPI mode and

    > UHS-II mode not supported).

    Which implicitly says that USH-I mode is supported.

    I was not able to find the SD memory card specifications version 4.1, but since we are fully compliant, it surely supports it.

    Unfortunately, ST doesn't provide Bare metal support for MP15, so I will not be able to help you more.

    There is an existing project on the community that can maybe help you (made by community member). This community project is also visible in the "Project" part of the community.st:

    https://community.st.com/s/project/a8g3W000000fxc1QAA/stm32mp1-baremetal-example-projects

    But I don't know if there is example using the UHS mode.

    Best Regards,

    Kevin

    In order to give better visibility on the answered topics, please click on 'Select as Best' on the reply which solved your issue or answered your question. See also 'Best Answers'