-
Notifications
You must be signed in to change notification settings - Fork 132
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
Add STM32C0x #1188
base: develop
Are you sure you want to change the base?
Add STM32C0x #1188
Conversation
You were just missing a dependency on |
I just created a commit very similar to 89d75c1, but was 30 seconds too late pushing it here 😆 |
Many thanks for your great help @salkinium and @rleh !! |
I was kinda wondering why RCC even gets pulled in for your minimal example, and for some reason the
So I defined them in the main.cpp file as a hack, just to get you unblocked for blinky. Would probably still be good to have the RCC module to go up to 48MHz and not stay at 16MHz boot frequency. |
Quite thanks for your quick and helpful suggestions!! But you're to fast for me or I'm to slow/untalented. In between I got blinky compiled well but I'm still to unfamiliar with modm and go by the docs step by step.
Yes sure! Once I get code running on it, I will try to fix the RCC issues. I also need to adapt the modules/driver for timer, uart, ADC, because my PCB needs them ;-) Also quite thanks for hinting me to the dependency SVG. Already built one before (during work through the docs), but was shocked in the first view :-) ... but I'm pretty sure once I get it running, it will be helpful!! |
Did you close this on purpose? If you want to add more changes to the PR, just push more commits to the branch, the PR will update automatically. |
Yes ;-) due to frustration... |
Okay, hard time but more clever now :-) ... or more hacky :-/
As I did not know anything about modm before, I'm pretty sure that I did it somehow wrong at some places. Some questions popped up during coding:
|
properties["bdcr"] = "CSR" if target.family in ["l0", "l1"] else "BDCR" | ||
properties["pll_ids"] = ["1", "2", "3"] if target.family in ["h7", "u5"] else [""] | ||
properties["bdcr"] = "CSR1" if target.family in ["c0"] else "CSR" if target.family in ["l0", "l1"] else "BDCR" | ||
properties["pll_ids"] = ["1", "2", "3"] if target.family in ["h7", "u5"] else [] if target.family in ["c0"] else [""] |
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.
"c0" requires an empty array for not walking through %% for id in pll_ids
in rcc.cpp.in.
Is [""] a correct option?
Reverted a couple of previous RCC hacks (like hsi48) because I felt they're wrong. Added a custom-board.hpp to the blinky sample because I had the impression that SysClock need to be enabled/activated as ref-docs say boot frequency is HSI (48MHz) divided by 4 which is 12MHz. But failed in RCC with PLL definitions because I'm to unknown. Blinky is running with a 2 second delay (instead of 0.5s), which seem to be the 1/2 boot frequency of 48MHz. Would be nice if someone can give me a hint ;-) |
I'll have a look next week in more detail when I'm on holiday, under the week I'm typically too mentally exhausted from work. |
In between I did some tries with STM32CubeMX together with STM32-VScode extension. This is not an option for me 👎 With this I can go on trying to get into my project and use modm for it 👍 So @salkinium, enjoy your holiday by reading a book or doing something funny, but don't with coding. My issue has time for somewhen after holiday! |
I ordered a NUCLEO-C031C6 dev board, will probably end of week. I also found a super cheap (~1.5CHF) STM32C011 barebone dev board on aliexpress, but that'll arrive later. |
Oh no, don't waste money for my dev issues. Edit: |
It's more to have a device to run the modm unit tests on. The nucleo boards are super cheap, and I need at least one device per family anyways. |
ba80648
to
275c0ab
Compare
Sorry for the delay, I've ported your examples to the NUCLEO-C031C6 board and they all work! Congrats and thanks for porting modm to STM32C0. I'll do my review directly in form of commits, it's just way faster this way. Sorry for force pushing to your branch, it's just simpler that way. |
275c0ab
to
0d67ea4
Compare
Add STM32C0x Summary:
In relation to #1187, I tried to add STM32C011F6P6 support for a custom PCB.
Well, somehow hard for an ungifted to jump into the internals, who's intention was to use modm for his project ;-)
However, can't become more dumb by trying :-)
Unfortunately I got stuck after a couple of lines and don't know if I missed something to hack in modm or if I made something wrong with my minimal blink example :-/
If I chose a supported MCU it compiles well, but all supported MCU's I found, do also have a board, so...
This is what I get now:
Any hints are welcome ;-)