UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
609 Views
Registered: ‎08-30-2018

u-boot can not detect sd card

Jump to solution

Hello all,

 

I designed a custom board to use Zynq XC7Z010 SoC with a petalinux which would boot from a SD card.

I routed the signals SD_CLK, SD_CMD, SD_D0, SD_D1, SD_D2, SD_D3 to the correct pins of the SD card. When I turn the system on and connect the terminal of Zynq to my PC i got the following messages:

 

 

U-Boot 2018.01-gfa78b3d (May 09 2019 - 11:49:11 -0300)

DRAM:  ECC disabled 512 MiB
MMC:   sdhci@e0100000 - probe failed: -6

** Bad device mmc 0 **
Using default environment

In:    serial@e0000000
Out:   serial@e0000000
Err:   serial@e0000000
SF: Detected s25fl512s_256k with page size 512 Bytes, erase size 256 KiB, total 64 MiB
Net:   ZYNQ GEM: e000b000, phyaddr 3, interface rgmii-id
eth0: ethernet@e000b000
Hit any key to stop autoboot:  0
no mmc device at slot 0
** Bad device mmc 0 **
## Error: "distro_bootcmd" not defined

 

When I put my SD card to the evaluation board I have, it is detected by u-boot.

 

I checked the signals above mentioned and they are correctly mapped. However, I am thinking that maybe I have wrongly neglect the CARD_DETECT signal or something similar. 

Reading in others similar questions, I understood that the pin mapping of SD controller is defined in the device tree configuration files? But I don't have a complete understanding of it. If this is right, could someone give a clarification on how can I find in the device tree if the pins that I mapped are correct or if I forgot something?

 

In addition, the messages "MMC: sdhci@e0100000 - probe failed: -6" and "Bad device mmc 0 "" could indicate issues other than a missed pin?

 

Thanks in advance,

 

Luis

 

0 Kudos
1 Solution

Accepted Solutions
458 Views
Registered: ‎08-30-2018

Re: u-boot can not detect sd card

Jump to solution

Hello @gavinerryairbus  and @deville ,

Thanks for your feedbacks. I would like to share my solution as well:

 

The root of my problem was that the manufacturer of the module I was using (Enclustra ZX2) did not specified all the pins I should used to make my custom board compatible with their software package. So the first version of my board was missing the CardDetect, Write Protecion and an additional signal. After some time of reverse engineering with theirs base board I found that I should pull down this signals and them everything worked fine.

 

I guess the version of U-boot which worked to @gavinerryairbus  did not use this pins to check the SD card integrity.

 

Thanks for your attention!

 

Best Regards,

Luis

3 Replies
Adventurer
Adventurer
565 Views
Registered: ‎09-28-2018

Re: u-boot can not detect sd card

Jump to solution

Hi @luis_possatti 

Side question to get this topic started for you: Do you have implemented a 1.8V level shifter on your SD card? Likely not because these are so small they are expensive to mount / place on your board.    

Therefore in an extra dtsi overlay I have an extra entry indicating this.

/* SD0 eMMC, 8-bit wide data bus */
&sdhci0 {
	status = "okay";
	bus-width = <8>;
	max-frequency = <50000000>;
};

/* SD1 with level shifter */
&sdhci1 {
	status = "okay";
	max-frequency = <50000000>;
	no-1-8-v;	/* for 1.0 silicon */
	disable-wp;
};

 

If you look into the Uboot code you're entry point for further investigations is here:

https://github.com/Xilinx/u-boot-xlnx/blob/xilinx-v2018.2/drivers/mmc/mmc.c#L2116

You should be able to find out what error 6 means. 

Edit: It is also a bit odd your boot command itself is not recognized apart from the failing mmc detection. Are you certain you made the right adaptions to include/configs/xilinx_zynqmp.h 

You can also add "#define DEBUG" to have more detailed output

kind regards

Deville

Highlighted
472 Views
Registered: ‎04-03-2014

Re: u-boot can not detect sd card

Jump to solution

Hello

I've just had this exact problem (including the probe failed -6 error), with an SD card that worked on a dev board (in my case the Enclustra ZX5/PE1), but not on our custom board.

The fix I found was to use an older U-Boot version (I was using the 2018.01 version as you were).  In my case I am now using U-Boot 2016.07-gd89b1b0.

Works fine with this version of U-Boot.

 

Hope this helps

Gavin

 

459 Views
Registered: ‎08-30-2018

Re: u-boot can not detect sd card

Jump to solution

Hello @gavinerryairbus  and @deville ,

Thanks for your feedbacks. I would like to share my solution as well:

 

The root of my problem was that the manufacturer of the module I was using (Enclustra ZX2) did not specified all the pins I should used to make my custom board compatible with their software package. So the first version of my board was missing the CardDetect, Write Protecion and an additional signal. After some time of reverse engineering with theirs base board I found that I should pull down this signals and them everything worked fine.

 

I guess the version of U-boot which worked to @gavinerryairbus  did not use this pins to check the SD card integrity.

 

Thanks for your attention!

 

Best Regards,

Luis