Trying to configure GPIO pin direction, "busybox devmem" returns 0xffffffff for all addresses


I’m trying to configure pin 29 on the 40-pin header as an input with a pullup. Evidently, there’s no API support, so we have to use busybox to manually write values to configuration registers.

The pin I want to use is 29 on the connector. This has internal names such as GPIO01 and PQ.05. When accessing it through the kernel API, this is gpio-453. And when I access it using ioctls in my code, it’s pin 105. In the pinmux spreadsheet, it’s also referred to as EXTPERIPH3_CLK and GPIO3_PQ.05, and the Verilog ball name is SOC_GPIO32. This has the full name PADCTL_G3_SOC_GPIO32_0, and the G3 padgroup is PADCTL_A0, which has a base address of 0x0234000. GPIO32 has an offset of 0x68. Therefore the address I should access is 0x02340068.

The roadblock I’m encountering is that although the instructions (Jetson AGX Orin Platform Adaptation and Bring-Up — Jetson Linux Developer Guide documentation) suggest reading the register, this is what I get:

# busybox devmem 0x02340068

This can’t be right. Is there some step I’ve missed that’s supposed to explicitly enable read access to these hardware registers? Obviously I tried googling this, but I’m coming up empty.


Addendum: I wrote my own code to mmap /dev/mem and access memory. Absolutely every address I read returns 0xffffffff. It seems that /dev/mem isn’t working properly. I’m doing this as root. Anything I have to do do enable /dev/mem support?

Another addendum: I wrote my own code to mmap /dev/mem and access the pinmux registers. Whenever I run either my program or busybox, something like this gets added to dmesg:

[98089.048787] CPU:0, Error: cbb-fabric@0x13a00000, irq=25
[98089.054186] **************************************
[98089.059112] CPU:0, Error:cbb-fabric, Errmon:2
[98089.063596]    Error Code            : TIMEOUT_ERR

