Commit Graph

3852 Commits (be31d50cc485f976c45abff7107b6c76d7885674)

Author SHA1 Message Date
Martin Kojtal 19f2138ef3 cmsis importer: add IAR fix for .S files 2021-08-20 13:23:06 +01:00
Martin Kojtal 68667df7ac
Merge pull request #14995 from saheerb/master
travis ci migration to github action
2021-08-12 09:50:13 +01:00
Jaeden Amero e588f80d13
Merge pull request #14902 from LDong-Arm/greentea_skip
CMake: tests: Support skipping unsupported test with reason
2021-08-11 14:44:07 +01:00
Jaeden Amero 4125fd0786
Merge pull request #14972 from OpenNuvoton/nuvoton_m2354_tfm_psa_fwu
M2354: Support PSA Firmware Update
2021-08-11 13:57:57 +01:00
Lingkai Dong 4917e0154c CMake: tests: Support skipping a test with a reason
Add a new argument `TEST_SKIPPED` to `mbed_greentea_add_test()` to
indicate a test is skipped and give a reason (e.g. the Mbed target
and/or configuration does not provide what the test requires).

The skip reason of a test is printed when running tests with `ctest`,
and the test is marked as "Skipped" in the test report.
2021-08-11 11:43:14 +01:00
Lingkai Dong 86c00f6b4b cmake: Improve indentation of mbed_greentea_add_test doc 2021-08-11 11:42:24 +01:00
Lingkai Dong e60ffed6f4 CMake: turn mbed_greentea_add_test() into a function
Unlike a macro, a function is more self-contained and can return
early if necessary.
2021-08-11 11:40:10 +01:00
Saheer 91fa6801f8 travis ci migration to github action 2021-08-11 11:02:06 +01:00
Robert Walton 00dbf4c71d CMake: greentea: Use more specific name for baremetal option
Make it obvious the option is used for greentea tests.
2021-08-10 16:54:27 +01:00
Robert Walton 40154ee2b1 CMake: greentea: Port mbed-drivers-ticker to CTest
Call add_test in mbed_greentea_add_test and specify mbedhtrun as the
command to run.

An MBED_HTRUN_ARGUMENTS variable has been added, which is a semicolon
separated list of arguments to forward to htrun. The user is required to
pass in any arguments mbedhtrun needs to communicate with the device
under test at CMake configuration time.

We automate passing some of the htrun arguments in CMake using data
provided by mbed_config.cmake or gathered from the CMake environment.
The following arguments are passed to htrun from CMake:

* -f/--image-path
* -e/--enum-host-tests
* -m/--micro
* -R/--reset-timeout

--baud-rate is also passed if the MBED_CONF_PLATFORM_STDIO_BAUD_RATE
config parameter is defined.

