-
Notifications
You must be signed in to change notification settings - Fork 3k
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
minimal-printf: Enable using a target configuration parameter #11891
minimal-printf: Enable using a target configuration parameter #11891
Conversation
@hugueskamba, thank you for your changes. |
6826848
to
c72e2ae
Compare
Why a target option? It's not a natural fit there. Structurally it belongs in Does it make it easier to handle this in the tools? Doing this means the build tools have to extract a config option either way, and by the time all config has been considered, we must have the library flags, I think. |
The other option to select library ( |
Ah, good point. I guess I'm thinking it in terms of "we're providing printf in platform", but you can equally view it as "the C library is not providing printf", so it's more of a C library option. But on the other hand, microlib is selected via a There is a layering distinction here - there are build system options in target.json, and there are code config options. Need more input from tools team here - they'd know better how they want this to be structured, and what's important to them w.r.t. any future plans. |
Maybe we all have had it wrong this whole time and the c library should be brought in as just another external dependency... I kid but it almost feels right. |
As said above, this is not target attribute but rather an application - minimal-printf should work for any and does not need any target code changes.
Let's wait for tools team review |
It doesn't fit as a target description as it's not a characteristic of HW platform. And I wouldn't like it to be different, by default, for different HW based on target.json entry. It's an user defined configuration option and should be set in mbed_app.json as mbed config. In the future we may connect it with bare metal, but it still a app option (except cases when a board only supports bare metal). |
This PR is coming ahead of another PR we are working on which enables microlib using This PR provides a similar mechanism for the selection of I agree that this should be a mbed config option rather than a target option. But is it possible?
|
c3442d3
to
074bab3
Compare
This isn't the best place to review the architecture of Mbed 6 and I think we should speak to the architects guiding these changes. I believe this change is following the change in approach to the microlib, it would be wise to follow suit with minimal printf. The plans there, as I understand them are as follows:
|
I will provide some comments here but this PR is not the correct place for this discussion.
This is correct. We will be introducing a change in the coming days to build microlib with the ARM toolchain, not the uARM toolchain which will be deprecated as per requirements. In this PR, we want to provide a similar mechanism for minimal-printf which is currently built using an extended profile
To clarify, what you list under You are correct about the issue though, there is no way to indicate whether or not a board can support a RTOS in terms or memory requirements or otherwise. There is work planned for next PI to port some Mbed 2 targets (particularly those which could not be ported to Mbed OS 5 due to memory limitations) to the bare metal profile. Part of this work should be to identify the HW requirements (and introduce a new target config parameter).
The The upcoming PR will provide a solution to control whether As you noted, there will be a discrepancy between the boards which support building with microlib depending on whether the uArm toolchain method is used or the new
This currently does not apply to GCC_ARM or IAR. For GCC_ARM, newlib or newlib-nano is chosen according to the |
There's no special HW features that boards need to have to support RTOS, it's all about available memory. In theory even very small board 4-8K could work with RTOS if it would be configured for this specific usecase. What we are talking about is the default, we need to provide some sort of configuration that works OOB and for some boards that would need to be RTOS-less. |
@madchutney anymore to do regarding this PR? |
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.
Thanks for the changes, one more suggestion.
074bab3
to
5dd0401
Compare
5dd0401
to
82e1ddb
Compare
This force-push fixes the indentation. |
82e1ddb
to
5df55ce
Compare
Because of this we are sticking to |
Started CI to get early results |
Yes, it was deemed to be a lot of work for a tool we are replacing "soon". |
Test run: SUCCESSSummary: 11 of 11 test jobs passed |
@evedon Happy with the current proposal ? Otherwise this is good to go in. |
I am fine with the code change but we need to update minimal-printf README to give instructions on the alternative way of using the library. |
@hugueskamba Part of this PR or is this in the docs? |
5df55ce
to
893d2bd
Compare
|
893d2bd
to
d5aef28
Compare
CI restarted |
Test run: SUCCESSSummary: 11 of 11 test jobs passed |
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.
Is that documented anywhere in the handbook?
Description (required)
Summary of change (What the change is for and why)
Minimal-printf is currently enabled using a build profile extension; this is not the commonly used way to configure Mbed OS. Configuration of Mbed OS is usually done by overriding configuration parameters with a JSON file.
This PR adds a configuration parameter to enable Minimal-printf.
Documentation (Details of any document updates required)
Minimal printf README
Pull request type (required)
Test results (required)
Reviewers (optional)
@bulislaw @madchutney @evedon @rajkan01
Release Notes (required for feature/major PRs)
Summary of changes
Add ability to enable Minimal printf using configuration parammeter.
A new configuration parameter
target.printf_lib
has been added to enable it.Impact of changes
Convenient and familiar way to configure Mbed OS.
Migration actions required
N/A