I'm trying to find out if there is a way to query which programs/code are accessing and writing to the GPIO on an RPi 4. For some background:
I have a couple of GPIO pins which are behaving unexpectedly - one is toggling between high and low states at approx. 1Hz. Another is constantly set low, if I set it high then it will revert back to a low after about 1 second. The logical explanation is that there is code running somewhere (I suspect written by myself at some point) which is causing these behaviours, but I can't figure out where it is. It is not in any of the main programs that I run.
I don't call any programs in rc.local that would cause the behaviour, and the only alterations I've made in config.txt are to set a number of GPIO to outputs and drive them high. I haven't made any edits to bashrc, init.d tab, systemd or crontab that might auto-run scrips. Task manager doesn't give me any clues to where the culprit is either.
Installing a fresh version of NOOBS would almost certainly solve the problem, but I'm trying to avoid having to start from scrach and reinstall / setup the RPi again.
Is there any way to find out which code is causing the GPIO behaviour that I can't account for?