Using MaskRom button for a different purpose

Is there any way the maskrom button can be read by software? I’d like to change its function to basically reset the a configuration file if it’s pressed (either by booting or while running).
I assume it’s not mapped to any of the GPIO pins?

I’d use the GPIO pins, but I’m also using the PoE HAT, so I don’t have easy access to them.

Hi Mr.X

maskrom button is bound to GPIO3_B1

Oh! Really? That’s great! Is that in the documentation somewhere? I didn’t see it.
Thank you for letting me know, I’ll give it a try. :slight_smile:

Just checking my math, that would be gpio105 ?
Tried this, with no joy…
cd /sys/class/gpio
echo 105 > export
cd gpio105
echo value // with button pressed
Always getting a 0 for value.

NM, looks like that method has been deprecated. When using libgpiod it works!
gpiomon gpiochip3 9
produces:

event: FALLING EDGE offset: 9 timestamp: [   21266.641538866]
event:  RISING EDGE offset: 9 timestamp: [   21266.950695645]
event: FALLING EDGE offset: 9 timestamp: [   21267.675559210]
event:  RISING EDGE offset: 9 timestamp: [   21267.984560536]
event: FALLING EDGE offset: 9 timestamp: [   21268.552949065]
event:  RISING EDGE offset: 9 timestamp: [   21269.613091993]
event: FALLING EDGE offset: 9 timestamp: [   21270.273891276]
event:  RISING EDGE offset: 9 timestamp: [   21270.834306187]
event: FALLING EDGE offset: 9 timestamp: [   21271.435750577]
event:  RISING EDGE offset: 9 timestamp: [   21272.000043948]

as I push the button! :slight_smile:

It seems that using gpiomon or gpioget to monitor the MaskRom button messes up a mounted emmc.
Just calling either of those functions causes the following errors to show in dmesg:

[  163.408574] mmc_host mmc0: Bus speed (slot 0) = 400000Hz (slot req 400000Hz, actual 400000HZ div = 0)
[  163.408574] mmc0: tried to HW reset card, got error -110
[  163.408632] mmcblk0: recovery failed!
[  163.408654] I/O error, dev mmcblk0, sector 5009416 op 0x1:(WRITE) flags 0x0 phys_seg 1 prio class 2
[  163.408683] EXT4-fs warning (device mmcblk0p1): ext4_end_bio:343: I/O error 10 writing to inode 783 starting block 626177)
[  163.408936] Buffer I/O error on device mmcblk0p1, logical block 622081

Any suggestions on how to avoid this problem?

Is it actually possible to use that GPIO without messing up the eMMC?