Move the fpu settings across all cores so they are aligned.
Some cores did not have fpu set for ARMClang. I matched here both toolchains to set up
the fpu the same (Only exception is soft vs hard - that is separate issue I would not like to touch
in this series).
Set DOMAIN_NS=1 only for _NS cores. We had it otherway around.
I verified one non NS target that was failing to build, plus also checked the old tools
that had this definitions:
```
91: "Cortex-M23-NS": ["__CORTEX_M23", "ARM_MATH_ARMV8MBL", "DOMAIN_NS=1",
92 "__CMSIS_RTOS", "__MBED_CMSIS_RTOS_CM"],
93 "Cortex-M23": ["__CORTEX_M23", "ARM_MATH_ARMV8MBL", "__CMSIS_RTOS",
94 "__MBED_CMSIS_RTOS_CM"],
```
Some armasm flags are passed to the ASM whilst we actually use armclang to invoke it. This causes build failures as armclang is not compatible with armasm flags.
This commit passes the same flags to all tools in the chain.
Due to the recent release of Mbed CLI 2, the command line options
have been renamed to ensure good usability and harmonize with the old
tools.
These are the following changes done:
* Minimum Cmake - 3.19.0 is required
* Minimum Mbed-tools - 4.0.0 is required
* mbed-tools cmd `init` to `new`
* mbed-tools cmd `build` to `compile`
* Removed whitespaces
Fixes https://github.com/ARMmbed/mbed-os/issues/13983
Move linker script to the function mbed_set_mbed_target_linker_script.
I also moved memmap as it is needed for an app. The location might not be the best fit,
we will address this in separate pull request.
Promote MBED_TOOLCHAIN_FILE_USED to cache variable so
its previous state can be recalled when re-building. This
is because CMAKE_TOOLCHAIN_FILE is also a cache variable and its
value is set on first run when it has not been set.
nanostack border router is now owned by ISG and has been moved
out of ARMmbed and into their organisation. ISG will be
responsible for updating and testing this example going forward.
The compile defintions should always be added depending on the
selected toolchain.
mbed_set_toolchain_options() should only be called if a third-party
toolchain file has not been used as it has compile options that can
cause conflicts.
The new function (mbed_set_cpu_core_definitions()) should always be
called as it has defintions needed by Mbed OS to work with that
particular MCU core.
mbed_set_cpu_core_options() should only be called if a third-party
toolchain file has not been used as it has compile options that can
cause conflicts.
As the assembler does not seem to recognise the request to the
linker to use microlib, remove that instruction.
Microlib is still used as the linker selects microlib as a result
of being explicitly asked to do so.
Rename the CMake variable expected from applications from MBED_ROOT to
MBED_PATH to be consistent with the naming used for the configuration file
(MBED_CONFIG_PATH) also expected from applications.
Issue https://gitlab.kitware.com/cmake/cmake/-/issues/21093
Until this is fixed, we should disable response files for ARMClang + ninja on Windows.
Other toolchains and host systems should benefit from response files thus not disabling them
completely.
This fixes the issue with not finding includes. It's not trivial to find the root cause, it took me a while to figure out why ARMClang can't find the paths.
I moved the check to Mbed OS main cmake. It should not be in the toolchain file as it is not
related to the toolchain but to generator. We need toolchain properly set up first.
Note, I had to protect setting CMAKE_NINJA_FORCE_RESPONSE_FILE. If I set it to 0, ninja
would still use rsp files so I rather protected it and define that variable only when
required, not always.
Co-authored-by: Hugues Kamba <41612201+hugueskamba@users.noreply.github.com>
mbed-os consists of mbed-core and mbed-rtos
mbed-baremetal consists of mbed-core
The main change is for mbed-core. Changing from object library to be interface. This way it allows us to do the above to have 2 main targets for users to use.
This should be backward compatible change as mbed-os target we used contains the same files/options as previously set.
These settings like enable_language should be done in the application and just once.
We hit the issue when you expose sources to an app (interface or public), CMake errors as some of the internal settings have not been configured.
A linker script needs symbols (stack size, app size, etc). They are basic values or defines. Not any array like or string like macros. We should filter these, as they are not valid anyway.
The other option to fix this would be to fix all the macros but I dont think it is needed as these config values won't be used in the linker script anyway.
Not allowed in ld files macros with spaces, like MACRO={0, 2, 3} or MACRO=(4 * 2000).
Directories that start with special prefixes (TARGET_, FEATURE_, COMPONENT_) are added to the build based on Mbed target configuration from targets.json instead of calling utility function mbed_add_cmake_directory_if_labels().
Aside from the core mbed-os CMake target, a number of targets have been created so they can optionally be included by application executables that require them using `target_link_libraries()`.
Co-authored-by: Martin Kojtal <martin.kojtal@arm.com>
Co-authored-by: Rajkumar Kanagaraj <rajkumar.kanagaraj@arm.com>
- Add linker option to generate map file for GCC_ARM and ARM toolchain
- Add mbed_generate_map_file function to call memap.py (parse the map
file).
- Add mbed_generate_executable function to generate executable artifacts with a memory map table
Add function "has_binary_license" to check if a file has a
non-permissive license contains one. PBL is not recognized by scancode,
causing it to be flagged as a non-permissive license. CI doesn't allow
any non-permissive licenses, although, files flageed as SPDX are
allowed. Workaround causes all files with a valid PBL to be flagged as
missing an SPDX.
Add condition in "has_spdx_text_in_scancode_output" to ignore any spdx
identifier with "unknown" in the name. Scancode erroneously matches PBL
to matched_rule.identifer "spdx-license-identifier: unknown-spdx". This
prevents the workaround from working.
Add function "has_binary_license" to check if a file has a non-permissive license contains one. PBL is not recognized by scancode,
causing it to be flagged as a non-permissive license. CI doesn't allow
any non-permissive licenses, although, files flageed as SPDX are
allowed. Workaround causes all files with a valid PBL to be flagged as
missing an SPDX.
Add condition in "has_spdx_text_in_scancode_output" to ignore any spdx
identifier with "unknown" in the name. Scancode erroneously matches PBL to matched_rule.identifer "spdx-license-identifier: unknown-spdx". This prevents the workaround from working.
It was removed in 6.0 (see reference below), and it was reintroduced when we updated
cmsis from the upstream. We missed to remove the commit adding the file in the cmsis
importer. This fixes it and the file should not be introduced again.
Fixes#13823
Already removed in 6.0: https://github.com/ARMmbed/mbed-os/pull/12055
SPDX are not yet done in our codebase. We suggest them to be present but 3rd party
drivers have not yet been updated. The check as it was causes problems when updating
3rd party drivers (red flags in the PR).
Proper fix will be to clean up SPDX id in the codebase.
ScanCode can possibly return many licenses found for a single file scanned.
This commit ensures that the file is not reported as lacking a permissive license
if at least one license found in it is permissive.
Previously the script was reporting an issue if it found at least one license
in a file that was not permissive.
Additionally catch more errors and provide specific details about failures.
Provide unitest.
Remove code block from license_check that evalutes whether a files
licenses are permissive and that there is a SPDX notice. Scancode
sometimes incorrectly attributes a single license notice to permissive
and non-permissive licenses. Removed code block results in many false
positives because it labels any file that has a "non-permissive" license
as such even when there is a permissive license.
Add function spdx_check to scancode-evaluate.py to improve analysis of
copyright and license notice tests.
Add unit test and dependent stubs for testing of scancode-evaluate.py.
license_check takes a JSON as argument and checks for source missing
copyright or license notices.
Each JSON represents a separate test case, and stubs are added for test case
3 and 4 where license_check looks for an spdx notice in the source file.
- GPIO xml parsing correction (#13711)
- Octo SPI support
- bug correction
- warning style correction
- new TIM_MST choice algo
- full PinNames.h file creation
- output directory is now
targets_custom/TARGET_STM/TARGET_STM32XX/TARGET_STM32XXXX
Passed GreenTea CI.
Added RZ_A2XX and GR_MANGO to targets.json.
Added RZ_A2XX to mbedlib.json in lwipstack and netsocket/ppp.
Added TARGET_RZ_A2XX directory to targets/TARGET_RENESAS.
Added TARGET_RENESAS_EMAC directory to features/netsocket/emac-drivers.
Moved TARGET_RZ_A1_EMAC directory into the TARGET_RENESAS_EMAC directory below and renamed to TARGET_RZ_A1XX.
Added TARGET_RZ_A2XX directory to features/netsocket/emac-drivers/TARGET_RENESAS_EMAC.
This applies only to `ARM_MUSCA_B1` target
When MCUBOOT repo: UPSTREAM was set as default as part of TF-M 1.1
release, few things were changed:
MCUBOOT_IMAGE_NUMBER: '2'
MCUBOOT_UPGRADE_STRATEGY: 'OVERWRITE_ONLY'
MCUBOOT_HW_KEY: 'On'(default)
Therefore the signing strategy for Non-secure image (Mbed OS)
needs to be done with its own private key, which is validated during
boot.
Signed-off-by: Vikas Katariya <vikas.katariya@arm.com>
Add a script to parse `targets.json` to identify PSA targets and ensure
mandatory parameters are configured correctly for all PSA targets.
Signed-off-by: Devaraj Ranganna <devaraj.ranganna@arm.com>
The API is_PSA_non_secure_target() uses obsolete labels to detect if a
target is PSA non-secure target and is not needed anymore.
Mbed OS depends on TF-M for PSA SPM and services. TF-M is built using
it's own build system. Therefore, we don't need to differentiate secure
and non-secure targets anymore in Mbed OS as all PSA targets in Mbed OS
are non-secure targets.
Signed-off-by: Devaraj Ranganna <devaraj.ranganna@arm.com>
Current logic `is_TFM_target` relies on the availability of attribute
`tfm_target_name` to identify PSA targets. The API `is_TFM_target` is
used in pytest to validate PSA target configuration which again checks
the availability of `tfm_target_name`. If a target doesn't contain the
attribute `tfm_target_name` then this check will fail instead of
catching it. Therefore, we now check for `TFM` config option in `labels`
attribute.
The API `is_TFM_target()` returns true for Mbed OS PSA targets which are
supported by TF-M also.
Add a new API `is_PSA_target()` which returns true for all Mbed OS PSA
targets.
Signed-off-by: Devaraj Ranganna <devaraj.ranganna@arm.com>
Add TF-M to Mbed OS, replacing the previous PSA implementation for
TF-M-capable targets. This commit adds files imported from TF-M, without
modification. The version of TF-M imported can be found in
`features/FEATURE_PSA/TARGET_TFM/VERSION.txt`.
These changes switch to TF-M as the sole PSA implementation for v8-M and
dual core targets, with TF-M running on the secure side and Mbed OS
running on the non-secure side. Single core v7-M targets will continue
to have PSA implemented via PSA emulation, implemented by Mbed OS.
Move or remove many PSA-implementing files, as PSA will be provided by
TF-M on non-single-v7-M targets. Delete any files that are not relevant
for PSA emulation mode.
- Remove imported TF-M SPM
- Remove Mbed SPM and tests
- Remove Mbed-implemented PSA services and tests
- Remove PSA_SRV_IMPL, PSA_SRV_IPC, PSA_SRV_EMUL and NSPE.
- Replace PSA_SRV_EMUL and PSA_SRV_IMPL with MBED_PSA_SRV
- Remove any files autogenerated by
"tools/psa/generate_partition_code.py", which no longer exists.
Add new feature `PSA` to support PSA in Mbed OS.
Move the Mbed OS implementation of PSA services for v7-M targets (which
employ PSA emulation, and don't yet use TF-M) to
features/FEATURE_PSA/TARGET_MBED_PSA_SRV. Update the `requires`
attribute in TESTS/configs/baremetal.json to avoid breaking baremetal
testing builds.
Update .astyleignore to match new directory structure
Update Mbed TLS importer to place files into FEATURE_PSA
Create the following generic PSA targets:
* `PSA_Target` (Root level PSA generic target)
* `PSA_V7_M` (Single v7-M PSA generic target)
* `PSA_DUAL_CORE` (Dual-core PSA generic target)
* `PSA_V8_M` (v8-M PSA generic target)
Flatten MUSCA_NS and private MUSCA targets into public MUSCA targets.
Move mcuboot.bin to flat location (removing prebuilt folder)
Signed-off-by: Devaraj Ranganna <devaraj.ranganna@arm.com>
Signed-off-by: Jaeden Amero <jaeden.amero@arm.com>
Currently, the final binary (TF-M + Mbed OS) is signed after
concatenating TF-M and Mbed OS binaries. But TF-M signs the images
separately and then concatenates them. Update the Musca B1 signing
strategy to match TF-M.
Signed-off-by: Devaraj Ranganna <devaraj.ranganna@arm.com>
When python3 is enforced to build the ARM_MUSCA_A1 or ARM_MUSCA_B1
targets, it is unable to find binary utility tool scripts which are
imported from TF-M.
The reason to use the python3 environment is as follows: Mbed OS + TFM
contained a faulty boot record TLV, which failed the attestation test
(TF-M regression). The data in the boot record TLV will be included in
the generated attestation token as 1 item in the SW_COMPONENTS claim.
This data (in the boot record TLV) is pre-encoded in CBOR format at
build time and appended to the image during the image signing process
(done by the imgtool Python3 script).
Signed-off-by: Vikas Katariya <vikas.katariya@arm.com>
Give a warning rather than error if an unrecognised feature is used.
This will help compatibility when new features are added.
Signed-off-by: Darryl Green <darryl.green@arm.com>
For backwards compatibility reasons, since the latest Mbed OS tools must
be able to build any previous online-compiler-supported version of Mbed
OS, allow targets to use `default_lib` or `c_lib`. This should enable
the tools to work with Mbed OS 5 style targets.json.
- This change will cause build-system to produce both .bin and .hex files.
- Files are small and their creation is fast, thus there are no negative impact
on build time and storage requirements.
- .bin files are required for updating the device
- .hex files are very handy for post build (external to build system) custom
scripts (e.g. image signing)
- Configuration still allows selecting either .bin or .hex files, this settings is still
relevant as it specifies what file is flashed to a device for tests or by
`--flash` argument.
For backwards compatibility reasons, as the Mbed tools must be able to
build any online-compiler-supported version of Mbed, revert back to
emitting a warning when ARMC5 is used. This will enable ARMC5 to
continue working in the online compiler for Mbed OS 5 and other previous
versions. ARMC5 remains unsupported in Mbed 6.
This reverts commit 03d57b7ba2.
We cant afford to raise an exception now. As anyone using this out there do not catch it. Rather
an empty list, as it can work after this fix - won't do anything.
This is non trivial fix as the function is being used outside of this repository.
Tools rely on it to return list of targets for 2 or 5. As we removed release_version from many targets,
this broke the logic. To keep the logic as it was, without updating all tools out there now,
lets just return full set of targets - all are supported.
In case for Mbed 2, returning all targets does not make sense, but rather raise an exception here. Not supported. This avoids suprised. If you look at build api functions there are many checks for 2 or 5 so more
clean up needed to actually get release_version out of the tools.
cherry pick otherwise fails because the sources were moved under rtos/source. I manually resolved these patches. For the future, lets use these newer sha that should work.