ModalAI Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Issue Reading GPIO 1146 (Pin 6 on J10) on VOXL2

    VOXL 2 IO
    2
    2
    76
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Amir AvniA
      Amir Avni
      last edited by

      Hi,

      I'm trying to read values from GPIO 1146 (Pin 6 on J10), but the value always remains the same regardless of whether I connect it to 3.3V (high) or 0V (low).

      I successfully changed the direction to output and verified using a multimeter that writing '0' or '1' correctly changes the voltage.

      However, when I switch the GPIO to input mode, reading /sys/class/gpio/gpio1146/value always returns the same value, regardless of the external voltage applied.

      It seems that the value read from /sys/class/gpio/gpio1146/value is actually determined by the contents of active_low, rather than the actual pin state.

      voxl2:/sys/class/gpio/gpio1146$ cat /sys/class/gpio/gpio1146/direction
      in
      voxl2:/sys/class/gpio/gpio1146$ cat /sys/class/gpio/gpio1146/value
      0

      Is there a known issue with reading input values on this GPIO? Do I need to configure anything else (e.g., pull-up/down settings) to get correct readings?

      Thanks!

      1 Reply Last reply Reply Quote 0
      • modaltbM
        modaltb ModalAI Team
        last edited by

        Hi @Amir-Avni,

        Does your silkscreen on VOXL2 show M0154 or M0054?

        If M0054, it's 'hard coded' as an output only... behind a uni-directional level shifter.....

        If it's M0154, there's a directional level shifter in front of that GPIO that allows us to (with a kernel tweak) switch between UART and SPI.

        By default we are configured for UART use case, and the level shifter is set to allow an INPUT, by setting GPIO 67 low (as default), which is setup in device tree here, see "67" in modalai,gpio-init-output-low
        https://gitlab.com/voxl-public/system-image-build/meta-voxl2-bsp/-/blob/v1.8.02/recipes-kernel/linux-msm/files/dts/common/m0xxx-modalai-gpio.dtsi?ref_type=tags#L12

        To enable VOXL2 J10 pin6 (gpio46) as an input, make sure gpio67 is set to low

        1 Reply Last reply Reply Quote 0
        • Alex KushleyevA Alex Kushleyev referenced this topic on
        • First post
          Last post
        Powered by NodeBB | Contributors