Add accessible GPIO through linux OS in Jetson Nano


I want to access some GPIO through linux OS in Jetson Nano.

As I know, accessible GPIO in GPIO sysfs is mapped to expansion 40-pin header.

But What I want to access GPIO is not mapped to expansion header.

For example, UART0_CTS (SODIMM Pin No. 105) and GPIO06 (SODIMM Pin No. 130) is not mapped.

How can I access these pins via GPIO sysfs or memory address access? Or some else way?

hi @jtlee

Please refer the following topic, hope this will help you Need the sysfs numbers for gpio in the jetson Nano reference design

thank you

hello jtlee,

please also check this thread, Topic 144550, for several ways to access GPIOs. such as, kernel APIs, python scripts, C++ samples.

I think I should gpio access via

According from @ankithsingh, GPIO index is defined at $L4T_Sources/r32.4.3/Linux_for_Tegra/source/public/kernel/kernel-4.9/include/dt-bindings/gpio/tegra-gpio.h.

And I think accessing GPIO address should reference jetson-nano-gpio-example/gpionano.h at master · valentis/jetson-nano-gpio-example · GitHub .

But I don’t know how to get GPIO address exactly. In gpionano.h, GPIO_216’ address is 0x6000d60C, and GPIO_50’s address is 0x6000d108. However, GPIO06 = GPIO3_PI.00 = ( 8 * 8 ) + 0 = 64, so it is mapped to GPIO_64 but I don’t know get related GPIO address.

Can you teach me about GPIO address getting formula?

Thank you.

please refer to GPIO DMA Address Map as see-also. thanks

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