[SOLVED] GPIOH numbering issues

Post Reply
tmered
Posts: 10
Joined: Thu Aug 13, 2020 11:11 pm
languages_spoken: english
ODROIDs: c2, c4
Has thanked: 5 times
Been thanked: 2 times
Contact:

[SOLVED] GPIOH numbering issues

Post by tmered »

I am setting up an Odroid-C4 and have noticed some inconsistencies with the GPIOH pins (GPIOH_5/6/7).

According to https://wiki.odroid.com/odroid-c4/hardw ... connectors, their GPIO numbers should be 22,23,24 respectively, which is also indicated by the output of gpio readall. However I have run into some issues using these pins:

GPIOH_6: I use this in a custom kernel module, and when I print the gpio number that I get there it says 433, not 23.

GPIOH_7: I used this to set up a power button (https://wiki.odroid.com/odroid-c4/appli ... key_wakeup), and using gpio number 24 in the boot.ini gave startup errors, but using gpio number 434 in the boot.ini works properly

GPIOH_5: I am using this to drive an external LED. I am testing it with these commands:

Code: Select all

$gpio export 22 out # This fails
gpio: Unable to open GPIO direction interface for pin 22: No such file or directory
$ gpio export 432 out # This works and sets the direction correctly
$ gpio -g write 22 1 #This works (turns led on/off)
$ gpio -g write 432 1 #This fails
Segmentation fault (core dumped)
So it seems like some parts of the system expect numbering of 22/23/24, while others expect 432/433/434.

User avatar
tobetter
Posts: 5878
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: Many
Location: Paju, South Korea
Has thanked: 248 times
Been thanked: 718 times
Contact:

Re: GPIOH numbering issues

Post by tobetter »

What's the kernel version running with your C4?

joshua.yang
Posts: 433
Joined: Fri Sep 22, 2017 5:54 pm
languages_spoken: Korean, English
ODROIDs: XU4, XU4Q + Cloudshell2, H2, N2
Has thanked: 26 times
Been thanked: 98 times
Contact:

Re: GPIOH numbering issues

Post by joshua.yang »

Hi.

Sorry for the inconvenience.
I have made a patch to fix that issue. The patch makes GPIOH to be shown not the lower number but it follows the base number.
The numbers in gpio readall results and behavior of gpio export are corrected.

Could you try this unofficial version and let us know the results?
Repository: https://github.com/awesometic/wiringPi
Patch: https://github.com/awesometic/wiringPi/ ... 6cc7d846af
These users thanked the author joshua.yang for the post:
tmered (Fri Sep 04, 2020 11:28 pm)

tmered
Posts: 10
Joined: Thu Aug 13, 2020 11:11 pm
languages_spoken: english
ODROIDs: c2, c4
Has thanked: 5 times
Been thanked: 2 times
Contact:

Re: GPIOH numbering issues

Post by tmered »

tobetter wrote:
Fri Sep 04, 2020 9:16 am
What's the kernel version running with your C4?

Code: Select all

odroid@odroid:~$ uname -r
4.9.230+
joshua.yang wrote:
Fri Sep 04, 2020 2:22 pm
Could you try this unofficial version and let us know the results?
Repository: https://github.com/awesometic/wiringPi
Thanks, this worked. gpio readall now shows 432-434 for those pins and gpio export 432 out /gpio -g write 432 1 now work as expected
These users thanked the author tmered for the post:
odroid (Mon Sep 07, 2020 11:17 am)

joshua.yang
Posts: 433
Joined: Fri Sep 22, 2017 5:54 pm
languages_spoken: Korean, English
ODROIDs: XU4, XU4Q + Cloudshell2, H2, N2
Has thanked: 26 times
Been thanked: 98 times
Contact:

Re: GPIOH numbering issues

Post by joshua.yang »

tmered wrote:
Fri Sep 04, 2020 11:26 pm
Thanks, this worked. gpio readall now shows 432-434 for those pins and gpio export 432 out /gpio -g write 432 1 now work as expected
Thank you for confirming it. :)

joshua.yang
Posts: 433
Joined: Fri Sep 22, 2017 5:54 pm
languages_spoken: Korean, English
ODROIDs: XU4, XU4Q + Cloudshell2, H2, N2
Has thanked: 26 times
Been thanked: 98 times
Contact:

Re: [SOLVED] GPIOH numbering issues

Post by joshua.yang »

The new WiringPi which includes fixing this issue was uploaded. This is can be downloaded via our Github repository or Launchpad PPA.
These users thanked the author joshua.yang for the post:
tmered (Wed Sep 09, 2020 11:26 pm)

tmered
Posts: 10
Joined: Thu Aug 13, 2020 11:11 pm
languages_spoken: english
ODROIDs: c2, c4
Has thanked: 5 times
Been thanked: 2 times
Contact:

Re: [SOLVED] GPIOH numbering issues

Post by tmered »

Great thanks! The master branch on github works now.
The wiki documentation (https://wiki.odroid.com/odroid-c4/hardw ... connectors) still has the old GPIO numbers, so it may still cause some confusion

joshua.yang
Posts: 433
Joined: Fri Sep 22, 2017 5:54 pm
languages_spoken: Korean, English
ODROIDs: XU4, XU4Q + Cloudshell2, H2, N2
Has thanked: 26 times
Been thanked: 98 times
Contact:

Re: [SOLVED] GPIOH numbering issues

Post by joshua.yang »

tmered wrote:
Wed Sep 09, 2020 11:28 pm
Great thanks! The master branch on github works now.
The wiki documentation (https://wiki.odroid.com/odroid-c4/hardw ... connectors) still has the old GPIO numbers, so it may still cause some confusion
Updated. Thanks for notifying me. :)

Post Reply

Return to “Hardware and peripherals”

Who is online

Users browsing this forum: No registered users and 0 guests