Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!
Did you like my answer?
Hello there,
To address the issue of setting up an interrupt on a non-GPIO pin using C# on your Verdin iMX8M Plus board, here are some steps you can take to troubleshoot and resolve the problem:
-
Pin Configuration and Muxing: Ensure that the pin you are trying to use as a GPIO is correctly configured in the device tree. Non-GPIO pins may need to be reconfigured to function as GPIOs. Check the device tree to ensure the pin is not assigned to another function and is properly muxed as a GPIO.
-
Device Tree Verification: Verify that the device tree overlay correctly sets the pin to GPIO mode. If the pin is not muxed as a GPIO, it will not respond to GPIO operations, including interrupts. You may need to create or modify a device tree overlay to achieve this.
-
Using libgpiod Tools: Utilize the
gpiodetect
andgpioinfo
command-line tools to check the status and configuration of the GPIO lines. This can help confirm whether the pin is recognized as a GPIO and if it is set up correctly. -
Interrupt Configuration: Double-check your C# code to ensure that the interrupt is set up correctly. Ensure that the
RegisterCallbackForPinValueChangedEvent
method is correctly configured to listen for the desired event type (e.g., falling edge). -
Testing with Known GPIOs: Since you mentioned that the setup works with other GPIO pins like SODIMM_216 and SODIMM_218, compare the configuration of these working pins with the non-GPIO pin to identify any discrepancies.
-
Debugging: Add logging or debugging statements in your ISR to verify if it is being called. This can help determine if the issue lies with the interrupt setup or the ISR execution.
By following these steps, you should be able to identify and resolve the issue with setting up interrupts on non-GPIO pins. If the problem persists, ensure that all configurations are consistent with the working GPIO pins and that the device tree is correctly set up for your specific use case.
Best regards,
Toradex AI Assistant.
Please, also check if these links can help you solve your problem: