I2C pins to GPIO on Jetson Orin Nano Dev Kit

Hi, I am working on Jetson Orin Nano. I have a simple task to use I2C pins as GPIO due to their high current drive strength. But I am unable to do so as Jetson-io does not give control over i2c. My question is can I do it by defining device overlay or it is essential to change main the device tree file?

hello nauman2,

you may see-also Topic 245589 for reference, it changes the mb1 settings, you’ll need to re-flash the target to apply the update.

Hi, with Jetgpio library I was able to control i2c pins without changing DTB. But right now what I have observed that with JetGPIO library I can toggle the i2c pin as gpio with the maximum frequency of 120Khz. My question is will I be able to toggle it at higher speed if I make changes in Main DTB and reflash as you suggested above? Secondly, I do not wasnt to flash the whole system I just want to change the DTB which as per my understading is possible but I am not able to understand or find the right resouce. For example I can generate the pinmux files as per “Jetson Orin NX and Nano Series — NVIDIA Jetson Linux Developer Guide 1 documentation” this for jetson orin nano. But a bit confused about what to do next. Since I am working on Jetson orin nano device kit I guess I can use jetson-orin-nano-devkit.conf file for this which is availabe in Linux for Tegra folder. I can see the PINMUX_CONFIG and PMC_CONFIG flags in it which should point to the new files I generated but I am not able to locate the Flag or include which i need to update to include gpio.dtsi file generated by pinmux. Also this .conf file has DTB_FILE = tegra234-p3768-0000+p3767-0000-nv.dtb where can I get the source .dts file for this?

hello nauman2,

may I know what’s your expectation?

FYI,
you’ll need to full-flash the target completely to update pinmux config.
assume you worked with Jetpack-6.1/r36.4.0, please visit jetson-linux-r3640 to download [Driver Package (BSP) Sources] package for device tree source files.

Hi thank you for reply. I am trying to run DRAM Click board with jetson orin nano. I read about the drive strength problem which may be the reason for board not working with jetson orin nano. So I was thinking about may be I can use I2c pins that can supply 2mA of current and build gpio based spi using bitbanging. Gpio based spi works but it sclk maximum speed is limited to 8Khz. And I am using JETGPIO Library in c. Right now I have one more problem I am currently testing Spi of hetson orin nano using Spidev and oscilloscope and I have observed that spi clock speed with spidev is fixed at 3.18Mhz. I have tried both c and python program but the spi speed remains the same. Any idea?

hello nauman2,

please give it a try to configure axi_cbb for better results of GPIO bit-bang speed.
for instance,
please check its default clock rate with… # cat /sys/kernel/debug/bpmp/debug/clk/axi_cbb/rate

you may using # echo 409600000 > /sys/kernel/debug/bpmp/debug/clk/axi_cbb/rate.
and, # echo 1 > /sys/kernel/debug/bpmp/debug/clk/axi_cbb/mrq_rate_locked to configure a higher rate for verification.

Hi thank you the prompt reply. On reading the rate my system return 204000000. I will set it to the value you mention and try hopefully I expect to see the gpio toggle speed double. But can you also guide me about the spi clock problem I mentioned. Thanks

The current topic seems relating to use I2C pin as GPIO.

I would suggest opening another topic for SPI clock issue and provide the following information.

  1. full dmesg
  2. device tree
  3. SPI connections
  4. the result with running spidev_test to perform SPI loopback test

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