MicroSD card not detected on Jetson Nano production module

Hi jetson_user,

Yes, I think it is little bit too soon to say it is an issue from the configuration script.

By default, the sdmmc on tegra is only enabled for sdmmc4 which is for emmc. As you could see the OEM Design guide says “Not assigned” for the sdcard usage on Devkit carrier.

So the debug method should be

  1. Find one HDMI and keyboard

  2. Enable the sdhci@700b0000 status to “okay” in either tegra210-p3448-0002-p3449-0000-a02.dts or tegra210-p3448-0002-p3449-0000-b00.dts which depends on your flash config.

  3. Check if sdcard can work or not. If not work,please attach the dmesg.

Hi WayneWWW,

Thank you for your response. I tried the mentioned steps. I found that during flashing only tegra210-p3448-0002-p3449-0000-b00.dtb was being copied into the rootfs, so I assumed the correct file was tegra210-p3448-0002-p3449-0000-b00.dts. I enabled the sdhci@700b0000 status in this file, and built the kernel (obtained from L4T 32.2 public sources), and flashed again. The results were the same, the SD card was not detected. To be safe, I also tried with the same modification in tegra210-p3448-0002-p3449-0000-a02.dts, which also did not work. Please find attached the dmesg.
dmesg_sd_card_not_detected.txt (53.8 KB)

Just to add a few things, I went through the discussions here:

[url]Jetson NANO flash image - Jetson Nano - NVIDIA Developer Forums
[url]https://devtalk.nvidia.com/default/topic/1060943/jetson-nano/emmc-chip-on-sdmmc3/[/url]

And after going through the source code a bit, I saw the dts files all refer to SDMMC1 for the external SD card, which was the case for Nano dev., but for the Nano production module it should be SDMMC3. Is there a need to change to SDMMC3? If yes, how?

Hi jetson_user,

The sdmmc_vdd_en does not have a gpio and also the sdmmc_CD. Please check if you write it to the device tree.

Hi,

The SDMMC_VDD_EN signal is always enabled on the carrier board I am using. I think I remember from the datasheet for Jetson Nano production module, GPIO pin 208 is assigned to SDMMC_CD (this is the card detect signal I hope). Is it so?

But I could observe a change in the voltage level of this pin (active low by default to active high) when an SD card is inserted.

How do I check a write to the device tree? Could I please get some specifics? Also, which other dts and dtsi files should I verify? Is there like a pinout I could verify inside the device tree? I still seem to be confused about the SDMMC1 being referred to as the SD card port, which was true for Nano development, but not for production module, which has SDMMC3 port for SD card. This was particularly inside the file:
sources/hardware/nvidia/soc/t210/kernel-dts/tegra210-soc/tegra210-sdhci.dtsi

Hi jetson_user,

I think you might be right about the sdmmc3 in device tree. I will check with internal team to check why there is such comment in source code.

As for checking device tree, you could check it during runtime by the node /proc/device-tree on your nano.

Hi jetson_user,

Yes, please enable sdhci@700b0400 in device tree. That is sdmmc3. The comment in device tree is not correct for production nano.

1 Like

Also, the patch is needed.

---

