-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Conditional booting based POWER Led level #1053
Comments
I've not tried it, but there may be a way using a Try adding this (untested) section to config.txt:
Reboot, then run Assuming this works, whether it can be used to achieve what you want depends on what your goal is. |
I was aware of the conditional filter for GPIO and had already tried something like:
However, that didn't work (device boots regardless of pin value) and was wondering if there was something I was missing. P.S |
Did you try my suggestion to test whether the filter is working? |
Running: Power LED ON during boot
Power LED OFF during boot
|
OK, thanks - it looks thoroughly broken. |
You mean it needs fixing or it is not possible? |
The gpio filter could conceivably be fixed (until we find the problem I can't promise anything), but I don't see how a fixed-length delay is going to do anything useful for you unless your configuration guarantees to have power eventually. |
A delay is necessary in our case as we are building up power gradually and when devices are connected on the USB hub it fails to reach the necessary 5V. So we added a static delay to let our system build up its necessary power |
I had 2 minutes with the debugger up. |
I was expecting that to be the case for the first pass, but the dtoverlay parsing is done in a second, later pass using (I thought) the same rules. |
OK, I'll check again tomorrow. |
Actually I had seen this whilst debugging. The gpio expander open error path via gpioman is flawed and leaves it thinking the expander is open & initialised when it isn't. Fixing that may mean that it initialises correctly on that second pass. |
That's definitely the problem area, but the error path is never used because the incomplete configuration selects the dummy driver which always succeeds. It needs either a way to reset the erroneous latched state or a way of deferring the choice of driver until the configuration is complete. |
I'm getting the correct driver selected, but it then checks SMPS traits and doesn't fail if neither are selected, just leaving things in a bad state. It is worth noting that the SoC is pulling very little power at the point that config.txt is parsed, so I had to drop the voltage significantly further than expected. |
2ndstage: Increase eth_open timeout to 5 seconds See: #1041 firmware: video_encode: Use default values on invalid nStride or nSliceHeight See: #1051 firmware: gpioman/FXL6408: Handle open failing sensibly See: #1053 firmware: Delay backlight coming on See: #1052 firmware: LCD driver close fixes 2ndstage: ignore autoboot.txt if boot partition is already set See: raspberrypi/noobs#508
2ndstage: Increase eth_open timeout to 5 seconds See: raspberrypi/firmware#1041 firmware: video_encode: Use default values on invalid nStride or nSliceHeight See: raspberrypi/firmware#1051 firmware: gpioman/FXL6408: Handle open failing sensibly See: raspberrypi/firmware#1053 firmware: Delay backlight coming on See: raspberrypi/firmware#1052 firmware: LCD driver close fixes 2ndstage: ignore autoboot.txt if boot partition is already set See: raspberrypi/noobs#508
Fix should be in latest rpi-update firmware. |
@akarapatis Please test and report back. |
Just to confirm, are you on a 3B+, or a 3B? It makes a big difference. |
uname -r returns Running: Power LED OFF during boot
Power LED ON during boot
|
@6by9 I checked again the 2 scenarios. Also I am running it on 3B |
[ I think you would get rid of the overlay errors if you named the overlays "*.dtbo", like all the rest. ] |
In addition, my config.txt contains
It was the config.txt suggested to see whether the POWER LED pin is read or not |
That all looks fine. It does appear that the logic is inverted, so |
@6by9 Forgive me about the original post. I thought I had tested it properly. Indeed it seems inverted. However, one more question: so my config.txt now looks
|
It looks like it is just the order that things are parsed. As I think Phil had said, things are done in phases, and I think the dtoverlay phase that we were using as a canary is done later than the boot_delay (which is pretty early on).
is part of vc4-kms-v3d-overlay.dts to select an increased CMA heap. |
@6by9 Thank you for help. Indeed it seemed that boot_delay was evaluated before the conditional booting. However, if we edit the overlay this might be overwritten by an update and if we create a new one we need to keep updating it ourselves. In any case, it is very helpful |
I was suggesting creating your own overlay, eg boot-delay-overlay.dts. Whilst there is a chance that someone else will create an overlay with the same name which could overwrite yours, the likelihood is very low. None of the update mechanisms should ever delete overlays they don't know about. |
You can always submit your overlay to be added to the standard kernel. I would suggest making it a generic
This would be more generally useful, and would get around the need for any string manipulation (which overlays can't do). |
I guess this issue can close. Thank you for fixing the bug and helping me finding a solution. |
For Rpi-3B, is it possible to define conditional booting based on POWER Led level ?
I know that the POWER Led is connected to GPIO port expander on i2c-0 and that you can read it from
/sys/devices/platform/leds/leds/led1
.But is there a way to use it in config.txt ?
If not, what would you suggest? ( E.g. modify bootloader)
References
The text was updated successfully, but these errors were encountered: