-
Notifications
You must be signed in to change notification settings - Fork 2k
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
pkg/stm32cmsis: retrieve STM32 CMSIS header from a package #14152
Conversation
My worry is that this is pulled in for every application. Now an easy hack would be to make stm32cube a 'tool', but maybe we can add a global package cache (i.e. don't store them in |
Exactly what I said but less clear.
Sound reasonable. I can try that approach.
I think that this would make the most sense but that might not work for the packages built with their own build system (openthread and maybe some others). |
I like the idea, it will be much easier to maintain and add new cpu/boards. I think a global package cache would be great for all packages. Another solution might be to use git submodules, so it's downloaded only once, globally. I'm not sure if it's possible though. |
Using the |
+84 −708,552 😄 |
It seems like Murdock doesn't like it :) |
I just pushed a major update of this PR: now each repo is not targetting I'll have to edit the commit messages when I'll squash to rename stm32cube to stm32cmsis there as well. Regarding the caching directory, I kept it even if the download is faster because I still think it's handy to not clone the repo all the time. It's disabled on the CI because of incompatibilities with Murdock. |
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.
I like this a lot!
Tried to build some boards locally and it all went smooth.
Let's see what Murdock thinks of it when it's back to normal operation.
This adds ~1.5g (from ~0.5g) to git-cache, making git hit scaling issues. please don't build for now! |
I guess we could just use |
That would make my life easier indeed :) Do you have that board for testing ? |
I think this CPU has existed (it's mentioned on the ST website) so probably it could be in an old version of the STM32 Cube. I'll add a specific handling for this one in the patch |
by default stm32f0/l0/l1 families simply call the interrupt enum SVC_IRQn
49e4b49
to
c59f4af
Compare
Yea, at that price I couldn't pass on it :) |
Off-topic: they propose other interesting platforms (8bit STMs :) ) |
I triggered this one twice on Murdock and got no failures. It seems to be ~2 minutes slower. Some detailed numbers:
So in total, it adds 9h10m. |
offline discussion: seems like a lot. I'll run some benchmarks to pinpoint where that comes from. |
So I ran an isolated Murdock run (on breeze, a 16core Ryzen box) building for iotlab-m3 and nucleo-f401re, this PR and its merge base. I built each twice, one time with cleared ccache, then again. It looks good. the cold cache build (which probably triggered an initial download of the necessary headers into git-cache, which blocks other cores that need the same) took 5:37 vs 5:17 minutes pr/master, with hot caches (and the header repos in git-cache) took 2:52 vs 2:47, which is within measurement accuracy. So let's go, I guess we won't miss those 700k lines much :) Nice job @aabadie! |
ACK. |
For reference, here's the output of the test runs: master: https://gist.github.com/81dd9278aff04fcfc0d4b3b6b7ffe749 |
Contribution description
This PR is a POC that adds stm32cube repositories as a single external package (example: the F4 repository). Each stm32cube repository contains all the CMSIS headers of each STM32 families (for F4 it's in "Drivers/CMSIS/Device/ST/STM32F4xx/Include").
The stm32cube package is only used for fetching the headers automatically when building an application targetting an STM32 microcontroller. Thus, this PR also removes all STM32 vendor headers from the codebase.
Not everything is perfect, there are pros and cons:
pros:
68 additions and 708,552 deletions.
cons:
I think the pros are very important and here are some ideas I have to mitigate a bit the cons. All of them try to fetch the stm32cube only once in a single location. This way, only the very first build of an application will fetch the stm32cube code (for a given family), the next builds will just reuse the already downloaded headers.
cpu/stm32/include/vendor
. The package will also contains some logic to prevent the fetch if the vendors headers are already there or maybe if a lock file is already there and contains the same version.cpu/stm32/stm32cube.inc.mk
and don't use the usual package mechanism.There might be other solutions I haven't thought of so any suggestion is very welcome.
If you think that this PR is useless or that the cons are too much a pain. Then we can close this and continue the usual STM32 way.
Testing procedure
Issues/PRs references
Based on #14144