diff --git a/kernel-dts/porg-plugin-manager/tegra210-porg-plugin-manager.dtsi b/kernel-dts/porg-plugin-manager/tegra210-porg-plugin-manager.dtsi
index 67283d4..bad9b67 100644
--- a/kernel-dts/porg-plugin-manager/tegra210-porg-plugin-manager.dtsi
+++ b/kernel-dts/porg-plugin-manager/tegra210-porg-plugin-manager.dtsi
@@ -308,7 +308,8 @@
 			override@1 {
 				target = <&sdhci2>;
 				_overlay_ {
-					vmmc-supply = <&max77620_ldo6>;
+					status = "okay";
+					vqmmc-supply = <&max77620_ldo6>;
 					no-sdio;
 					no-mmc;
 					sd-uhs-sdr104;
diff --git a/kernel-dts/tegra210-porg-p3448-common.dtsi b/kernel-dts/tegra210-porg-p3448-common.dtsi
index 4e0f741..4be84f9 100644
--- a/kernel-dts/tegra210-porg-p3448-common.dtsi
+++ b/kernel-dts/tegra210-porg-p3448-common.dtsi
@@ -256,6 +256,11 @@
 		status = "disabled";
 		/delete-property/ keep-power-in-suspend;
 		/delete-property/ non-removable;
+		mmc-ddr-1_8v;
+		mmc-ocr-mask = <3>;
+		uhs-mask = <0x0>;
+		max-clk-limit = <400000>;
+		tap-delay = <3>;
 	};
 
 	sdhci@700b0200 { /* SDMMC2 for Wifi */

Thanks for the response. By enabling sdhci@700b0400 in device tree you mean :

“Enable the sdhci@700b0000 status to ‘okay’ in tegra210-p3448-0002-p3449-0000-b00.dts”,

right?

oops, no , I meant “sdhci@700b0400”

Hi WayneWWW,

It worked, thank you!

I am using the source code from: L4T 32.2 public sources (Jetson Nano), and the paths for the files mentioned in the patch are different, so I applied those changes manually. Summarizing what I did:

  1. Set status for sdhci@700b0400 to “okay” in:

sources/hardware/nvidia/platform/t210/common/kernel-dts/t210-common-platforms/tegra210-p2530-common.dtsi
sources/hardware/nvidia/platform/t210/common/kernel-dts/t210/porg/kernel-dts/tegra210-porg-p3448-common.dtsi

  1. Patch changes applied manually in:

sources/hardware/nvidia/platform/t210/porg/kernel-dts/porg-plugin-manager/tegra210-porg-plugin-manager.dtsi

sources/hardware/nvidia/platform/t210/porg/kernel-dts/tegra210-porg-p3448-common.dtsi

I hope these are the required and correct changes. If not, please let me know.

The SD card was not listed when I ran ‘df -h’ after boot, i.e., it was not automounted. So I had to manually mount it to a specific location, for instance, /mnt, using the command:
sudo mount /dev/mmcblk1p1 /mnt -o defaults,rw

Maybe this is an ownership thing? We could look into this further, but if you have a quick fix, please let us know. For now, I am accepting your answer.

How about using fstab?
https://help.ubuntu.com/community/Fstab

Hi WayneWWW,

I did not yet implement auto-mount-sd-card-on-startup by changing fstab. I plan to have a script (do not have it yet) which before running my startup application would mount the /dev/mmcblkp1 (sd card partition) at $HOME/sd_card location. But at the moment I do this manually. It seems the sd card mounting works, but the device takes a long time to boot when the sd card is kept inserted. Here’s the output of systemd-analyze time:

Startup finished in 11.261s (kernel) + 2.454s (userspace) = 13.715s
multi-user.target reached after 2.423s in userspace

However, I noticed that after power on from a completely powered off state, it takes around 2 min 45 seconds to boot.

The reboot command is however faster, happens in 30 seconds! Similar to the case when no SD card is inserted, and irrespective of whether the SD card patch is applied or not.

Could you shed some light on what might be happening here?

Since the kernel code was modified owing to an additional driver I am using, I had to change the patch slightly. Please find it below.

diff --git a/hardware/nvidia/platform/t210/common/kernel-dts/t210-common-platforms/tegra210-p2530-common.dtsi b/hardware/nvidia/platform/t210/common/kernel-dts/t210-common-platforms/tegra210-p2530-common.dtsi
--- a/hardware/nvidia/platform/t210/common/kernel-dts/t210-common-platforms/tegra210-p2530-common.dtsi	2019-09-18 13:21:25.000000000 +0200
+++ b/hardware/nvidia/platform/t210/common/kernel-dts/t210-common-platforms/tegra210-p2530-common.dtsi	2019-09-18 13:26:22.723470000 +0200
@@ -131,7 +131,7 @@
 		uhs-mask = <0x1c>;
 		power-off-rail;
 		nvidia,update-pinctrl-settings;
-		status = "disabled";
+		status = "okay";
 	};
 
 	sdhci@700b0200 {
diff --git a/hardware/nvidia/platform/t210/porg/kernel-dts/porg-plugin-manager/tegra210-porg-plugin-manager.dtsi b/hardware/nvidia/platform/t210/porg/kernel-dts/porg-plugin-manager/tegra210-porg-plugin-manager.dtsi
--- a/hardware/nvidia/platform/t210/porg/kernel-dts/porg-plugin-manager/tegra210-porg-plugin-manager.dtsi	2019-09-18 13:21:25.000000000 +0200
+++ b/hardware/nvidia/platform/t210/porg/kernel-dts/porg-plugin-manager/tegra210-porg-plugin-manager.dtsi	2019-09-18 13:28:08.251948000 +0200
@@ -313,7 +313,8 @@
 			override@1 {
 				target = <&sdhci2>;
 				_overlay_ {
-					vmmc-supply = <&max77620_ldo6>;
+					status = "okay";
+					vqmmc-supply = <&max77620_ldo6>;
 					no-sdio;
 					no-mmc;
 					sd-uhs-sdr104;
diff --git a/hardware/nvidia/platform/t210/porg/kernel-dts/tegra210-porg-p3448-common.dtsi b/hardware/nvidia/platform/t210/porg/kernel-dts/tegra210-porg-p3448-common.dtsi
--- a/hardware/nvidia/platform/t210/porg/kernel-dts/tegra210-porg-p3448-common.dtsi	2019-09-18 13:21:25.000000000 +0200
+++ b/hardware/nvidia/platform/t210/porg/kernel-dts/tegra210-porg-p3448-common.dtsi	2019-09-18 13:30:00.344454000 +0200
@@ -250,9 +250,14 @@
 	};
 
 	sdhci@700b0400 {
-		status = "disabled";
+		status = "okay";
 		/delete-property/ keep-power-in-suspend;
 		/delete-property/ non-removable;
+		mmc-ddr-1_8v;
+		mmc-ocr-mask = <3>;
+		uhs-mask = <0x0>;
+		max-clk-limit = <400000>;
+		tap-delay = <3>;
 	};
 
 	sdhci@700b0200 { /* SDMMC2 for Wifi */

P.S. I still boot from the internal flash memory and plan to use the SD card to store data which my startup application generates on specific conditions.

1 Like

Since the above question is not related to the main topic of this thread, a separate thread has been created for it, here: [url]https://devtalk.nvidia.com/default/topic/1065480/jetson-nano/jetson-nano-production-module-takes-long-time-to-boot-when-sd-card-is-inserted/[/url].

1 Like

hi , jetson user.
did you complete follow the jeson_nano_product_design_guide about the SD card schematic?
how does jetson_nano handle the SD_DETECT? When TF inserted, should it gene a posedge or negedge on GPIO08?

Hi gzh886,

I did not look into the hardware design. I just know that the DETECT signal goes to GPIO_08 (= GPIO_PZ2). By default this signal is HIGH but when SD card is inserted it goes low. Sorry if this doesn’t help because I do not know much about the hardware design.

Hi,

I working with a Production Nano with a custom carrier board. It did not detect SD card after applied the patch (setting status to “okay” inside the sdhci@700b0400 on the .dts file) and flash it. My sd detect pin is always ground and connects to GPIO12. Can you let me know, which file do I need to modify? I looked at the pinmux, where GPIO08 and GPIO12 are already set to input.

Hi nielbuss,

Please help to open a new topic if it’s still an issue to support. Thanks

Hello, @jetson_user

Did you change the kernel source and then flash the Image and dtb?
After that, do you check the sd card mount using the “df -h” command?

If you don’t mind, could you please share a picture of the board you installed the sd card on?

Thank you.