Check in scripts which are able to generate flash algos for supported
targets.
To initially download all packs the following command should be run:
"python extract.py --rebuild_all"
After that all supported targets can be rebuilt by running:
"python extract.py"
Finally, to rebuild an individual target you can used its pack name:
"python extract.py --target STM32F302R8"
Before, the types were not checked and just expected. The old behavior
would cause lots of tracebacks, or, much worse, convert things like:
```
{
"target_overrides": {
"*": {
"target.macros_add": "CONFIG_GPIO_AS_PINRESET"
}
}
}
```
into a definition of each of the letters as macros that expand to
nothing, causing massive compilation problems.
I resolved this by adding some type checking to the config data. Now
there is a type check for most of the fields within a library and
application configurations.
The file `project_api.py` was poorly named and caused much confusion.
Given that it was actually a front end to the exporters, I put it into
the export sub-dir.
Added the ability to specify a branch to update rather than a fork
Replaced print commands with the use of a logger
Updated the run_cmd functions in line with previous improvements
When constructing a toolchain for export, we currently set the
`build_dir` to the `export_dir`. When exporting offline, the
`export_dir` is always set to the root of the project. The toolchains
ignore their `build_dir` when scanning for sorces, so when the exporters
use the toolchains to scan for their resources, they get nothing.
In this patch we set the `build_dir` of the toolchain that the exports
use to nothing. A path of nothing should not match anything, and will
therefore not ignore everything when scanning for resources.
Add an 'all' parameter to get_flash_algorthim_binary. When set
an enumerator of all flash algorithms is returned. rather than just
the first flash algorithm.
I accidentally broke only uARM mbed 2 builds. Here is the story: When
scanning for resources, toolchains look for any `TOOLCHAIN_<classname>`
folders to include. These `<classname>`s mostly match the name passed in
on the command line with one exception: `uARM` on the command line maps
to `ARM_MICRO` the class. This would not be a problem except for the bug
that I introduced in a prior commit. The bug is that the mbed2 library
builds will use the name passed in on the command line to construct
`TOOLCHAIN_<cli-name>`. This will not match when scanning.
I fixed it by translating the `<cli-name>` into the `<classname>`.
Fixed results output summary.
General tidy up of long lines.
Added a new field to json file, target_list, to allow the user to
override the set of targets used for the compilation.
An earlier patch in this series changed the API for
`build_api.prepare_toolchain`. This commit updates the `find_test`
function to call `prepare_toolchain` correctly.
An earlier patch in this series relies on the assumption that all
toolchain construction goes through `prepare_toolchain`. This is still
not the case. The only remaining user of the `mbedToolchain` object that
does not go through `prepare_toolchain` is the static analysis scanner.
It's basically dead-code at this point. I say we remove it. So this
patch removes it.
The prior patch in this series makes the assumption that any building
will go through `build_api.prepare_toolchain`. This was not a valid
assumption for the mbed2 build process. So, instead of maintaining 2
ways of using the toolchain classes, I elected to unify on
`prepare_toolchain`.
This is a bug fix for the following bug (Github issue #437):
If two builds were run specifying a non-default build folder, the second
build would fail to link with duplicate symbols and may not fit on the
device. The root of this problem is that these non-default build folders
are not ignored by scan-resources, and therefore included in the build.
We fix this bug by ignoring the build directory passed into the tools.
Resolves the github issue #3790: Blinky fails to build (on Mac) after
addition of linker script preprocessing feature. Paraphrasing, this
issue is that Homebrew on mac does not install `arm-none-eabi-gcc` in
the same location as `arm-none-eabi-cpp`, the C Pre-Processor. The tools
prior to this commit, and after turning on the pre-processing of the
linker-script will fail on any Mac homebrew installed toolchains.
This commit resolves the above issue by allowing the toolchain's path to
the executable to remain empty after a call to `check_executable`. When
this path is empty, the tools will search the PATH environment variable
for the executable.
We have scripts (written in python) that are run after a binary image is
created in the tools. These scripts are not really exportable, as they
are part of the tools and may include and use any bits of python code
they please. So we don't export them. This patch disables export
combinations that would not work because the post-binary hook is not
exported. A white-list is used for forward compatibility.
Recently the Keil IDE has released version 5.23. This version requires
the FPU to be set as part of the <Cpu> tag in the .uvprojx (XML project
file). This patch adds the appropriate FPU settings based on the
trailing F (FPU enabled) or FD (Double precesion FPU enabled) string of
the core.
Replace use of print and write with logging (with different levels).
Add the ability to choose the logging level on the command line.
Fix the exclusion of uARM from compilation.
Remove print_on_fail from run_cmd() functions, now use logging.
- Fixing code formatting errors with astyle tool.
- Replaced use of TOOLCHAIN_xxx macros with compiler emitted macros.
- Added const to BlockDevice::get_xxx_size() member functions.
- Added documentation for FAT filesystem thread support.
- Added documentation for fat_filesystem_set_errno().
- Added documentation clarifying the reasons for errno/stat symbol definitions in retarget.h.
- Removed FAT filesystem from mbed 2 testing.
- Fixed FATMisc.h Copyright (c) 2016 year to 2017 as its a new file.
- Removed #ifndef NDEBUG from HeapBlockDevice.cpp.
- Removed unnecessary todo comment in retarget.cpp.
This patch will prevent building bootloader builds on targets that have
not yet had their linker scripts/scatter files changed to allow for the
ROM space shrinking expected by bootloader builds. At the point of this
patch, bootloader linker script modifications are only supported by the
NUCLEO_F429ZI, K64F, KL46Z, and Odin.
To enable a boot-loader style application, override
"targets.bootloader_exec" or "targets.restrict_size" on a particular
target. These parameters are a bin or hex file, and an integer, in bytes,
respectively. If either override is present, then an application region
is created after the boot-loader region, when "targets.bootloader_exec"
is present, and before post-application, when "targets.restric_size" is
present. The size of the boot-loader region is read from the file
provided in the configuration.
Usage: python tools/check_release.py
Run from the mbed-os directory.
For details on how the script works and how to set up the configuration
json file, please see the python file header.
The zipping function of the exporters would unconditionally add all
files scanned by scan resources to a zip, including all of the files
associated with each feature. This would conflict with
`build_api.scan_resources` adding all of the files to the resources
object that correspond to the enabled features. To resolve this
difference in behavior, I made the zipping function oblivious to
features and had the upper level function, which has access to the
target configuration, do the proper merging.
Before, `make_gcc_arm` would export a makefile with both linker flags in
the `$(LD)` make variable and the `$(LD_FLAGS)` make variable. This only
affected GCC based makefiles, as the `$(LD)` make variable would only
contain the linker for both ARMC5 and IAR. This patch enforces the
`$(LD)` behavior of ARMC5 and IAR on all of the compilers by truncating
`$(LD)` to just the command
For toolchains that do not implicitly run the C pre-processor on their
linker scripts the toolchain is expected to define a `preproc`
attribute. The Makefiles then pick up on this attribute and add another
rule for pre-processing the linker script automatically.
This allows us to define parts of the linker script outside of the
linker script itself. In particular, we are interested in restricting
ROM to a subsection.
The field device_name is intended to match that of a target in a
device family pack. Remove this field for devices which do not have
a pack. Fix the name for devices that have the name incorrect. Update
IAR definitions for device which no longer have a device_name but
still need to have support for the IAR exporter.
The worker_result variable was not guaranteed to have a `'result'` or
`'reason'` key and accessing them before testing for them could result
in an error when they are not provided. This patch changes the checks to
prevent check for their existence before accessing them.
* Adding Cortex-A support for gnuarmeclipse
* Preventing '-mthumb' from being added to Cortex-A builds.
Previously, both '-mthumb' and '-marm' were being supplied to the
compiler (in that order). Because '-marm' came last, the compiler
respected this option. This change makes it so '-mthumb' is added for
all 'Cortex-M' targets only.
* Renaming to capital .S for Eclipse compatibility
On the ARM toolchain linker flags specified in the build profile do
not get passed to armlink. This patch adds these flags to the
arguments sent to armlink.
Before the toolchains would ignore error messages that contained the
string "Fatal error". This would lead to a silent failure unless the
compile command was ran with verbose options. This is now fixed.
- configure the jinja Environment to raise exception when substitution
variables are not defined
- trim spaces and lines, to avoid empty lines in generated files
Commit 19d56fd40f removed the default file
paths for the toolchains. This was done under the assumption that the
top-level compile scripts were properly checking that the toolchain
executable was availble. The build.py script was doing this in the wrong
place. This commit rearranges the script a bit so the check is performed
properly.
Assert that the length is greater than one rather than the value
itself. This bug was introduced in the commit:
329be06ad0 -
"exporters - group by directories in prj root"
Update exporter grouping code to group by directories in the root
of the project rather than by the parent directory of each file. This
reduces the number of groups and allows all mbed-os code to reside
in its own folder.
example specified in the supplied .json file, in a user specified fork.
A pull request is then made from each fork to the ARMmbed master repo.
New usage:
python update.py <args>
Where <args> are:
[-c <file.json>] optional argument for example list, default
example.json
-U <github user with forked repos>
-T <github authorisation token>
tag
* Rename because the tool has been renamed
* Removed duplicate symbol definitions
* Removed common flags from ld flags (common are c/c++ only)
* Moved EmBlitz to it's own folder