1

Occasionally my headless Raspberry Pi becomes unresponsive.
I have configured the watchdog, but it doesn't always kick in.
So I have added a reset button which does a hard reset by connecting the GLOBAL_EN to GND.
Another solution would be to just cut off the power.
Is there a difference between those two solutions with respect to SD corruption?

0

2 Answers 2

0

Connecting GLOBAL_EN to GND is not a safe shutdown. Removing power from the RPi while it's running is also not a safe shutdown. A safe shutdown is one in which any pending writes to the SD card are completed before stopping the processor.

The simplest solution to your problem may be the "one-button ON-OFF" switch. It's described in this answer. If that doesn't do it for you, follow up here in the comments & I'll come up with something else.

2
  • From my understanding, using the GPIO overlay creates an interrupt which means that the kernel still needs to be responsive to interrupts, which may not always be the case with a hanging system. As my system only hangs occasionally, I cannot tell, if the GPIO overlay will solve my issue. Nonetheless, I will give it a try and accept your answer as a solution.
    – user333869
    Commented Sep 27, 2023 at 14:51
  • @user333869: The overlay signals the processor to issue a shutdown, so yes - if your system cannot issue the shutdown, then this will not help. That said, it seems far more likely to me that the "hang" you see is due to the communications link between your terminal and your RPi. If you can measure the current being drawn by your RPi, you should be able to detect a significant reduction after the shutdown is issued. Hope that's clear...
    – Seamus
    Commented Sep 27, 2023 at 15:27
0

It will make no difference.

Cutting power will actually take a short time for capacitors to discharge vs instantaneous PMIC reset.

I would install a button and activate the shutdown overlay to see if this works.

See https://raspberrypi.stackexchange.com/a/42945/8697

2
  • I think that any operation that forcibly interrupts SD card writes can lead to data corruption. A hard reset of the CPU can do that, as well as a power cut. But what about wear leveling operations of the SD card itself? These will be interrupted hard by power off but possibly soft by a CPU reset.
    – user333869
    Commented Sep 25, 2023 at 5:32
  • That wasn't the question you asked. I was not recommending either.
    – Milliways
    Commented Sep 25, 2023 at 6:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.