Per feedback from STM the correct ROM size is 1 MB, instead of
16 MB. The KEIL source information is (in the pack itself) wrong, since
the KEIL webpage lists it as a 16 MB part, too - but if you look into
other sources - it is indeed 1 MB.
SPIFReducedBlockDevice parameters come from mbed_lib.json if not provided
explicitly.
Introduced an app config file for running filesystem tests with RSPIF
block device
SPIFBlockDevice parameters come from mbed_lib.json if not provided
explicitly.
Introduced an app config file for running filesystem tests with SPIF
modules
QSPIFBlockDevice parameters come from mbed_lib.json if not provided
explicitly.
Introduced an app config file for running filesystem tests with QSPIF
modules
- By default, Mbed OS build tools use standard C library for all supported toolchains.
It is possible to use smaller C libraries by overriding the "target.default_lib" option
with "small". This option is only currently supported for the GCC_ARM toolchain.
This override config option is now extended in the build tool for ARM toolchain.
- Add configuration option to specify libraries supported for each toolchain per targets.
- Move __aeabi_assert function from rtos to retarget code so it’s available for bare metal.
- Use 2 memory region model for ARM toolchain scatter file for the following targets:
NUCLEO_F207ZG, STM32F411xE, STM32F429xI, NUCLEO_L073RZ, STM32F303xE
- Add a warning message in the build tools to deprecate uARM toolchain.
- NewLib-Nano C library is not supporting floating-point and printf with %hhd,%hhu,%hhX,%lld,%llu,%llX
format specifier so skipping those green tea test cases.
Update the CMSIS-pack info to `index.json` in arm_pack_manager -folder.
The update happens via python project.py --update-packs and a modified
version of the cmsis-pack-manager tool, which allows the download of
(most) CMSIS-pack files. The changes for this family ONLY are then updated
to the `index.json` -file.
Mbed OS PR #12093 need this change, as they refer to a target (device_name)
from the updated CMSIS-packs.
Ref: https://github.com/ARMmbed/mbed-os/pull/12093
Ideally, there is nothing wrong, but it seems to produce AStyle
error when release script runs for PSA Auto-generated files.
Therefore removed the spaces from the problematic line.
Fixes#12084
Signed-off-by: Vikas Katariya <Vikas.Katariya@arm.com>
We removed catching and passing, we want to know for any misconfiguration if bootloader
is supported. Regions should check if bootloader is supported. In case not, just return.
Otherwise we catch any error.
This should help us to uncover missing regions or other config error (in case bootloader
is enabled via bootloader_supported set to true).
Currently any misconfiguration of, for example, bootloader feature will cause the
build system to just silently drop it and continue building which can lead to
completed builds of something the user didn't want to build in worst case and
failing builds after compilation (=wasted time) in the best.
For GCC we're being cautious by passing the
`-fno-delete-null-pointer-checks`. This option prevents some
optimisation opportunities, so removing it can reduce code size.
One particular optimisation loss occurs in `Callback` where a test
similar to this occurs:
extern void myfunc();
inline void foo(void (*fnptr)())
{
if (fnptr) {
do A;
} else {
do B;
}
};
foo(myfunc);
With `-fno-delete-null-pointer-checks`, the compiler does not assume
that `&myfunc` is non-null, and inserts the "null check" - seeing if the
address is 0. But performing that test of the address is incorrect
anyway - if myfunc actually could be at address 0, we'd still want to do
A.
Anyway, we do not have an equivalent option enabled for either Clang or
IAR, and we have performed clean-ups avoiding issues with
apparently-null vector tables in Clang already, for example #10534.
Therefore it should(TM) be safe to remove the option for GCC. We do not
have general data or code at address 0, only vectors are likely to be
there, so it does not make sense to be globally restricting code
generation for that.
Planning to update to supporting GCC 9 as found in GNU Tools for Arm
Embedded Processors 9-2019q4-major.
Newer GCC in particular supports ARMv8-M security extensions, and
link-time optimisation - two areas of interest.
Should be no code changes required, but need to change the warning in
the toolchain script.
- add --inline option to linker flags
Some routines are so small that they can fit in the space of the
instruction that calls the routine. Use this option to make the
linker replace the call of a routine with the body of the routine,
where applicable.
Currently mbed-os-example-blinky and mbed-os-example-wifi are built for each and every target in Mbed OS. This will change that only DISCO_L475VG_IOT01A is built for mbed-os-example-wifi. DISCO_L475VG_IOT01A was chosen as its one of the wi-fi supported boards and having integrated wi-fi.
The retarget code allocates an array of FileHandle* for console and file
handling (filehandles). A tiny target only needs a console (putc/getc).
There is no need for file handling.
The POSIX layer and the array of FileHandle* is not required for small
targets that only need a console ; this code is optionally compiled
out if the configuration parameter platform.stdio-minimal-console-only is
set to `"true"`.
Since the offline build is made to auto-generate PSA related components
and services for Secure targets, we can change the output directory to
update the files in the respective locations.
TARGET_PSA
--TARGET_MBED_SPM
--COMPONENT_SPE
psa_setup.c
--TARGET_TFM
--COMPONENT_SPE
--inc
tfm_partition_defs.inc
tfm_partition_list.inc
tfm_service_list.inc
tfm_spm_signal_defs.h
--services
--inc
autogen_sid.h
mbed_spm_partitions.h
The release script is been modified to commit these files if there are
any changes detected when `--commit` argument is passed.
Cleaning of auto-generated is been removed as it uses the main directory
for its operations, but PSA auto-generation will work if any of the
service and application-based manifests are updated.
Signed-off-by: Vikas Katariya <Vikas.Katariya@arm.com>
Only generate PSA headers/source related to components and services
when Secure build is initiated during compile time of PSA targets.
Let the Non-secure build rely on the checked-in files already present.
Signed-off-by: Vikas Katariya <Vikas.Katariya@arm.com>
Build system was using an internal feature of the Pool class that is unavailable
in a py3 system. This would cause an exception if tool execution failed.
Offending code has now been removed
Manually replaced the existing STM32H7 section and replaced it with the
context of updated `index.json` that pulled in the Keil packs available
today, as of 18th October, 2019.
See related PR; https://github.com/ARMmbed/mbed-os/pull/11707
All scripts pertaining to example projects tests should be in the same
directory. The test framework uses Python2 therefore this script also needs
to be Python2 compatible.
- remove "mbed" and "test-repo-source" key
- add "sub-repo-example" key as an indicator if an example has sub examples
- add "subs" key to sotre sub examples names
Add 2 targets for DISCO_H747I dualcore:
* DISCO_H747I -> for CM7 core
* DISCO_H747I_CM4 -> for CM4 core
Current restrictions:
* TICKLESS deactivated
* DeepSleep not supported (DeepSleep wrapped to sleep)
Warning: use of the same IP (example I2C1) by both core at the same time is not prevented,
but is strongly not recommended.
Some Hardware Semaphore are use for common IP, to manage concurrent access by both cores: Flash, GPIO, RCC.
Warning: Drag and drop of binary to DISCO_H747I will flash CM7.
In order to flash CM4, one can use STM32 CubeProgrammer tool.
Something on Travis CI's side has changed such that invoking the 'wait' command within a script attempts to wait on some other jobs in addition to those spawned within the CI job.
Workaround is to explicitly collect the PIDs for processes spawned within the script and only wait on those.
The exported project uses project file to set optimization, we can provide this
via misc options. It was recently changed to Ol and this was not handled in our
scripts.
1. All TZ targets should have name pattern: PLATFORM_[PSA_/NPSA_]S/NS, where:
(1) 'PLATFORM' for test spec platform name
(2) 'PSA/NPSA' for PSA/non-PSA targets. Defaults to PSA target on absent.
(3) 'S'/'NS' for secure/non-secure targets
2. Secure target may participate in Greentea, so its name is also truncated here.
Support secure/non-secure combined build for non-PSA target:
1. In secure post-build, deliver built secure image to TARGET_NU_PREBUILD_SECURE
directory which is to combine later.
2. In non-secure post-build, merge non-secure image with secure image saved in
TARGET_NU_PREBUILD_SECURE directory.
3. In non-secure post-build, user can also drop pre-built secure image saved in
TARGET_NU_PREBUILD_SECURE directory and provide its own by adding the line below
in mbed_app.json:
"target.extra_labels_remove": ["NU_PREBUILD_SECURE"]
1. All TZ targets should have name pattern: PLATFORM_[PSA_]S/NS, where:
(1) 'PLATFORM' for test spec platform name
(2) 'PSA' is optional to distinguish PSA/non-PSA targets, especially when
both PSA/non-PSA targets are supported
(3) 'S'/'NS' for secure/non-secure targets
2. Secure target may participate in Greentea, so its name is also truncated here.
When a Doxygen group has been defined (created), all its needed to add
documentation to that group is `\addtogroup`. Since all the information
about the group is preserved, it is not necessary to mention the group
hierarchy again with `\ingroup`. This PR removes unnecessary Doxygen lines
across the `drivers`, `events`, `platform` and `rtos` directories.
It also ensures that new groups are created with `\defgroup` once and
referenced with `\addtogroup` whenever documentation needs to be added to
an existing group.
The release script must be run from mbed-os root, otherwise the test
partition binaries will not be created. Add a note in the tool's README
to make this clear and hopefully help save someone some debugging time
in the future.
µVision 5.28a now has options for gnu++14, c++14 and c++17, so we can
use them rather than falling back to c++14 or gnu++11.
This does mean that an export of current master, which uses gnu++14,
will now require version 5.28a. I have not tested what happens if
5.27 is given a project file with these new option numbers.
However, export of current master is broken for 5.27 anyway, as the
fallback to gnu++11 means it fails to compile the C++14 constructs
now in the codebase.
Fixes#11217, as long as users update µVision too.
* Modify compilation API to provide a list of paths to exclude from the build.
* `_exclude_files_from_build` becomes a static method
* Replace ternary expression with simple `if/else` statement
* Make unit test case for dirs exclusion independent of system files
* Fix rtos include path in NRFCordioHCIDriver
* Flatten USB driver directory structure
* Add missing include for us_ticker
* Add more missing includes for us_ticker
* Fix mbed_hal_fpga_ci_test_shield/uart test
* Fix bare-metal build
* Fix Watchdog UNITTEST
* Fix Mbed OS 2 build for Public/Internal headers relocating
The contents of the usb directory were moved to appropriate locations and the usb directory removed.
* Public USB headers moved under drivers/
* Internal USB headers moved under drivers/internal/
* USB Source code moved under drivers/source/usb/
* Moved usb/device/hal/ under hal/usb/
* Moved usb/device/USBPhy/ under hal/usb/
* Merged usb/device/targets/ into targets/
* Separated public and private USB API documentation under Doxygen groups drivers-public-api and drivers-internal-api.
Separate drivers, events, and rtos internal APIs from public APIs.
* Move source files to source subdirs
* Move internal headers to internal subdirs
* Add Doxygen comments for documenting internal and public APIs
* Remove source code from header files in order to remove include pre-processor directives
that included header files not directly used by said header files
* Explicitly include header files instead of implicit inclusions via third-party header files.
Release Notes
This will break user code that was using an internal API as the internal header files have been moved.
This will only break if the user was including the header file using a namespace (i.e #include "foo/bar.h" instead of #include "bar.h"
* Fixed wrapper functions for IAR
* Fixed and renamed profile to minimal-printf.json
* Moved minimal-printf under platform
* Removed minimal-printf/mbed_lib.json
* Modified exporter template to work with partial profile
* Prevented optimization of printf to avoid compiler function substitution
This brings massive ROM savings, and allows to use debug builds
also with larger applications (for. ex. Mesh stack).
Diff. for mbed-cloud-client-example with Wi-Sun stack.
Total Static RAM memory (data + bss): 85120(-216) bytes
Total Flash memory (text + data): 592668(-329296) bytes
* Adjust definition to make the default constructor `constexpr`.
This permits use in classes that want lazy initialization and their
own `constexpr` constructor, such as `mstd::mutex`.
* Add `get_no_init()` method to allow an explicit optimisation for
paths that know they won be the first call (such as
`mstd::mutex::unlock`).
* Add `destroy()` method to permit destruction of the contained object.
(`SingletonPtr`'s destructor does not call its destructor - a cheat
to omit destructors of static objects). Needed if using in a class
that needs proper destruction.
Do not specify the debug level for develop and release profiles. Instead
rely on the compiler to choose sensible default (-g2). Note that -g1 is
minimal debugging information and does not include structure definitions
which quite heavily reduces debugging experience.
For develop and release profiles this results in elf file containing
structure definitions. This does not impact debug profile as it already
did use -g3 which is the highest debug level.
Compatible debuggers (eg. gdb, SEGGER Ozone) can use the extra information
to provide better debugging experience. For example, when compiled .elf is
loaded in gdb, this change makes it trivial to access internal RTX data.
Without this change on develop profile:
(gdb) print osRtxInfo.thread.run
'osRtxInfo' has unknown type; cast it to its declared type
With this change on develop profile:
(gdb) print osRtxInfo.thread.run
$1 = {curr = 0x20014F04, next = 0x20014F04}
VSCode exporter was generating a launch config that contained absolute paths to the
compiler executables. It makes more sense to use the executables that are
installed into the system PATH.
When packing data into multiple regions using the `.ANY` directive,
the linker can accidentally overfill an area.
This doesn't normally happen because it defaults to
`--any_placement=worst_fit`, which puts data in the region with
most space.
When we prioritise regions with `.ANY1`/`.ANY2`, it may totally fill
an area, then fail to leave enough space for linker-generated veneers.
We've just seen this error with the new K64F linker map.
Adding `--any-contingency` makes it lower priority when a region is
98% full, avoiding this error.
The option should not have any effect on targets with scatter files
without prioritised `.ANY` directives.
Due to some historical reasons ARMC 5 compiler behaves very
differently compared to others (GCC, IAR, ARM C 6) as it optimizes
performance rather than size (like the others).
All compilers should behave the same way with the same profile,
thus ARM C 5 should also drive towards size (space).
Lots of target code, STM in particular, uses the `register` keyword, so
it'll take a little while to clean up. In the interim, some builds are
producing a lot of warnings. Suppress the warning for now, as `register`
remains legal C++14 and C11, despite C++14 deprecating it.
C++17 removes `register`, so code will need to be cleaned before any
further C++ version update.
Clang warns about reserved user-defined literals by default. This
warning is not terribly helpful; compilers aren't normally in the
habit of warning about use of reserved identifiers. It can interfere
with, for example, deliberate emulation of a future standard
language feature.
The warning was promoted to an error in an mbed client build, due to a
non-C++11 "%s"name occurring in a macro. But the macro itself was never
invoked, so the misinterpretation as C++11 caused no problems other than
this warning. Killing the warning will let that code build on ARMC6.
The code already built on GCC and IAR.
If that macro ever was used, then a separate error about operator ""
name not being defined would be generated, on all 3 toolchains.
This is limited to ARMC6 because as of µVision V5.27 you can't set C++11
for ARMC5.
Also current µVision does not support gnu++14. We should be able to get
is as `<default>`, as it is the default for ARM Compiler 6.10-6.12,
but this option does not work as documented and actually requests
gnu++89 explicitly. So gnu++14 is mapped to gnu++11.
Musca-A1 is a Cortex-M33 based target with security extension enabled.
- ARM_MUSCA_A1 is the non-secure target running mbed-os.
- ARM_MUSCA_A1_S is the secure target running TF-M.
- TF-M sources were imported and patched in previous commits.
- TF-M secure bootloader (McuBoot) for MUSCA_A1 is submitted by a pre-built binary.
- A post-build hook concatenates The secure and non-secure binaries,
signs it and then concatenates the bootloader with the signed binary.
due to partial implementation. Having FUTURE_SEQUANA_M0 and
FUTURE_SEQUANA PSA targets is misleading.
Signed-off-by: Devaraj Ranganna <devaraj.ranganna@arm.com>
Change the heuristic for selection of CMSE in the tools python, so that
a non-TrustZone ARMv8 build can happen.
Ideally we would have more direct flagging in the targets, but this
refines the heuristic so the necessary behaviour can be easily
achieved.
* DOMAIN_NS=1 is based purely on the `-NS` suffix on the core name.
* Enabling CMSE in the compiler and outputting a secure import library
is now enabled when the core doesn't have an `-NS` suffix by either
the target label `TFM` being present or the flag `trustzone` being set.
This covers the existing ARMv8-M behaviour - TF-M builds have the TFM
label, as per its documentation; M2351 secure builds have no explicit
flagging, so we ensure that the M2351_NS target has the trustzone flag
set, and the out-of-tree secure target inherits that.
PSA code generation will be called automatically upon mbed invocation.
The autogenerated files will be created under <mbed-os-root>/PSA_AUTOGEN directory.
Unify TF-M and Mbed-SPM code generators:
- Unify SPM initialization logic:
- All partitions are registered at once
- Test partitions are guarded by #ifndef
- Introduce single template list
- Beatify template files and add "Autogen-do not modify" notice
Prepare for integration with mbed-os build system:
- Generate all the files in a single place
Simplify tools/psa/release.py script
* For ARMC6, core types `Cortex-M4` and `Cortex-M7` did not explicitly
add `--fpu=none`, so it defaulted to assuming FPU present. This would
cause a compilation error if the target's cmsis.h had `__FPU_PRESENT`
defined to 0.
* For GCC, `Cortex-M33FE` did not include `+dsp` in the architecture
selection.
* For ARMC5 and ARMC6, `Cortex-M0+` did not pass `M0plus` to the
non-Clang tools.
* Unify PSA generators
* Replace scanning for mbed_spm templates with json
* Make generate_source_files and parse_manifests common
* Make assert_int an internal function
* Use parse_manifests in pytests
* Update docs
Projects that are zipped are typically from the online compiler or they
are meant to be used in a separate environment. Since the postbuild
script requires the Mbed OS tools to present in the project, we will
disable the postbuild script when the project is exported to a zipped
project.