get_config.py can be used to view the configuration of the mbed project
that's being compiled:
- without '-v' it displays a simple list of configuration parameters and
their values
- with '-v' it displays additional data for each configuration parameter
(like the place of definition and the last place that set a value for
the configuration parameter).
Tested by running "get_config.py" on a few tests from
tools/test/config_test.
The tests check a number of features of the configuration mechanism
(mostly the inheritance and overriding of configuration parameters), as
well as the behavarious in various abnormal situations.
This commit adds the implementation of the configuration mechanism and
applies it for two uses cases:
- building a program (build_project in build_api.py)
- building a library (build_library in build_api.py)
There's also a new method 'get_config' in build_api.py that's used to
return the configuration of a project. Currently, it's used only for
testing, the intention is to use it for the implementation of the 'mbed
config' command.
Tested with various test configurations on the "blinky" example and also
with its own set of tests (to be added in a separate commit).
'make.py' was modified to send the target *name* to build_project, as
opposed to the target *instance*. This is needed because the
coniguration mechanism allows for creating custom targets, but these
targets are not available until the configuration file
mbed_app_config.json is parsed, which happens in build_project (so
before make.py calls 'build_project'). The API of build_project didn't
change, it now accepts both target names and target instances for the
'target' argument.
Known issues:
- doesn't currently work when doing binary builds of the SDK. Currently,
building the SDK is broken in mbed-os, so this will be added later.
- when building tests, the build process ends up calling
'build_project', so the configuration mechanism should play well with
tests. However, this wasn't tested.
A later commit will all documentation for the configuration mechanism.
- added a method that can be used to new targets dynamically (this
will be used by the configuration mechanism).
- the JSON parser now keeps the order of the keys read from the JSON
file (will also be used by the configuration mechanism).
- there's now a global target cache in targets.py, so that a target
with a given name will only be created once.
There was an issue where the binary name was incorrectly set when building
from any directory that isn't the project root. This fixes that issue by
first getting the absolute path, then finding the binary name using that.
Pull in mbedmicro/mbed. Make the following changes in addition:
- Ignore unused directories in mbed
- Add stub mbed-drivers/mbed.h for backwards compatibility
- Remove targets.json and instead use mbed's version
Disassembly files can unintentionally get picked up by the test build
system. This patch changes the file extension on those files from
".s" to ".s.txt" so they are ignored.
Make the following changes for IAR support:
-define __deprecated_message for IAR
-fix python error in iar.py
-move variable length array in buffered serial from cpp file to c file.
IAR only supports variable length arrays in c.
Added a parameter '-l' to control how many project runs are uploaded at a
time. The default is 1000. The prevents HTTP errors when the POST request
is too large.
It is now possible to remove a macro using "_remove" for both macros
without vale (MACRO) and macros with value (MACRO=VALUE) simply by
specifying the macro name.
Turn on support for variable length arrays for the IAR C compiler.
This provides greater compatibility with GCC and ARMCC.
Note: The current version of iccarm at the time of this patch
(V7.40.3.8902) does not support variable length arrays in C++.
I ran into this earlier today and yesterday:
If you spelled something wrong/forgot to tab complete and had build succesfully before it woild silently and incorrectly build successfully
Check the content of `.mbedignore` files and try to match the file
patterns against the directories and source files found while travelling
the directory structure.
Every line in `.mbedignore` file is treated as a unix style glob pattern.
Before matching, the pattern is appended with its directory location, so
it will match only folder on same level, or deeper in the directory structure.
For example:
Directory ./source/test contains .mbedignore with content:
`unittest/*`
Then everything under ./source/test/unittest/ is ignored, including the
unittest folder itself.
Another example:
When .mbedignore file contains just `*`, then everything under the folder
it is located, is ignored. It won't even be added to include paths.
After a build has been completed print out ram and rom usage.
The sizes shown are the same as those reported by
arm-none-eabi-size.exe. The output looks like:
Memory sections sizes:
text 37244
data 60
bss 7800