# How to use mmap /dev/mem with GPIO port Jetson xavier NX

**URL:** <https://forums.developer.nvidia.com/t/how-to-use-mmap-dev-mem-with-gpio-port-jetson-xavier-nx/237746>\
**Category:** Linux\
**Tags:** hw, gpio, boot, ubuntu, kernel\
**Created:** [December 22, 2022, 10:09am UTC](https://forums.developer.nvidia.com/t/how-to-use-mmap-dev-mem-with-gpio-port-jetson-xavier-nx/237746 "2022-12-22T10:09:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![chien1.nguyendinh](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@chien1.nguyendinh](https://forums.developer.nvidia.com/u/chien1.nguyendinh)\
**Post date:** [December 22, 2022, 10:09am UTC](https://forums.developer.nvidia.com/t/how-to-use-mmap-dev-mem-with-gpio-port-jetson-xavier-nx/237746/1 "2022-12-22T10:09:05Z")

</div>

I am in need of mmap to use GPIO01 in NVIDIA Jetson Xavier NX Developer Kit Carrier Board P3509\_A01.  
I check that GPIO01 is being controlled by GPIO\_CTL2\_GPIO3 (PQ.05)  
#define GPIO\_CTL2\_GPIO3\_BASE = 0x02233000  
char \*addr;  
addr = mmap(NULL, 0x1000,PROT\_READ | PROT\_WRITE, MAP\_SHARED, fd, GPIO\_CTL2\_GPIO3\_BASE);

=\> But when I write the value to addr it doesn’t actually output the value to Pin.  
Can anyone show me how to make it work?

---

<div class="post-metadata">

**Author:** ![generix](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/generix/32/16024_2.png) [@generix](https://forums.developer.nvidia.com/u/generix)\
**Post date:** [December 23, 2022, 12:42pm UTC](https://forums.developer.nvidia.com/t/how-to-use-mmap-dev-mem-with-gpio-port-jetson-xavier-nx/237746/2 "2022-12-23T12:42:48Z")

</div>

Please ask in the appropriate forum:  
[https://forums.developer.nvidia.com/c/agx-autonomous-machines/jetson-embedded-systems/jetson-agx-xavier/75](https://forums.developer.nvidia.com/c/agx-autonomous-machines/jetson-embedded-systems/jetson-agx-xavier/75)
