Skip to main content
YHass.14
Associate III
July 8, 2021
Solved

SDIO eMMC access failed in SDIO_CK without division

Hello all.

I use STM32F4 controller with eMMC external Flash.

I use two IDEs:

  • IAR version 8.30
  • STM32CubeIDE version 5.2.0

The access to eMMC external Flash succeeds while I use IAR IDE.

The access to eMMC external Flash failed while I use STMCubeIDE with same SDIO clock of IAR .

I divide by 2 the SDIO clock for STMCubeIDE.

The access to eMMC external Flash is better but failed after 10-20 accesses.

Can anyone advise what is the problem of STMCubeIDE compiler/linker/optimizer?

Thanks in advance.

Yacob.

This topic has been closed for replies.
YHass.14
YHass.14Best answer
Associate III
August 26, 2021

Hello all,

The failure was the external Flash stuck and did not response.

I solved the failure by compiling in Release configuration with the following levels:

  • Debugging level: Maximum (-g3) (same as Debug configuration)
  • Optimization level: Optimize for Debug (-Og)

Yacob Hassidim.

4 replies

Amel NASRI
ST Technical Moderator
July 13, 2021

Hi @Community member​ ,

Could you please precise if you are referring to a Cube example? If yes, which one?

Otherwise, please share the code allowing to reproduce the issue?

Thanks.

-Amel

To give better visibility on the answered topics, please click on "Best Answer" on the reply which solved your issue or answered your question.
YHass.14
YHass.14Author
Associate III
July 15, 2021

Hello @Amel NASRI​ ,

Thank you for your reply.

I have not Cube example.

The code is calling to the following ST HAL functions:

 HAL_StatusTypeDef halStatus;
 MMC_HandleTypeDef* mHalMmc;
 uint8_t* pBuffer;
 uint32_t blockAdd;
 uint32_t numberOfBlocks;
 uint32_t timeout;
 
 /*Read Block Operation*/
 halStatus = HAL_MMC_ReadBlocks(
 mHalMmc,
 pBuffer,
 blockAdd,
 numberOfBlocks,
 timeout);
 while(HAL_MMC_GetState(mHalMmc)!=HAL_MMC_STATE_READY);
 
 /*Write Block Operation*/
 halStatus = HAL_MMC_WriteBlocks(
 mHalMmc,
 pBuffer,
 blockAdd,
 numberOfBlocks,
 timeout);
 while(HAL_MMC_GetState(mHalMmc)!=HAL_MMC_STATE_READY);
 

Another issue that I forgot to mention: I use FreeRTOS.

I remind again:

The ST HAL functions succeed under IAR always but under CubeIDE most of the times they failed.

Thanks in advance for your advise.

Yacob Hassidim.

YHass.14
YHass.14AuthorBest answer
Associate III
August 26, 2021

Hello all,

The failure was the external Flash stuck and did not response.

I solved the failure by compiling in Release configuration with the following levels:

  • Debugging level: Maximum (-g3) (same as Debug configuration)
  • Optimization level: Optimize for Debug (-Og)

Yacob Hassidim.

Amel NASRI
ST Technical Moderator
August 26, 2021

Hi @Community member​ ,

Thanks a lot for coming to share the solution you found.

-Amel

To give better visibility on the answered topics, please click on "Best Answer" on the reply which solved your issue or answered your question.