How can I use Rpi GPIO Header of iMX93?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How can I use Rpi GPIO Header of iMX93?

Jump to solution
1,646 Views
dpcivl
Contributor III

Hello, I am currently working on a project with the iMX93 EVK board. I am trying to control an interface by running a blinking LED example, but I'm having trouble figuring out how to use the RPi GPIO header.

I suspect that the RPi GPIO header is associated with 'gpiochip2'. I tried using GPIO line 0, assuming it was related, but the LED didn't respond. I also tried changing the line to 17 (the BCM number), but that didn't work either. I ruled out a hardware issue because the LED lights up when I connect it directly to 3.3V.

Could you please guide me on how to resolve this issue? Which documentation should I refer to for more information?

Below is the Python code I executed:

import gpiod
from gpiod.line import Direction, Value
import time

LINE = 17

with gpiod.request_lines(
    "/dev/gpiochip2",
    consumer="blink-example",
    config={
        LINE: gpiod.LineSettings(
            direction=Direction.OUTPUT, output_value=Value.ACTIVE
        )
    },
) as request:
    while True:
        request.set_value(LINE, Value.ACTIVE)
        time.sleep(1)
        request.set_value(LINE, Value.INACTIVE)
        time.sleep(1)

 

Tags (3)
0 Kudos
Reply
1 Solution
1,618 Views
dpcivl
Contributor III
I found that those pins not working were used to do something else not for GPIO but SPI, SAI, CAN ...

View solution in original post

0 Kudos
Reply
1 Reply
1,619 Views
dpcivl
Contributor III
I found that those pins not working were used to do something else not for GPIO but SPI, SAI, CAN ...
0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-1934665%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EHow%20can%20I%20use%20Rpi%20GPIO%20Header%20of%20iMX93%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1934665%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%2C%20I%20am%20currently%20working%20on%20a%20project%20with%20the%20iMX93%20EVK%20board.%20I%20am%20trying%20to%20control%20an%20interface%20by%20running%20a%20blinking%20LED%20example%2C%20but%20I'm%20having%20trouble%20figuring%20out%20how%20to%20use%20the%20RPi%20GPIO%20header.%3C%2FP%3E%3CP%3EI%20suspect%20that%20the%20RPi%20GPIO%20header%20is%20associated%20with%20'gpiochip2'.%20I%20tried%20using%20GPIO%20line%200%2C%20assuming%20it%20was%20related%2C%20but%20the%20LED%20didn't%20respond.%20I%20also%20tried%20changing%20the%20line%20to%2017%20(the%20BCM%20number)%2C%20but%20that%20didn't%20work%20either.%20I%20ruled%20out%20a%20hardware%20issue%20because%20the%20LED%20lights%20up%20when%20I%20connect%20it%20directly%20to%203.3V.%3C%2FP%3E%3CP%3ECould%20you%20please%20guide%20me%20on%20how%20to%20resolve%20this%20issue%3F%20Which%20documentation%20should%20I%20refer%20to%20for%20more%20information%3F%3C%2FP%3E%3CP%3EBelow%20is%20the%20Python%20code%20I%20executed%3A%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-python%22%3E%3CCODE%3Eimport%20gpiod%0Afrom%20gpiod.line%20import%20Direction%2C%20Value%0Aimport%20time%0A%0ALINE%20%3D%2017%0A%0Awith%20gpiod.request_lines(%0A%20%20%20%20%22%2Fdev%2Fgpiochip2%22%2C%0A%20%20%20%20consumer%3D%22blink-example%22%2C%0A%20%20%20%20config%3D%7B%0A%20%20%20%20%20%20%20%20LINE%3A%20gpiod.LineSettings(%0A%20%20%20%20%20%20%20%20%20%20%20%20direction%3DDirection.OUTPUT%2C%20output_value%3DValue.ACTIVE%0A%20%20%20%20%20%20%20%20)%0A%20%20%20%20%7D%2C%0A)%20as%20request%3A%0A%20%20%20%20while%20True%3A%0A%20%20%20%20%20%20%20%20request.set_value(LINE%2C%20Value.ACTIVE)%0A%20%20%20%20%20%20%20%20time.sleep(1)%0A%20%20%20%20%20%20%20%20request.set_value(LINE%2C%20Value.INACTIVE)%0A%20%20%20%20%20%20%20%20time.sleep(1)%3C%2FCODE%3E%3C%2FPRE%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1935013%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20How%20can%20I%20use%20Rpi%20GPIO%20Header%20of%20iMX93%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1935013%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EI%20found%20that%20those%20pins%20not%20working%20were%20used%20to%20do%20something%20else%20not%20for%20GPIO%20but%20SPI%2C%20SAI%2C%20CAN%20...%3C%2FLINGO-BODY%3E