-
Notifications
You must be signed in to change notification settings - Fork 159
Start RCC update to use ClockHelper v2.0 data #744
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
Conversation
…nto new_rcc marge generate.zig with other HALs
|
Note on recursive expressions: After analyzing the latest bug fix during unit testing for U575, I noticed that some expressions are not actually recursive. What happens is that the reference name ends up being the same as the node name, resulting in confusion during code generation. Hopefully, by fixing this problem, support for F7/WB/N6 and MP will be restored. |
- nuke recursive expr (fix compilation error on STMM/F7/N/W clocktrees) - add STM32G061 Unit test - remove unused files from STM32F103
|
Just one more small detail: translate flags to booleans instead of optional in out.config And separate configurations in out.config into Advanced, Normal, and Flags, just like the configuration. |
|
@RecursiveError i see that there is a massive diff for this PR. Let's put data files in their own repo, what should I call it? |
Or could we generate them instead and not check in the file? |
|
@mattnite Well, they actually already have their own repository. This module is basically a copy of it, because I didn’t want to introduce an external dependency. That said, if the idea is to create one under the org, I originally named it something generic like “ClockHelper”, so I think that name could work. (I do like the name CubeMZ, but I admit it’s kind of a stretch for just clock configuration 😄) I agree that keeping it as a separate repo makes more sense anyway — there are still going to be a lot of updates coming. I mainly need feedback at this stage to know what should be changed. |
…oolean and Removed unnecessary extra info from the MCU.
Co-authored-by: Mathieu Suen <[email protected]>
|
Let me know if you need help solving the conflict. I have change the hal.zig file. and move it back to the STM32F103.zig file. That might be the source of it. |
|
The clockhelper is ready for now. @mattnite Regarding separating the data files into their own repository, do you have any ideas in mind? I intended to just add the original repository as a dependency of this module and pass hal_imports as an argument in the init() function of chips.zig. |
|
@RecursiveError I think the best way to split it up would be to incorporate the |
|
@mattnite That makes sense. I can modify the code generator to emit individual clock trees, or even a small set on the fly, instead of producing everything upfront. What I’m still not fully clear on is how the pieces are expected to be wired together: Understanding that interface/flow will help me align the generator with the intended architecture. |
I have no clear idea too but I guess once this is merge we can start pushing more RCC related work to the common folder. And I got the feeling that clocks is core components for HAL so it would really improve STM32 HAL. :) |
|
@RecursiveError I'm going to be diving into this patch further tomorrow so I can better determine what the interface should be. |
|
@RecursiveError I have some ideas. First off, we have something workable, the main reason I want to structure things differently is so that generated code, with potentially very large changes every once in a while is something I'd like to keep in separate repos. One exception of note is the Chips.zig file for our stm32 port, I don't think there's a way around that one. I've created a repo for you: https://github.com/ZigEmbeddedGroup/ClockHelper, essentially what I want you to do is move everything under stm32-clocks there. From what I understand, we should have a very clean interface which is very similar to how things work currently: a single From my understanding of this single module, it has all the clock trees for all the chips, and we currently select which one by chip name at comptime using a mapping function. This should provide a great starting point that we can iterate on. Thank you for all this amazing work, and putting even more effort into integrating it with MicroZig. |
I don't have permission to make the initial commit to the repo :( |
|
@RecursiveError fixed, made you a maintainer and pushed an init commit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔍 Lint Results
Found 2 issues on changed lines in 2 files:
- port/stmicro/stm32/src/hals/STM32F103/mcu_trees.zig: 1 issue
- port/stmicro/stm32/src/hals/STM32F103/rcc.zig: 1 issue
ℹ️ Additional issues on unchanged lines
The following 19 issue(s) exist but are not on lines changed in this PR:
examples/stmicro/stm32/src/stm32f1xx/rtc.zig:24: TODO style comments need to have a linked microzig issue on the same line.
examples/stmicro/stm32/src/stm32f1xx/timer_capture.zig:1: TODO style comments need to have a linked microzig issue on the same line.
examples/stmicro/stm32/src/stm32f1xx/usb_cdc.zig:1: TODO style comments need to have a linked microzig issue on the same line.
examples/stmicro/stm32/src/stm32f1xx/usb_cdc.zig:2: TODO style comments need to have a linked microzig issue on the same line.
examples/stmicro/stm32/src/stm32f1xx/usb_cdc.zig:210: TODO style comments need to have a linked microzig issue on the same line.
examples/stmicro/stm32/src/stm32f1xx/usb_cdc.zig:438: TODO style comments need to have a linked microzig issue on the same line.
examples/stmicro/stm32/src/stm32f1xx/usb_hid.zig:1: TODO style comments need to have a linked microzig issue on the same line.
examples/stmicro/stm32/src/stm32f1xx/usb_hid.zig:2: TODO style comments need to have a linked microzig issue on the same line.
examples/stmicro/stm32/src/stm32f1xx/usb_hid.zig:154: TODO style comments need to have a linked microzig issue on the same line.
examples/stmicro/stm32/src/stm32f1xx/usb_hid.zig:246: TODO style comments need to have a linked microzig issue on the same line.
examples/stmicro/stm32/src/stm32f1xx/usb_hid.zig:277: TODO style comments need to have a linked microzig issue on the same line.
port/stmicro/stm32/src/generate.zig:256: TODO style comments need to have a linked microzig issue on the same line.
port/stmicro/stm32/src/hals/STM32F103/rcc.zig:2: TODO style comments need to have a linked microzig issue on the same line.
port/stmicro/stm32/src/hals/STM32F103/rcc.zig:100: TODO style comments need to have a linked microzig issue on the same line.
port/stmicro/stm32/src/hals/STM32F103/rcc.zig:102: TODO style comments need to have a linked microzig issue on the same line.
port/stmicro/stm32/src/hals/STM32F103/rcc.zig:309: TODO style comments need to have a linked microzig issue on the same line.
port/stmicro/stm32/src/hals/STM32F103/rcc.zig:430: TODO style comments need to have a linked microzig issue on the same line.
port/stmicro/stm32/src/hals/STM32F103/rcc.zig:552: TODO style comments need to have a linked microzig issue on the same line.
port/stmicro/stm32/src/hals/STM32F103/rcc.zig:568: TODO style comments need to have a linked microzig issue on the same line.
| @@ -0,0 +1,134 @@ | |||
| //TODO: find a better way to select and configure the clock tree for each MCU | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO style comments need to have a linked microzig issue on the same line.
| @@ -1,23 +1,20 @@ | |||
| //NOTE: this file is only valid for densities: Low, Medium, High, and XL. Connectivity line devices are not supported in this version. | |||
| //NOTE: this file is only valid for densities: Low, Medium and High. Connectivity/XL line devices are not supported in this version. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO style comments need to have a linked microzig issue on the same line.
Updating with new lint results
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔍 Lint Results
Found 1 issue on changed lines in 1 file:
- port/stmicro/stm32/src/hals/STM32F103/rcc.zig: 1 issue
ℹ️ Additional issues on unchanged lines
The following 19 issue(s) exist but are not on lines changed in this PR:
examples/stmicro/stm32/src/stm32f1xx/rtc.zig:24: TODO style comments need to have a linked microzig issue on the same line.
examples/stmicro/stm32/src/stm32f1xx/timer_capture.zig:1: TODO style comments need to have a linked microzig issue on the same line.
examples/stmicro/stm32/src/stm32f1xx/usb_cdc.zig:1: TODO style comments need to have a linked microzig issue on the same line.
examples/stmicro/stm32/src/stm32f1xx/usb_cdc.zig:2: TODO style comments need to have a linked microzig issue on the same line.
examples/stmicro/stm32/src/stm32f1xx/usb_cdc.zig:210: TODO style comments need to have a linked microzig issue on the same line.
examples/stmicro/stm32/src/stm32f1xx/usb_cdc.zig:438: TODO style comments need to have a linked microzig issue on the same line.
examples/stmicro/stm32/src/stm32f1xx/usb_hid.zig:1: TODO style comments need to have a linked microzig issue on the same line.
examples/stmicro/stm32/src/stm32f1xx/usb_hid.zig:2: TODO style comments need to have a linked microzig issue on the same line.
examples/stmicro/stm32/src/stm32f1xx/usb_hid.zig:154: TODO style comments need to have a linked microzig issue on the same line.
examples/stmicro/stm32/src/stm32f1xx/usb_hid.zig:246: TODO style comments need to have a linked microzig issue on the same line.
examples/stmicro/stm32/src/stm32f1xx/usb_hid.zig:277: TODO style comments need to have a linked microzig issue on the same line.
port/stmicro/stm32/src/generate.zig:256: TODO style comments need to have a linked microzig issue on the same line.
port/stmicro/stm32/src/hals/STM32F103/rcc.zig:2: TODO style comments need to have a linked microzig issue on the same line.
port/stmicro/stm32/src/hals/STM32F103/rcc.zig:100: TODO style comments need to have a linked microzig issue on the same line.
port/stmicro/stm32/src/hals/STM32F103/rcc.zig:102: TODO style comments need to have a linked microzig issue on the same line.
port/stmicro/stm32/src/hals/STM32F103/rcc.zig:309: TODO style comments need to have a linked microzig issue on the same line.
port/stmicro/stm32/src/hals/STM32F103/rcc.zig:430: TODO style comments need to have a linked microzig issue on the same line.
port/stmicro/stm32/src/hals/STM32F103/rcc.zig:552: TODO style comments need to have a linked microzig issue on the same line.
port/stmicro/stm32/src/hals/STM32F103/rcc.zig:568: TODO style comments need to have a linked microzig issue on the same line.
Note: This is not the final version; renames and configuration corrections are still planned.
Includes tests for the following microcontrollers (tests are also valid for all microcontrollers in the same sub-family):