STM32F103 Small APIS and changes#639
Merged
mattnite merged 16 commits intoZigEmbeddedGroup:mainfrom Aug 26, 2025
Merged
Conversation
Collaborator
|
That’s very strange. Can you explain that in a comment?
Thanks,
G
…On Tue, Aug 5, 2025 at 11:20 PM Guilherme S. Schultz < ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In port/stmicro/stm32/src/hals/STM32F103/rcc.zig
<#639 (comment)>
:
> @@ -506,6 +531,14 @@ pub fn disable_all_clocks() void {
rcc.APB1ENR.raw = 0;
rcc.APB2ENR.raw = 0;
}
+
+/// Reset all clocks to their default state
+pub fn reset_all_clocks() void {
+ rcc.APB2RSTR.raw = std.math.maxInt(u32);
It has "FORCE_RESET()" for each peripheral + the bus that sets everything
to 1, and 10 lines later it has "RELEASE_RESET() that returns it to 0.
I didn't understand why they are separate functions exactly, since both
are used in sequence without any kind of delay in between, But anyway, you
have to write 0, otherwise the peripheral will be locked indefinitely.
—
Reply to this email directly, view it on GitHub
<#639 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADZNHWO26NRHQ4CFBJ26XT3MFYANAVCNFSM6AAAAACDDOJ2COVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTAOJQGI4TMMZVHA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Collaborator
Author
|
Ok no problem, it's really a strange behavior, so much that the first
version of "disable_clock()" just wrote 1 to the RTSR, which actually
stopped the peripheral...The problem is that afterwards the peripheral did
not return at all.
… *Grazfather* left a comment (ZigEmbeddedGroup/microzig#639)
<#639 (comment)>
That’s very strange. Can you explain that in a comment?
Thanks,
G
On Tue, Aug 5, 2025 at 11:20 PM Guilherme S. Schultz <
***@***.***> wrote:
> ***@***.**** commented on this pull request.
> ------------------------------
>
> In port/stmicro/stm32/src/hals/STM32F103/rcc.zig
> <
#639 (comment)>
> :
>
> > @@ -506,6 +531,14 @@ pub fn disable_all_clocks() void {
> rcc.APB1ENR.raw = 0;
> rcc.APB2ENR.raw = 0;
> }
> +
> +/// Reset all clocks to their default state
> +pub fn reset_all_clocks() void {
> + rcc.APB2RSTR.raw = std.math.maxInt(u32);
>
> It has "FORCE_RESET()" for each peripheral + the bus that sets
everything
> to 1, and 10 lines later it has "RELEASE_RESET() that returns it to 0.
>
> I didn't understand why they are separate functions exactly, since both
> are used in sequence without any kind of delay in between, But anyway,
you
> have to write 0, otherwise the peripheral will be locked indefinitely.
>
> —
> Reply to this email directly, view it on GitHub
> <
#639 (comment)>,
> or unsubscribe
> <
https://github.com/notifications/unsubscribe-auth/AADZNHWO26NRHQ4CFBJ26XT3MFYANAVCNFSM6AAAAACDDOJ2COVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTAOJQGI4TMMZVHA>
> .
> You are receiving this because you commented.Message ID:
> ***@***.***>
>
—
Reply to this email directly, view it on GitHub
<#639 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/APT5DPEUAZXCL4XWT2NA4BT3MFYLLAVCNFSM6AAAAACDDOJ2COVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTCNJXGI3TIOJSGE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
mattnite
approved these changes
Aug 26, 2025
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.
Add support for small APIs such as:
And small bug fixes and typo corrections: