-
Notifications
You must be signed in to change notification settings - Fork 232
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
eMMC init issue #107
Comments
As it looks to me, your data lines have some errors... like no valid data could be received on the data lines when the bus is tested. You are using SDMMC1 IP block right ? All is left to do is to put a scope on the data lines and see what is happening, how the data is transmitted... Also eMMCs are designed to operate at signaling/power at either 3v3, 1v8 or 1v2, it should not be changed during the operations. So 1V8sel does not have any point in your schematic. eMMC should not voltage switch. Are you using 3v3 for all voltage references for this eMMC ? |
I added this debug code:
And got:
So the function runs correctly once, and fails every other time? |
switch_fun is used for various things throughout the initialization procedure. to switch to highspeed, to change bus width, etc. So it's normal that it's called multiple times. It looks like it starts failing that's true |
Try to hack through mmc_detect_buswidth and see if that helps, skipping that detection should leave the emmc in 1 bit bus mode |
Also, try to enable HIGH DRIVE STRENGTH for your eMMC pins... here is a wiki page that shows an example how to do that |
Thanks for that. I hacked through mmc_detect_buswidth and got:
Changing the drive strength made no change. |
remove the enabling of the DDR also. DDR only works with at least 4 bits so it will try to enable 4 bits again |
basically you need mode 0 : 1 bit bus and no DDR #define MMC_BUS_WIDTH_8_DDR 6 |
OK, did that and the errors disappeared! Thanks... However I cannot probe it in u-boot, nor can I write anything to it via sam-ba so I can't test if it's working. Apologies that this is vague! Should I concentrate on uboot? |
So, did at91bootstrap succeed in copying u-boot from EMMC ?? |
I can't write anything to emmc to begin with. at91bootstrap is the only bit of software that vaguely recognizes its existence. I was hoping to find the problem in at91bootstrap |
I understand but it's very important if at91bootstrap managed to read on 1 bit or not. If 1 bit works, then, it's clear that the other 7 lines are messed up . maybe you have them mixed up in the schematics ? |
Sure, I'll see if I can find a way of testing that, thanks |
for testing the bus, the emmc sends a test pattern and the software must validate if the pattern was correctly received. If you mixed up some lines in hardware then bit 1 will arrive as bit 4, etc. so it will always fail |
It seems to fail on |
fails, even when I force it to be |
Okay so we need to go back... the extended CSD is received correctly ? Try to print it out (mmc_card_identify). |
You can also try to comment the switch_fun call which moves to HIGH speed mode (EXT_CSD byte 185 ). |
here is extended CSD:
|
Tried that, kept it in low speed mode, verified on oscilloscope, 400kHz clock speed |
I was able to get Linux to recognise it and mount it if I set the Linux device tree to bus width 1, with a slower clock. For now I'm happy that it's somewhat working and I'll take up further issues with the manufacturer. Thanks @ehristev for your help debugging, much appreciated! 🤺 |
Hi all,
I hope this is the right forum for this, if not please point me in the right direction.
We have a custom board, using a SAMA5D27 D1G CU, and a Micron MTFC2GMDEA-0M WT 2GB eMMC.
Schematic has been verified and board layout:
I can't get it to be recognised by u-boot, but at91 bootstrap does show some interesting data, however it returns an error (-10) when running
mmc_cmd_switch_fun()
on line 791 ofmci_media.c
CONFIG_DEBUG_VERY_LOUD
is set.The CID looks correct, and it detects the right version, but that's all I can get out of it. I've been banging my head off this for a week or so now so any help would be greatly appreciated.
Thanks
The text was updated successfully, but these errors were encountered: