Skip to content

lib/cmsis: Upgrade to CMSIS 5.5.0. #4610

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

Closed
wants to merge 1 commit into from

Conversation

glennrub
Copy link
Contributor

Motivation for the PR is to facilitate for newer cortex-m architectures being candidates for micropython.
Also license seems to change from previous 4.3.0 to 5.4.0, from BSD 3 Clause to Apache 2.0.

@dpgeorge, could it be an option to move CMSIS to a git-submodule instead of having the files committed?

@dpgeorge
Copy link
Member

could it be an option to move CMSIS to a git-submodule instead of having the files committed?

Yes I think that's a good idea, considering that:

  • it's a large change, and future changes will also likely be large
  • less than half the ports use the CMSIS library (so many users can build and use uPy without this component)
  • license is changed, best to keep different licenses out of the source files actually kept in the repo, and users can use a different CMSIS if the license is not appropriate for them

Also, would be important to check and understand what changed in CM4 and CM7 headers (and maybe CM1, CM3), eg by checking how an stm32 board's firmware changes (if it does).

Upgrading CMSIS to version 5.5.0.

Deleting hard commited copy of CMSIS and replacing it by
submodule targeted lib/cmsis. Pointing submoudle to the
release 5.5.0 tag.

Source: https://github.com/ARM-software/CMSIS_5/releases/tag/5.5.0
@glennrub glennrub force-pushed the upgrade_cmsis_to_5.4.0 branch from af74c54 to fa086bb Compare March 19, 2019 15:17
@glennrub glennrub changed the title lib/cmsis: Upgrade to CMSIS 5.4.0. lib/cmsis: Upgrade to CMSIS 5.5.0. Mar 19, 2019
@glennrub
Copy link
Contributor Author

glennrub commented Mar 19, 2019

@dpgeorge, I have updated the PR to delete the hard coded copy of CMSIS Core and introduced a submodule that points to https://github.com/ARM-software/CMSIS_5, 5.5.0 tag. I found that CMSIS was updated yesterday, and its probably better to use as close as possible to head when updating. Also updated what i found of references to CMSIS includes in Makefiles in the repository.

Also, would be important to check and understand what changed in CM4 and CM7 headers (and maybe CM1, CM3), eg by checking how an stm32 board's firmware changes (if it does).

Yeah, i guess we need to do some kind of sanitycheck of firmware. I did not really plan myself to do any deep analysis of ASM, other than validating that its not having size impacts and that the targets run as expected. But if you would, we can probably take a deep down look at the details before/if we merge this.

My initial plan is to test the pca1000x + microbit target boards in nrf-port with and without BLE enabled. And verify that there are not size impacts on cortex-m0/m4 targets. I'm not having stm targets available though, so i would need some help testing those.

@dpgeorge
Copy link
Member

I have updated the PR to delete the hard coded copy of CMSIS Core and introduced a submodule that points to https://github.com/ARM-software/CMSIS_5, 5.5.0 tag.

Ok, thanks. It's definitely nice to point to ARM's repository for these files, but... that repo is about 300Mbyte in size, which is much larger than the MicroPython repo. The existing lib/cmsis dir is under 1Mbyte, so for ports that need CMSIS suddenly the required download and disk usage more than doubles.

If this size increase is deemed a problem, an option is to create our own copy of the CMSIS repo keeping only the files we need (files in CMSIS/Core, which total less than 2MByte). It's not much effort to do this so maybe worth it to save the bandwidth. Any opinions?

I'm not having stm targets available though, so i would need some help testing those.

I can test stm32 targets, no problem.

@glennrub
Copy link
Contributor Author

that repo is about 300Mbyte in size, which is much larger than the MicroPython repo.

I count more around 140MB, but that does not change the fact that it is huge. And your point of only using a fraction of this is valid. Maybe the first Commit wasn't to bad after all (af74c54). Could this still be a liable option, even if the license has changed?

@dpgeorge
Copy link
Member

I count more around 140MB, but that does not change the fact that it is huge.

The git metadata (found in .git/modules/lib/cmsis) is around 200MB and the actual code (in lib/cmsis) is 140MB so in total it's more than 300MB. I guess the git metadata is large because the history is long, the files are big, and there were lots of big changes in that repo.

In contrast, the stm32lib submodule has git metadata of 15MB and actual code size of 108MB. And the git metadata of the main uPy repo itself is around 35MB.

Maybe the first Commit wasn't to bad after all. Could this still be a liable option, even if the license has changed?

Yes, let's just go back to that, it's the simplest thing to do and has the least impact in the change of size. If users need the old version (for whatever reason) it's pretty easy to just have a separate directory (eg lib/cmsis_custom) and point to that instead of the standard one.

I can test stm32 targets

I have tested PYBV10 with this new CMSIS. The generated firmware is 4 bytes smaller and inspecting the disassembly there is a lot that's changed. But it seems superficial change, that chunks of code are reordered within a given function (eg a beq is changed to bne and its target blocks swapped) and loading of some memory addresses is also reordered.

Running tests with the new CMSIS, they all pass. Performance is the same. And all other boards for the stm32 port build without error. Also teensy and cc3200 build fine.

So I'd be happy to update it. But let's wait until after the next release, which should be very soon.

@dpgeorge
Copy link
Member

I created a new PR to update the files in-place to v5.5.1, see #4820

@dpgeorge
Copy link
Member

dpgeorge commented Jun 3, 2019

CMSIS was updated to 5.5.1 in 0a6c479

@dpgeorge dpgeorge closed this Jun 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy