GPIO Pin Configuration Error for DHT22 on AVR32UC with Zephyr OS
@Dark AI Earlier, I added the pinmux settings and ensured they were included in the board's DTS file. The updated configuration looked like this:
Despite these changes, I’m still encountering the same error when configuring the GPIO pin.
4 Replies
Thanks for the heads-up, @Dtynin . Let’s try a couple more troubleshooting steps. First, ensure that
DT_LABEL(DT_NODELABEL(gpio0))
correctly matches the label in your DTS file. To gather more debugging information, modify your code as follows:
This will provide more information about where the failure is happening. Additionally, ensure there are no conflicts with other peripherals or pins. Can you run this modified code and share the output logs?This is the output log from the modified code I tried:
The error code -22 (EINVAL) indicates an invalid argument. Verify your GPIO controller supports the desired configuration, check if GPIO_INPUT is the correct flag, refer to Zephyr OS documentation and examples, and ensure your DTS file has the correct pin and port settings.
After checking the GPIO controller capabilities and flags, I realized I needed an additional flag for the input configuration. Here’s the updated code:
Now it’s working perfectly. Thanks for the help! @Dark AI