Problem creating pinmux for Jetson TX2 using SPI

Hi

Im always getting 0 from my reading and since the elinux documentation is so terrible i am still unable to test if the SPI is actually working. I do see spidev.3.0

I looked again at the pinmux configuration adn thans to the documentation on the elinux site, i am unable to confirm whether i did this right. In my cfg file i see options for rsvd2 and lpdr-disable what do i do with these?

I went to (on host machine, not Jetson) nvidia/nvidia_sdk/JetPack_4.2_Linux_p3310/Linux_for_Tegra/bootloader/t186ref/BCT/

and opened the file:
tegra186-mb1-bct-pinmux-quill-p3310-1000-c03.cfg and made the following changes

pinmux.0x02430038 = 0x00000056; # gpio_cam4_pn3: rsvd2, tristate-disable, input-disable, lpdr-disable
pinmux.0x02430040 = 0x00000056; # gpio_cam5_pn4: rsvd2, pull-down, tristate-enable, input-enable, lpdr-disable
pinmux.0x02430048 = 0x00000056; # gpio_cam6_pn5: rsvd2, tristate-disable, input-disable, lpdr-disable
pinmux.0x02430050 = 0x00000058; # gpio_cam7_pn6: rsvd0, pull-up, tristate-disable, input-disable, lpdr-disable

and then i run the flash script:
sudo ./flash.sh jetson-tx2 mmcblk0p1

i still get all zeros when i read from the SPI interface.

What did i do wrong and where do i have to make changes?

Thanks

Read/Write the REG by devmem2 to check.

[url]TX2 SPI4 - Jetson TX2 - NVIDIA Developer Forums

Could you please tell me if I made the pinmux config correctly?

The tutorial has spi4 instead of the word rsvd2

What should the above 4 lines look like? I’m using a Jetson TX2 r32 jetpack 4.2

Thanks

You should program it as below.

pinmux.0x02430038 = 0x00000401; # gpio_cam4_pn3: spi4, tristate-disable, input-disable
 pinmux.0x02430040 = 0x00000455; # gpio_cam5_pn4: spi4, pull-down, tristate-enable, input-enable
 pinmux.0x02430048 = 0x00000401; # gpio_cam6_pn5: spi4, tristate-disable, input-disable
 pinmux.0x02430050 = 0x00000409; # gpio_cam7_pn6: spi4, pull-up, tristate-disable, input-disable

Omg it worked!!! Finally!

Thank you very much! The documentation NEEDS to say that the entire lines should look like what you wrote, because the pin hex numbers are different so we are confused whether we need to just change the right hand side (spi4, pull-down… )but it turned out i had to change the assigned hex numbers too.

Also the elinux site says “heres what a wrong config looks like…” and its completely different from my original cfg file because mine has rsvd2 instead of spi4 which is also very confusing

I just want to clarify the quoted solution above and how it differs from the one found here: https://devtalk.nvidia.com/default/topic/1056610/jetson-tx2/spi-config-on-tx2-r28-3/post/5357387/#5357387. In the solution found in the link, there is a 5th entry:

pinmux.0x02430028 = 0x00000401; # gpio_cam2_pn1: extperiph3, tristate-disable, input-disable

Is this 5th entry specific to TX2 r28.3?

There is also no mention of the 5th entry in the elinux doc (https://elinux.org/Jetson/TX2_SPI). Nevertheless, the linked solution (https://devtalk.nvidia.com/default/topic/1056610/jetson-tx2/spi-config-on-tx2-r28-3/post/5357387/#5357387) is accepted and apparently working. So I’m wondering if someone can explain what the purpose of the 5th entry would be?

@GWAVE
This pin should not need to the SPI function. It could be a copy and past accident.

pinmux.0x02430028 = 0x00000401; # gpio_cam2_pn1: extperiph3, tristate-disable, input-disable