Commit Graph

1221 Commits (d489c92a1bc541d19df66f79501a91ba3f29764b)

Author SHA1 Message Date
Martin Kojtal 1fd4cfd798
Merge pull request #14516 from 0xc0170/fix-cmake-project-name
CMake: remove MBED_PATH and use <PROJECT-NAME>_SOURCE_DIR/MODULE_PATH instead
2021-04-15 14:00:21 +02:00
Martin Kojtal 121c8286da CMake: set CMAKE_MODULE_PATH in the Mbed OS CMakelists.txt
Update CMAKE_MODULE_PATH at once place.

Note, we update also CMAKE_MODULE_PATH in app.cmake. This is temporary until we get a proper way to include
Mbed Os (removing app.cmake need to be included by an application).
2021-04-14 13:09:28 +01:00
Martin Kojtal b6a90c4ae1 CMake: fix for CMAKE_CURRENT_LIST_DIR in functions
CMAKE_CURRENT_LIST_DIR behaves differently in functions. We store it in the CMakeLists itself, so anyone
calling a function would get the actual list dir where the scripts are.

To illustrate: if I call a function from src/CMakelists.txt, function located in src/scripts, `CMAKE_CURRENT_LIST_DIR` in the function would point
to the src/ folder but not to src/scripts.
2021-04-14 13:09:27 +01:00
Martin Kojtal afd938491a CMake platform: remove MBED_PATH, use standard variables
As we still use target labels, TFM is not visible to CMake. Protect include of their scripts with the same mechanism.
2021-04-14 13:09:26 +01:00
Lingkai Dong bd92ca06fa ARM_MUSCA_B1: default baud rate to 115200
The TF-M secure binary has a fixed baud rate of 115200. Having a
different baud rate on the non-secure side results in broken serial
outputs.
2021-04-06 18:11:46 +01:00
Anna Bridge d20384aaf9
Merge pull request #14456 from ladislas/ladislas/feature/fix-mbed_atomic-mac-m1
Fix define MBED_EXCLUSIVE_ACCESS for Apple M1 (__aarch64__) computers
2021-03-26 14:57:10 +00:00
Ladislas de Toldi f80ed5ef3e
Fix define MBED_EXCLUSIVE_ACCESS for Apple M1 (ARM64) computers
The new Apple M1 Mac computers are ARM based. When compiling and running
unit tests on an M1 Mac, the architecture is defined as __arm__

An extra check for __aarch64__ is needed to set MBED_EXCLUSIVE_ACCESS to 0U for the M1
Mac

If not, compilation fails with "Unknown ARM architecture for exclusive access" error
2021-03-23 11:42:02 +01:00
Lingkai Dong e6fd25df83 Enforce full-qualified path for `os_wrapper/*.h`
Some host operating systems are case-insensitive and cannot
distinguish (for example) `semaphore.h` in `os_wrapper` from
`Semaphore.h` from Mbed OS `rtos`. This causes the wrong header to be
included.

By adding `os_wrapper/.mbedignore`, we guarantee that

    #include "Semaphore.h"

always points to `rtos/Semaphore.h`, while the fully-qualified include

    #include "os_wrapper/semaphore.h"

continues to work because its parent directory is still in the include
path.
2021-03-22 16:41:52 +00:00
Martin Kojtal 96e19afdd1
Merge pull request #14396 from LDong-Arm/tfm_os_wrapper
TF-M: Switch to vanilla TF-M's OS wrapper
2021-03-22 12:06:04 +01:00
Lingkai Dong a6081e5681 Update VERSION.txt for imported TF-M files 2021-03-22 10:01:46 +00:00
George Psimenos d239ef98cd Rename USBTX/RX to CONSOLE_TX/RX 2021-03-18 17:01:54 +00:00
jeromecoutant 9d453cce68 [STD-PIN] ARDUINO_UNO pins
- hal/include/hal/ArduinoUnoAliases.h creation
- doc update
2021-03-18 17:01:50 +00:00
jeromecoutant a4350f72bd [STD-PIN] BUTTON and LED define
hal/tests/TESTS/mbed_hal/gpio/main.cpp is replaced by
hal/tests/TESTS/pin_names/generic/main.cpp now
2021-03-18 17:01:50 +00:00
jeromecoutant a6c213bb10 [STD-PIN] Replace STDIO_UART_TX by USBTX 2021-03-18 17:01:50 +00:00
Lingkai Dong eeae3d73dd Import OS wrapper from the vanilla TF-M
Previous, we patched TF-M to replace its OS wrapper with CMSIS RTOS
to resolve manage management issue when integrated with Mbed OS. But
as of TF-M v1.2, the OS wrapper has been reworked in the vanilla TF-M,
and now it makes identical calls to its underlying CMSIS RTOS as our
patches do. So, we remove our patches and use vanilla TF-M's OS
wrapper instead to avoid extra maintenance overhead.

