PPS jetson nano

Hey
I want to enable PPS on jetson nano for pin 18. I have read various threads on this forum, but things are a bit unclear for me.
I have e.g read this topic


So I downloaded the kernel sources from this link L4T Driver Package (BSP) Sources
and made these changes

pps {
        gpios = <&gpio TEGRA_GPIO(B, 7) 0>;

        compatible = "pps-gpio";
        status = "okay";
    };

just below
gpio: gpio@6000d000
(as suggested in another thread)
I made the change in
Linux_for_Tegra/sources/hardware/nvidia/soc/t210/kernel-dts/tegra210-soc/tegra210-soc-base.dtsi
My question is what is the further steps, like how to compile the file and where to copy the generated file and so on to make it work
Thanks!

Hi jetson_spi,

Please read the l4t development guide to rebuild the dtb and then reflash your board.

Hi @WayneWWW

I managed to modify Linux_for_Tegra/sources/hardware/nvidia/soc/t210/kernel-dts/tegra210-soc/tegra210-soc-base.dtsi and compile it and then copy it to /boot/dtb on a fresh image.
when I type the command dmesg | grep pps then I get
pps pps0: new PPS source pps.-1
pps pps0: Registered IRQ 114 as PPS source
and pps0 is showing up in /dev
so I think its okay

But in this thread


I got DTB and DTBO files from @shgarg , so I can enable mcp2515 can modules.
So here is my question I have one image where mcp2515 can modules are enabled (DTB and DTBO files from @shgarg) and works fine and I have another image with the pps what can I do so I have one image so both the mcp and the pps works because now I have one DTB where pps is enabled and another DTB and DTBO where mcp2515 can is enabled
Thanks!

Hi jetson_spi,
You can try this:

  1. First use dtc command to convert dtb to dts for pps dtb.
    sudo dtc -I dtb -o pps.dts
    In your current directory, you will have pps.dts file get saved.
    Copy pps node contents from it and save it somewhere.
  2. Convert final mcp dtb which got created, (you can find final dtb name in /boot/extlinux/extlinux.conf ) , same way to mcp.dts
  3. Copy pps node contents to anywhere (may be after any spi node) in mcp.dts.
  4. Convert final mcp.dts to final mcp-dtb :
    sudo dtc -I dts mcp.dts -O dtb -o
  5. Reboot device in such a way so that mcp dtb gets picked up.
    What we did here is, we copied pps contents in mcp dtb, thus using both.

Thanks,
Shubhi

hi shgarg
Sorry for my late reply, I just found time to do it today.
The node from pps.dts

pps {
gpios = <0x3d 0xf 0x0>;
compatible = “pps-gpio”;
status = “okay”;
};

I copied it under spi node in the mcp.dts which I found under /boot/extlinux/extlinux.conf
Then I rebooted but it give me this on dmesg | grep pps

dmesg | grep pps
[ 0.599003] pps_core: LinuxPPS API ver. 1 registered
[ 0.599030] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti giometti@linux.it
[ 4.936911] OF: /pps: could not get #gpio-cells for /i2c@7000d000/max77620@3c/regulators/ldo0
[ 4.945496] pps-gpio pps: failed to get GPIO from device tree
[ 4.951289] pps-gpio: probe of pps failed with error -22

and the pps is not showing up when I type ls /dev

and dmesg | grep mcp I get
dmesg | grep mcp
[ 7.430731] mcp251x spi0.0 can0: MCP2515 successfully initialized.
[ 7.457439] mcp251x spi1.1 can1: MCP2515 successfully initialized.
[ 9.876498] mcp251x spi0.0: failed to acquire irq 0
[ 9.885470] mcp251x spi1.1: failed to acquire irq 0
[ 9.893469] mcp251x spi0.0: failed to acquire irq 0
[ 9.898811] mcp251x spi1.1: failed to acquire irq 0
[ 10.092435] mcp251x spi0.0: failed to acquire irq 0
[ 10.104904] mcp251x spi0.0: failed to acquire irq 0
[ 10.168316] mcp251x spi1.1: failed to acquire irq 0
[ 10.184133] mcp251x spi1.1: failed to acquire irq 0
I dont know if that is a problem for the mcp

Thanks!

Hi,
Firstly, it should not be under spi, below spi node for ex:
spi@7000d400 {

};
pps {

};

Also, which gpio did you use for pps? From where did you copy gpios contents?

Sorry I wrote wrong, its not under spi but below, as you just mentioned. According to this thread PPS On Jetson Nano its pin 18. Sorry I dont think I copied som gpios content

Try with this change.

1 Like

Thanks @shgarg

dmesg | grep pps
[ 0.599820] pps_core: LinuxPPS API ver. 1 registered
[ 0.599843] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti giometti@linux.it
[ 4.672515] pps_core: source pps.-1 got cdev (248:0)
[ 4.672524] pps pps0: new PPS source pps.-1
[ 4.672575] pps pps0: Registered IRQ 114 as PPS source

and now its showing up under ls /dev as pps0

Do you have an explanation on what you did? :)

And do you have any idea what this is
dmesg | grep mcp
[ 7.307843] mcp251x spi0.0 can0: MCP2515 successfully initialized.
[ 7.323488] mcp251x spi1.1 can1: MCP2515 successfully initialized.
[ 10.965550] mcp251x spi1.1: failed to acquire irq 0
[ 10.972232] mcp251x spi0.0: failed to acquire irq 0
[ 10.979393] mcp251x spi1.1: failed to acquire irq 0
[ 10.984732] mcp251x spi0.0: failed to acquire irq 0
[ 11.100081] mcp251x spi0.0: failed to acquire irq 0
[ 11.109608] mcp251x spi0.0: failed to acquire irq 0
[ 11.206618] mcp251x spi1.1: failed to acquire irq 0
[ 11.220032] mcp251x spi1.1: failed to acquire irq 0

and if it will be a issue for the mcp

Hi,
&gpio gives 0x56 in dts format. I don’t know how you ended up with 0x3d.
Have you updated MCP driver?
Also, I came up with new dtb for MCP use, in which you do not have to update mcp driver.
I will post those dtbs in MCP forum thread by today.
Try MCP communication with those dtbs.
For now, i think, your mcp driver change is not reflected here. Can you check once?

Hi @Sharg

the mcp driver should be the modified one I always have used, because I took a copy of that image (there was working) and flashed to other sd cards and after that this happened with mcp, so maybe something went wrong. Because now im even not able to set the can1 interface up

I solved the problem. The problem was that it was the MCP driver that not was modified, so I just changed it to the modified one.