I'm getting some, what I would call strange, although this may be expected by those with better understanding than I have, behaviour from GPIO2.
Using Raspbian, on generic configuration, GPIO2 is set as "in":
echo "2" > /sys/class/gpio/export
echo "in" > /sys/class/gpio/gpio2/direction
A hardware device attached to this pin sets the pin low, which I then use to trigger a process (play a video, this may only be partially relevant), I read the pin state using:
cat /sys/class/gpio/gpio2/value
Everything works as expected, I receive the low "0" trigger, and play a video, except when the SD card is pulled from the Pi, placed in a Linux (Ubuntu) system, and an additional video file is placed into the same folder.
If this is done, once the Pi boots up again, GPIO2 never goes low again.
How this is relevant is, if I'm ssh'd into the Pi and I copy a video file to that folder, everything continues to work as expected, it is only when I manually add/replace a file on a different machine, onto the SD card, that this fails.
Just to be clear, this isn't about why the new video won't play, it does play when I manually omxplayer the file. It is just that, when a video is placed on the Pi as described above on an external machine, that GPIO2 no longer goes low. I do have another indicator for me to know that the hardware continues to attempt to set GPIO2 low.
I'm not really too concerned about what is going on, why this is happening, etc... ok, I am interested in the problem, only in the sense that I'd like to have the system recover from this undesirable condition, but I would think that resetting the GPIOs would solve this, but no matter what I do to unexport, etc. no attempt is allowing me to get the original behaviour back. The only way I can get the behaviour back to what I want, is by re-imaging the card.
Does anyone have any ideas?