This commit re-imports TF-M files associated with the OS wrapper.
2021-03-17 09:41:56 +00:00
mbedmain c73413893f Update Mbed version block 2021-03-15 12:45:41 +00:00
Martin Kojtal 8947e3cbeb
Merge pull request #14403 from saheerb/CY8CKIT064B0S2_4343W-115200
update baud rate of CY8CKIT064B0S2_4343W to 115200
2021-03-12 13:28:21 +00:00
Lingkai Dong 4450464fc8 Add integer overflow check to the malloc wrappers
Add a check that the combined size of the buffer to allocate and
alloc_info_t does not exceed the maximum integer value representable
by size_t.
2021-03-10 09:47:15 +00:00
Saheer Babu aba132e84c update baud rate of CY8CKIT064B0S2_4343W to 115200 2021-03-09 22:48:50 +00:00
Lingkai Dong 31cc82dabb "Updated secure binaries for [(ARM_MUSCA_S1, ARMCLANG)]"
This brings in the platform init fix:

    https://github.com/ARMmbed/trusted-firmware-m/pull/15
2021-03-09 10:22:58 +00:00
Lingkai Dong f225791fee CMake: Support signing and merging TF-M binaries
This commit adds post binary hook support for TF-M targets.

To apply this hook to a TF-M target, do the following in the target's
`CMakeLists.txt`:
* include `mbed_set_post_build_tfm.cmake`
* call `mbed_post_build_tfm_sign_image()`, passing
  - Mbed OS target name
  - TF-M target name
  - path containing the target's bootloader, layout files and signing
    keys
  - path to the secure binary
  - path to the non-secure binary (i.e. the "raw" Mbed application)
2021-03-05 16:16:26 +00:00
Martin Kojtal 8a1ce92317
Merge pull request #14368 from LDong-Arm/minimal_printf_cmake_fix
Fix CMake include path for the minimal-printf test
2021-03-05 14:22:09 +00:00
Lingkai Dong 074b0ba00c Fix CMake include path for the minimal-printf test 2021-03-02 17:27:50 +00:00
Lingkai Dong 62c8379d8d TARGET_TFM_V1_0: compatibility with Mbed TLS 2.24.0
Mbed TLS 2.24.0 requires a few new macros and an inline function in
the PSA Crypto header. This PR adds them to make sure the TF-M v1.0
target (specifically CYTFM_064B0S2_4343W) continues to compile with
the new Mbed TLS.

Note: Support for older versions of TF-M than v1.2 will be dropped,
so existing TF-M targets should migrate to TF-M v1.2 as soon as
possible.
2021-02-25 15:40:57 +00:00
Lingkai Dong 2807a01fd3 "Updated directory platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_LATEST " 2021-02-25 14:02:57 +00:00
Lingkai Dong eb0ac59494 Deprecation warnings for key enrollment algorithm
Setting/getting key enrollment algorithm is not recommended and not
part of the vanilla PSA or TF-M. For now keep the API just for
backward compatibility with existing projects, and this commit
adds deprecation warnings.
2021-02-25 14:02:57 +00:00
Lingkai Dong 12b2c89962 PSA/TF-M: support key enrollment algorithm
Add `psa_set_key_enrollment_algorithm()` and
`psa_get_key_enrollment_algorithm()` for TF-M targets.

