Enable more CS pins for SPI - Cannot find /Linux-for-Tegras directory

Okay, it is caused from you export toolchain path in user mode but run the command in sudo mode.
After you can run nvbuild.sh, what errors do you hit during build the kernel?
Please share the log.

Thank you. This is the log when i run nvbuild.sh

$ sudo -E ./nvbuild.sh -o $PWD/kernel_out

Building kernel-5.10 sources
make: Entering directory '/home/ppovoa/nvidia/nvidia_sdk/JetPack_5.1.3_Linux_JETSON_AGX_XAVIER_TARGETS/Linux_for_Tegra/sources/kernel/kernel-5.10'
make[1]: Entering directory '/home/ppovoa/nvidia/nvidia_sdk/JetPack_5.1.3_Linux_JETSON_AGX_XAVIER_TARGETS/Linux_for_Tegra/sources/kernel_out'
  GEN     Makefile
drivers/video/Kconfig:27: can't open file "drivers/video/tegra/Kconfig"
make[2]: *** [/home/ppovoa/nvidia/nvidia_sdk/JetPack_5.1.3_Linux_JETSON_AGX_XAVIER_TARGETS/Linux_for_Tegra/sources/kernel/kernel-5.10/scripts/kconfig/Makefile:89: tegra_defconfig] Error 1
make[1]: *** [/home/ppovoa/nvidia/nvidia_sdk/JetPack_5.1.3_Linux_JETSON_AGX_XAVIER_TARGETS/Linux_for_Tegra/sources/kernel/kernel-5.10/Makefile:645: tegra_defconfig] Error 2
make[1]: Leaving directory '/home/ppovoa/nvidia/nvidia_sdk/JetPack_5.1.3_Linux_JETSON_AGX_XAVIER_TARGETS/Linux_for_Tegra/sources/kernel_out'
make: *** [Makefile:220: __sub-make] Error 2
make: Leaving directory '/home/ppovoa/nvidia/nvidia_sdk/JetPack_5.1.3_Linux_JETSON_AGX_XAVIER_TARGETS/Linux_for_Tegra/sources/kernel/kernel-5.10'

Just my thoughts on this.

Earlier even though you were doing pin muxing correctly your changes were not reflecting might be because you were not using β€œ-r” flag in the flashing command.

So it was flashing the old kernel and old master DTB file always.

Check try to analyse this.
Thanks.

Please do not use sudo for nvbuild.sh

Okay, the error is the same.

Do you have kernel/nvidia/drivers/video/tegra/Kconfig in your source?

No, I dont have the video folder.

It seems something missing in your kernel source, please try to sync them again.

Thank you, that was it. It’s now working perfectly.

TLDR:

To change Pinmux follow this guide: Jetson Module Adaptation and Bring-Up: Jetson AGX Xavier Series β€” NVIDIA Jetson Linux Developer Guide 1 documentation

Find the source device-tree file:

  • In the jetson device run $ dmesg|grep dts to find the .dtsi file;
    In my case was in hardware/nvidia/platform/t19x/galen/kernel-dts/common/tegra194-p2888-0001-p2822-0000-common.dtsi

  • Change the source device-tree (in this case I change the original CS pins to a custom ones):

(To increase the number of CS pins you need to change the num-cs parameter, set the chosen pins in cs-gpios parameter and add spi@2 and spi@3 sections)

tegra194-p2888-0001-p2822-0000-common.dtsi

spi@3210000 {
		status = "okay";	
		spi-max-frequency = <33000000>;
		num-cs = <2>;
		cs-gpios = <TEGRA194_AON_GPIO(BB, 1) GPIO_ACTIVE_LOW>, <TEGRA194_MAIN_GPIO(Q, 1) GPIO_ACTIVE_LOW>;

		spi@0 {
			compatible = "tegra-spidev";
			reg = <0x00>;
			spi-max-frequency = <33000000>;
			controller-data {
				nvidia,rx-clk-tap-delay = <0x11>;
			};
		};

		spi@1 {
			compatible = "tegra-spidev";
			reg = <0x01>;
			spi-max-frequency = <33000000>;
			controller-data {
				nvidia,rx-clk-tap-delay = <0x11>;
			};
		};
	};
  • Finally rebuilt the kernel and flash the device
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.