Commit Graph

113 Commits (master)

Author SHA1 Message Date
Martin Kojtal 77f8a30749 cmsis: fix iar asm build error with including header
mbed-cli1 does not pass -I to IAR for iarasm (comparing to other toolchains). Because old tools are frozen,
we implement this workaround for fixing the build.

We use preprocessor macros that are passed to .S files anyway, so we do not loose anything but we do diverge again from CMSIS, for now..
2021-08-20 13:22:56 +01:00
Lingkai Dong 7e3565b5f5 Unit tests: Move cmsis target_h stubs
This creates a new mbed-headers-cmsis which is always and only used
by mbed-headers-platform, so we add the former to the laters' linked
targets.
2021-08-02 17:42:42 +01:00
Martin Kojtal 180eb75f09 cmsis: patch fpu in asm for armcc5
For FPU, use armasm to select fpu selection. This will be fixed upstream in the next version of CMSIS. Meanwhile, we use our local patch.

Taken from --cpu selection for armasm:

--cpu           | {FPU}
Cortex-M4.fp.sp | VFPv4_SP_D16
Cortex-M7.fp.sp | FPv5-SP
Cortex-M7.fp.dp | FPv5_D16

Tracking issue: https://github.com/ARM-software/CMSIS_5/issues/1266
2021-07-29 14:31:39 +01:00
Martin Kojtal c122158d49 cmsis: preprocess irq files
We use preprocessor for asm files even for Armcc. If symbol is defined it's replaced by preprocessor,
asembler would just see 1 or 0 in this case and errors:
TARGET_M33\\irq_armv8mml.S", line 31: Error: A1185E: Symbol missing

Use preprocessor instead.
2021-07-29 14:31:39 +01:00
Martin Kojtal dca1d5c42e cmsis: fix armcc compat header redefition of enable/disable irq
The fix will be in the 5.8.1 CMSIS, we cherry-pick it to our imported version.
See e797cca3f4
2021-07-29 14:31:39 +01:00
Martin Kojtal 00580ce3f5 cmsis: fix rtx_def inclusion in .S files for Gcc Arm
rtx_def includes two CMSIS headers that pull in C/C++ headers in our case. As I found out,
they should only define macros. We can fix it but it will require some refactoring as our targets
use mbed rtx headers to define heap using stdin header, plus some other offenders.

Workaround is to exclude the headers we do not need in irq assembly files.

Tracking issue https://github.com/ARMmbed/mbed-os/issues/14962
2021-07-29 14:31:38 +01:00
Martin Kojtal 218e93c97f cmsis: fix license header in rtx_def
Upstream fix was merged https://github.com/ARM-software/CMSIS_5/pull/1238. Included here as it will be overwritten once again updated
2021-07-29 14:29:57 +01:00
Bartek Szatkowski 4744fdb2f3 CMSIS/RTX: Allow overwriting mutex ops for ARMC
(cherry picked from commit 08ab8cc47d)
2021-07-27 10:06:39 +01:00
Deepika 06b815a9d2 CMSIS/RTX: Patch to conditionally compile
tz_context.c should be compiled only for secure world,
definition of API's in tz_context.h should be part of secure
binary/bootloader when building mbed-os as non-secure

(Cherry picked from d0a43b8af0)

(cherry picked from commit fb354752eb)
2021-07-27 10:06:38 +01:00
Bartek Szatkowski 8ade0d46ec 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)
2021-07-27 10:06:37 +01:00
Martin Kojtal 7941286531 [CMSIS_5]: Updated to 13b9f72f2 2021-07-27 10:06:34 +01:00
Martin Kojtal 2a24d81ef0
Merge pull request #14821 from boraozgen/rtos-events-enable
RTOS: Add configuration to enable RTX events
2021-07-20 09:47:59 +02:00
Bora Özgen 8b4b48e74c RTOS: Add configuration to enable RTX events 2021-06-23 14:38:35 +02:00
Meano 6feca90589 Unify the __CORTEX_A macro in the files containing cmsis.h 2021-06-23 13:36:52 +08:00
Werner Lewis c97dcd0bae CMSIS: Modify M0/M0+ GCC asm to support ARMC6 2021-05-24 13:56:19 +01:00
Werner Lewis 204dd5b1a8 cmake: Use GCC CMSIS assembly with ARM toolchain
CMSIS provides both GNU and legacy ARM assembly files. Instead of using
armasm and legacy asm with ARM Compiler 6, CMakeLists is modified to
use the GNU format with both GCC_ARM and ARM C6.
2021-05-24 13:56:19 +01:00
Rajkumar Kanagaraj a88f43f367 CMake: Update mbed os, unittest CMake and add CMAKE_CROSSCOMPILING guard
- Add a new MbedOS project in mbed os root CMake which can be used along with
  BUILD_TESTING conditional check for enabling the unittest build
- Update UNITTEST CMake for setting the CMake configuration like c, cxx flags etc.,
- Add if CMAKE_CROSSCOMPILING conditional check wherever target configuration check
  and toolchain configuration to avoid such configuration gets included for unittest build.
2021-05-11 02:49:03 -07:00
Lingkai Dong c4178b4ce8 TF-M targets: Clean up RTOS configuration
On Armv8 targets, the PSA interface on the non-secure side only
requires mutexes, thus we remove other RTOS overrides to reduce
memory usage in general use cases.

TF-M and PSA test applications require more RTOS resources, and
they have their own configurations defined in
mbed-os-tf-m-regression-tests.

This commit also adds missing configuration for ARM_MUSCA_B1.
2021-04-06 18:16:46 +01:00
Martin Kojtal 88a242f749
Merge pull request #14306 from hugueskamba/hk_cmake_create_cmsis_cortex_libs
CMake: Create CMSIS library targets to remove dependency on MBED_TARGET_LABELS
2021-02-23 08:36:49 +00:00
Hugues Kamba 2c3481297c CMake: Create CMSIS library targets to remove dependency on MBED_TARGET_LABELS
This goes towards eventually removing reliance on targets.json to specify
the requirements of Mbed targets.
2021-02-19 13:39:32 +00:00
Martin Kojtal 85c2d7a25c CMake: remove IAR references as they are not supported 2021-02-17 09:19:03 +00:00
Martin Kojtal 09e0ffda6e CMake rtos: add M55 to irq handlers, use m33 handlers = the same 2021-01-29 14:23:01 +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
Rajkumar Kanagaraj 8016a53400 CMake: replace usage of the mbed_add_cmake_directory_if_labels() function (#13754)
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().
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 0e257b0730 CMake: Fix location of M33 exception handler source file 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 d83648937f CMake: Add support for cmsis dir 2020-11-06 17:25:15 +00:00
Martin Kojtal 0bb4ff04c6 cmsis: remove math header file
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
2020-11-02 10:23:45 +00:00
Harrison Mutai 4fad1112e5 Add SPDX license identifier to Arm files
Add license identifier to files which Arm owns the copyright to,
and contain either BSD-3 or Apache-2.0 licenses. This is to address
license errors raised by scancode analysis.
2020-10-15 10:47:27 +01:00
Martin Kojtal 6bfd89e656
Merge pull request #13196 from gbrtth/musca_s1_support_mbed6
Add ARM_MUSCA_S1 as a new target platform
2020-09-10 16:53:14 +01:00
Gabor Toth bdf2306f16 Add platform support to Musca S1
Change-Id: Iebdd4bc402446caba6b7bd894eddb0a85ed884d8
Signed-off-by: Mark Horvath <mark.horvath@arm.com>
Signed-off-by: Gabor Toth <gabor.toth@arm.com>
2020-09-10 14:53:41 +02:00
Mark Horvath 656e046113 Call mbed_tfm_init earlier
Change-Id: I0f45425058bf5cabbda877463ff1d8f4d713be8f
Signed-off-by: Mark Horvath <mark.horvath@arm.com>
2020-09-08 14:36:12 +02: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
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
Michael Schwarcz 58af676e9c CMSIS/CORTEX-M: Don't build mbed_tz_context.c in TF-M targets
- TF-M v8m secure-side implements their own TZ context APIs so need to avoid building the Mbed implementation.

(cherry picked from commit d3f7abdb7c)
2020-05-11 11:18:02 +01:00
Deepika 856989d5d4 CMSIS/RTX: Patch to conditionally compile
tz_context.c should be compiled only for secure world,
definition of API's in tz_context.h should be part of secure
binary/bootloader when building mbed-os as non-secure

(Cherry picked from d0a43b8af0)

(cherry picked from commit fb354752eb)
2020-05-11 11:18:00 +01:00
Bartek Szatkowski b6313331cd CMSIS/RTX: Reintroduce arm_math.h
(cherry picked from commit 6a6e3ac0eb)
2020-05-11 11:17:57 +01:00
Martin Kojtal fb4f9e5b19 [CMSIS_5]: Updated to a65b7c9a3 2020-05-11 11:17:50 +01:00
Michael Schwarcz 80f2475a89 CMSIS/CORTEX-M: Don't build mbed_tz_context.c in TF-M targets
- TF-M v8m secure-side implements their own TZ context APIs so need to avoid building the Mbed implementation.

(cherry picked from commit d3f7abdb7c)
2020-05-11 09:47:34 +01:00
Deepika fcaecd57ce CMSIS/RTX: Patch to conditionally compile
tz_context.c should be compiled only for secure world,
definition of API's in tz_context.h should be part of secure
binary/bootloader when building mbed-os as non-secure

(Cherry picked from d0a43b8af0)

(cherry picked from commit fb354752eb)
2020-05-11 09:47:34 +01:00
Bartek Szatkowski 9f1e666732 CMSIS/RTX: Reintroduce arm_math.h
(cherry picked from commit 6a6e3ac0eb)
2020-05-11 09:47:34 +01:00
Martin Kojtal 48747cdb26 [CMSIS_5]: Updated to b5f0603d6 2020-05-11 09:47:34 +01:00
Martin Kojtal 5a985a7da5 cmsis: remove arm math
Fixes #12054

Not needed file, should be part of DSP. The functionality is part of the library provided
by CMSIS.
2020-01-03 12:25:39 +00:00
Jonatan Antoni 14150bb7c6 Core(A): Fixed __FPU_Enable function not to mess registers. (#589)
- Enhanced function to use only two temporary registers.
- Added used registers to clobber list.

Change-Id: If7c9462ed4424781e40379fbe12a5e4e3257920f
2019-05-21 19:25:58 +09:00
Michael Schwarcz e8f9faee7e CMSIS/CORTEX-M: Don't build mbed_tz_context.c in TF-M targets
- TF-M v8m secure-side implements their own TZ context APIs so need to avoid building the Mbed implementation.

(cherry picked from commit d3f7abdb7c)
2019-04-10 14:42:48 +03:00
Deepika cd54d2e02f CMSIS/RTX: Patch to conditionally compile
tz_context.c should be compiled only for secure world,
definition of API's in tz_context.h should be part of secure
binary/bootloader when building mbed-os as non-secure

(Cherry picked from d0a43b8af0)

(cherry picked from commit fb354752eb)
2019-04-10 14:42:43 +03:00