This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

J722SXH01EVM: Not able to toggle GPIOs via chardev (libgpiod)

Part Number: J722SXH01EVM
Other Parts Discussed in Thread: AM67A

Tool/software:

Hi,

we are having trouble toggling the GPIOs on the AM67A EVM. We've tried three GPIOs so far:

  • Pin17 on J33 (22Pin CSI camera port): GPIO0_15
  • Pin18 on J33 (22Pin CSI camera port): GPIO0_16
  • Pin13 on J28 (40Pin User Expansion Header): GPIO0_33

But no matter how we toggle these GPIO pins via "chardev", the electrical level never changes (checked with logic analyzer and multimeter), it is always low. For example, to set GPIO0_15 to HIGH, we used:

$ gpioset -m wait gpiochip2 15=1

where gpiochip2 is 600000.gpio according to

$ gpiodetect
gpiochip0 [1-0023] (24 lines)
gpiochip1 [4201000.gpio] (24 lines)
gpiochip2 [600000.gpio] (92 lines)
gpiochip3 [601000.gpio] (52 lines)
gpiochip4 [2-0020] (16 lines)

but the level on J33.Pin17 never goes up even before "Enter" is hit.

I wonder is it the way I am toggling these pins wrong, or am I missing some H/W or S/W configurations here? Please help, thanks!

Danxuan

  • Hi Danxuan, 

    First as a sanity check, could you try turning off and on the user LED.

    1. gpioset -c 0 16=1
    2. gpioset -c 0 16=0

    I have tried this on a clean installation of 10.0 SDK and can confirm the onboard LED turns on and off.

    Regards,

    Takuma

  • Hi Takuma,

    Thanks for your reply. Turning "USER_LED2" on and off doesn't work with SDK9 because:

    root@j722s-evm:/opt/edgeai-gst-apps# gpioset -m wait 0 16=1
    gpioset: error setting the GPIO line values: Device or resource busy

    As I reported, toggling on "GPIO0_15", "GPIO0_16" and "GPIO0_33" all doesn't with SDK9 since there is no electrical level changes observed.

    Since you were using SDK10, I then installed the SDK10 as well on my SD card. Now I am able to toggle the "USER_LED2" and "GPIO0_33" successfully using:

    $ gpioset -c 0 16=1
    $ gpioset -c 0 16=0
    $ gpioset -c 2 33=0
    $ gpioset -c 2 33=1

    Obviously the Chardev API has changed in SDK10 and it now works. Toggling GPIOs seems to fail in SDK9.

    Thanks,

    Danxuan

  • Hi Danxuan,

    Ok, understood. I will let our development team know as well. 

    For your development, is it fine to continue with SDK 10.0? This is the latest SDK, so it should have the newest features and bug fixes from upstream Linux.

    Regards,

    Takuma

  • Hi Takuma,

    Thanks for your information. Yes, we will try to continue with the SDK10. If we encounter any problem during the development with this SDK, we will open separate threads for that. Thanks!

    Cheers,

    Danxuan