power_panic: Add settling delay to AC fault startup check - #5254
Conversation
|
Noting for clarity on versioning: I'm aware I targeted |
|
Follow-up on hardware verification status: Rebuilt against the correct Confirmed Local flash on the Core One L was blocked by bootloader signature enforcement (error #35606), as expected for a build signed with zeros. I understand the documented unlock path is to break the appendix seal on the xBuddy PCB, which is a permanent physical modification. Holding off on that step (I JUST got this printer and am trying to help fix this error screen I get every once in a while...but I'm not itching to jump to full "hack the printer" mode) pending any signal from maintainers — happy to do it if you'd like pre-merge confirmation from the exhibiting hardware, otherwise I'll wait for your signed build pipeline to produce a testable artifact. |
The AC power monitoring circuit may transiently assert fault during power-on before stabilizing. The single-read check in check_ac_fault_at_startup() triggers ERR_ELECTRO_ACF_AT_INIT on these transients, requiring multiple resets to boot successfully. Add a retry loop (5x 200ms) that tolerates brief transients while still catching genuine persistent faults. The IWDG watchdog is not yet running at this point in boot, so the delay carries no watchdog risk. The ac_fault_isr() provides ongoing protection after boot.
0e519af to
d8c009a
Compare
Fixes #5253
Summary
Adds a 1-second settling-delay retry loop to
check_ac_fault_at_startup()to tolerate transient AC fault signals during power-on. See #5253 for the full analysis (Pull::up removal inc9b365bc4, expansion to all printers in0050cb43a, floating-pin theory, and the alternative hardware fix of restoringPull::up).Change
void check_ac_fault_at_startup() { + // Retry with settling delay: the AC power monitoring circuit + // may transiently assert fault during power-on. Genuine faults + // persist; transients clear within the retry window. + for (int i = 0; i < 5 && power_panic::is_ac_fault_active(); ++i) { + delay_ms(200); + } if (power_panic::is_ac_fault_active()) { fatal_error(ErrCode::ERR_ELECTRO_ACF_AT_INIT); } ac_fault_enabled = true; }+6 lines. Uses
delay_ms()fromtiming.h— already included in this file at line 67, consistent withdelay_us_precise()already used at line 798. Busy-wait, no FreeRTOS scheduler dependency.Safety
setup()), so the delay carries no watchdog risk.ac_fault_isr()provides ongoing protection after boot — the startup check only matters for faults already asserted at boot.ac_fault_enabled = trueexists in the original code too; not a regression.Testing
Built cleanly for COREONE target at master HEAD. Hardware verification pending — the exhibiting unit runs
6.5.3+12780and a localv6.5.3build failed due to the bootstrap toolchain's Intel-only binary not resolving on Apple Silicon. Will follow up with a result once built on x86 hardware.Secondary observation:
utils/build.py's bootstrap toolchain doesn't support Apple Silicon natively. Happy to file a separate issue if useful.Alternative noted in issue
A hardware-level fix (restoring
Pull::upon theacFaultpin) may be more correct than software debounce. That decision depends on the AC monitoring circuit's output stage, which I can't determine from firmware alone. Deferring to your team — happy to close this PR and re-do it as a pindef change if that's preferred.