Losing GPIO interrupt on M4 by LINUX OS booting

Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Hello,

Thank you for reaching out with your question. The issue you’re encountering, where the GPIO interrupt on the Cortex-M4 is lost after booting Linux, is likely due to the Linux kernel reconfiguring the GPIO during its initialization process. Let’s go through some steps to address this:

  1. Understanding the Interrupt Configuration:

    • The line interrupts = <GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>; in your device tree specifies the interrupt setup for the GPIO. Here, GIC_SPI refers to a Shared Peripheral Interrupt in the Generic Interrupt Controller. The number 136 is the interrupt number assigned to this GPIO, and IRQ_TYPE_LEVEL_HIGH indicates that the interrupt is triggered on a high-level signal.
  2. Disabling GPIO in the Device Tree:

    • You’ve attempted to disable the GPIO node using a device tree overlay. Ensure that this overlay is correctly applied and that the Linux kernel is not re-enabling or reconfiguring the GPIO. Double-check the syntax and application of your overlay.
    • After modifying the device tree, rebuild and deploy it to ensure the changes take effect.
  3. Preventing Linux from Reconfiguring the GPIO:

    • Verify that no other parts of the device tree or kernel configuration are setting up the GPIO for use by Linux. This includes checking for any pinctrl settings or other GPIO configurations that might be applied during boot.
    • Consider using a custom kernel or device tree configuration that explicitly leaves the GPIO unconfigured or reserved for the M4 core.
  4. Testing and Validation:

    • After applying these changes, test the system to ensure the M4 core can maintain control over the GPIO without interference from Linux.
    • Monitor the boot logs to see if there are any messages related to GPIO configuration that might indicate where the conflict arises.

By following these steps, you should be able to maintain control over the GPIO from the M4 core even after Linux boots. If issues persist, further investigation into the specific kernel and device tree configurations may be necessary.

Best regards,
Toradex AI Assistant

Please, also check if these links can help you solve your problem:

Conflict between SPI and GPIO.