I cannot get the device tree to update on the Jetson Nano devkit. I have tried both updating using the spreadsheet, exporting .dtsi files updating the kernel and UBoot and flashing, as well as modifying the .dtb file on the Nano by decompiling/recompiling and updating extlinux.conf. After trying both Nvidia’s official guide as well as 3rd party guides I always end up at a step that is either incomplete in it’s description and vague, or gives an error.
My setup is as follows:
I designed a custom carrier board for the Jetson Nano emmc (p3448-0020) but as a first step I am using the SD card version (p3448-0000). I will eventually need to move rootfs to an SD Card (sdmmc3) and configure many of the pins to GPIO outputs, but for now I am focusing specifically on switching GPIO04 (pin 127) from Bidirectional Z w/ pinwake enabled to Output Drive 1, w/ pinwake disabled.
Quick disclaimer: I am a hardware guy and new to this sort of thing. Please be as specific as possible leaving out no information or steps. If my questions seem dumb they probably are, but I’m pretty turned around and often don’t even know what questions to ask. It also seems like the documentation is pretty patchy, but could just be me. Thanks!
The first thing I tried was modifying the device tree on the Nano by doing the following:
cd /boot
sudo dtc -I dtb -O dts -o mydevicetree.dts tegra210-p3448-0000-p3449-0000-b00.dtb
sudo gedit mydevicetree.dts
In mydevicetree.dts I changed the following:
pin_gpio4{
pins="gpio4";
function = "32k-out1";
}
to
pin_gpio4{
pins="gpio4";
function = "gpio";
}
I then did
dtc -I dts -O dtb -o tegra194-p3668-all-p3509-0000.dtb mydevicetree.dts
cd /boot/extlinux
gedit extlinux.conf
and made extlinux.conf look like this:
LABEL primary
MENU LABEL primary kernel
LINUX /boot/Image
FDT /boot/tegra210-p3448-0000-p3449-0000-b00.dtb
INITRD /boot/initrd
APPEND ${cbootargs} quiet root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 console=ttyS0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0
After rebooting I check which device tree is being used:
sudo cat /proc/device-tree/nvidia,dtsfilename
which returns
/dvs/git/dirty/git-master_linux/kernel/kernel-4.9/arch/arm64/boot/dts/../../../../../../hardware/nvidia/platform/t210/porg/kernel-dts/tegra210-p3448-0000-p3449-0000-b00.dts
which I believe is telling me that it’s still using the kernel in /boot/dtb rather than in /boot.
To check whether or not the GPIO is available for use and it’s name I use this script:
gpio_list = {k: list(GPIO.gpio_pin_data.get_data.get_data()[-1]['TEGRA_SOC'].keys())[i] for i, k in enumerate(GPIO.gpio_pin_data.get_data.get_data()[-1]['BCM'])}
for k, v in gpio_list.items():
print(k, v)
Which returns the same 22 GPIO that are available by default, so it seems nothing is changing.
The next thing I tried was using the pinmux spreadsheet provided by NVidia. After making the necessary change I exported the two .dtsi files and followed the instructions found here
starting at Pg 3 under pinmux changes. Step 1 under “Porting U-Boot” step is ambiguous. It states:
Copy include/configs/ p3450-porg.h to include/configs/<board>.h.
but I cannot locate these directories or files. What does this instruction mean? To copy the contents of p3450-porg.h to .h?
I also tried following the instructions on the document found here
but found it had no effect on the device tree. Furthermore, it specifies renaming the exported .dtsi files like so:
tegra-minitouch-pinmux.dtsi to <src_path>/hardware/nvidia/platform/t210/porg/kernel-dts/porg-platforms/tegra210-porg-pinmux-p3448-<sku>-<version>.dtsi
tegra-minitouch-gpio-default.dtsi to <src_path>/hardware/nvidia/platform/t210/porg/kernel-dts/porg-platforms/tegra210-jetson-cv-gpio-p2597-2180-a00.dtsi
but in the Jetson Nano Adaptation and Bring-Up document found here
under “Porting the Linux Kernel > To update the device tree image” it only specifies the renaming of one .dtsi file like so:
<prefix>-pinmux.dtsi to <src>/hardware/nvidia/platform/t210/porg/kernel-dts/porg-platforms/tegra210-porg-pinmux-p3448-0001-<ver>.dtsi
Am I only supposed to rename the one or both? Are these instructions correct?
I also tried updating the device tree in U-Boot and rebuilding by following this document
but when I run
make p3450-porg_defconfig
I get
HOSTCC scripts/basic/fixdep
HOSTCC scripts/kconfig/conf.o
SHIPPED scripts/kconfig/zconf.tab.c
SHIPPED scripts/kconfig/zconf.lex.c
SHIPPED scripts/kconfig/zconf.hash.c
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/conf
***
*** Can't find default configuration "arch/x86/configs/p3450-porg_defconfig"!
***
scripts/kconfig/Makefile:113: recipe for target 'p3450-porg_defconfig' failed
make[1]: *** [p3450-porg_defconfig] Error 1
Makefile:579: recipe for target 'p3450-porg_defconfig' failed
make: *** [p3450-porg_defconfig] Error 2
Side note: in this document it still specifies <board_and_rev> to be p3450-0000 but should be p3450-porg.
So to sum up, I’ve tried many different avenue for updating the device tree for the Jetson Nano and each have either given an error or simply not worked. If anyone could provide solutions to any of the problems I have stated, or better yet, a detailed exact step by step process of what to do to accomplish my goal that’d be great! Any additional information on any of this that helps to illuminate how it all works would also be appreciated as well as methods for checking success.