Commit Graph

916 Commits (refactor_hal_greentea_cmake)

Author SHA1 Message Date
Martin Kojtal 539d1c784f
Merge pull request #15017 from hallard/STM32WL_HP_optimal
STM32WL fixed current consumption for mode RBI_CONF_RFO_HP
2021-08-30 14:17:01 +01:00
Martin Kojtal 43a060fe7c
Merge pull request #14926 from katherrafi/hal_callback_override
Eth: STM32: Overriding HAL callbacks in stm32xx
2021-08-26 09:51:48 +01:00
Kather Rafi Ibrahim a9f51e31fd Eth: STM32: Overriding HAL callbacks in stm32xx
This commit enables the Overriding of HAL callbacks and IRQHandler
in stm32xx_emac.cpp. Hence the user can have their own
implementations of callbacks and IRQHandler functions.

Signed-off-by: Kather Rafi Ibrahim <katherrafi.i@hcl.com>
2021-08-25 14:30:47 +05:30
Charles 6d0747727e added optimal settings for RFO_HP only
fixed wrong help values name

added detailled comments

fix style-check

fix style-check
2021-08-25 10:23:06 +02:00
Martin Kojtal 09eee5881e
Merge pull request #14988 from npal-cy/pr/swintegration-501
CYW43XXX Cordio HCI driver: update BT power up sequences to remove redundant delay (500ms) during HCIDrive initialization
2021-08-17 12:20:17 +01:00
Mika Leppänen 096ce41094 Disabled interrupts on smt32f7 and stm32h7 before calling disable data cache
Interrupts are disabled before calling disable data cache on Ethernet initialization.
2021-08-16 13:29:25 +03:00
nazar.palamar b245445ecb Addressed code review comments: 1. remove bt_power member from HCIDriver class; 2. set PullUp for bt_power in CyH4TransportDriver; 3. cleanup code: replace tabs to 4 spaces 2021-08-13 17:25:14 +03:00
nazar.palamar c2f7a9539b Update of BT power up sequences to remove redundant delay (500ms) in BT_POWER operation during HCIDrive initialization.
Current BT_POWER sequence:
1. BT_POWER=0  ( from CyH4TransportDriver::initialize)
2. delay 1ms   ( from CyH4TransportDriver::initialize)
3. BT_POWER=1  ( from CyH4TransportDriver::initialize)
4. delay 500ms (from HCIDriver::do_initialize)
5. BT_POWER=1  (from HCIDriver::do_initialize)
6. delay 500ms (from HCIDriver::do_initialize)

updates:
1. remove 4) and 5)
2. keep all BT_POWER operations in one place. The best logic place is CyH4TransportDriver::initialize.

So finally the BT_POWER sequences should looks like:
1. BT_POWER=0  ( from CyH4TransportDriver::initialize)
2. delay 1ms   ( from CyH4TransportDriver::initialize)
3. BT_POWER=1  ( from CyH4TransportDriver::initialize)
4. delay 500ms ( from CyH4TransportDriver::initialize)
2021-08-13 17:25:12 +03:00
Martin Kojtal df00ed4efe
Merge pull request #14982 from npal-cy/pr/swintegration-481
CYW43XXX Cordio HCI driver: fixed MCU deep-sleep locking flow
2021-08-13 13:08:36 +01:00
Robert Walton 7842320ab7 CMake: Add option to enable greentea tests
Add an option to enable the greentea tests independently from the unit
tests.

We can't just use the typical BUILD_TESTING option to enable greentea
tests. BUILD_TESTING enables unit tests and fetches googletest, which
are compiled for the host. Greentea tests are cross compiled and require
a toolchain file. For this reason we add a new option just to enable
greentea tests, preventing build failures triggered by the unit tests
and googletest.
2021-08-10 16:35:11 +01:00
nazar.palamar 1d6843e538 Fixed MCU deep-sleep locking flow in CYW43XXX Cordio HCI driver. The CYW43XXX Cordio HCI driver incorrect handles lock/unlock deep-sleep entry, as results it allows to put PSoC6 in to deep-sleep when CYW43xx does not expect this (the host_wake_up pin in ACTIVE_LOW state, which means hat host must be in ACTIVE mode ).
Now, CYW43XXX Cordio HCI driver has the following MCU deep-sleep locking scenarios/flows:
a) A BT device or MCU does not support Low Power mode (MBED configuration does not include MBED_TICKLESS, DEVICE_SLEEP, DEVICE_LPTICKER or CYCFG_BT_LP_ENABLED features). In this case, CyH4TransportDriver locks deep-sleep in the initialize() function and unlocks the terminate() function.