Temporary checks have been added to mbed_greentea_add_test to keep the
old flow working until we port all of the greentea tests to CTest. These
checks should be removed after we make all greentea tests runnable by
CTest.
2021-08-10 16:54:03 +01:00
Chun-Chieh Li 5114e4c7c2 M2354: Support PSA Firmware Update
1.  Change from single image boot to multiple image boot
2.  SDH is configured to Secure for placing update firmware. It becomes inaccessible to Mbed.
3.  Post-build script supports both multiple image boot and single image boot
4.  Update readme to reflect above change
5.  Increase forced_reset_timeout due to longer booting time for Greentea test
2021-08-05 10:14:33 +08:00
Jaeden Amero 744814f0a0
Merge pull request #14900 from 0xc0170/feature_CMSIS_5_13b9f72f2
Update CMSIS to 5.8.0
2021-07-30 09:43:11 +01:00
Martin Kojtal 049d1f145d cmsis importer: add commits for Mbed OS changes
See specific SHA for details.
2021-07-30 08:35:04 +01:00
Martin Kojtal b9043fb91c cmsis: importer sha removal
I had to resolve conflicts with these sha. CMSIS 5.8.0 includes fixes and makes these changes
irrelevant.
2021-07-27 10:06:40 +01:00
Martin Kojtal 7941286531 [CMSIS_5]: Updated to 13b9f72f2 2021-07-27 10:06:34 +01:00
Lingkai Dong 257a4e551c CMake: Do not set `CMAKE_AR`
The variable for archiver is automatically set by CMake. There is
no need to explicitly set it, unless a project really needs to
override the default archiver.
2021-07-23 15:56:58 +01:00
Lingkai Dong 782375c431 CMake: Enable improved armclang support in CMake 3.21
CMake versions 3.20 and below always add compiler and linker flags
based on `CMAKE_SYSTEM_PROCESSOR`, for example `--cpu=Cortex-M33`.
This sometimes overrides flags we set in tools/cmake/cores/*.cmake
and results in link failure or unbootable binaries. To workaround
this, we added more linker flags to "counter" what CMake automatically
adds.

From CMake 3.21 onwards, CMake by default does not add flags to
armclang anymore, and it fully relies on projects to set all flags.
In this case we do not need to set `CMAKE_SYSTEM_PROCESSOR` or use
workarounds anymore. We still turn on workarounds when an older
version of CMake (3.19 and 3.20) is used, but in the future we might
require users to have at least CMake 3.21.
2021-07-23 15:56:58 +01:00
Lingkai Dong 4b6f243963 CMake: Cortex-A: Use MBED_CPU_CORE to set -mcpu
As we're moving away from the use of CMAKE_SYSTEM_PROCESSOR, use
MBED_CPU_CORE instead. They differ in cases, but both GCC and Arm
toolchains support case-insensitive CPU names.
2021-07-23 15:56:58 +01:00
Lingkai Dong 23d659ef9e CMake: Add test for multiple-executable support
Add a test to build two executables in two directories under a single
project.
2021-07-22 17:31:45 +01:00
Lingkai Dong 351680fb18 Rework post-build to support multiple executables
When building greentea tests, each test is an executable with its
own output binary path. This is also the case when a user project
produces multiple executables. But the current implementation of
post-build operations always assumes there's only one executable,
at the root of the build directory.

The post-build command depends on Mbed target, and it always takes
the the executable we build as an input file. To achieve this, we
let each Mbed target (that has a post-build command) define a function

    function(mbed_post_build_function target)

which takes a CMake executable target as an argument from which it can
get its binary path using generator expressions. It generates and adds
to the passed executable target a post-build custom command.

Notes:
* The function name needs to be exact, because CMake only supports
literal function calls - CMake can't dereference a function name from
a variable. To avoid multiple definitions of this function, each Mbed
target needs to guard it with a macro to check if the user is
building this Mbed target.
* `mbed_post_build_function()` is a function, but it is usually
defined by another macro rather than a parent function, because
nesting functions would make many variables inaccessible inside the
innermost `mbed_post_build_function()`.
* There's no more need to force regenerate images. Previously, post-
build commands were custom *targets* which always got to run, so we
force regenerated images on every build to avoid patching an image
that's already been patched once on previous build. Now post-build
commands are custom *commands* of the same executable target, and they
are only run if the executable target itself is rebuilt.
2021-07-22 17:31:22 +01:00
Robert Walton fcd57b24d3 CMake: Move post build functions out of root CMakeLists.txt
The 'post build' functions are made visible by adding the mbed-os
subdirectory. This is not ideal as any components in mbed-os wishing to
call the functions must be added after the functions are defined. To
improve modularity move these functions to a separate CMake script.

We include the post build CMake script in app.cmake for now so we don't
break user's projects.
2021-07-22 11:50:43 +01:00
Jaeden Amero 662bd59973
Merge pull request #14940 from Patater/update-prettytable
python: Allow newer prettytable with newer python
2021-07-21 14:55:52 +01:00
Jaeden Amero 14d4ee3f3b python: Allow newer prettytable with newer python
This helps to allow installation of Mbed OS's Python requirements, when
CMake is used, into the same Python environment as mbed-os-tools. The
versions specified here are aligned with mbed-os-tools;
tools/cmake/requirements.txt depends on the same version of prettytable
as mbed-os-tools's requirements.txt.
2021-07-21 13:55:18 +01:00
Martin Kojtal 530c90b351
Merge pull request #14932 from ARMmbed/remove_tools_host_tests
Remove host_tests from mbed-os/tools
2021-07-21 14:51:30 +02:00
Jaeden Amero c703b0de23
Merge pull request #14880 from Patater/dont-require-icetea
Dont require icetea
2021-07-20 15:54:51 +01:00
Rajkumar Kanagaraj e75b67fada Remove host_tests from mbed-os/tools
host tests (mbedhtrun) is maintained as part of mbed-os-tools but there
is a redundant duplicate of host_tests under mbed-os/tools/ directory
this PR changes to remove those duplicates and update test_api py modules
to use host tests from mbed-host-tests
2021-07-20 05:07:28 -07:00
Jaeden Amero 45a8826ee2 icetea: Remove icetea TEST_APPS
icetea was intended to be deprecated in Mbed 6. icetea is no longer
maintained. Remove icetea-specific TEST_APPS and run_icetea tests from
Mbed OS.
2021-07-15 16:07:20 +01:00
Robert Walton e9747d7bcd CMake: greentea: Fix io issue with greentea-client
The stdio implementation of the standalone greentea-client wasn't
streaming "KiVi protocol" messages through the serial IO. Separate out
the existing implementation for greentea-client that uses
mbed_retarget.h's `read` and `write` functions so greentea tests
continue to work with the standalone client.

The IO fixture is shared between the "legacy" embedded greentea-client
and the newer standalone client.
2021-07-09 14:33:08 +01:00
Martin Kojtal 7350b03088
Merge pull request #14872 from hallard/STM32WLEx
Add STM32WLE5 for custom targets LORA_E5 and RAK3172
2021-07-08 13:25:24 +02:00
Jaeden Amero c3f3ed7661 cmake: Use namespaced greentea client library
When using an exported or installed version of greentea, it's necessary
to use the greentea namespace.
2021-07-07 14:29:14 +01:00
Jaeden Amero 4e2206e482 Use standalone greentea-client
For CMake or Mbed CLI 2, use the standalone greentea-client.
2021-07-07 14:29:14 +01:00
Charles c8fdc0a897 added STM32WLE5CCUx + version 1.1.0 2021-07-06 17:10:53 +02:00
Lingkai Dong f4d551e80e CMake: Replace MBED_TEST_LINK_LIBRARIES with MBED_TEST_BAREMETAL
Currently we have `MBED_TEST_LINK_LIBRARIES` for specifying
* Whether to link `mbed-os` or `mbed-baremetal`
* Any additional libraries we want tests to link

It's not fit for purpose anymore, because
* No flavor of Mbed OS is selected by default, but we should've
really defaulted to `mbed-os`, the full RTOS version. Build doesn't
work unless `-DMBED_TEST_LINK_LIBRARIES=<...>` is passed, which
is redundant.
* A test should never need additional libraries passed via command
line - its `CMakeLists.txt` should specify what it links.

This commit replaces `MBED_TEST_LINK_LIBRARIES` with a new option
`MBED_TEST_BAREMETAL` to build a test with either RTOS (default)
or without it (by passing `-DMBED_TEST_BAREMETAL=ON`).
2021-07-06 13:43:06 +01:00
Lingkai Dong 2a1d50f0fa app.cmake: Replace tabs with spaces
The coding standards of Mbed OS require indentation of four spaces.
2021-07-06 13:35:43 +01:00
Jaeden Amero 75808eaaf2
Merge pull request #14783 from rwalton-arm/dont_capture_stdout
tfm-post-build: Don't capture subprocess stdout
2021-07-06 12:57:45 +01:00
Martin Kojtal 80ce06fb67
Merge pull request #14876 from rwalton-arm/mbed_path_greentea
CMake: greentea: Remove dependency on global MBED_PATH
2021-07-06 13:30:25 +02:00
Robert Walton dfb4e087e3 CMake: greentea: Remove dependency on global MBED_PATH
The mbed_greentea_add_test macro required a greentea test to set an
MBED_PATH variable to the path of the mbed-os root directory, which it
attempts to add as a 'subdirectory' of the test project. We can instead
use CMake's built in CMAKE_CURRENT_LIST_DIR variable to deduce the path
to mbed-os relative to the current list file directory, removing the
need for greentea tests to set MBED_PATH.
2021-07-06 10:53:32 +01:00
Robert Walton d5a4ad1fe9 CMake: greentea: Remove call to deprecated function
mbed_greentea::mbed_greentea_add_test was calling the deprecated
`mbed_configure_app_target` function, which is currently a no-op.
2021-07-05 22:53:35 +01:00
saheerb bf84452c60 enable google and azure example application tests in ci 2021-07-05 20:30:35 +01:00
Charles ca32375228 added STM32WLE5JCIx 2021-07-05 13:08:09 +02:00
Robert Walton da6febf616 CMake: mbed_greentea: Remove trailing whitespace 2021-07-02 11:44:51 +01:00
Jaeden Amero b5c2f7079e
Merge pull request #14718 from Meano/develop
Feature: Make changes for Cortex-A5 support
2021-07-01 10:23:41 +01:00
Martin Kojtal 66a770e92e
Merge pull request #14780 from Patater/update-python-requirements
Update python requirements
2021-06-30 16:38:02 +02:00
Jaeden Amero 270ea5deb7
Merge pull request #14815 from LDong-Arm/test_psa_k64f_k66f
Enable PSA tests on K64F/K66F and fix missing PSA Crypto init in TLSSocketWrapper
2021-06-30 15:20:05 +01:00
Jaeden Amero 9b09cddf1d python: Update requirements
Update versions of urllib3, PyYAML, jinja2, cryptography.
2021-06-30 09:12:31 +01:00
Robert Walton 6d78f93b9e tfm-post-build: Don't capture subprocess stdout
subprocess.PIPE is used to enable the parent process to communicate with
the subprocess via pipes, which mean all stdout and stderr messages are
captured and returned as part of Popen.communicate's result tuple.

In our case, we want to display the error messages on the console, so we
don't need to capture the output from stdout.

Example of a typical error message before this change:
```
Traceback (most recent call last):
  File "platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_LATEST/scripts/generate_mbed_image.py", line 197, in <module>
    sign_and_merge_tfm_bin(args.tfm_target, args.target_path, args.non_secure_bin, args.secure_bin)
  File "platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_LATEST/scripts/generate_mbed_image.py", line 81, in sign_and_merge_tfm_bin
    " secure binary, Error code: " + str(retcode))
Exception: Unable to sign musca_b1 secure binary, Error code: 1
```

Example of the error message after this change:
```
Traceback (most recent call last):
  File "/mbed-os/tools/psa/tfm/bin_utils/wrapper.py", line 13, in <module>
    import click
ModuleNotFoundError: No module named 'click'
Traceback (most recent call last):
  File "platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_LATEST/scripts/generate_mbed_image.py", line 194, in <module>
    sign_and_merge_tfm_bin(args.tfm_target, args.target_path, args.non_secure_bin, args.secure_bin)
  File "platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_LATEST/scripts/generate_mbed_image.py", line 80, in sign_and_merge_tfm_bin
    raise Exception("Unable to sign " + target_name +
Exception: Unable to sign musca_b1 secure binary, Error code: 1
```

This is a significant improvement as now you can see what the reason for
the failure was.
2021-06-29 15:37:44 +01:00
Hari Limaye f95052cf6f CMake: Require TEST_SOURCES in greentea CMake file
Assumption that greentea test file is always named main.cpp is
incorrect. Updated mbed_greentea_add_test() macro to make TEST_SOURCES
parameter compulsory, which is used to specify greentea test
file(s). This allows tests to use C, or have a different name.
Therefore also updated all pre-existing greentea test CMake files to
explicity add main.cpp to TEST_SOURCES.
2021-06-29 13:33:42 +01:00
Hari Limaye defc80a13e CMake: Remove alias for TEST_NAME argument
The mbed_greentea_add_test macro previously set a variable in order to
use the un-prefixed TEST_NAME to refer to the argument in the macro
body. Whilst pair-programming with LDong, this was identified and
determined to be unecessary (maybe it was a failed attempt to fix
something, that was never reversed?) and so it has been removed.
2021-06-29 13:32:57 +01:00
Lingkai Dong 8ce87194fd test configs: Test Experimental API on K64F/K66F
When using the `mbed test` command to build and run tests, some
targets have additional configurations/overrides defined in
`tools/test_configs/`:
* `target_configs.json` lists which targets support which configs.
* `config_paths.json` maps the name of each config to the JSON file to
use.

By default, only `default_test_configuration` from
`target_configs.json` gets used when building and running tests.
Others listed in `test_configuration` need to be switched via
`--test-config <NAME>`.

This commit enables Experimental API in the default configurations of
K64F and K66F in order to test Mbed OS PSA. Any existing configs are
kept, which is why `HeapBlockDeviceAndEthernetAndExperimental.json` is
created for K64F.
2021-06-28 10:31:55 +01:00
Lingkai Dong 2d36341f41 target_configs.json: Remove unreachable nsapi entries
In `tools/test_configs/`, target-specific test configurations are
defined in `target_configs.json` and parsed by `__init__.py`. The
latter only makes use of `default_test_configuration` (default test
configuration to use) and `test_configurations` (more configurations
selectable via `mbed test --test-config <config>`. Anything else
is ignored, including nsapi, so this commit cleans up dead entries.
2021-06-28 10:31:55 +01:00