-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
L4 integration: Add cmsis files for STM MCU series L4. #1888
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
It's great that the L4 series is working! But adding 50k lines of headers is a lot... you only need the L476 right? Maybe we can just add that one? |
Ok - sorry about that. I removed the not needed ones. I' ltry to reduce it to one commit. |
574684d
to
b91dab4
Compare
b91dab4
to
142a99d
Compare
Reduced to one commit. Only added necessary files. |
Couldn't these ST / CMSIS files be added as git submodules somehow? |
Maybe. It is getting a bit much to have 70k+ lines of extra code, most of which wil never be used by the majority of people cloning this repository. |
@tobbad I now have a Limifrog board with STM32L4 so I can test your code. I will get to it probably next week. Your code looks very clean, but the main outstanding issue is to decide how to handle the large CMSIS/HAL code drop. Probably a git submodule is the way to go. |
@dpgeorge: The code is actually for the the STM32L4-discovery of STM. The LimiFrog as less Flash (512MBye) and Xavier told me, that during the boot up of LimiFrog he has to do some special fixes:
|
I added a mechanism to allow board specific initializations to be used. Take a look at: The Makefile will automatically include all of the c files from the board directory: |
I added basic support for building LIMIFROG and deploy over stlinkk to my repo at https://github.com/tobbad/micropython/tree/limifrog_integration If you have a STLINK at hand (is on any discovery board) you can deploy the binary with: |
We should probably have stmhal/mpconfigport.mk setup defaults and allow the board specific mpconfigboard.mk files to override. |
7f587c0
to
0c97e4c
Compare
9167980
to
1cc81ed
Compare
Ok, I have tested this entire set of PRs. I have successfully built the limifrog_integration branch of @tobbad's fork (I know that one's not the very last one to merge, but it's close enough). I have a Limifrog board and I managed to download the firmware via DFU. And it works! @tobbad you have done a great job! I added Xavier's code to check for entering DFU mode, as described above. This way you don't need an ST-LINK debugger, the Limifrog acts just like a pyboard does. So I'd like to merge all of these PRs. I will gradually go through them and check them, squash some things, and clean up the commit messages. Regarding the CMSIS files and the ST HAL: after looking at it again I think the simplest thing is to just merge these new files straight into the repo. This keeps it simple (no submodules etc). And it doesn't add that much in terms of bytes: if we just include the cmsis/devinc/stm32l476.h file that's only an extra 750k compared to existing 12m in that directory; and the hal/l4 files total 3.1m, compared with existing 6.5m. I don't think it's worth going to a lot of fuss just to save 4meg from being added. If you have a differing opinion, please let it be known! |
Thank you for your kind feedback. We have nowadays terabyte storage in out desk/laptop and 10+ MByte/s connections to the internet. In my opinion time spent to lower the memory usage on micropython is better invested than time spend reducing the storage usage of the Repo. So I agree with your conclusions regarding HAL/CMSIS files. If you have any questions during the merge i will try to answer them as quick as possible. Limifrog_integration: I removed the special target and switched to the same memory layout as on pyb. With this layout you just can run the release version on the board. l4 debug: I had some issues with the tools for debugging this series. I did some fixes for stlink (use master/head) and if openocd does not want to download the debug code make a mass erase with st-flash. BTW: There are some example scripts for limifrog on https://github.com/tobbad/micropython_lib |
This PR merged in 2ba6677. Leaving the ticket open until it's all done. |
All PRs related to this L4 integration have now been merged. STM32L476DISC and LIMIFROG boards are now working. |
Improvements to Group
This is the 1st PR in a series of PR to support the STM32L4 series in micropython. (see http://forum.micropython.org/viewtopic.php?f=12&t=1332&sid=64e2f63af49643c3edee159171f4a365)
I add the cmsis files from STM32Cube_FW_L4_V1.3.0 with windows line ending converted to unix.