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

Source: https://forum.modalai.com/topic/4200/issue-reading-gpio-1146-pin-6-on-j10-on-voxl2
Category: VOXL 2 and VOXL 2 Mini (https://forum.modalai.com/category/26/voxl-2-and-voxl-2-mini)
Tags: voxl-2-io
Posted: 2025-02-24 14:24:34 UTC by Amir Avni
Replies: 1 · Views: 1423

## Amir Avni · 2025-02-24 14:24:34 UTC

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!

## Reply by modaltb (ModalAI staff) · 2025-02-25 01:34:39 UTC

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
