Access MBED_TARGET_LABELS as a global variable instead of a property.
At this point the evaluation of the property MBED_TARGET_LABELS
created in the top level CMakeLists.txt results in an empty string.
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>
Prevent singleton lock if the RTOS is not yet ready.
lp_ticker is used during the RTOS initialization process.
ST lp_ticker implementation calls sleep functions
which in turn attempts to print to the console when sleep tracing
is enabled. Console initialization attempts to lock the singleton mutex.
`Mutex::unlock` was decrementing the `_count` member after releasing
the mutex, which meant it was unprotected, exposing a race that
could corrupt the count.
This could lead to an assert in `ConditionVariable::wait`, which
checks that the mutex count is one.
RTE_Component can't be included in the assembly file, as it is application header file
(C/C++) therefore assembler fails in this case. If the symbol RTE_CMSIS_RTOS2_RTX5_ARMV8M_NS is
needed, just define it via config. Therefore I am leaving the rest of ifdef _RTE_ there.
CMSIS repo does not support pre-processor defines, hence multiple assembly
files are added for secure/non-secure and floating point tools.
Mbed OS tools support assembly file pre-processing, but the build system
does not support multiple assembly files for each target, hence updating
the assembly files.
1. Patch RTX so irq_cm4f.S files work with no FPU targets
2. Patch RTX so irq_armv8mml.S files to work with and without FPU
2. Patch RTX so irq_armv8mml.S and irq_armv8mbl.S files to work with secure and
non-secure builds
(cherry picked from commit 96e0689204)
In case of ARM compiler, idle and timer thread stack though assigned
to `.bss.os` section since not zero initialized are part of `data` section.
In this commit, we are moving stacks of idle and timer thread to bss
section and thereby saving ROM space.
(cherry picked from commit 9549fff786)
mbed OS used older RTX4 version and with osThreadDef accepting only 3
parameters, to preserve compatibility we hardcode the 'instances'
parameter to 1.
(cherry picked from commit 428acae1b2ac15c3ad523e8d40755a9301220822)
(cherry picked from commit 4360b7bbf8)
CMSIS repo does not support pre-processor defines, hence multiple assembly
files are added for secure/non-secure and floating point tools.
Mbed OS tools support assembly file pre-processing, but the build system
does not support multiple assembly files for each target, hence updating
the assembly files.
1. Patch RTX so irq_cm4f.S files work with no FPU targets
2. Patch RTX so irq_armv8mml.S files to work with and without FPU
2. Patch RTX so irq_armv8mml.S and irq_armv8mbl.S files to work with secure and
non-secure builds
In case of ARM compiler, idle and timer thread stack though assigned
to `.bss.os` section since not zero initialized are part of `data` section.
In this commit, we are moving stacks of idle and timer thread to bss
section and thereby saving ROM space.
mbed OS used older RTX4 version and with osThreadDef accepting only 3
parameters, to preserve compatibility we hardcode the 'instances'
parameter to 1.
(cherry picked from commit 428acae1b2ac15c3ad523e8d40755a9301220822)
(cherry picked from commit 4360b7bbf8)
Chrono conversions inadvertantly changed the core timed sleep routine
used by the RTOS idle to use `OsTimer::update_and_get_tick()` instead of
`OsTimer::get_tick()`.
Correct this, and expand/clarify documentation and naming to try to
prevent recurrence.
Another minor fix observed while inspecting code - `OsClock` can't just
use `milliseconds`, it should match the period of `OsTimer`, which
theoretically can be different.
Previously we overrode nRF targets to have a larger stack
due to memory required by SoftDevice. Having deprecated SoftDevice
in favour of Cordio for BLE (#12674), such requirement does not
apply anymore.
All MBED_SPM targets have been removed previously, via commits
5cc66282dd ("PSOC6: remove PSA targets") and 115b09aba43b ("psoc6:
Remove FUTURE_SEQUANA and FUTURE_SEQUANA_M0"). Remove all the dead
MBED_SPM code, as no targets use it.
Signed-off-by: Jaeden Amero <jaeden.amero@arm.com>
Some non-Mbed-OS, pre-existing CMSIS-RTOSv2 applications depend on
CMSIS-RTOSv2 Automatic Dynamic Allocation, also known as Object-specific
memory pools. Mbed OS doesn't by default provide any memory to the
CMSIS-RTOSv2 Automatic Dynamic Allocation pool, as doing so would waste
memory if the feature is not used; even if the feature is used, as a
platform, Mbed OS can't know how many objects of which types will be
created by an application and therefore will either waste memory or not
provide enough memory in a hard to debug manner. Portable CMSIS-RTOSv2
applications depending on CMSIS-RTOSv2 Automatic Dynamic Allocation
should instead configure the memory pools themselves, as applications
know best their memory requirements.
Add Mbed configuration options which can be used by applications to
control the amounts of memory available to the CMSIS-RTOSv2 Automatic
Dynamic Allocation subsystem. This enables portable CMSIS-RTOSv2
applications, which can run on any CMSIS-RTOSv2 OS, to be able to run on
Mbed OS as well.
RTX's configuration options for CMSIS-RTOSv2 memory are documented at
http://www.keil.com/pack/doc/CMSIS_Dev/RTOS2/html/config_rtx5.html
Signed-off-by: Devaraj Ranganna <devaraj.ranganna@arm.com>
Signed-off-by: Jaeden Amero <jaeden.amero@arm.com>
These changes are for TFM_DUALCPU and TFM_V8M platforms.
The initialization happens after mbed-os kernel is kicked off and
when the thread is up and running.
We are initializing the following for TFM_DUALCPU platforms:
* IPC Interrupts for syncing multi-core platforms.
* NS Mailbox to receive messages.
* NS interface.
We are only initializing Non-secure interface for TFM_V8M platforms.
mbed_tfm_init() in tfm_mbed_boot.c overrides the WEAK mbed_tfm_init()
for a specific platform.
Signed-off-by: Vikas Katariya <vikas.katariya@arm.com>
Following IAR guide for RAM vector table, this is in the code snippet there:
```
extern void * __vector_RAM_table [];
void main(void)
```
Found in https://github.com/ARMmbed/mbed-os/pull/12547