b) A BT device and MCU support Low Power mode. In this case, the control of the unlock/lock of the deep-sleep functionality will be done in bt_host_wake_rise_irq_handler and bt_host_wake_fall_irq_handler handlers. Finally, CyH4TransportDriver unlocks the deep-sleep in terminate() function (if it was locked before) by checking the bt_host_wake_active flag.

Fixes #13076, #13700, #13295.
2021-08-06 16:41:24 +03:00
Lingkai Dong dca2aa79a0 Unit tests: Remove redundant CMake target mbed-headers-base
Individual libraries' `target_h` stub headers have now all been moved
from `mbed-headers-base` to `mbed-headers-<library>`.

Note: Even though headers previously in `target_h` are technically
stubs/fakes too, they are used by not only unit tests but also regular
libraries when compiled for unit tests, because no target-specific HAL
implementation exists in this case. In order for regular library
sources to pick up `target_h` headers, those headers must

* have the same names as regular headers
* appear first in include paths

This is why those headers are part of `mbed-headers-<library>` and not
`mbed-stubs-<library>`. Before this refactoring, `mbed-headers-base`
was the first in unit tests' include paths.
2021-08-02 17:42:43 +01:00
Lingkai Dong 71962481a4 Unit tests: Remove mbed.h stub from target_h
The header `mbed.h` is a convenient wrapper that pre-includes some
platform headers, for use by user applications. Libraries and tests
internal to Mbed OS should not use it, and they should explicitly
include headers they need. So a stub is not needed.
2021-08-02 17:42:42 +01:00
Lingkai Dong 44cd64a3e4 Unit tests: Fix style in cellular myCellularContext.h stub 2021-08-02 13:47:57 +01:00
Lingkai Dong 57dd6812c3 Unit tests: Move cellular target_h stubs
We move test-specific files from the top-level UNITTESTS directory
into individual components' UNITTESTS/doubles subdirectories.
2021-08-02 13:47:57 +01:00
Martin Kojtal 3318720ada
Merge pull request #14941 from hazzlim/update-tests-to-use-chrono
Update references to time values to use chrono
2021-07-30 12:02:10 +01:00
harmut01 86c2d70a5b Greentea: Remove deprecated APIs and use chrono
References to time should do so using std::chrono. We reworked tests in
connectivity and drivers to use std::chrono and new APIs in order to
remove deprecation warnings resulting from deprecated API calls.
This required addition of  a macro for test assertions using std::chrono
values.

As host test "timing_drift_auto" expects time values represented as an
integral number of microseconds, we explicitly provide this in place
using "microseconds{TICKER_TIME}.count()" in the relevant ticker tests.
We recognise this is ugly, but thought it best to descriptively convert
from std::chrono to the host test's required representation.

Co-authored-by: Hari Limaye <hari.limaye@arm.com>
2021-07-29 14:06:27 +01:00
Martin Kojtal b94fe130a3
Merge pull request #14288 from boraozgen/bg96-socket-send-segmentation
BG96: Add segmentation to TCP socket send
2021-07-29 10:31:23 +01:00
Charles d13aaf408c
Allow LoRaWAN STM32WL driver debug led to be inverted (#14910) 2021-07-29 10:29:53 +01:00
Robert Walton 98e25f193e unittests: Test_LoRaWANStack.acquire_rx_metadata: Fix SEGFAULT
We failed to set `LoRaMac_stub::mlme_ind_ptr` to a valid pointer. When
we tried to dereference it in `LoRaWANStack::process_reception` we hit a
SEGFAULT.
2021-07-27 21:09:39 +01:00
Robert Walton 421adc9888 unittests: Fix Test_LoRaWANStack.acquire_tx_metadata
This test was relying on the state of `LoRaMac_stub::bool_true_counter`
to be set to 1 from a previous test. When the test was ran in isolation
the `LoRaWANStack::rx_timeout_interrupt_handler` callback would fail
because we weren't returning true from the stub implementation of
`LoRaMac::nwk_joined`. Due to this
`LoRaWANStack::post_process_tx_no_reception` was never called. This
caused the LoRaWANStack object to think the "tx_metadata" was "stale"
(i.e the data hadn't changed since any previous read). So, when we
attempted to call `LoRaWANStack::acquire_tx_metadata` it returned
`LORAWAN_STATUS_METADATA_NOT_AVAILABLE` as it thought we had no new
metadata to report, causing the test assertion to fail.
2021-07-27 21:09:39 +01:00
Robert Walton 9f3069f1e1 unittests: Test_LoRaMac.post_process_mcps_req: Fix segfault
We had commented out a line where we reset LoRaPHY_stub::uint16_value to
0. This was causing an invalid array access in
LoRaMac::handle_data_frame, when trying to extract the
_mps_indication.channel from list of channel_params_t returned by
lora_phy->get_phy_channels.
2021-07-27 21:09:39 +01:00
Robert Walton 2e75d184b6 unittests: Remove ATHandler test interdependencies
Some tests in athandlertest.cpp relied on the state of stubs set in
previous tests. This caused test failures if the tests cases were ran in
isolation. Remove the interdependencies between tests by setting stub
values in the tests that rely on them.
2021-07-27 21:09:39 +01:00
Robert Walton a09d08917b CMake: unittests: Show all tests in CTest report
Previously a test executable was recognised as a single test by CTest.
However, test executables usually contain multiple test cases, the
results of the test cases should be individually reported. With our
previous setup we could miss test case failures that didn't cause the
executable to return an error code.

This commit uses gtest_discover_test to discover all test cases in a
test executable. This enables CTest to match test passes and failures
from the googletest binary output.
2021-07-27 21:09:39 +01:00
Robert Walton 1e48a61d89 CMake: unittests: Remove trailing whitespace 2021-07-27 21:09:38 +01:00
Jaeden Amero 0a944f0ac4 test: lorawanstack: Use valid message type
We previously made up an invalid message type, which was roughly
`MCPS_MULTICAST | 0x40`. This causes an MBED_ASSERT failure in the
handle_rx function, as it uses an assert to validate the message type
passed to it (in convert_to_msg_flag()). Use the valid message type
MCPS_MULTICAST instead in the handle_rx unit test.
2021-07-27 10:28:12 +01:00
Robert Walton 07aefbc6bc unittests: Test_LoRaWANTimer.start: Fix test failure
We weren't initialising the mocks correctly, so an MBED_ASSERT failed in
`LoRaWANTimer::start` because the "timer_id" was not set.
2021-07-27 10:28:12 +01:00
Jaeden Amero 4480abeaf9 cmake: Avoid linking to gcov
Use the `--coverage` option instead of manually linking to gcov, as some
host platforms (like macOS, FreeBSD) don't have gcov by default and use
an llvm equivalent instead.
2021-07-22 15:41:49 +01:00
Jaeden Amero b17ffaa68a cmake: Remove trailing whitespace
Remove trailing whitespace from lorawantimer's CMakeLists.txt.
2021-07-22 15:41:06 +01:00
Martin Kojtal e060c8c007
Merge pull request #14730 from Ekidna/fix/sx126x-select-pins
Add config macros for device-variant, freq-support and xtal config
2021-07-21 14:52:44 +02:00
Rajkumar Kanagaraj fb5b0ede45 CMake: Limit the mbed-fakes-ble to required dependency mock 2021-07-21 01:56:29 -07:00
Rajkumar Kanagaraj 9df7a50f39 CMake: Move ble fakes into FEATURE_BLE double dir
Previously ble fakes as part of UNITTESTS/fakes, this PR moves
ble fakes to FEATURE_BLE double directory to make ble stubs
to be self-contained.
2021-07-21 01:56:29 -07:00
Rajkumar Kanagaraj 86737bdb89 Remove mbed-headers-connectivity
Moved all the headers out of mbed-headers-connectivity, and these changes remove
that headers lib reference from lorawan and cellular unit tests
2021-07-21 01:56:29 -07:00
Rajkumar Kanagaraj a61392ae30 CMake: Create mbed-headers-ble library
Previously ble headers are part of mbed-headers-connectivity, this PR
moves ble headers into new mbed-headers-ble to make ble stubs to be
more self-contained and improves the composition of the library.
2021-07-21 01:51:48 -07:00
Martin Kojtal 146c98ccd6
Merge pull request #14920 from hazzlim/refactor-connectivity-netsocket-unittests
Refactor connectivity netsocket unittests
2021-07-20 14:58:40 +02:00
Martin Kojtal 2181d7cc77
Merge pull request #14924 from ARMmbed/refactor_cellular_unittest
Refactor cellular unittest CMake
2021-07-20 10:09:57 +02:00
Martin Kojtal 2bb1539ec4
Merge pull request #14922 from ARMmbed/at-handler-fix
Cellular: AT command fix - hex string shouldn't be quoted on bc95
2021-07-20 10:04:02 +02:00
Martin Kojtal c9234177c1
Merge pull request #14921 from paul-szczepanek-arm/fix-ble-default-db
BLE: suppress error when no path is passed in for ble security db
2021-07-20 10:02:28 +02:00
Martin Kojtal 1a7175d0a7
Merge pull request #14919 from paul-szczepanek-arm/fix-feature-toggle
BLE: fix missing define guards for feature selection
2021-07-20 10:02:12 +02:00
Hari Limaye 14cab32df4 Unittests: Make netsocket test header dependencies explicit
The CMake target `mbed-headers` brings in all
headers, and we are gradually moving away from it and explicitly use
only headers needed by each unit test.
2021-07-19 10:37:45 +01:00
Hari Limaye 4e54bf94d0 Unittests: Replace files with stubs in netsocket unit tests
Some netsocket unit tests depend on nanostack-libservice library, but
should use stubs instead of including the source files. We remove the
source files and link to mbed-stubs-nanostack-libservice.
2021-07-19 10:37:25 +01:00
Hari Limaye 8ad216ae1a Unittests: Clean up unused sources from netsocket
Some source files included when building netsocket unit tests with CMake
were determined to be unused by removing the files from target_sources()
and verifying that the tests still built and ran successfully. These
files have been removed from CMake builds.
2021-07-19 10:37:16 +01:00
Hari Limaye 47943dcf3d Unittests: connectivity: remove trailing whitespace 2021-07-19 10:36:54 +01:00
Rajkumar Kanagaraj f32a3cbeb7 CMake: Limit cellular device cmake to use mocks/sources what it depends
Update cellular device unit tests CMake depends on a mock, which is
required for the test instead of depending on the group of mbed-stubs,
mbed-headers, mbed_stub_headers, libraries.
Limit the cellular context unit test CMake target_sources to keep only
required sources
2021-07-15 06:27:28 -07:00
Rajkumar Kanagaraj 27bfa906c6 CMake: Limit cellular common unit tests to use mocks what it depends
Update cellular common unit tests CMake depends on a mock, which is
required for the test instead of depending on the group of
mbed-headers libraries.
2021-07-15 06:25:50 -07:00
Rajkumar Kanagaraj 6cf1211b3a CMake: Limit at cellular unittest to use mock what it depends
Update AT cellular unit tests CMake depends on a mock, which is required
for the test instead of depending on the group of mbed-stubs,
mbed-headers, mbed_stub_headers, libraries.
2021-07-15 06:17:07 -07:00
Paul Szczepanek a8982ca06e AT command fix - hex string shouldn't be quoted on bc95 2021-07-14 21:43:53 +01:00
Paul Szczepanek 8a4b278a38 suppress error when no path is passed in for ble sec db 2021-07-14 17:26:57 +01:00
Hari Limaye db2042755c Unit tests: Make lorawan test header dependencies explicit
To quote @LDong-Arm - "The CMake target `mbed-headers` brings in all
headers, and we are gradually moving away from it and explicitly use
only headers needed by each unit test."
2021-07-14 15:27:30 +01:00
Paul Szczepanek 7ba7f3e667 fix toggling off ble feature signing 2021-07-14 15:13:13 +01:00