Commit Graph

714 Commits (8f0724600864946edc38fa5db1fbca41987e2b1e)

Author SHA1 Message Date
Evelyne Donnaes 786c64af06 Fix ThisThread warnings 2020-11-27 11:57:09 +00:00
Martin Kojtal 57bbb4739b
Merge pull request #13085 from pea-pod/remove-deprecated-mbed-assert
Change MBED_STATIC_ASSERTs version for built-in
2020-11-24 13:38:07 +00:00
Hugues Kamba 794e32df74 CMake: Use relative paths to list source files and directories
The absolute path is still required for listing linker
files as they are referenced from a function in the top
level CMake input source file.
2020-11-09 12:32:30 +00:00
Martin Kojtal f8a02ce5de Update rtos/CMakeLists.txt
Co-authored-by: Hugues Kamba <41612201+hugueskamba@users.noreply.github.com>
2020-11-06 17:25:22 +00:00
Rajkumar Kanagaraj e7c0d93ad4 CMake: add mbed-os and mbed-baremetal targets
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.
2020-11-06 17:25:22 +00:00
Rajkumar Kanagaraj d2be577b01 CMake: split rtos from core target
Add or remove and directories containing source files, header files, and macro definitions that implement RTOS support.
This includes:
- cmsis/CMSIS_5/CMSIS/RTOS2/
- cmsis/device/rtos/
- rtos/source/ConditionVariable.cpp
- rtos/source/Thread.cpp
2020-11-06 17:25:22 +00:00
Hugues Kamba bf84a5b329 CMake: Rename CMake targets
* mbed-os renamed mbed-core
* mbed-os-<COMPONENT> renamed mbed-<COMPONENT>
2020-11-06 17:25:22 +00:00
Hugues Kamba c82e8c2337 CMake: Restore rtos api and netsocket presence macro names
The old tools rely on the old names to build
2020-11-06 17:25:22 +00:00
Martin Kojtal 8529e88e61 cmake: fix present inclusion
We use only _PRESENT macros for components if they are enabled. Use the same in
the mbed.h file or anywhere else.
2020-11-06 17:25:21 +00:00
Hugues Kamba fa98689639 CMake: Componentize Mbed OS into multiple CMake targets (#13732)
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>
2020-11-06 17:25:21 +00:00
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 b78ef7ac08 CMake: Fix CI error due to dir restruct of rtos and storage dirs 2020-11-06 17:25:16 +00:00
Hugues Kamba 554a5d3597 CMake: Fix failure due to restructure of rtos and ppp directories 2020-11-06 17:25:16 +00:00
Hugues Kamba 5c453e5d46 CMake: Add support for rtos dir 2020-11-06 17:25:15 +00:00
pea-pod 507181d262 Change MBED_STATIC_ASSERTs version for built-in 2020-10-27 08:30:40 -05:00
Rajkumar Kanagaraj fcf36bb9e2 Move rtos greentea test closure to library 2020-09-16 13:06:05 +01: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
Martin Kojtal e127bb245e
Merge pull request #13374 from caoyuan96421/bugfix2
Fixed ThisThread flag_wait_any functions (fix #13360)
2020-08-10 11:45:37 +01:00
George Beckstein e77cdffbaa Include mbed_assert.h in Queue 2020-07-30 11:23:24 -04:00
Yuan Cao 8a2428b4dc Fixed ThisThread flag_wait_any functions 2020-07-29 20:47:05 -04:00
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