You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "tinnedkarma (via GitHub)" <gi...@apache.org> on 2026/01/17 00:05:08 UTC
[PR] stm32h7/clk: work in progress [nuttx]
tinnedkarma opened a new pull request, #17978:
URL: https://github.com/apache/nuttx/pull/17978
## Summary
Some time ago I've learned about the nuttx's clk framework. My work being mostly on stm32h7 mcu's I've some nucleo boards to spare.
I've worked in my space time on moving the reset and clock configuration to this clk framework.
It is starting to get some shape although I'm kinda worried that is not really the "embedded" way of doing things.
It uses more (by 100% some can say) ram usage to store the clk structs, the clk file part of the procfs needs 10kb ram just to generate the output buffer.
That being said, there are lot's of reasons to use this approach, at least of this beefy stm32h7 mcu family.
It simplifies a lot the clock interaction
I'll keep this in draft to see if there is any use of these changes. Anyone is free, or encouraged, to have a look over this changes, although lots of things still missing, the stm32_rcc.c file is close to something final.
## Impact
Should be considered **breaking change**.
Lot's of things will differ.
* The previous clock configuration was done in the *board.h* while the initialization was done in some *stm32_clkconfig* function.
* usart driver will be reworked to adapt the new clk config.
* timers?? not yet there but most probably there should be changes as well.
* small changes thru ought the stm3h7 family will be touched
## Testing
This is still work in progress, so, not many tests, other than the development lifecycle
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] stm32h7/clk: work in progress [nuttx]
Posted by "tinnedkarma (via GitHub)" <gi...@apache.org>.
tinnedkarma commented on code in PR #17978:
URL: https://github.com/apache/nuttx/pull/17978#discussion_r2705680261
##########
drivers/clk/clk_divider.c:
##########
@@ -244,10 +244,11 @@ static uint32_t clk_divider_bestdiv(FAR struct clk_s *clk, uint32_t rate,
}
mindiv = 0;
- if (divider->flags & CLK_DIVIDER_MINDIV_MSK)
+ if ((divider->flags & CLK_DIVIDER_MINDIV_MSK) &&
Review Comment:
Hello @xiaoxiang781216, thank you for your input.
I do not intend to merge it as is. At the moment I'm not sure it's worth merging at all.
I just opened this PR to "test the waters", see how much attention the nuttx clk framework will draw, to be honest.
There are some important thing I still need to figure out before I start splitting into more PRs, hopefully I find some time to document them in the PR description as well.
I am struggling with the initialization sequence, the clk framework needs memory allocation, so the clk init is delayed to nx_start, but a lot of things happens around the stm32 rcc before nx_start. As with my current progress I am sure I'll find a lot of other things that might be tricky to solve, hence the reason of opening this PR really early in the development. Maybe there is some progress done by someone else that might have some useful hints.
That said, I'll track my progress in the PR description. Maybe Issue would be a better approach, but it hides the code, which I kinda want to be upfront.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] stm32h7/clk: work in progress [nuttx]
Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #17978:
URL: https://github.com/apache/nuttx/pull/17978#discussion_r2700606834
##########
drivers/clk/clk_divider.c:
##########
@@ -244,10 +244,11 @@ static uint32_t clk_divider_bestdiv(FAR struct clk_s *clk, uint32_t rate,
}
mindiv = 0;
- if (divider->flags & CLK_DIVIDER_MINDIV_MSK)
+ if ((divider->flags & CLK_DIVIDER_MINDIV_MSK) &&
Review Comment:
it's better to move clock framework self change to new pr
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] stm32h7/clk: work in progress [nuttx]
Posted by "tinnedkarma (via GitHub)" <gi...@apache.org>.
tinnedkarma closed pull request #17978: stm32h7/clk: work in progress
URL: https://github.com/apache/nuttx/pull/17978
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org