Using SD Card alongside emmc as external memory with SDMMC3

Hi, my issue is similar to his, but I have a separate power supply chip for the SD card. It can be confirmed that there is no problem with the circuit, but I can’t find the relevant files that need to be modified. Without changing any files, the device cannot detect the SD card.

Continuing the discussion from Using SD Card alongside emmc as external memory with SDMMC3:

kernel source code could be downloaded from l4t archive page for each jetpack.

Hi, I downloaded the L4T kernel archive, but I can’t find the following directories and configuration files.

1.hardware/nvidia/platform/t23x//bct/
2.Controller Product Configuration’s configuration file.

Is this issue for Orin or Xavier? You are posting this question in Xavier NX forum in case you don’t know where you are now…

Hi, this issue is about Xavier NX. I know that t23x in the file directory should be replaced with t19x, but I still can’t find the corresponding directory and configuration files. Moreover, I also discovered a problem during this process: the Xavier NX module cannot use the graphical interface with Jetson Linux versions 35.5.0 to 35.6.2.

  1. I think the problem here is you totally don’t know what you are doing now.
    Let me check first. Do you have some background knowledge about how a device tree works? For example, the syntax and the rule.
    This has nothing to do with NVIDIA driver. It is a pure knowledge from Linux kernel which I cannot guide you from beginning.

  2. The source code you downloaded shall have t19x one and the jakku one inside of it is for Xavier NX.

  3. I don’t know anything about the graphical issue you are talking about. And it sounds nothing to do with this topic. If you want to check about it, file a new topic for it. You could also cross check with NV devkit carrier board first to see if that only happened to your carrier board.

Hi, I don’t really understand how device trees work.

Do you have anyone who is working on Linux software on your side?

Some background knowledge here.

I have been learning from the Jetson Linux Developer Guide.

Thank you

And some other similar posts to enable sdmmc3 on a custom board.

HI,My Jetson Linux version is 35.4.1.

The GCC version used corresponds to bootlin-toolchain-gcc-93.

I encountered the following error while compiling the kernel.

zmy@zmy-virtual-machine:~/kernel_src$ ./nvbuild.sh -o $HOME/Desktop/kernel_out/
Building kernel-5.10 sources
./nvbuild.sh: row 88: make: Command not found.
zmy@zmy-virtual-machine:~/kernel_src$

Hi,Are there any limitations on the dependencies? For example, do custom software packages need to be required?

Hi,I am currently using public dependency packages (flex, bison), and the following error occurs during compilation. (QAQ)

make[2]: *** [arch/arm64/boot/dts/ddot/ddot/ddot/ddot/ddot/ddot/hardware/nvidia/platform/t19x/jakku/kernel-dts/tegra194-p3668-0000-p3509-0000.dtb] Error 2
DTC arch/arm64/boot/dts/ddot/ddot/ddot/ddot/ddot/ddot/hardware/nvidia/platform/t19x/galen-industrial/kernel-dts/tegra194-p2888-0008-p2822-0000.dtb
DTC arch/arm64/boot/dts/ddot/ddot/ddot/ddot/ddot/ddot/hardware/nvidia/platform/t19x/galen-industrial/kernel-dts/tegra194-p2888-0008-p2822-0000-noecc.dtb
DTC arch/arm64/boot/dts/ddot/ddot/ddot/ddot/ddot/ddot/hardware/nvidia/platform/t19x/galen-industrial/kernel-dts/tegra194-p2888-0008-p2822-0000-maxn.dtb
DTC arch/arm64/boot/dts/ddot/ddot/ddot/ddot/ddot/ddot/hardware/nvidia/platform/t19x/galen-industrial/kernel-dts/tegra194-p2888-0008-p2822-0000-safety.dtb
/home/zmy/kernel_src/kernel/kernel-5.10/Makefile:1391: recipe for target ‘dtbs’ failed
make[1]: *** [dtbs] Error 2
Makefile:213: recipe for target ‘__sub-make’ failed
make: *** [__sub-make] Error 2

Hi,I found the problem.

I think I’m a little fool.

I wrote sdhci@344000 instead of sdhci@3440000, I missed a zero.

Now, I have fixed it, and the compilation passed.

Hi,I made a mistake again. My Jetson Linux is R32.7.2, but I had been using a modified R35.4.1 kernel, which caused it to get stuck on the boot screen. After switching to the R32.7.2 kernel source code, the following error occurred during compilation.

zmy@zmy-virtual-machine:~/kernel_src$ ./nvbuild.sh -o $HOME/kernel_out/
Building kernel-4.9 sources
make: Entering directory “/home/zmy/kernel_src/kernel/kernel-4.9”
scripts/kconfig/conf --silentoldconfig Kconfig
***
*** Configuration file “.config” not found!
***
*** Please run some configurator (e.g. “make oldconfig” or
*** “make menuconfig” or “make xconfig”).
***
scripts/kconfig/Makefile:37: recipe for target ‘silentoldconfig’ failed
make[3]: *** [silentoldconfig] Error 1
Makefile:575: recipe for target ‘silentoldconfig’ failed
make[2]: *** [silentoldconfig] Error 2
make[1]: *** No rule to make target ‘O’. Stop.
Makefile:554: recipe for target ‘__build_one_by_one’ failed
make: *** [__build_one_by_one] Error 2
make: Leaving directory “/home/zmy/kernel_src/kernel/kernel-4.9”

Hi Wayne, the version of Jetson Linux I’m using now is R35.4.1.

The kernel version I compiled is R35.4.1.

But in my compiled kernel file tegra194-p3668-all-p3509-0000.dtb, the status of my sdmmc@3440000 is “okay.”

I placed the compiled kernel file into the directory: Linux_for_Tegra/kernel/dtb/.

Finally, I used the command: “sudo ./flash.sh -r -k kernel-dtb jetson-xavier-nx-devkit-emmc mmcblk0p1” to flash the kernel onto the NX.

However, after flashing, the status of sdmmc@3440000 became “disabled.” I decompiled the kernel on the NX and found that the status in the kernel is “disabled.”

What is the reason for this? Where did I go wrong?

Please do full flash instead of -r -k command in flash.sh.

Also, reading your flash log to check if that is really “tegra194-p3668-all-p3509-0000.dtb” in use.

Hi!Wayne.

I did it!

Thank you so much for your guidance. You’re amazing, like a Superman.

1.资料准备:

我们需要下载以下文件:1.对应版本的内核源代码文件、2.对应版本的gcc文件、3.来自Jetson 下载中心的Jetson Xavier NX Pinmux Table。

2.环境准备:

我们需要安装编译工具:1.build-essential、2.flex、3.bison、4.libssl-dev。
使用命令"sudo apt-get install build-essential flex bison libssl-dev"来安装以上编译工具。

3.根据自己的电路图设置引脚参数:

我的电路连接是

cd-gpio ---第208引脚(默认是NV_THERM_FAN_TACH)
vcc --- 3.3v电源独立供电芯片

4.然后打开我们在步骤1中下载的Jetson Xavier NX Pinmux Table:

在Pin #列中找到第208引脚。

将对应的Customer Usage属性从NV_THERM_FAN_TACH改为GPIO3_PQ.02(我尝试不修改,发现没有区别。)

点击"Generate DT File"按钮,生成DTSi文件。

5.组装pinmux:

将步骤4生成"tegra19x-jetson_xavier_nx_module-gpio-default.dtsi"、“tegra19x-jetson_xavier_nx_module-padvoltage-default.dtsi”、"tegra19x-jetson_xavier_nx_module-pinmux.dtsi"文件复制到目录“Linux_for_Tegra/kernel/pinmux/t19x/”中。
执行以下两个命令生成“tegra19x-mb1-padvoltage-p3668-a01.cfg”、“tegra19x-mb1-pinmux-p3668-a01.cfg”文件。

"python pinmux-dts2cfg.py --pad pad_info.txt tegra19x-jetson_xavier_nx_module-padvoltage-default.dtsi  1.0 > tegra19x-mb1-padvoltage-p3668-a01.cfg"

"python pinmux-dts2cfg.py --pinmux addr_info.txt gpio_addr_info.txt por_val.txt tegra19x-jetson_xavier_nx_module-pinmux.dtsi tegra19x-jetson_xavier_nx_module-gpio-default.dtsi 1.0 > tegra19x-mb1-pinmux-p3668-a01.cfg"

最后将生成的“tegra19x-mb1-padvoltage-p3668-a01.cfg”、“tegra19x-mb1-pinmux-p3668-a01.cfg”文件更新到目录“Linux_for_Tegra/bootloader/t186ref/BCT/”中。

6.查看我们需要修改的内核文件和内核源代码文件:

登录到jetson Xerver NX上执行以下命令查看所使用的内核文件

ls /boot/dtb

这里我的是

kernel_tegra194-p3668-0001-p3509-0000.dtb

所以需要获取的内核是

tegra194-p3668-0001-p3509-0000.dtb

执行以下命令查看所使用的内核文件使用的源代码文件

dmesg | grep dts

这里我的是"hardware/nvidia/platform/t19x/jakku/kernel-dts/common/tegra194-p3668-common.dtsi"

7.提取内核源代码文件:

从下载好的源代码文件"public_sources.tbz2"中提取出内核源代码文件"kernel_src.tbz2"
解压文件"kernel_src.tbz2",注意"kernel_src.tbz2"压缩文件中没有根目录。请为内核源代码创建一个根目录以避免文件混乱。

8.提取gcc编译工具:

将对应版本的gcc工具文件解压。

9.常试编译以确保编译不出现错误:

执行命令设置编译gcc环境

export CROSS_COMPILE_AARCH64_PATH='gcc根目录,绝对路径'

创建一个目录用于输出编译好的内核文件

进入源代码根目录并执行命令编译内核

./nvbuild.sh -o 输出内核文件目录路径

###如果报错了,请自行解决。###

10编辑源代码文件:

编辑步骤6中对应的源代码文件"hardware/nvidia/platform/t19x/jakku/kernel-dts/common/tegra194-p3668-common.dtsi":

在sdhci_sd: sdhci@3400000设备后添加SDMMC3设备

sdmmc3: sdhci@3440000 {
	mmc-ocr-mask = <0x0>;
	cd-inverted;
	cd-gpios = <&tegra_main_gpio TEGRA194_MAIN_GPIO(Q, 2) 0>;
	#cd-gpios是检测引脚,这里我的是GPIOQ.2,低电平触发。
	nvidia,cd-wakeup-capable;
	mmc-ocr-mask = <0>;
	cd-inverted;
	status = "okay";
};

11.编译内核:

清理旧内核

sudo rm -rf 输出内核文件目录路径/*

执行命令以编译内核

./nvbuild.sh -o 输出内核文件目录路径

12.更新内核到NX上:

编译好的内核文件存储在目录“输出内核文件目录路径/arch/arm64/boot/dts/nvidia”中
复制新的dtb文件到目录“Linux_for_Tegra/kernel/dtb”中。
执行命令将新内核更新到NX上

sudo ./flash.sh -r -k kernel-dtb <board> <rootdev>
<board> --- 开发板 --- 例如 jetson-xavier-nx-devkit-emmc
<rootdev> --- 根设备 --- 例如 mmcblk0p1