# AGX GPIO integration with simulink

**URL:** <https://forums.developer.nvidia.com/t/agx-gpio-integration-with-simulink/333859>\
**Category:** Jetson AGX Orin\
**Tags:** matlab, gpio, jetson-orin, jetson-inference\
**Created:** [May 21, 2025, 7:35am UTC](https://forums.developer.nvidia.com/t/agx-gpio-integration-with-simulink/333859 "2025-05-21T07:35:36Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![aqsasyed966](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@aqsasyed966](https://forums.developer.nvidia.com/u/aqsasyed966)\
**Post date:** [May 21, 2025, 7:35am UTC](https://forums.developer.nvidia.com/t/agx-gpio-integration-with-simulink/333859/1 "2025-05-21T07:35:37Z")

</div>

Jetson AGX-Orin

**Target Operating System**  
 Windows

**Host Machine Version**  
 native Ubuntu Linux 20.04 Host installed with SDK Manager

Hey,  
I am integrating agx-orin developer kit with simulink using toolchain ‘Nvidia-Jetson’, the simulink file is deploying and running but i can not see anything on GPIO pins. I need to run pwm on pin 15 and take input from pin 22.  
I found that i need to configure pinmux of agx by reflashing it with newly generated pinmux.dtsi and gpio.dtsi files through spreadsheet and I have done it several times but no luck.  
Now, I am trying to configure the register address of gpio using following:  
###########################  
The following example shows you how to update Pin MCLK05: SOC\_GPIO33: PQ6:

1. The Pinmux register base address = 0x2430000

- Offset = 0x70
- Pinmux register address = 0x2430070

1. Run the following command.

> `$ busybox devmem 0x02430070`  
> The output value is 0x00000054.

1. To set the pin as the output, run the following command.

> `$ busybox devmem 0x02430070 w 0x004`

1. Read back to confirm:

> `$ busybox devmem 0x02430070`

Starting with JetPack 6, the GPIO sysfs has been deprecated.

To set the direction of the GPIO controller between the input and the output, users can use upstream GPIO tools instead of GPIO sysfs.  
###########################################

but I am unable to install busybox for arm64. please guide!!

source: [[Jetson AGX Orin Platform Adaptation and Bring-Up — NVIDIA Jetson Linux Developer Guide](https://docs.nvidia.com/jetson/archives/r36.4.3/DeveloperGuide/HR/JetsonModuleAdaptationAndBringUp/JetsonAgxOrinSeries.html#pinmux-changes)]

---

<div class="post-metadata">

**Author:** ![SivaRamaKrishnaNV](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/sivaramakrishnanv/32/14043_2.png) [@SivaRamaKrishnaNV](https://forums.developer.nvidia.com/u/SivaRamaKrishnaNV)\
**Post date:** [May 21, 2025, 7:42am UTC](https://forums.developer.nvidia.com/t/agx-gpio-integration-with-simulink/333859/2 "2025-05-21T07:42:03Z")

</div>

Dear @aqsasyed966 ,  
Are you using DRIVE AGX Orin or Jetson AGX Orin?

---

<div class="post-metadata">

**Author:** ![aqsasyed966](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@aqsasyed966](https://forums.developer.nvidia.com/u/aqsasyed966)\
**Post date:** [May 21, 2025, 8:04am UTC](https://forums.developer.nvidia.com/t/agx-gpio-integration-with-simulink/333859/4 "2025-05-21T08:04:48Z")

</div>

Sorry I have rectified the tag. Thanks for mentioning.

---

<div class="post-metadata">

**Author:** ![KevinFFF](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/kevinfff/32/15508_2.png) [@KevinFFF](https://forums.developer.nvidia.com/u/KevinFFF)\
**Post date:** [May 22, 2025, 2:08am UTC](https://forums.developer.nvidia.com/t/agx-gpio-integration-with-simulink/333859/6 "2025-05-22T02:08:50Z")

</div>

Hi aqsasyed966,

Are you using the devkit or custom board for AGX Orin?  
What’s the Jetpack version in use?

> [@aqsasyed966](#):
>
> **Target Operating System**  
> Windows

Are you using Windows on AGX Orin?

> [@aqsasyed966](#):
>
> I need to run pwm on pin 15 and take input from pin 22.

Do you mean the PIN15 and PIN22 from 40-pins expansion header(J30)?

> [@aqsasyed966](#):
>
> but I am unable to install busybox for arm64. please guide!!

I think `busybox` should be available by default.

---

<div class="post-metadata">

**Author:** ![aqsasyed966](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@aqsasyed966](https://forums.developer.nvidia.com/u/aqsasyed966)\
**Post date:** [May 22, 2025, 3:46am UTC](https://forums.developer.nvidia.com/t/agx-gpio-integration-with-simulink/333859/7 "2025-05-22T03:46:10Z")

</div>

> [@KevinFFF](#):
>
> Are you using the devkit or custom board for AGX Orin?  
> What’s the Jetpack version in use?

I am using AGX-ORIN 64GB Developer Kit with Jetpack 6.1

> [@KevinFFF](#):
>
> Are you using Windows on AGX Orin?

No, i am using Ubuntu 22.04, but i am deploying the simulink code from windows host into the agx.

> [@KevinFFF](#):
>
> Do you mean the PIN15 and PIN22 from 40-pins expansion header(J30)?

yes. The gpio pins on 40-pin header

> [@KevinFFF](#):
>
> I think `busybox` should be available by default.

Nope. its not available.

I am unable to make any change on J30 pins even after reflashing with new dtsi files.  
can you please show any working example of changing the pin-function from SFIO to GPIO?

---

<div class="post-metadata">

**Author:** ![KevinFFF](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/kevinfff/32/15508_2.png) [@KevinFFF](https://forums.developer.nvidia.com/u/KevinFFF)\
**Post date:** [May 22, 2025, 9:07am UTC](https://forums.developer.nvidia.com/t/agx-gpio-integration-with-simulink/333859/8 "2025-05-22T09:07:00Z")

</div>

> [@aqsasyed966](#):
>
> Nope. its not available.

Do you have any customization so that busybox is unavailable by default?  
Please run the following command in the AGX Orin devkit to veirfy.

```auto
$ busybox 
$ which busybox

```

> [@aqsasyed966](#):
>
> can you please show any working example of changing the pin-function from SFIO to GPIO?

You can search from `Jetson AGX Orin Developer Kit Carrier Board Specification` to know that PIN15 of J30 is `PN.01`.  
 ![image](https://global.discourse-cdn.com/nvidia/optimized/4X/7/2/5/725d043d92839ab6917ef1551e5a36c85f374917_2_690x19.png)  
And you can configure it for default Output/High in pinmux spreadsheet.  
 ![image](https://global.discourse-cdn.com/nvidia/original/4X/b/d/2/bd2fb496c62597facc7cd4958327b519a24b201f.png)

---

<div class="post-metadata">

**Author:** ![aqsasyed966](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@aqsasyed966](https://forums.developer.nvidia.com/u/aqsasyed966)\
**Post date:** [May 23, 2025, 7:04am UTC](https://forums.developer.nvidia.com/t/agx-gpio-integration-with-simulink/333859/9 "2025-05-23T07:04:56Z")

</div>

Many thanks for the response.

> [@KevinFFF](#):
>
> Do you have any customization so that busybox is unavailable by default?  
> Please run the following command in the AGX Orin devkit to veirfy.

I have ran both the commands, its saying busybox: command not found

> [@KevinFFF](#):
>
> You can search from `Jetson AGX Orin Developer Kit Carrier Board Specification` to know that PIN15 of J30 is `PN.01`.

I am using pin 15 as PWM and its working fine. but pin 22 is not working as GPIO. i have changed its respective pin spreadsheet and reflashed, but no luck.  
can you give specific changes that i can change in /boot/kernel\_tegra234-p3737-0000+p3701-0005-nv.dtb for boot time changes?

---

<div class="post-metadata">

**Author:** ![KevinFFF](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/kevinfff/32/15508_2.png) [@KevinFFF](https://forums.developer.nvidia.com/u/KevinFFF)\
**Post date:** [May 26, 2025, 5:38am UTC](https://forums.developer.nvidia.com/t/agx-gpio-integration-with-simulink/333859/10 "2025-05-26T05:38:15Z")

</div>

![image](https://global.discourse-cdn.com/nvidia/optimized/4X/0/1/0/01070651b1be0b05a0c209d2ac54fc4c628a2ac5_2_690x22.png)  
For PIN22 of 40-pins header, it should be `PP.04`.  
If you want to use it as an output GPIO pin, please configure it as following in pinmux spreadsheet.  
 ![image](https://global.discourse-cdn.com/nvidia/original/4X/f/1/1/f11e7beb9467610fec350b13fd1a2432f82e411d.png)

I would also suggest you applying the following patch if you want to control GPIO in JP6.x.  
[40hdr - SPI1 gpio padctl register bit[10] effect by gpiod tools in JP6 - #20 by KevinFFF](https://forums.developer.nvidia.com/t/40hdr-spi1-gpio-padctl-register-bit-10-effect-by-gpiod-tools-in-jp6/301171/20)

---

<div class="post-metadata">

**Author:** ![aqsasyed966](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@aqsasyed966](https://forums.developer.nvidia.com/u/aqsasyed966)\
**Post date:** [May 26, 2025, 6:38am UTC](https://forums.developer.nvidia.com/t/agx-gpio-integration-with-simulink/333859/11 "2025-05-26T06:38:46Z")

</div>

Can you please explain where to apply this patch?

Also, I am unable to use busybox as shown in this post: [https://forums.developer.nvidia.com/t/40hdr-spi1-gpio-padctl-register-bit-10-effect-by-gpiod-tools-in-jp6/301171/11](https://forums.developer.nvidia.com/t/40hdr-spi1-gpio-padctl-register-bit-10-effect-by-gpiod-tools-in-jp6/301171/11)

I am getting:  
bash: busybox: command not found.

how can I write/read register value??

---

<div class="post-metadata">

**Author:** ![KevinFFF](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/kevinfff/32/15508_2.png) [@KevinFFF](https://forums.developer.nvidia.com/u/KevinFFF)\
**Post date:** [May 26, 2025, 7:39am UTC](https://forums.developer.nvidia.com/t/agx-gpio-integration-with-simulink/333859/12 "2025-05-26T07:39:51Z")

</div>

> [@aqsasyed966](#):
>
> Can you please explain where to apply this patch?

Please refer to [Kernel Customization — NVIDIA Jetson Linux Developer Guide 1 documentation](https://docs.nvidia.com/jetson/archives/r36.4/DeveloperGuide/SD/Kernel/KernelCustomization.html) to sync and build kernel image. The patch should be applied in kernel source.

> [@aqsasyed966](#):
>
> bash: busybox: command not found.
> 
> how can I write/read register value??

Could you try if the following command can help for this?

```auto
$ sudo apt update
$ sudo apt install busybox

```

Or you can try using `devmem2` instead.

```auto
$ sudo apt install devmem2

```

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/system/32/68080_2.png) [@system](https://forums.developer.nvidia.com/u/system)\
**Post date:** [June 18, 2025, 1:59am UTC](https://forums.developer.nvidia.com/t/agx-gpio-integration-with-simulink/333859/14 "2025-06-18T01:59:57Z")

</div>

Closed on June 18, 2025, 1:59am UTC

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