cancel
Showing results for 
Search instead for 
Did you mean: 

SDIO eMMC access failed in SDIO_CK without division

YHass.14
Senior

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.

1 ACCEPTED SOLUTION

Accepted Solutions
YHass.14
Senior

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.

View solution in original post

4 REPLIES 4
Amel NASRI
ST Employee

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 Accept as Solution on the reply which solved your issue or answered your question.

YHass.14
Senior

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
Senior

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.

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 Accept as Solution on the reply which solved your issue or answered your question.