Unable to read gpios

Hi, I am unable to read GPIOs (always getting 0x00000000 from gpio_port_get or 0 from gpio_pin_get). My main project is https://github.com/marcuswu/leaf-fall/tree/main/firmware/keyboard, but I made a smaller test project to try to figure out the gpio issue at https://github.com/marcuswu/test-gpio.

All of my GPIOs are configured as input, active low, pull up. I did have some overlap with nfc, the reset pin, and other things like uart defined on the dts for the board I am using to build (nrf52dk/nrf52832) so I disabled those things. I'm actually using the Raytac MDBT42Q-512KV2 on a custom board, but I'm just using my overlay to reconcile differences.

The leaf-fall codebase uses gpio interrupts (sense mode since there are more than 8) to detect changes, but I also need to read the full current state of all gpios. The pins parameter in the interrupt callback is set correctly, but the gpio port still reads 0x00000000. The test-gpio project does away with all the complexity and simply reads from the gpio in a loop logging everything. I get all 0's no matter what I do with the test project as well.

Any thoughts on what could be wrong?

Related