GPIO pins 31, 36 won't output high level

Post Reply
ntarcds
Posts: 8
Joined: Mon Aug 14, 2023 11:19 pm
languages_spoken: english
Has thanked: 1 time
Been thanked: 3 times
Contact:

GPIO pins 31, 36 won't output high level

Post by ntarcds »

Hello,

I am using ODROID-M1 running Ubuntu server from https://wiki.odroid.com/odroid-m1/os_im ... u/20220531.
As far as I know this is the latest Ubuntu server version available from Hardkernel for this target.

I am using the following GPIO :

Code: Select all

pin 32 (gpiochip = 3, offset = 27)
pin 36 (gpiochip = 3, offset = 28)
pin 31 (gpiochip = 4, offset = 14)
pin 35 (gpiochip = 3, offset = 29)
I would like to drive those pins as output (either low level "0V" or high level "3.3V").
Unfortunately, only pins 32 and 35 can be set to high or low (measured with a multimeter).
Pins 31 and 36 always remain at "0V".

I am using the following command to drive the pins, and check with a multimeter:
(example for pin 31, this requires package "gpiod")

Code: Select all

sudo gpioset -m wait -D push-pull 4 14=1
Could you please help troubleshooting the issue?
Why would I be able to set pins 32 and 35 to high/low whereas 31/36 always remain "low", using the same command?
Is there any difference in the configuration of those pins in the Device Tree? (push-pull, open-drain, etc)

Thanks in advance for your support!
Nicolas

User avatar
mctom
Posts: 3250
Joined: Wed Nov 11, 2020 4:44 am
languages_spoken: english, polish
ODROIDs: OGA, XU4, M1, H3+, SP3, Vu8M, N2L
Location: Gdansk, Poland
Has thanked: 438 times
Been thanked: 593 times
Contact:

Re: GPIO pins 31, 36 won't output high level

Post by mctom »

Hi,

One thing that comes to my mind are alternative pin functions that may take precedence over gpioset, but pin 36 does not have any.

Try the deprecated sysfs control method, perhaps it will behave differently:
https://wiki.odroid.com/odroid-m1/appli ... attributes

Try forcing "0" output and see if the logic isn't reversed for any reason.

Also try adding pull-up bias to your gpioset command, that would be weird, but perhaps these pins do not have totem pole outputs at all?

I checked my old project that I'm currently running on my M1, and I didn't use pins 31 and 36. But I am using pin 32 and it works indeed..
Punk ain't no religious cult, punk means thinking for yourself!
OpenUPS
PiStackMon

ntarcds
Posts: 8
Joined: Mon Aug 14, 2023 11:19 pm
languages_spoken: english
Has thanked: 1 time
Been thanked: 3 times
Contact:

Re: GPIO pins 31, 36 won't output high level

Post by ntarcds »

Thanks for your answer!

Unfortunately GPIO values do not change even with the deprecated sysfs interface.

But... Turns out it was my stupid mistake.
A custom process was running as a systemd service and this process already used the GPIO, using the ODROID WiringPi python library.
Normally I should not have been able to request the same GPIO used by the process from the command line using gpioset/get, the Linux gpio subsystem should have forbid this.
However the ODROID WiringPi library uses /dev/gpiomem internally and writes directly to the hardware registers to control the pins, effectively bypassing the machinery of the Linux gpio subsystem.

So basically when I tried to set the level of pin 31 for example, the custom process would "erase" my configuration silently.

Disabling the custom process makes setting/getting GPIO levels working for all GPIO pins I need!

Regards
These users thanked the author ntarcds for the post (total 2):
odroid (Wed Aug 16, 2023 5:26 pm) • mctom (Wed Aug 16, 2023 7:50 pm)

Post Reply

Return to “Issues”

Who is online

Users browsing this forum: No registered users and 2 guests