Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kernel panic if Pi shutdown from cmdline #130

Open
greiginsydney opened this issue Jan 29, 2023 · 2 comments
Open

Kernel panic if Pi shutdown from cmdline #130

greiginsydney opened this issue Jan 29, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@greiginsydney
Copy link
Owner

image

[Image lifted from one of the reference links below].

The Pi has manifested this issue for some time, but as I'm the only one likely to ever encounter it, I've had it low on the TODO list.

Previuous investigations have revealed the cause: that by using gpio-poweroff in the setup.sh script (as part of the handshaking between Pi and Arduino) I've broken the normal shutdown process.

#Set GPIO27 to follow the running state: it's High while running and 0 when shutdown is complete. The Arduino will monitor this pin.
dtoverlay=gpio-poweroff,gpiopin=27,active_low

References:
https://forums.raspberrypi.com/viewtopic.php?t=143519
https://raspberrypi.stackexchange.com/questions/127947/pi-zero-doesnt-fully-shut-down-after-adding-a-gpio-poweroff-dtoverlay-to-boot

Yup, this is me:

"Use of this overlay (and the gpio-poweroff mechanism) required that there is an external mechanism to remove the power in response to the GPIO being toggled. Failure to do so within the allowed window (3 seconds is the default) results in a kernel warning, followed by undefined behaviour."




Today I've encountered the same kernel panic in another Pi-based project, and I commenced some fresh investigation into the issue, which has unearthed this apparent gem:

"Some approaches for a constant status led (ab)use the gpio-poweroff overlay which interrupts proper shutdown procedures, but gpio-led doesn’t."

So I'm experimenting with this as a replacement line:
dtoverlay=gpio-led,gpio=27,trigger=default-on,active_low

It won't be in 'vNext' (4.5.1) as I want to let it soak for QUITE a while in Dev before I let it loose on you.

More references:
https://raw.githubusercontent.com/raspberrypi/firmware/master/boot/overlays/README


- Greig.

@greiginsydney greiginsydney added the bug Something isn't working label Jan 29, 2023
@greiginsydney greiginsydney self-assigned this Jan 29, 2023
greiginsydney added a commit that referenced this issue Feb 14, 2023
greiginsydney added a commit that referenced this issue Feb 14, 2023
Fully(?) resolves issue #130 - subject to extended soak-testing.
@franioli
Copy link

franioli commented Jun 1, 2023

Hi Greig,
I am experiencing the same bug with intvlmt8r 4.5.2 (I am trying right now the new version 4.5.3).
I will try to update the setup.sh script uncommenting these lines of code and I will test it.

@greiginsydney
Copy link
Owner Author

Hi Francesco,

Please be VERY careful tinkering with any of the code that controls the power interaction between the Pi and the Arduino. Get that wrong and you risk bricking the intvlm8r - hence why i've been taking it very carefully.

This 'issue' isn't one anyone will encounter in the field - it only manifests on the bench, so I wouldn't be too concerned for it.

Having said that I'm happy to receive input and suggestions if you do invest some time into it.

- G.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants