Commit Graph

33368 Commits (28cdb37058864c3336005a68e446a23f3fafb37c)

Author SHA1 Message Date
Martin Kojtal 28cdb37058
Merge pull request #14813 from ARMmbed/drivers_unittest_header_lib
CMake: unit-tests: Make drivers unittests only depend on headers it uses
2021-06-24 15:43:18 +02:00
Rajkumar Kanagaraj 9a4bdb8ef4 CMake: unit-tests: Make drivers UNITTESTS only depend on headers it uses
Previously the drivers unit tests depended on `mbed-headers`, which
is a collection of all available headers in mbed-os. To make it easier
to separate the library, only depend on the headers we're using.
2021-06-22 04:17:56 -07:00
Rajkumar Kanagaraj 10beeab6c2 CMake: unit-tests: Pwmout & Watchdog: Remove trailing whitespace 2021-06-22 04:05:07 -07:00
mbedmain cecc47b4a5 Update Mbed version block 2021-06-18 11:54:51 +01:00
Martin Kojtal 3319bebfc4
Merge pull request #14801 from paul-szczepanek-arm/fix-ble
BKE: fix statements outside correct feature guard blocks
2021-06-17 22:03:17 +02:00
Paul Szczepanek ede39c4608 put statements inside the correct feature guard blocks 2021-06-17 16:51:28 +01:00
Martin Kojtal 1a2e96bb04
Merge pull request #14797 from saheerb/mbedtls_fix
run example-tls on faster K64F board (than K66F)
2021-06-17 15:58:12 +02:00
Martin Kojtal c358ab2946
Merge pull request #14749 from tymoteuszblochmobica/fcntl
Fcntl  setting improvement,
2021-06-17 15:37:55 +02:00
Martin Kojtal 8cb8e49a67
Merge pull request #14747 from paul-szczepanek-arm/fix-adv-con
BLE: fix advertising set termination event
2021-06-17 15:37:29 +02:00
saheerb 5d11a1e350 run example-tls on faster K64F board (than K66F) 2021-06-17 09:43:53 +01:00
Martin Kojtal 3cf5f8e14f
Merge pull request #14752 from tymoteuszblochmobica/sockets
LWIP Broadcast  socket option added
2021-06-15 15:08:53 +02:00
Martin Kojtal fd7e33b361
Merge pull request #14772 from LDong-Arm/mbedtls_timing
Improve implementation of Mbed TLS timing
2021-06-15 13:09:49 +02:00
Lingkai Dong 49163f0f33 Move Mbed TLS self tests to a separate configuration
We potentially save flash space by not enabling Mbed TLS self-tests
by default. A new test config file, TESTS/configs/mbedtls.json, is
provided to enable self tests. This newly created JSON file also
enables timing in Mbed TLS so timing gets tested.
2021-06-15 10:50:14 +01:00
Lingkai Dong d6f825ebf0 mbedtls: Run mbedtls_timing_self_test if MBEDTLS_TIMING_C
This allows us to verify the support for Mbed TLS timing on Mbed OS.

Note: The macros MBEDTLS_TIMING_C and MBEDTLS_TIMING_ALT are not
enabled by default and need to be additionally enabled to run this
test.
2021-06-14 17:49:17 +01:00
Lingkai Dong ca719a96a8 mbedtls: Use LowPowerTimeout for mbedtls_set_alarm() if available
The function `mbedtls_set_alarm()` is only precise to seconds, so
`LowPowerTimeout` is enough and saves power.
2021-06-14 17:49:17 +01:00
Lingkai Dong e16f59a2ee timing_mbed.cpp: Check MBEDTLS_TIMING_ALT
Do not compile the Mbed implementation of Mbed TLS unless
MBEDTLS_TIMING_ALT is defined. This prevents a macro check error on
devices that do not have LPTICKER or USTICKER when Mbed TLS timing
is not enabled.
2021-06-14 17:48:42 +01:00
Lingkai Dong 17ae051075 mbedtls: Add full platform implementation of timing
When MBEDTLS_TIMING_C and MBEDTLS_TIMING_ALT are enabled,
the Arm Compiler generates errors like the following (one for
each missing symbol):

    Error: L6218E: Undefined symbol mbedtls_timing_get_delay

Reason:

The function `mbedtls_timing_self_test()` in the Mbed TLS default
`timing.c` always gets compiled, if MBEDTLS_SELF_TEST is defined.
And MBEDTLS_SELF_TEST is always defined, as we have a Greentea test
to run some of the Mbed TLS self tests. (In the future we should try
not to enable MBEDTLS_SELF_TEST except for tests, but it requires
a rework in our test flow.)

`mbedtls_timing_self_test()` tests (calls) the full API declared in
`timing.h`, and the ARM Compiler requires all symbols referenced by
all functions to be defined, even those not used by the final
application. This is unlike GCC_ARM which resolves what are required.

Solution:

To fix the "undefined symbol" errors, we add an implementation of
`mbedtls_timing_get_timer()` based on Mbed OS `LowPowerTimer` or
`Timer` (depending on which one is available), and copy Mbed TLS's
default `mbedtls_timing_set_delay()` and `mbedtls_timing_get_delay()`
which are built on top of `mbedtls_timing_get_timer()`. This will also
benefit user applications that need to enable timing in Mbed TLS.
2021-06-14 17:29:19 +01:00
Lingkai Dong f96f98e60e mbedtls: Use LowPowerTimer/Timer for timing
Previously we used `gettimeofday()` for Mbed TLS timing, but its
implementation provided by Mbed OS is only precise to seconds. The
microsecond component of the output `struct timeval` is always set
to zero. But Mbed TLS requires millisecond precision.

To provide required timing precision, switch to use `LowPowerTicker`
or (microsecond) `Ticker`. `LowPowerTicker` is preferred as it saves
power and Mbed TLS does not require microsecond precision.
2021-06-14 17:25:08 +01:00
Martin Kojtal 0c9be22f58
Merge pull request #14768 from anttiylitokola/update-mbed-coap
Update mbed-coap to version v5.1.11
2021-06-14 12:09:46 +02:00
Martin Kojtal 2dcd6c026d
Merge pull request #14767 from ghseb/early-test-skip
connectivity tests: early skip fix
2021-06-14 12:06:59 +02:00
Martin Kojtal 1606b00186
Merge pull request #14741 from boraozgen/trng-def-checks
MbedTLS: Add definition checks for TRNG
2021-06-14 12:05:16 +02:00
Sebastian Stockhammer 3bee4917bb Early test skip
Adding mbed-os subdirectories that are not required for a specific project to .mbedignore is a good way to reduce compilation time. Sometimes it happens that tests depend on ignored files, which causes the test-build to fail even though the corresponding feature/component
is not configured. The reason is that the conditional that skips the test is placed after the includes.
2021-06-14 10:46:14 +02:00
Martin Kojtal 2a73d44343
Merge pull request #14750 from tymoteuszblochmobica/size_spi
Increase SPI stack size to 2048 for BlueNrg driver
2021-06-14 10:32:51 +02:00
Martin Kojtal 50e23b75f8
Merge pull request #14765 from rwalton-arm/fix_unittest_check
Fix unittest check
2021-06-14 10:17:17 +02:00
Antti Yli-Tokola 6a3e0d55ae Update mbed-coap to version v5.1.11
Block-Wise request (block1) error handling improvements:
 * Removed SN_COAP_BLOCKWISE_MAX_TIME_DATA_STORED usage. Block-Wise requests will now follow normal retranmission rules.
 * Process block1 responses only once. If response is coming in wrong order just ignore it wait next response to happen.
2021-06-14 09:21:45 +03:00
Martin Kojtal 39644781a2
Merge pull request #14748 from AlbanJeantheau-silabs/fix_calculate_ufsi
Correct ufsi timing calculation
2021-06-11 16:11:10 +02:00
Martin Kojtal 3c622f60b5
Merge pull request #14743 from OpenNuvoton/nuvoton_m251_m261_wdt
Nuvoton: Support watchdog on M251/M261 series
2021-06-11 16:10:53 +02:00
Martin Kojtal 530d4beea5
Merge pull request #14734 from jeromecoutant/PR_RFSWITCH
STM32WL LORA: HW specific out of STM32WL_LoRaRadio class
2021-06-11 16:09:48 +02:00
Martin Kojtal 86b85a3e84
Merge pull request #14760 from Patater/tls-timing-alt-fix
mbedtls: Rename Mbed timing implementation
2021-06-11 14:05:33 +02:00
Martin Kojtal df12718139
Merge pull request #14737 from paul-szczepanek-arm/cmake-ble-rebased
BLE: Add cmake unittest fakes for BLE and events
2021-06-11 14:04:47 +02:00
Paul Szczepanek 86426102ec
remove unittest readme 2021-06-11 10:44:38 +01:00
AlbanJeantheau-silabs 3001e52216
Handle timer rollover in calculate_ufsi
Co-authored-by: Jarkko Paso <jarkko.paso@arm.com>
2021-06-11 10:39:16 +02:00
Alban Jeantheau b4b35c6a88 coding style 2021-06-11 10:35:47 +02:00
Robert Walton a0befae2d4 CMake: Only build unit tests if Mbed OS is the current project
Typically when adding a unit test directory to a CMake project a check
will be used to ensure the subdirectory is added only if the following
are true:

* The BUILD_TESTING option is set to ON.
* The current CMake project is the top-level project.

The reason being, if a downstream project includes our project they
generally don't want to build our unit tests.

