Commit Graph

32486 Commits (241b062cdff0f4a568882a593a67f295f2ad7f8b)

Author SHA1 Message Date
Lingkai Dong 241b062cdf Update .gitignore for Mbed TLS importer
The directory `mbed-tls-lib` previously in `.gitignore` no longer
exists. Instead, we can simply ignore the entire TARGET_IGNORE.
2021-02-25 14:02:57 +00:00
Lingkai Dong 63523bd0aa Remove _NS aliases for Musca B1/S1
In targets.json, ARM_MUSCA_B1 and ARM_MUSCA_S1 have alias target
names suffixed with `_NS`. They are identical to targets without
`_NS` and exist purely for compatibility with the old naming
convention we had. The CI builds them as separate targets and uses
extra resources.

As we are upgrading Musca targets to TF-M v1.2, it's time to clean
up the aliases.
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
Lingkai Dong 88a38c2750 Musca S1: include missing `cmsis_nvic.h`
The vector table needs to be copied from ROM to RAM, in order for us
to set IRQ handlers at run time. The address in RAM is defined by
`NVIC_RAM_VECTOR_ADDRESS` in `cmsis_nvic.h`, but its inclusion
was missing from Musca S1's `cmsis.h` and consequently the vector
table was not copied.

On most targets this results in a memory access error when we set
vectors. But Musca S1's ROM is in its MRAM (which can be accessed
like any RAMs), and this causes the ROM image to be modified
with no error/warning. On the next boot, MCUboot fails the image
integrity check.

This commit adds the missing include, in the same spirit as
01dd997d55.
2021-02-25 14:02:57 +00:00
Lingkai Dong ac4533a5bd Exclude Musca signing layouts from compilation
Files containing signing layouts are parsed by the post build
hook for signing purpose only.
2021-02-25 14:02:57 +00:00
Vikas Katariya 79755ea243 Add missing license header and SPDX identifier
This files are imported and part of:
a8e12dae38

Issue has been raised https://github.com/mcu-tools/mcuboot/issues/930

As these scripts are going to be part of release its important to have
licensing information.
2021-02-25 14:02:57 +00:00
Vikas Katariya 1a8386a178 Refactor: MUSCA targets post binary hook scripts
Raise an exception if there was an issue with handling any command
when signing the binaries for MUSCA targets.
2021-02-25 14:02:57 +00:00
Vikas Katariya 308ffe9e89 Remove old binary signing scripts of TF-M 1.1 2021-02-25 14:02:56 +00:00
Vikas Katariya 8648e4f4d6 Remove: ARM_MUSCA_A1 support
ARM_MUSCA_A1 is not supported since Mbed OS 6.0
Refer: https://github.com/ARMmbed/mbed-os/pull/13165

Therefore remove files from kv_config and TF-M post binary hook script.
2021-02-25 14:02:56 +00:00
Vikas Katariya ef9ed987bc Update `ARM_MUSCA_S1.py` post binary hook script
The script changes are required with respect to TF-M v1.2
integration for this target. The imgtool.py is been replaced with
`wrapper.py` which uses click command to run the signing algorithm.

The version `-v` and dependencies `-d` have been updated to resolve
upgrade issues from TF-M v1.1 --> v1.2
2021-02-25 14:02:56 +00:00
Vikas Katariya 39e226bf6a Update target `ARM_MUSCA_S1` TF-M V1.2 binaries
* Remove the old `mcuboot.bin`
* Add `bl2.bin`
* Update TF-M secure binaries

GCC_ARM toolchain used.
2021-02-25 14:02:56 +00:00
Vikas Katariya c0721a95ca Update partition files for `ARM_MUSCA_S1`
* Partition files are synced with TF-M v1.2
* To have uniformity with TF-M v1.2, rename the following:
 ** image_macros_preprocessed_ns.c to `signing_layout_ns.c`
 ** image_macros_preprocessed_s.c to `signing_layout_s.c`
* `MCUBOOT_IMAGE_NUMBER` is set to 2 by default for TF-M v1.2,
therefore it is necessary that Mbed OS compiles the right macros
for when linking and using the partition files.
2021-02-25 14:02:56 +00:00
Vikas Katariya 1ac58a81a1 Update `ARM_MUSCA_B1.py` post binary hook script
The script changes are required with respect to TF-M v1.2
integration for this target. The imgtool.py is been replaced with
`wrapper.py` which uses click command to run the signing algorithm.

