pic32cz fixes: better reset clock and uart restoration - #843
Open
rizlik wants to merge 3 commits into
Open
Conversation
rizlik
force-pushed
the
pic32cz_fixes
branch
2 times, most recently
from
August 4, 2026 15:11
84a9815 to
1d647a4
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Improves PIC32CZ boot handoff behavior by deinitializing the debug UART before clock reset, adding a small PLL regulator settle delay and restoration logic, and adjusting the default wolfHSM PIC32CZ port path configuration.
Changes:
- Add
uart_deinit()for PIC32CZ SERCOM1 UART and call it beforepic32_clock_reset()when preparing to boot. - Track whether the SUPC PLL regulator was already enabled at reset, add a settle delay after enabling it, and restore the regulator state before boot.
- Change
WOLFHSM_MICROCHIP_PIC32CZfrom a required setting to a defaulted value inarch.mk.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| hal/uart/uart_drv_pic32cz.c | Adds UART deinitialization to drain TX, disable/reset SERCOM, and release pin muxing before clock reset. |
| hal/pic32cz.c | Tracks PLL regulator initial state, adds a settle delay after enabling it, deinitializes UART before clock reset, and restores PLL regulator state. |
| arch.mk | Defaults the wolfHSM PIC32CZ port path variable instead of hard-erroring when unset. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
28
to
31
| #ifdef DEBUG_UART | ||
| #include "uart_drv.h" | ||
| void uart_deinit(void); | ||
| #endif |
Comment on lines
290
to
292
| ifeq ($(WOLFHSM_CLIENT),1) | ||
| ifeq ($(WOLFHSM_MICROCHIP_PIC32CZ),) | ||
| $(error WOLFHSM_MICROCHIP_PIC32CZ is not set: point it at the wolfHSM \ | ||
| PIC32CZ client port directory (the one containing port/)) | ||
| endif | ||
| WOLFHSM_MICROCHIP_PIC32CZ ?= .. | ||
|
|
danielinux
requested changes
Aug 4, 2026
danielinux
approved these changes
Aug 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.