From 157d1267691c7f87e192e16dfc13f8204a5e4e7c Mon Sep 17 00:00:00 2001 From: Hugues Kamba Date: Fri, 15 Nov 2019 11:32:27 +0000 Subject: [PATCH] UBLOX_EVK_ODIN_W2: Fix baremetal build and greentea tests Remove lwIP reliant networking and BLE tests for baremetal Mbed OS 5 ported lwIP in its OS mode and uses threads. Networking that rely on lwIP needs to be removed so it can be compiled with the baremetal profile. The BLE cordio Greentea tests are also disabled given that the feature is not supported without an RTOS. --- features/FEATURE_BLE/mbed_lib.json | 1 + .../targets/TARGET_CORDIO/TESTS/cordio_hci/driver/main.cpp | 5 +++++ .../TARGET_CORDIO/TESTS/cordio_hci/transport/main.cpp | 6 ++++++ features/lwipstack/mbed_lib.json | 1 + .../sdk/ublox-odin-w2-drivers/OdinWiFiInterface.cpp | 3 +++ .../sdk/ublox-odin-w2-drivers/OdinWiFiInterface.h | 6 +++++- .../sdk/ublox-odin-w2-drivers/default_wifi_interface.cpp | 4 ++++ 7 files changed, 25 insertions(+), 1 deletion(-) diff --git a/features/FEATURE_BLE/mbed_lib.json b/features/FEATURE_BLE/mbed_lib.json index 57a3c90446..efae862cad 100644 --- a/features/FEATURE_BLE/mbed_lib.json +++ b/features/FEATURE_BLE/mbed_lib.json @@ -1,6 +1,7 @@ { "name": "ble", "config": { + "present": 1, "ble-role-observer": { "help": "Include observer BLE role support (scanning for and processing advertising packets).", "value": true, diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/TESTS/cordio_hci/driver/main.cpp b/features/FEATURE_BLE/targets/TARGET_CORDIO/TESTS/cordio_hci/driver/main.cpp index 64f42bd0d8..5afcde2da1 100644 --- a/features/FEATURE_BLE/targets/TARGET_CORDIO/TESTS/cordio_hci/driver/main.cpp +++ b/features/FEATURE_BLE/targets/TARGET_CORDIO/TESTS/cordio_hci/driver/main.cpp @@ -13,6 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#if !MBED_CONF_BLE_PRESENT +#error [NOT_SUPPORTED] BLE cordio test cases require the BLE library. +#else #include @@ -109,3 +112,5 @@ Specification specification(greentea_test_setup, cases, greentea_test_teardown_h int main() { return !Harness::run(specification); } + +#endif // !MBED_CONF_BLE_PRESENT diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/TESTS/cordio_hci/transport/main.cpp b/features/FEATURE_BLE/targets/TARGET_CORDIO/TESTS/cordio_hci/transport/main.cpp index 4492aee531..dff9923a47 100644 --- a/features/FEATURE_BLE/targets/TARGET_CORDIO/TESTS/cordio_hci/transport/main.cpp +++ b/features/FEATURE_BLE/targets/TARGET_CORDIO/TESTS/cordio_hci/transport/main.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +#if !MBED_CONF_BLE_PRESENT +#error [NOT_SUPPORTED] BLE cordio test cases require the BLE library. +#else + #include #include @@ -265,3 +269,5 @@ int main() return !Harness::run(specification); } #endif // CORDIO_ZERO_COPY_HCI + +#endif //!MBED_CONF_BLE_PRESENT diff --git a/features/lwipstack/mbed_lib.json b/features/lwipstack/mbed_lib.json index 5ac827ac82..53d46ec2d2 100644 --- a/features/lwipstack/mbed_lib.json +++ b/features/lwipstack/mbed_lib.json @@ -1,6 +1,7 @@ { "name": "lwip", "config": { + "present": 1, "ipv4-enabled": { "help": "Enable IPv4", "value": true diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TARGET_MODULE_UBLOX_ODIN_W2/sdk/ublox-odin-w2-drivers/OdinWiFiInterface.cpp b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TARGET_MODULE_UBLOX_ODIN_W2/sdk/ublox-odin-w2-drivers/OdinWiFiInterface.cpp index f872621853..4ebdd6683a 100644 --- a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TARGET_MODULE_UBLOX_ODIN_W2/sdk/ublox-odin-w2-drivers/OdinWiFiInterface.cpp +++ b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TARGET_MODULE_UBLOX_ODIN_W2/sdk/ublox-odin-w2-drivers/OdinWiFiInterface.cpp @@ -14,6 +14,8 @@ * limitations under the License. */ +#if MBED_CONF_LWIP_PRESENT + #include "OdinWiFiInterface.h" #include "cb_main.h" #include "cb_wlan.h" @@ -2107,3 +2109,4 @@ static cbTARGET_PowerSaveMode convertPowerSaveAtToIoctl(target_power_save_mode_e return mode; } +#endif // MBED_CONF_LWIP_PRESENT diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TARGET_MODULE_UBLOX_ODIN_W2/sdk/ublox-odin-w2-drivers/OdinWiFiInterface.h b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TARGET_MODULE_UBLOX_ODIN_W2/sdk/ublox-odin-w2-drivers/OdinWiFiInterface.h index c5226255b1..8a0c1d3bd7 100644 --- a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TARGET_MODULE_UBLOX_ODIN_W2/sdk/ublox-odin-w2-drivers/OdinWiFiInterface.h +++ b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TARGET_MODULE_UBLOX_ODIN_W2/sdk/ublox-odin-w2-drivers/OdinWiFiInterface.h @@ -1,5 +1,5 @@ /* ODIN-W2 implementation of WiFiInterface - * Copyright (c) 2016 u-blox Malmö AB + * Copyright (c) 2016 u-blox Malm� AB * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,6 +17,8 @@ #ifndef ODIN_WIFI_INTERFACE_H #define ODIN_WIFI_INTERFACE_H +#if MBED_CONF_LWIP_PRESENT + #include "WiFiInterface.h" #if DEVICE_WIFI_AP #include "UbloxWiFiSoftAPInterface.h" @@ -443,3 +445,5 @@ private: }; #endif + +#endif // MBED_CONF_LWIP_PRESENT diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TARGET_MODULE_UBLOX_ODIN_W2/sdk/ublox-odin-w2-drivers/default_wifi_interface.cpp b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TARGET_MODULE_UBLOX_ODIN_W2/sdk/ublox-odin-w2-drivers/default_wifi_interface.cpp index 70db323ebe..e2d6f02c6b 100644 --- a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TARGET_MODULE_UBLOX_ODIN_W2/sdk/ublox-odin-w2-drivers/default_wifi_interface.cpp +++ b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TARGET_MODULE_UBLOX_ODIN_W2/sdk/ublox-odin-w2-drivers/default_wifi_interface.cpp @@ -15,6 +15,8 @@ * limitations under the License. */ +#ifdef MBED_CONF_LWIP_PRESENT + #include "OdinWiFiInterface.h" WiFiInterface *WiFiInterface::get_target_default_instance() @@ -22,3 +24,5 @@ WiFiInterface *WiFiInterface::get_target_default_instance() static OdinWiFiInterface wifi; return &wifi; } + +#endif // MBED_CONF_LWIP_PRESENT