Commit Graph

84 Commits (0f7d03ae1c48350ee9581c6a68cf787fb98b5498)

Author SHA1 Message Date
Hugues Kamba a0fbe2947a CMake: Fix build failure due to CMSIS restructure 2020-11-06 17:25:20 +00:00
Hugues Kamba 42cd929418 CMake: Fix detection of RTX assembly file
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.
2020-11-06 17:25:18 +00:00
Hugues Kamba 06f4e1bc8b CMake: Break down RTX CMake source file into 2 source files 2020-11-06 17:25:18 +00:00
Hugues Kamba 5c453e5d46 CMake: Add support for rtos dir 2020-11-06 17:25:15 +00:00
Hugues Kamba 834e530abd CMSIS: Restructure ported CMSIS_5
See docs/adr/0001_cmsis_component_source_structure_recommendations.md
For details information.
2020-09-01 15:55:13 +01:00
Anna Bridge b3c19227a4
Merge pull request #13459 from 0xc0170/fix_platform_component
platform: fix internal platform headers
2020-08-25 15:53:12 +01:00
Martin Kojtal a6ce2c53a0 platform: move internal headers to internal/
They belong to internal folder to follow our guideline, not in source as they were.
2020-08-20 08:58:00 +01:00
Lingkai Dong 017b043473 TARGET_PSOC6: set CY_RTOS_AWARE based on RTOS availability 2020-08-13 12:12:46 +01:00
Yuan Cao 8a2428b4dc Fixed ThisThread flag_wait_any functions 2020-07-29 20:47:05 -04:00
Devaraj Ranganna 76e911c5ef psa: Replace Mbed PSA with TF-M
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>
2020-06-18 12:16:20 +01:00
Martin Kojtal 04498252e1
Merge pull request #13034 from hugueskamba/hk_fix_sleep_tracing
ST boards: Fix sleep tracing
2020-06-05 15:51:46 +02:00
Martin Kojtal 8ff3c95b2d
Merge pull request #13030 from kjbracey-arm/thisthreadgetname
Fix ThisThread::get_name definition
2020-06-05 10:39:34 +02:00
Martin Kojtal 7ae621ee86
Merge pull request #12988 from jeromecoutant/PR_OS_TIMER
OS timer uses LPTICKER by default, then USTICKER
2020-06-04 15:15:43 +02:00
Martin Kojtal 0a365b3ae0
Merge pull request #12983 from kjbracey-arm/mutexcount
Mutex::unlock - decrement _count inside lock
2020-06-04 14:39:28 +02:00
Hugues Kamba 5d94fd4d73 ST boards: Fix sleep tracing
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.
2020-06-01 15:31:09 +01:00
Kevin Bracey 922b656d39 Fix ThisThread::get_name definition 2020-05-29 11:46:58 +03:00
jeromecoutant a7c9601d08 OS timer uses LPTICKER by default, then USTICKER
This PR makes the bare-metal mode work automatically
regardless of the tickless-from-us-ticker setting
- in non RTOS mode
- and in RTOS tickless mode
2020-05-19 12:34:11 +02:00
Kevin Bracey b52a3b3120 Mutex::unlock - decrement _count inside lock
`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.
2020-05-15 19:10:53 +03:00
Lingkai Dong 0ac17eaea8 Define MBED_CONF_RTOS_MAIN_THREAD_STACK_SIZE properly in rtos mbed_lib.json 2020-05-15 15:16:44 +01:00
Martin Kojtal 7149ffed11 rtos: do not include RTE_Component header
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.
2020-05-12 12:10:48 +01:00
Martin Kojtal 2fae95e85e rtos: fix incorrect conflict resolution
We used previously __FPU_USED so stay with it in M33 startup file.
2020-05-12 08:10:41 +01:00
Bartek Szatkowski 640e1fd896 CMSIS/RTX: Pre-processor defines used for assembly
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)
2020-05-11 11:25:59 +01:00
deepikabhavnani 30597a6ab9 CMSIS/RTX: Move Idle and Timer thread stack to bss section.
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)
2020-05-11 11:22:44 +01:00
Bartek Szatkowski f7dc7e92c8 CMSIS/RTX: Fix using FALSE/TRUE with preprocesor
(cherry picked from commit dd21ea0ae0)
2020-05-11 11:22:37 +01:00
Bartek Szatkowski 94d9406621 CMSIS/RTX: Allow overwriting mutex ops for ARMC
(cherry picked from commit 08ab8cc47d)
2020-05-11 11:18:04 +01:00
Bartek Szatkowski 63370074b1 CMSIS/RTX: Patch RTX4 to preserve osThreadDef compatibility
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)
2020-05-11 11:17:54 +01:00
Martin Kojtal fb4f9e5b19 [CMSIS_5]: Updated to a65b7c9a3 2020-05-11 11:17:50 +01:00
Bartek Szatkowski 96e0689204 CMSIS/RTX: Pre-processor defines used for assembly
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
2020-05-11 10:36:13 +01:00
deepikabhavnani 9549fff786 CMSIS/RTX: Move Idle and Timer thread stack to bss section.
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.
2020-05-11 10:35:25 +01:00
Bartek Szatkowski dd21ea0ae0 CMSIS/RTX: Fix using FALSE/TRUE with preprocesor 2020-05-11 10:34:45 +01:00
Bartek Szatkowski 08ab8cc47d CMSIS/RTX: Allow overwriting mutex ops for ARMC 2020-05-11 10:28:12 +01:00
Bartek Szatkowski db2ef01580 CMSIS/RTX: Patch RTX4 to preserve osThreadDef compatibility
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)
2020-05-11 09:47:34 +01:00
Martin Kojtal 48747cdb26 [CMSIS_5]: Updated to b5f0603d6 2020-05-11 09:47:34 +01:00
Kevin Bracey 3f67eed31c Correct core RTOS sleep routine timing
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.
2020-05-07 11:43:01 +03:00
Martin Kojtal d1ae0d570c
Merge pull request #12425 from kjbracey-arm/chrono
C++ Chrono support
2020-04-30 11:41:43 +02:00
Lingkai Dong 81e676b86b RTOS: use default boot-stack-size for nRF as SoftDevice is no longer used
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.
2020-04-27 17:22:49 +01:00
Kevin Bracey f6e8ecadec Add Chrono support to EventFlags 2020-04-27 10:19:08 +03:00
Kevin Bracey 2c4e59012f Add Chrono support to Mutex 2020-04-27 10:19:08 +03:00
Kevin Bracey 53cfe0f610 Add Chrono support to Semaphore 2020-04-27 10:19:08 +03:00
Kevin Bracey 0223d92f7e Add Chrono support to ThisThread 2020-04-27 10:19:08 +03:00
Kevin Bracey fdc697ee85 Add Chrono and predicate support to ConditionVariable 2020-04-27 10:19:08 +03:00
Kevin Bracey f4e0ea2c75 Add Chrono support to Kernel and SysTimer 2020-04-27 10:19:08 +03:00
Martin Kojtal a79d3ce18d
Merge pull request #12271 from jainvikas8/jae-feature-twincpu-6-mbed-os-integration
Make cypress psoc64 TFM ready and also add TF-M initialization
2020-04-17 15:48:58 +02:00
Martin Kojtal dcd863bfe9
Merge pull request #12736 from Patater/rtosv2-compat
rtos: Improve CMSIS-RTOSv2 app compatibility
2020-04-17 09:29:01 +02:00
Jaeden Amero 07a84ec10a psa: Remove MBED_SPM code
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>
2020-04-16 14:10:54 +01:00
Devaraj Ranganna fa5a954031 rtos: Improve CMSIS-RTOSv2 app compatibility
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>
2020-04-15 18:08:14 +01:00
Vikas Katariya 9b7ef82b40 psa: Init IPC, Mailbox and Non-secure Interface
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>
2020-04-03 15:48:58 +01:00
Martin Kojtal 6678efe571
Merge pull request #12696 from 0xc0170/fix_boot_iar_vector
rtos: declare vector table type as in Technical Note 11578
2020-04-01 12:22:21 +02:00
Martin Kojtal b090065dec
Merge pull request #12708 from rajkan01/ARM_compiler_version
Remove compatibility for Arm Compiler versions prior to 6.01.0050
2020-03-31 10:36:56 +02:00
Martin Kojtal 5cbf666347 rtos: fix iar vector table type
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
2020-03-30 13:37:15 +01:00