Platform forum

MX6UL Custom Board hangs very near to start OS

nachodizz990 , 05-12-2017, 01:34 PM
Dear all , our board its hanging very near to boot

I have no routed the mechanical SD card detect and it seems to be the problem

I also patched the DTS with this

usdhc1 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_esdhc1>;
bus-width = <4>;

But still fails

See the video it hangs showing

Waiting for root device /dev/mmcblk0p2...

See attached video link


Thank you in advance
mairomaster , 05-15-2017, 01:50 AM
I am not good with the software at all, but I would be surprised if it's actually a problem with the SD card detect and it can't be fixed in the boot loader.
robertferanec , 05-15-2017, 08:53 AM
@nachodizz990 what I would do, I would find and unconnected CPU pin, set internal pull up/down (whatever you need to tell the software, that card is inserted) and used this pin in the software. But I think, it should be possible to tell software do not use card detect, I just don't know how.

Does SD work in uBoot? Also, I believe you may need to see the card detected before it tries to mount it and I do not see it in the console output.
nachodizz990 , 05-15-2017, 10:04 AM
Yes, Its being detected in Uboot (mmc0 is current device) but after starting to descompress the kernel it fails

Some NXP Guy told me that it can be that i have no updated the DDR setting with Stress Tool results yet

But i´m sure its a card detect problem!

Note that SD will not be the Final storage device (it will be emmc and it works)

But i´m curious about this

Boot rom code-> Works, because it uses 1 bit and DAT3 to CD
Uboot-> Works It also detects sd
When descompressing kernel -> It Fails!

It seems to be that Uboot ignores the signal and the kernel not

I´m getting crazy!

I´ve made the signal pulldown in pinmuxtool and it still fails

The MFG TOOL uboot does nOt detect the sd

Note that the board its booting from sd!

King Regards

robertferanec , 05-15-2017, 10:27 AM
Is your SD card correctly configured in device tree? When you are starting kernel you should see something like:

sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
mmc0: SDHCI controller on platform [sdhci-esdhc-imx.1] using DMA
mmc1: SDHCI controller on platform [sdhci-esdhc-imx.2] using DMA
...and later ...
mmc0: new high speed SDHC card at address 1234
mmcblk0: mmc0:1234 SA04G 3.63 GiB
mmcblk0: p1
nachodizz990 , 05-15-2017, 10:44 AM
Ok i will see, anyway, is the same tree of the EVK and it works, but the EVK haves CD routed...

nachodizz990 , 05-16-2017, 02:57 AM

Attached you can find the Boot Prompt Now It boots

There is a curious detail:

If I connect the USB TTL Adapter TX to SoC RX It detects SD if not, not

A NXP Guy told me about bad pcb grounding, but i think that as i dont placed pulldown resistors at CD and WP pins and they share IOMUX with UART1

when I connect the TTL adapter, the IP core gets the proper polarity and it works

robertferanec , 05-16-2017, 10:15 AM
i think that as i dont placed pulldown resistors at CD and WP pins and they share IOMUX with UART1
Does this mean, that in your device tree you map CD and WP to UART1 pins? Do you use UART1 to connect the debug console? If yes, I am not sure what will happen as CD/WP are normally mapped to GPIO, but in your case they woudl be mapped to UART (?)

Also: Connecting TX from PC may cause current leaking from PC to your board which often influences boot process (the voltage from TX will flow through ESD diode inside chips to power rail). That is reason why we isolated the debug console in OpenRex - we used transistors there.
nachodizz990 , 05-16-2017, 10:29 AM
Device Tree configures that pins for uart and uart works but if i do not connect uart the SD is not detected
SD is not exactly at tx rx pins but is in rts

But if i remove uart during linux running it continues working

This is quite strange!

Im testing all the hardware and the whole board runs fine!

I used Openrex Tutorials to scan i2c

Pinmux its the same as in the EVK but EVK inludes MECHANICAL detection

This is the last time i dont place, at least, a pulldown resistor!

King regards
robertferanec , 05-16-2017, 11:14 AM
What do you mean, when you say, "SD is on RTS"?

"But if i remove uart during linux running it continues working"
- that is why I mentioned, that a current leaking may influence the boot process ... only the time when it is starting. Once it boots up, some signals may change, e.g. level of RTS, so then it keeps working oki.
nachodizz990 , 05-16-2017, 11:31 AM
SD_CD is not routed to J14 in my board but yes in the EVK

SD_CD shares mux with UART RTS (J14) so it shares muxing area with uart

Perhaps any kind of feeding... i dont know this is strange!

robertferanec , 05-16-2017, 12:02 PM
I am not sure how it is in your software, but in iMX6 the CD alternate function is set as GPIO with proper pull up/down and it is not actually using CD alternate function.
nachodizz990 , 05-16-2017, 01:42 PM
Do you mean as follows:

The CD situation its being detected from a GPIO from OS by polling?

Is that GPIO shared with SD CD IP Core input?

I tied the RTS pin directly to GND without resistor as EVK SD1 works with SD mechanical CD
robertferanec , 05-16-2017, 03:12 PM
iMX6 software which we have with our boards uses for card detect a pin which is configured as GPIO. From your screenshot, it looks to me like you are configuring the pin as USHDC1_CD pin, that is why I am asking. Did you try to set it in uboot as a GPIO and put there pull down resistor?

But I would need to see device tree of your board and also the EVK board to see the difference.
nachodizz990 , 05-17-2017, 01:39 AM

robertferanec , 05-17-2017, 07:01 AM
"so probably is not configured as GPIO.."
- Double check this, it may help you to fix your problem. I was surprised, because even the iMX6 processor which we use has this SD_CD alternate feature, but they do not use it in software. They always configure the pin as GPIO.

"I´m currently using the EVK device tree"
- so, if they are using Card Detect and you are not connecting the pin to the SD slot, than software will not detect card on your board.

This is from device tree for OpenRex:
&usdhc2 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_usdhc2>;
bus-width = <4>;
cd-gpios = <&gpio1 4 0>;
wp-gpios = <&gpio1 2 0>;
status = "okay";
pinctrl_usdhc2: usdhc2grp {
fsl,pins = <
MX6QDL_PAD_SD2_DAT0__SD2_DATA0 0x17059
MX6QDL_PAD_SD2_DAT1__SD2_DATA1 0x17059
MX6QDL_PAD_SD2_DAT2__SD2_DATA2 0x17059
MX6QDL_PAD_SD2_DAT3__SD2_DATA3 0x17059
MX6QDL_PAD_GPIO_4__GPIO1_IO04 0x80000000 /* CD */
MX6QDL_PAD_GPIO_2__GPIO1_IO02 0x80000000 /* WP */

You can see, the software CD is using a pin configured as GPIO. Basically, if you set this GPIO with pull down internal resistor, than the software should always behave like a card is inserted. That is my theory, but I do not know if that will work Also, maybe in your software it is configured differently.

nachodizz990 , 05-17-2017, 08:58 AM
Very nice,

Now understand exactly what do you mean

Thank you so much for your graphical explanation

I´ll perform this as soon as I can and I will post results


Note low resources used while running app, i love this SoC!

Now i´m coordinating QT guys

Download video and see i in small player windows, quality is awesome

Use our interactive Discord forum to reply or ask new questions.
Discord invite
Discord forum link (after invitation)

Didn't find what you were looking for?