Commit Graph

689 Commits (514255f22b768d627c5cb850b84b0a7437b026a5)

Author SHA1 Message Date
Qinghao Shi fe8e51fde2 TESTS: fix timing drift test in rtos folder 2020-07-28 14:16:56 +01:00
Qinghao Shi 0bacd5b8e1 TESTS: update test with explicit skip message 2020-07-28 14:15:51 +01:00
Evelyne Donnaes 0dd6b195d7 Fixed doxygen comment 2020-07-20 17:40:41 +01:00
Ashok Rao 04fac35252 Incorporating reveiw comments - Moving mbed_rtos_types.h to public headers 2020-07-15 13:54:52 +01:00
Ashok Rao 3a1b0744ba Moving around a few items within \rtos 2020-07-09 15:57:29 +01: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 1014f8ca72
Merge pull request #12971 from kjbracey-arm/memorypool
MemoryPool fixes
2020-05-15 08:07:38 +02:00
Martin Kojtal e371db441c
Merge pull request #12949 from 0xc0170/feature_CMSIS_5_b5f0603d6
CMSIS: update to CMSIS 5.7.0
2020-05-14 13:21:12 +02:00
Kevin Bracey 24e7955edf MemoryPool fixes
Various deprecated methods weren't correct following recent changes.
2020-05-14 11:31:46 +03:00
Martin Kojtal 0b4b2afaf4
Merge pull request #12901 from kjbracey-arm/mailchrono
Rationalise Mail/Queue/MemoryPool timing APIs
2020-05-12 17:10:43 +02:00
Kevin Bracey 181446331e Rationalise Queue/Mail get/put APIs
To line up with MemoryPool/Mail alloc, rework naming of get/put

    Queue::get -> try_get, try_get_for
    Queue::put -> try_put, try_put_for
    Mail::get -> try_get, try_get_for
    Mail::put (no change, but assert that it works)

In the future the names `get` and `put` can be used for untimed blocking
operations. In the interim, you have to use
`try_get_for(Kernel::wait_for_u32_forever)`.

`Mail::put` differs in that it has always been a non-blocking call, but
it can be assumed to always succeed when used correctly, because the
Queue has enough room to store a pointer to every block in the
MemoryPool. It could in future be made a `void` return, similar to the
change made to `Mutex::lock`.
2020-05-12 15:17:01 +03:00
Kevin Bracey 166ada084e Rationalise MemoryPool/Mail alloc APIs
alloc APIs were generally inconsistent - take the opportunity to align with
other APIs like Semaphore.

    alloc -> try_alloc
    alloc_for -> try_alloc_for
    alloc_until -> try_alloc_until

In future the name `alloc` can be used for an untimed blocking
allocation.
2020-05-12 15:17:01 +03: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
Martin Kojtal 6052b4540a
Merge pull request #12872 from rajkan01/kernel_interface_func_doxygen
Add the Doxygen note to non-supported RTOS kernel APIs.
2020-04-29 22:17:14 +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
Rajkumar Kanagaraj 57e0063e8d Add the Doxygen note to non-supported RTOS kernel APIs. 2020-04-27 14:38:14 +01:00
Kevin Bracey e5e45d83e7 Chrono test fixes
* Remove ambiguity in single-parameter Queue::put and get
* Fix type problems in RTC test - add missing include
* Don't attempt to use TimerEvent default constructor
* Remove references to Timer::read_duration
2020-04-27 10:19:08 +03:00
Rajkumar Kanagaraj c71c980ccd Fix the CI build and unit test issue 2020-04-27 10:19:08 +03:00
Kevin Bracey 4575ad3f23 Add Chrono support to Queue,MemoryPool,Mail 2020-04-27 10:19:08 +03:00
Kevin Bracey f6e8ecadec Add Chrono support to EventFlags 2020-04-27 10:19:08 +03:00
Kevin Bracey 4f2fa53b37 Thread: minor space optimisation 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