[98089.069159]    Error Code            : TIMEOUT_ERR
[98089.073188]    MASTER_ID             : CCPLEX
[98089.076684]    Address               : 0x2340068
[98089.080275]    Cache                 : 0x0 -- Device Non-Bufferable
[98089.085466]    Protection            : 0x2 -- Unprivileged, Non-Secure, Data Access
[98089.092444]    Access_Type           : Read
[98089.095933]    Access_ID             : 0x17
[98089.095934]    Fabric                : cbb-fabric
[98089.102828]    Slave_Id              : 0x35
[98089.106051]    Burst_length          : 0x0
[98089.109539]    Burst_type            : 0x1
[98089.112854]    Beat_size             : 0x2
[98089.116072]    VQC                   : 0x0
[98089.118848]    GRPSEC                : 0x7e
[98089.121895]    FALCONSEC             : 0x0
[98089.125114]  **************************************
[98089.130151] ------------[ cut here ]------------
[98089.130170] WARNING: CPU: 0 PID: 13354 at drivers/soc/tegra/cbb/tegra234-cbb.c:577 tegra234_cbb_isr+0x130/0x170
[98089.140534] Modules linked in: fuse nvidia_modeset(O) xt_conntrack xt_MASQUERADE nf_conntrack_netlink nfnetlink xt_addrtype iptable_filter iptable_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 libcrc32c br_netfilter lzo_rle lzo_compress zram overlay ramoops reed_solomon bnep snd_soc_tegra186_asrc snd_soc_tegra210_iqc aes_ce_blk snd_soc_tegra186_dspk snd_soc_tegra210_ope snd_soc_tegra186_arad crypto_simd snd_soc_tegra210_mvc cryptd snd_soc_tegra210_dmic rtk_btusb snd_soc_tegra210_afc aes_ce_cipher snd_soc_tegra210_amx snd_soc_tegra210_adx ghash_ce btusb sha2_ce btrtl snd_soc_tegra210_mixer snd_soc_tegra210_i2s snd_soc_tegra210_admaif sha256_arm64 rtl8822ce snd_soc_tegra210_adsp snd_soc_tegra210_sfc btbcm sha1_ce snd_soc_tegra_pcm snd_soc_tegra_machine_driver btintel r8168 snd_soc_tegra_utils fusb301 snd_hda_codec_hdmi snd_soc_simple_card_utils snd_soc_spdif_tx r8169 snd_hda_tegra cfg80211 snd_soc_tegra210_ahub nvadsp realtek snd_hda_codec tegra210_adma userspace_alert
[98089.140661]  tegra_bpmp_thermal snd_hda_core nv_imx219 nvidia(O) spi_tegra114 binfmt_misc loop ina3221 pwm_fan nvgpu nvmap spidev ip_tables x_tables [last unloaded: mtd]
[98089.140696] CPU: 0 PID: 13354 Comm: busybox Tainted: G        W  O      5.10.104-tegra #1
[98089.140698] Hardware name: Unknown NVIDIA Orin NX Developer Kit/NVIDIA Orin NX Developer Kit, BIOS 3.0-32616947 02/21/2023
[98089.140701] pstate: 60400089 (nZCv daIf +PAN -UAO -TCO BTYPE=--)
[98089.140704] pc : tegra234_cbb_isr+0x130/0x170
[98089.140706] lr : tegra234_cbb_isr+0x10c/0x170
[98089.140707] sp : ffff800010003e10
[98089.140708] x29: ffff800010003e10 x28: ffff20b08026ab80
[98089.140711] x27: 0000000000000001 x26: 0000000000000080
[98089.140714] x25: ffffa2a2d36f9ed0 x24: ffffa2a2d404be40
[98089.140717] x23: ffffa2a2d39e7000 x22: 0000000000000019
[98089.140720] x21: ffffa2a2d3e6ef20 x20: 0000000000000002
[98089.140723] x19: ffffa2a2d3e6ef10 x18: 0000000000000010
[98089.140726] x17: 0000000000000000 x16: ffffa2a2d1fe3210
[98089.140728] x15: ffff20b08026b0f0 x14: ffffffffffffffff
[98089.140731] x13: ffff800090003917 x12: ffff80001000391f
[98089.140734] x11: 0101010101010101 x10: 7f7f7f7f7f7f7f7f
[98089.140736] x9 : ffff800010003c30 x8 : 2a2a2a2a2a2a2a2a
[98089.140739] x7 : 2a2a2a2a2a2a2a09 x6 : c0000000ffffefff
[98089.140742] x5 : ffff20b1b1bb2958 x4 : ffffa2a2d3cf7968
[98089.140744] x3 : 0000000000000000 x2 : ffffa2a2d217e170
[98089.140747] x1 : ffff20b08026ab80 x0 : 0000000100010000
[98089.140751] Call trace:
[98089.140753]  tegra234_cbb_isr+0x130/0x170
[98089.140761]  __handle_irq_event_percpu+0x68/0x2a0
[98089.140763]  handle_irq_event_percpu+0x40/0xa0
[98089.140766]  handle_irq_event+0x50/0xf0
[98089.140768]  handle_fasteoi_irq+0xc0/0x170
[98089.140772]  generic_handle_irq+0x40/0x60
[98089.140775]  __handle_domain_irq+0x70/0xd0
[98089.140778]  gic_handle_irq+0x68/0x134
[98089.140779]  el1_irq+0xd0/0x180
[98089.140787]  el0_ia+0x50/0xb0
[98089.140788]  el0_sync_handler+0x90/0xb0
[98089.140790]  el0_sync+0x16c/0x180
[98089.140793] ---[ end trace 71009e79516be4c4 ]---

Duplicate topic (Can’t switch GPIO01/PQ.05/105/453/pin-29 to input using /sys/class/gpio - Jetson & Embedded Systems / Jetson Orin Nano - NVIDIA Developer Forums)

1 Like

Thank you! I guess a little dyslexia happened there.

I’m reading 0x58 from this register. That means the following are enabled:

  • Input
  • Tristate
  • Pullup

But there is definitely no pullup on this pin. If I connect the pin to ground and then disconnect, the GPIO continues to read low. Any ideas?

Thanks again!

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