@alex.tx and @GlenM, I think the root cause of this issue might be the same as the root cause of this other topic, which is that the GPIO library is not thread-safe on the iMX6. More testing is required to confirm that.