The version `-v` and dependencies `-d` have been updated to resolve
upgrade issues from TF-M v1.1 --> v1.2
2021-02-25 14:02:56 +00:00
Vikas Katariya 65e2d45d99 Update target `ARM_MUSCA_B1` TF-M V1.2 binaries
* Remove the old `mcuboot.bin`
* Add `bl2.bin`
* Update TF-M secure binaries

GCC_ARM toolchain used.
2021-02-25 14:02:56 +00:00
Vikas Katariya 0ccf4db143 Update partition files for `ARM_MUSCA_B1`
* Partition files are synced with TF-M v1.2
* To have uniformity with TF-M v1.2, rename the following:
 ** image_macros_preprocessed_ns.c to `signing_layout_ns.c`
 ** image_macros_preprocessed_s.c to `signing_layout_s.c`
* `MCUBOOT_IMAGE_NUMBER` is set to 2 by default for TF-M v1.2,
therefore it is necessary that Mbed OS compiles the right macros
for when linking and using the partition files

** Workaround **
The `region_defs.h` has an explicit definition of `BL2`, even
though it is already defined in target.json for `ARM_MUSCA_B1`.
This is because of Mbed CLI 1, as it can't seem to use the right
macro when linking the files for Mbed OS application when using
the ARMCLANG toolchain.
2021-02-25 14:02:56 +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
Lingkai Dong e0d2c3d03a Fix paths in Mbed TLS importer
Note: Now we need to export common.h to the include path, because
this header is now also needed by PSA Crypto service.
2021-02-25 14:02:54 +00:00
Lingkai Dong e3641576d0 Move hash_wrappers.c to platform subdirectory
hash_wrappers.c is specific to Mbed OS, moving it into platform
as its original directory is for imported Mbed TLS source only.
2021-02-25 14:02:54 +00:00
Lingkai Dong 9e48b782b9 Add copyright header to hash_wrappers.c 2021-02-25 14:02:54 +00:00
Martin Kojtal 36b6013afe
Merge pull request #14350 from LDong-Arm/fix_iar_config_conflict
ARM_MPS2_Target: Fix conflicts in IAR configuration
2021-02-25 13:18:45 +00:00
Lingkai Dong c1d115e25b Fix conflicts in IAR configuration
In `targets.json`, the base target ARM_MPS2_Target does not have `iar`
in `supported_c_libs`. But its inherited targets have `IAR` in
`supported_toolchains`, causing configuration check to fail.
2021-02-25 12:03:26 +00:00
Martin Kojtal 7da6100ff6
Merge pull request #14304 from hugueskamba/hk_cmake_remove_app_target_reference
CMake: Refactor post-build hook to remove APP_TARGET references
2021-02-25 10:41:44 +00:00
Martin Kojtal 737153bcc1
Merge pull request #14328 from hugueskamba/hk_cmake_fix_greentea_tests
CMake: Fix Greentea tests
2021-02-24 16:09:55 +00:00
Martin Kojtal 8340ea2d2b
Merge pull request #14305 from paul-szczepanek-arm/cordio-host-fix-index
BLE: fix indexing of array in Cordio host stack
2021-02-23 14:23:21 +00:00
Martin Kojtal 6c08123dff
Merge pull request #14313 from hugueskamba/hk_cmake_fix_cortex_m33_gcc
CMake: Fix Cortex-M33 GCC build
2021-02-23 14:23:01 +00:00
Hugues Kamba 1ba3b73a30 CMake: Fix Greentea tests
* Specify new Greentea tests build steps in README
* Correct path to generated CMake configuration module
2021-02-23 13:08:43 +00:00
Martin Kojtal 57a6fe3a8e
Merge pull request #14314 from hugueskamba/hk_cmake_fix_musca_ns
CMake: Fix ARM MUSCA NS targets build
2021-02-23 11:04:38 +00: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
Martin Kojtal da51cb2185
Merge pull request #14318 from harmut01/example_build_errors
CMake: Fix path to STM32F0 GCC linker scripts
2021-02-23 08:36:27 +00:00
Martin Kojtal 14a5c79a33
Merge pull request #14298 from ARMmbed/cmake-remove-debug-print
CMake: remove debug print
2021-02-23 08:35:45 +00:00
Martin Kojtal 7b6c7cc2ad
Merge pull request #14295 from 0xc0170/cmake-remove-iar
CMake remove IAR references in the tree
2021-02-22 20:10:40 +00:00
Martin Kojtal 7369b63769
Merge pull request #14300 from harmut01/baremetal_arm_ssg
Add bare metal support to ARM_MPS2_Target family of targets
2021-02-22 20:10:25 +00:00
Martin Kojtal 120b25f138
Merge pull request #14315 from hugueskamba/hk_cmake_fix_nuvonton_m261
NUVOTON: Remove CMake listing of M261 include directory that do not exist
2021-02-22 20:10:02 +00:00
Martin Kojtal 8bff51dea1
Merge pull request #14311 from hugueskamba/hk_cmake_fix_cortex_a9_gcc
CMake: Fix Cortex-A9 builds with GCC_ARM
2021-02-22 20:09:55 +00:00
Martin Kojtal 778f833108
Merge pull request #14316 from hugueskamba/hk_cmake_fix_max32625
MAX32625: Fix CMake build
2021-02-22 20:09:33 +00:00
Martin Kojtal dbbdd0f077
Merge pull request #14309 from hugueskamba/hk_cmake_fix_stm32f091xc_gcc_arm
CMake: Fix STM32F091XC Mbed targets GCC_ARM build
2021-02-22 15:56:05 +00:00
Hugues Kamba cd6cb71c29 CMake: Fix Cortex-M33 GCC build
The GCC flag to specify the floating-point hardware (`mfpu`) does not accept
the value `none`. The default value is `auto` which causes the compiler to
select the floating-point and Advanced SIMD instructions based on the
settings of -mcpu and -march. The extension option `+nofp` has been added
to disable floating point instructions.
2021-02-22 15:21:20 +00:00
Martin Kojtal 3bb8de6ea3
Merge pull request #14308 from hugueskamba/hk_cmake_create_flash_cmsis_algo
Create FLASH CMSIS ALGO target to remove dependency on MBED_TARGET_LABELS
2021-02-22 14:36:44 +00:00
Harrison Mutai 5899dd0bc7 Fix path to GCC linker scripts
The linux filesystem is case sensitive, this was causing our nightly build to
fail when attempting to find the script with its lower case name. The
name of the file has been kept the same as this seems to be STMs
convention.
2021-02-22 14:07:52 +00:00
Hugues Kamba 80c679cc27 MAX32625: Fix CMake build
* Correct board CMake target name to match board name
* Make MAX32625 depend on MAXIM CMake target to inherit its include dirs
* Correct path to linker files
2021-02-22 13:38:32 +00:00
Hugues Kamba 3eb5296996 NUVOTON: Remove CMake listing of M261 include directory that do not exist
Remove listing of include directory that do not exist
2021-02-22 12:53:17 +00:00
Hugues Kamba 0ce36ac5e2 CMake: Fix ARM MUSCA NS targets build
Add the missing CMake targets for NS Mbed boards.
2021-02-22 12:17:41 +00:00
Martin Kojtal 29cfcd6d5f
Merge pull request #14307 from hugueskamba/hk_cmake_fix_nuvoton_targets
CMake: Fix some NUVOTON build
2021-02-22 12:12:18 +00:00
Paul Szczepanek 53cf06278a use the ccb instead of looking up the conn id 2021-02-22 11:31:25 +00:00
Hugues Kamba 261deae561 CMake: Fix Cortex-A9 builds with GCC_ARM
Add the `-march` flag for Cortex-A9 GCC_ARM in order to
generate instructions for the armv7-a machine type.
2021-02-22 11:28:06 +00:00
Hugues Kamba 11a445be95 CMake: Fix STM32F091XC Mbed targets GCC_ARM build
The linker file for the GCC_ARM toolchain was not
correctly listed.
2021-02-19 20:28:25 +00:00