kernel panic after shutdown
-
Pi Model: Zero 1.3
Power Supply used: official Raspberry Pi Power Supply
RetroPie Version: 4.5.1
Built From: Pre made SD Image on RetroPie website - retropie-4.5.1-rpi1_zero.img
USB Devices connected: Arduino leonardo used as gamepadWhen I shutdown through the menu I get e kernel panic after
Reached target Shutdown
.
The same thing happens when I hitsudo shutdown
on terminal and hangs there.
It doesn't happen if I hit reboot.
The message says
Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000000
Here is a picture of the screen.
I cannot provide logs because I don't have network access on my raspi.I tried another micro sd card with same results.
I was trying to power it with a powerbank before my first install and I had many power losses until I found out the cable was damaged. Could these power losses have damaged my pi?
Everything else is working fine (I think). What could this kernel panic mean? -
I found that this line
dtoverlay=gpio-poweroff:gpiopin=“22”,active_low="y"
in config.txt is responsible for that kernel panic. I read that other users have the same issue as well. Is this fixable? what is causing it? -
@roiko That's more of a question for the Raspberry Pi forums - it looks like a configuration for the GPIOs on the Pi to pull down the 22 Pin on board poweroff.
-
@roiko For what do you need this line? There are other solutions possible. Can you show me the guide that adviced you to add this? The usage of dtooverlays is a bit "unmodern" since there is system.d :)
-
@cyperghost said in kernel panic after shutdown:
The usage of dtooverlays is a bit "unmodern" since there is system.d :)
Not really, it's meant to modify the GPIO's behaviour on shutdown, not the other way around. I guess it's meant for a safe poweroff circuit that can detect - via the GPIO - that the OS is stopped.
-
@mitu I would rather put a file to system.d -- To be more exact to
/lib/systemd/system-shutdown/
from there you've full control over the GPIO.
To every script placed in the above directory a system-parameter is parsed. If the system parameter ispoweroff
then proceed with script and do something with the GPIO (set it low for example).I woule be your opinion if it's needed that the GPIO is set to high directly on power-on, but this parameter just tells to set GPIO low if the Pie shutdowns.
A bare form of the script would be....
#!/bin/bash [[ "$1" == "poweroff" ]] || exit poweroff_pin=22 echo $poweroff_pin > /sys/class/gpio/export echo out > /sys/class/gpio/gpio$poweroff_pin/direction echo 0 > /sys/class/gpio/gpio$poweroff_pin/value
You can also use python or wPi .... this would give you more and advanced features of course. I'm not sure if in @roiko's setup it is possible to easily export a pin just with bash.
-
This is indeed part of a safe shutdown circuit.
This pin needs to be HIGH while the raspberry pi is on and not change its state before shutdown process completes, because it drives the mosfet that provides power to the pi.
Thank you, I will try your script although I don't understand it.
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.