Note: This is deprecated and for backward compatibility only.
Setting an enrollment algorithm is not recommended, because
using the same key with different algorithms can allow some
attacks based on arithmetic relations between different
computations made with the same key, or can escalate harmless
side channels into exploitable ones. Use this function only
if it is necessary to support a protocol for which it has been
verified that the usage of the key with multiple algorithms
is safe.
2021-02-25 14:02:57 +00:00
Vikas Katariya ab09a6934b Add mbedtls_ecc_group_to_psa() to PSA in TF-M 1.2
The PSA headers imported from TF-M does not contain a declaration of
mbedtls_ecc_group_to_psa(), which is expected by pk.c from Mbed TLS.
This leads to an "undefined symbol" error when using the ARM toolchain
to compile an application for a TF-M target.
2021-02-25 14:02:56 +00:00
Vikas Katariya 260a33574b core: Upgrade TFM v1.2 related files
These files have been imported/copied from:
* ARMmbed/trusted-firmware-m
* ARMmbed/tf-m-tests

These are generic files, which are required for TF-M v1.2 integration
with Mbed OS for PSA_V8M and PSA_DUAL_CORE targets.
2021-02-25 14:02:56 +00:00
Vikas Katariya b0da9d0cdf Switch to using `TARGET_TFM_LATEST`
Rather than maintaining a specific `TARGET_TFM_V1_x`, its better to use
more generic name `TARGET_TFM_LATEST` to avoid confusion on the latest
TFM version supported by Mbed OS

* Rename the folder from `TARGET_TFM_V1_1` to `TARGET_TFM_LATEST`
* Update the CmakeLists.txt
* Change the name of the MUSCA targets to maintain uniformity
with TF-M v1.2
* Update target.json for PSA_V8_M to use `TFM_LATEST`
2021-02-25 14:02:55 +00:00
Lingkai Dong 410a1bad6b Import mbedtls-2.24 and Mbed PSA Service (non-TFM)
Files have been automatically imported by setting MBED_TLS_RELEASE to
mbedtls-2.24.0 in connectivity/mbedtls/tools/importer/Makefile and
running `make` in that directory.
2021-02-25 14:02:55 +00:00
Martin Kojtal 85c2d7a25c CMake: remove IAR references as they are not supported 2021-02-17 09:19:03 +00:00
Martin Kojtal 09dd4d2582 CMake platform: remove IAR related CMakeLists
Not supported
2021-02-17 09:15:50 +00:00
mbedmain 26606218ad Update Mbed version block 2021-02-16 16:01:39 +00:00
Martin Kojtal fb0d646f23
Merge pull request #14179 from caoddx/fix-minimal-printf
Fix minimal-printf floating point decimal output error
2021-02-05 10:10:39 +00:00
Rajkumar Kanagaraj 6824b14e48 CMake: rename greentea test macro 2021-02-02 07:43:40 -08:00
mbedmain 0c6753bb82 Update Mbed version block 2021-01-25 14:58:06 +00:00
caodd 9a7b2a8647 Fix minimal-printf floating point decimal output error 2021-01-20 20:54:34 +08:00
Martin Kojtal d841c77921
Merge pull request #13968 from hugueskamba/hk_cmake_arm_ssg_support
CMake: Add support for all ARM SSG Mbed targets
2021-01-20 08:03:03 +00:00
Hugues Kamba c724d790c0 CMake: Add mbed-psa library as a dependency to mbed-core if PSA is used
Include PSA source files only if a given Mbed target needs it.
This commit also consolidates CMakeLists.txt files within the platform
directory
2021-01-18 17:39:13 +00:00
Marc Emmers a8ea7758c3 Fix make_span text in comment block 2021-01-18 15:49:29 +01:00
Marc Emmers 8551e93bf2 Fix last extra space issues 2021-01-18 14:36:17 +01:00
Marc Emmers a826c89b10 Backport dynamic extent when including <span>
Keep make_span functions even when <span> is available for compatibility
2021-01-18 14:35:47 +01:00
Marc Emmers d5459ea380 Fix missing defintion 2021-01-18 14:34:26 +01:00
Marc Emmers 8f94feb0ed Add to list of backports 2021-01-18 14:33:20 +01:00
Marc Emmers 78f2cfc0d9 Add some comment blocks 2021-01-16 21:04:16 +01:00
Marc Emmers f7e19b5232 Add deduction guides 2021-01-16 21:04:05 +01:00
Marc Emmers 2e1b360e67 Remove nonstandard as_bytes 2021-01-16 21:03:29 +01:00
Marc Emmers 69331b0cc0 Fix minor style issues 2021-01-16 21:02:47 +01:00
Marc Emmers 96954d3319 Replace classes with structs where applicable 2021-01-16 20:02:24 +01:00