cancel
Showing results for 
Search instead for 
Did you mean: 

MMC Device 0 not found

alenik-mm
Associate II

Hello,

I have a custom board with an eMMC on it and with no SD card available. In the U-Boot device tree I have the following line (On sdmmc2 is my eMMC):

aliases{
	mmc0 = &sdmmc2;
};

The U-Boot seems to partly have a problem with it.

  • Commands like "mmc write" or "mmc info" use the MMC Interface 0 - they set "curr_device" to 0 by default (unless I use "mmc dev 1"). And this is not a problem.
  • However, the MMC environment works with MMC interface 1, which leads to failures. What I find the most weird is the following function in the mmc.c file:

static int env_mmc_save(void)
{
	ALLOC_CACHE_ALIGN_BUFFER(env_t, env_new, 1);
	int dev = mmc_get_env_dev();
        ...
}

The variable dev in the line 4 is always 1, I guess since the eMMC is set as boot instance 1.

To sum up: The MMC functions work by default with mmc 0, the env MMC works by defalt with mmc 1.

PS: I could maybe use the MMC 1 and use the 'mmc dev 1' at the beginning, but the STMCubeProgrammer cannot flash the devce as it comes with an error:

Download in Progress:
[==================================================] 100% 
 
File download complete
Time elapsed during download operation: 00:01:40.159
 
RUNNING Program ... 
  PartID:      :0x03 
Start operation done successfully at partition 0x03
GETPHASE command not acknowledged!
 
Reemission of GetPhase command
 
 
Error: GetPhase Error: mmc device 1 not found
Received PhaseID == 0xFF, system is going to reboot

Could someone help me on this?

1 ACCEPTED SOLUTION

Accepted Solutions
Olivier GALLIEN
ST Employee

Hi @Community member​ ,

I noticed you also raised same question to OLS.

We are working on a clean solution.

In the meantime we suggest to modify U-boot as follow :

int mmc_get_env_dev(void)

{

return 0;

}

Hope it help

Olivier

Olivier GALLIEN
In order 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.

View solution in original post

4 REPLIES 4
Olivier GALLIEN
ST Employee

Hi @Community member​ ,

I noticed you also raised same question to OLS.

We are working on a clean solution.

In the meantime we suggest to modify U-boot as follow :

int mmc_get_env_dev(void)

{

return 0;

}

Hope it help

Olivier

Olivier GALLIEN
In order 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.
alenik-mm
Associate II

Hi Olivier,

that also works for me. Thanks!

Aleksandar

allard
Senior

I'm running into the same problem, is there an option besides editing files? If not, how to edit the file above with the distribution package, by creating a patch file?

Hi @allard​ 

I consider more convenient to work in developer package during bring-up BSP setting phase.

But you can stick on Distribution and see this page for support :

https://wiki.st.com/stm32mpu/wiki/How_to_cross-compile_with_the_Distribution_Package#Modifying_the_U-Boot

Olivier

Olivier GALLIEN
In order 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.