In mbed-os, we do correctly specify the above condition before adding
the central UNITTEST subdirectory, which fetches googletest and adds the
"stub" libraries the unit tests depend on. However, we only check if
CMAKE_CROSSCOMPILING is OFF (or undefined) before actually adding the
unit tests. This mismatched logic would lead to unexpected build
failures in various scenarios. One likely case could be: a downstream
project including mbed-os happens to set CMAKE_CROSSCOMPILING to
OFF/undefined for any reason (possibly to build its own unit tests).
mbed-os would go ahead and attempt to build its tests without fetching
googletest or adding the required stub targets.

To fix the issue replace the check for CMAKE_CROSSCOMPILING in the unit
tests with the same BUILD_TESTING idiom we use for adding the central
UNITTESTS subdirectory.
2021-06-10 23:34:14 +01:00
Robert Walton d4f01818b4 CMake: unit-tests: Fetch googletest master
googletest now follows the "Abseil Live at HEAD" philosophy, which means
they recommend using the latest commit on the master branch and always
compiling from source. They recommend this to avoid version mismatch
issues and "diamond dependency" problems which are common in dependency
graphs with pinned versions. Google make the "promise" that future
changes won't break downstream code if it follows the "Abseil
compatability guidelines".

Upping the version to master also fixes some CMake configure time
warnings that were present with the older tagged releases of googletest:

CMake Deprecation Warning at __build/_deps/googletest-src/CMakeLists.txt:4 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.

CMake Deprecation Warning at __build/_deps/googletest-src/googlemock/CMakeLists.txt:45 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.

CMake Deprecation Warning at __build/_deps/googletest-src/googletest/CMakeLists.txt:56 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.
2021-06-10 23:25:19 +01:00
Robert Walton 314d224b30 CMake: unit-tests: Remove trailing whitespace from stubs/CMakeLists.txt 2021-06-10 23:24:43 +01:00
Robert Walton c761049903 CMake: unit-tests: Remove trailing whitespace 2021-06-10 23:24:43 +01:00
Robert Walton eb733925dc CMake: Remove trailing whitespace from CMakeLists.txt 2021-06-10 23:24:32 +01:00
Jaeden Amero 87d1992f4f mbedtls: Rename Mbed timing implementation
We get a linker warning with the recently added timing module
implementation for Mbed. This is because there is Mbed TLS also ships a
file called timing.c, which we are including in Mbed OS also. With CLI
1, we get an error about unique object files because of the similarly
named implementation files.

    Object file timing.o is not unique! It could be made from: mbed-os/connectivity/mbedtls/source/timing.c mbed-os/connectivity/mbedtls/platform/src/timing.cpp

Rename the Mbed timing module implementation to timing_mbed.cpp to avoid
this naming conflict.

Fixes: b8781e527b ("mbedtls: Add an alt implementation of timing")

Fixes #14759
2021-06-10 17:02:28 +01:00
Martin Kojtal aeaac0e70c
Merge pull request #14746 from jeromecoutant/PR_WB15CC
STM32WB: introduce STM32WB15CC NUCLEO
2021-06-10 14:16:10 +02:00
Martin Kojtal b74f62c974
Merge pull request #14659 from arduino/i2c_slave_patch
STM32: make i2c_salve_read return the number of bytes read
2021-06-10 14:10:31 +02:00
Paul Szczepanek 36d9b86d46
fix typos
Co-authored-by: Chris Swinchatt <christopher.swinchatt@arm.com>
2021-06-10 11:56:16 +01:00
Martin Kojtal 7620120843
Merge pull request #14756 from Patater/tls-timing-alt
mbedtls: Add an alt implementation of timing
2021-06-10 12:11:39 +02:00
Paul Szczepanek afeb696d01 fix CORDIO not passing the conn id in param for adv stop event
the hci handle is different from host handle, this is how it's done in conn open event, we carry the conn id in the hdr.param
2021-06-09 18:50:17 +01:00
Paul Szczepanek 963657bfb0 translate hci conn handle to host handle for adv stop event 2021-06-09 18:50:17 +01:00
Paul Szczepanek 6b930d6449 translate adv set error codes and only act on successful stop 2021-06-09 18:50:17 +01:00
Paul Szczepanek 4fae828987 Fix process enable queue guard not being reset on failed runs 2021-06-09 18:50:17 +01:00
Paul Szczepanek 7b94f257dd fix CORDIO not handling all adv set stop events 2021-06-09 18:50:17 +01:00
Jaeden Amero b8781e527b mbedtls: Add an alt implementation of timing
Implement the MBEDTLS_TIMING_ALT interface for Mbed OS. This
implementation is sufficient to run the Mbed TLS benchmarking
application.
2021-06-09 17:43:18 +01:00
Jaeden Amero 88c019990d
Merge pull request #14713 from Patater/lgtm
lgtm: Add initial LGTM configuration file
2021-06-09 16:09:01 +01:00