Skip to content
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

how to rebuild libmbed-os.a #279

Closed
paulvha opened this issue Oct 7, 2020 · 5 comments
Closed

how to rebuild libmbed-os.a #279

paulvha opened this issue Oct 7, 2020 · 5 comments

Comments

@paulvha
Copy link
Contributor

paulvha commented Oct 7, 2020

Much of the kernel code (for good reason) is stored in a static library {build.variant.path}/mbed/libmbed-os.a. I am studying the library code and want to check some changes. However even if I change the source code, it will not be taken into effect as the compiler (instructed in platform.txt) is using the library. How can I rebuild the libmbed-os.a from the changed source code?

regards,
Paul

@oclyke
Copy link
Contributor

oclyke commented Oct 7, 2020

Great question!
Check out the CI / GitHub Action here:
generate-variants.yaml

That's a hint... It relies on another GitHub action to run a few arbitrary mbed build jobs. If you check out the arguments passed in you can see that the mbed command to build a static library is:
mbed compile --library --source=mbed-os -m ${YOUR_TARGET_BOARD} -t ${YOUR_TOOLCHAIN}
(your toolchain would most likely be GCC_ARM, and your target board would be one of the variant folder names e.g. SFE_ARTEMIS for the RedBoard Artemis, SFE_ARTEMIS_DK for the Artemis Dev Kit and so on)

This means you will need to get mbed installed w/ a gcc toolchain. Here's a little more info about that:
https://learn.sparkfun.com/tutorials/artemis-development-on-arm-mbed-os-betaw

@paulvha
Copy link
Contributor Author

paulvha commented Oct 7, 2020

Thanks for the information.
regards
Paul

@Wenn0101
Copy link
Contributor

Wenn0101 commented Oct 7, 2020

I wanted to add. You want to use the ambiq-apollo3-arduino branch when doing this. The latest version of mbed changed some namespaces and the arduinoBLE has not yet been updated to match these changes. This branch is based on an older version of mbed.

@paulvha
Copy link
Contributor Author

paulvha commented Oct 7, 2020

thanks !!

@paulvha
Copy link
Contributor Author

paulvha commented Oct 16, 2020

As I have spend good time getting this going I have documented how I had done it. Maybe useful for others as a starting point
make_static.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants