Custom pinmux being patched after upgrade

Hello everyone.

First of all, I would like to mention that I have been reading many topics to see if any answer could fit my needs, wich is not the case.

I successfully changed the pinmux of my Jetson Nano and the GPIO I needed (62 and 63) where perfectly modified when I booted the device.

Then I did the basic commands :
sudo apt update
sudo apt upgrade

Upgrading the system causes the kernel and the DTS to be patched, and it goes back to the default configuration.
I checked the upgradable packages before upgrading the system and I saw these 3 packages :

  • nvidia-l4t-kernel
  • nvidia-l4t-kernel-dtbs
  • nvidia-l4t-kernel-headers

So I marked them as “hold” with the following command : sudo apt-mark hold nvidia-l4t-kernel

Then the DTB were the modified ones but I guess it’s not enough since my GPIOs went back to the default state and my changes are not applied anymore.

I read that this configuration is done in Cboot process and not in the kernel (which I don’t really understand). So my question is, how is it possible to update the pinmux after any upgrade of the system ? I tried to flash the DTB only with the command : sudo ./flash.sh -k DTB jetson-nano-emmc mmcblk0p1. Sadly it’s not working so I guess this command is not updating the Cboot part.

I’m using the L4T 32.4.4 version so I’m not supposed to modify U-boot anymore to get the job done for pinmux configuration.

Am I missing something on the pinmux modification ? Or do I just need to hold more packages (not sure wich ones)?

Thanks in advance for the help

hello act-reds,

Nano uses device tree for the pinmux configurations,
so, it’s expected the DTB upgrade overwrite your pin customization.

may I know what’s the pin customization you would like to done.
please share the pin state for reference, for example, # cat /sys/kernel/debug/gpio
thanks

This command is not showing the changes I did on the specific pins I need to modify.
The same output is showing with both configurations when I do : # cat /sys/kernel/debug/gpio gpio 62 and 63 are both empty, which seems to be normal.

The dts I’m modifying is :
tegra210-p3448-0000-p3449-0000-b00.dtb

The changes generated from the excel file are the following :
ph6 {
nvidia,pins = “ph6”;
nvidia,function = “rsvd0”;
nvidia,pull = <0x0>;
nvidia,tristate = <0x0>;
nvidia,enable-input = <0x0>;
};

ap_wake_nfc_ph7 {
nvidia,pins = “ap_wake_nfc_ph7”;
nvidia,function = “rsvd0”;
nvidia,pull = <0x0>;
nvidia,tristate = <0x0>;
nvidia,enable-input = <0x0>;
};

So I’m changing ph6 from in to out and I need both values at “1” at boot.

Everything works well until the upgrade.

Thanks

hello act-reds,

please have a try to disassembler the dtb file into text file for edit,
for example, $ dtc -I dtb -O dts -o temp.dts tegra210.dtb

after that, please convert the DTS into a new DTB file.
for example, $ dtc -I dts -O dtb -o output.dtb temp.dts

please use the customize DTB file to include your pin customization.
thanks

Hello JerryChang,

To be sure, what you asked me was to use dtc to disassemble the dtb, then modify the given dts and convert it back in dtb with dtc. Then copy this file in /boot/dtb (also copied it in /boot in case). I did that it’s not working either.
Anyway I don’t think it’s the dtb generation that is the problem since I get the expected results using dtc to check if the DTB has been correctly generated.

I guess there is something else than the dtb file used to configure the pinmux. I’ve seen some posts talking about Cboot and the fact that the script “flash.sh” with DTB option is not modifying Cboot.

By the way if use the “hold” option from apt on every nvidia package, it’s working perfectly well. Maybe the bootloader update is the package patching my configuration ?

Thanks

hello act-reds,

I would like to emphasize that it’s expect the OTA update (i.e. $ sudo apt upgrade) install the same content as JetPack release. since you’re having pin customization, you’ll need to re-generate the binary file after an OTA.

my question is…
did you confirm you’re having correct device tree definition for these two pins, GPIO02/ GPIO3_PH.06, and GPIO05/ GPIO3_PH.07.but you still see the pin state as default after checking the debugfs?

so,
it’s CBoot functionality includes a default booting scan sequence, please check extlinux.conf to ensure you’re NOT having FDT entry, since you’d updated device tree blob at the DTB partition.
thanks