Skip to content

New Target Mbed Connect Cloud board #5262

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 89 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
b1ff37c
HAL: ticker_api: Fix outdated comment
fkjagodzinski Sep 5, 2017
d43a847
Added additional DAPLink version info for `mbed detect` command`
dhwalters423 Sep 11, 2017
7ff57c4
Changed DAPLink version to interface version.
dhwalters423 Sep 12, 2017
076b096
STM: I2C: Confifure pins in OpenDrainNoPull by default (no pullup)
LMESTM Sep 14, 2017
e4b55dd
Removed get_mounted_details_txt from test_api.py
dhwalters423 Sep 15, 2017
256ab61
Fixed mount_point example usage
dhwalters423 Sep 15, 2017
aafe614
Edited get_interface_version info for clarity
dhwalters423 Sep 15, 2017
7b49591
Added in safety check if details_txt is None
dhwalters423 Sep 15, 2017
b363d00
[M487/NUC472] Fixed ethernet multi-function pin
cyliangtw Aug 23, 2017
52733fe
[M487] Replace mktime/localtime with interrupt-safe version in rtc
ccli8 Sep 4, 2017
6eb4e11
[NUC472/M453/M487] Refine sleep code
ccli8 Aug 29, 2017
83fc132
[NUC472] Fix RTC macro function with no arguments in BSP
ccli8 Sep 4, 2017
d4af4ba
[NUC472/M453/M487] Fix RTC hour error with AM/PM
ccli8 Sep 4, 2017
443d18a
[NANO130] Move target configuration from mbed_lib.json to targets.json
ccli8 Sep 13, 2017
c4c9022
[NANO130] Change SW2/SW3 to SW1/SW2 to match target board
ccli8 Sep 13, 2017
f553277
[NANO130] Fix lp_ticker typo
ccli8 Sep 15, 2017
3307098
[NANO130] Fix lp_ticker wake-up is incorrectly disabled
ccli8 Sep 18, 2017
785413a
[NANO130] Fix RTC hour error with AM/PM
ccli8 Sep 21, 2017
4040211
[NANO130] Refine sleep code
ccli8 Sep 22, 2017
bf426b0
[NUC472/M453/M487/NANO130] Remove dead power-down code with mbed OS 3
ccli8 Sep 22, 2017
4817f06
Allow exporters for NUCLEO_L486RG
adustm Sep 12, 2017
b887bb7
Added safety check, added test converage for new function
dhwalters423 Sep 25, 2017
4c2d17e
Removing unused imports/update copywright`
dhwalters423 Sep 25, 2017
0947db6
add quotation marks for compiler path
mgiaco Sep 26, 2017
f861b37
Extend nRF51 AnalogIn voltage range to 3.6 V
nvlsianpu Sep 26, 2017
0132691
fs: Fixed fstat retarget for regular files
geky Sep 26, 2017
ca5bcf7
remove the first join
mgiaco Sep 27, 2017
4824e18
STM32L4: add ADC calibration
bcostm Sep 27, 2017
fca9714
Add ADC calibration for STM32F1 and F3 devices
bcostm Sep 28, 2017
a047f62
Increased test coverage / mocking of external modules
dhwalters423 Sep 29, 2017
bb79f69
Minor copy edits, added comment
dhwalters423 Sep 29, 2017
61f46b8
Changed type => test_type
dhwalters423 Sep 29, 2017
fc503b8
Enable LPC1768 bootloader support
chrissnow Sep 5, 2017
a08fc2b
Move CRP out of startup and into CRP.c so it can be conditionally com…
chrissnow Sep 5, 2017
f8f5483
Linker update for bootloader support
chrissnow Sep 5, 2017
d640472
Ensure CRP is set correctly for IAR, GCC and ARM
chrissnow Sep 5, 2017
fb27e71
Implement MBED_USED
chrissnow Sep 30, 2017
5e36d32
rtl8195am - remove obsolete configs
tung7970 Sep 30, 2017
e6b1ef5
examples: remove eddystone ble examples
0xc0170 Oct 2, 2017
7ffa3dd
Merging changes from ATParser towards parser unification
SenRamakri Sep 27, 2017
3e1459b
Merging changes from ATParser got AT parser unification
SenRamakri Sep 27, 2017
120c9ad
Moved STDIO_UART defines to targets.json for UBLOX_EVK_ODIN_W2 instea…
Sep 25, 2017
d0de5f7
rtl8195am - fix ARMC6 guards
tung7970 Oct 2, 2017
f0ac234
Prevent DeepSleepLock from leaving sleep locked
c1728p9 Sep 28, 2017
ea46885
Add a test to validate locking
c1728p9 Sep 28, 2017
87b151c
Protect Ticker attach with a critical section
c1728p9 Sep 28, 2017
f854f3e
Properly unlock sleep in destructor of drivers
c1728p9 Sep 28, 2017
1a12815
Include doxygen from test directories
c1728p9 Sep 27, 2017
82ae53a
Simplify CRP placement.
chrissnow Sep 30, 2017
cdd29b8
Add retry to handle git clone failure
studavekar Oct 2, 2017
e9cd239
fs: Added in missing retarget definitions for ARM/IAR
geky Sep 26, 2017
2b27ad1
Nanostack v6.2.2
Oct 4, 2017
3d87507
Implement functional Wifi tests
Sep 19, 2017
3ac788f
Set timeout to 4 minutes.
Sep 19, 2017
0498e8d
Update template mbed_app.json
Sep 22, 2017
fde08a1
Fix includes.
Sep 29, 2017
5b40280
Update help text
Oct 3, 2017
72e7c32
Fix builds for targets without wifi or without mbed_app.json
Oct 3, 2017
80198f2
Add Doxygen documentation for testcases.
Oct 4, 2017
429b068
Add license texts
Oct 4, 2017
ad0b115
Prevent use of deleted ticker in Ticker test
c1728p9 Oct 4, 2017
87a2b5b
Fix documentation of BLE GattCharacteristic
akosthekiss Oct 1, 2017
9cb1f39
Introduced mbed Connect Cloud board based on ODIN-W2 Module
Oct 5, 2017
f47d8e9
Merge pull request #5249 from JuhPuur/master
theotherjimmy Oct 5, 2017
4dff32a
Merge pull request #5220 from c1728p9/sleep_lock_fixes
theotherjimmy Oct 5, 2017
a0b624b
Merge pull request #5038 from chrissnow/LPC1768-Bootloader
theotherjimmy Oct 5, 2017
da78647
Merge pull request #5077 from dhwalters423/dhwalters423-add-detect-info
theotherjimmy Oct 5, 2017
41998d5
Merge pull request #5084 from adustm/NUCLEO_L486_export
theotherjimmy Oct 5, 2017
9b62dce
Merge pull request #5199 from mgiaco/master
theotherjimmy Oct 5, 2017
da138f2
Merge pull request #5203 from geky/fix-fstat-newlib
theotherjimmy Oct 5, 2017
0dc264f
Merge pull request #5212 from SenRamakri/sen_ATCmdParserChanges2
theotherjimmy Oct 5, 2017
23d201c
Merge pull request #5237 from 0xc0170/fix_examples_eddy
theotherjimmy Oct 5, 2017
0fd13b5
Merge pull request #5240 from studavekar/retry-on-clone-failure
theotherjimmy Oct 5, 2017
7b2b18f
Merge pull request #5204 from geky/fix-retarget-defs
adbridge Oct 6, 2017
c5621b9
fix echo test handshake and reduce uart load
studavekar Oct 8, 2017
943fc32
Merge pull request #5255 from c1728p9/fix_ticker_test
0xc0170 Oct 9, 2017
8beedce
Merge pull request #5019 from fkjagodzinski/fix-ticker_API_docs
theotherjimmy Oct 9, 2017
d60f145
Merge pull request #5113 from LMESTM/i2c_OpenDrainNoPull
theotherjimmy Oct 9, 2017
d6136b9
Merge pull request #5157 from OpenNuvoton/nuvoton
theotherjimmy Oct 9, 2017
42532d7
Merge pull request #5161 from SeppoTakalo/wifi_tests
theotherjimmy Oct 9, 2017
df484e7
Merge pull request #5192 from andreaslarssonublox/ublox_move_stdio_ua…
theotherjimmy Oct 9, 2017
5c3ce0a
Merge pull request #5200 from nvlsianpu/nrf51_adcIn_range_extend
theotherjimmy Oct 9, 2017
80ff707
Merge pull request #5210 from bcostm/L4_add_adc_calib
theotherjimmy Oct 9, 2017
ad13457
Merge pull request #5232 from tung7970/fix-target
theotherjimmy Oct 9, 2017
82196ee
Merge pull request #5229 from akosthekiss/ble-service-doc-fix
theotherjimmy Oct 9, 2017
47275f0
Merge pull request #5238 from c1728p9/doxygen_in_test_directories
theotherjimmy Oct 9, 2017
df88a9d
Merge pull request #5272 from studavekar/echo_test_fix_handshake
theotherjimmy Oct 9, 2017
0ef8f55
Introduced mbed Connect Cloud board based on ODIN-W2 Module
Oct 5, 2017
3a20bc1
Merge branch 'master' of https://github.com/andcor02/mbed-os
Oct 10, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions TESTS/mbed_drivers/echo/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,18 @@ using namespace utest::v1;
// Echo server (echo payload to host)
template<int N>
void test_case_echo_server_x() {
char _key[10] = {};
char _key[11] = {};
char _value[128] = {};
const int echo_count = N;
const char _key_const[] = "echo_count";
int expected_key = 1;

greentea_send_kv(_key_const, echo_count);
// Handshake with host
greentea_send_kv("echo_count", echo_count);
greentea_parse_kv(_key, _value, sizeof(_key), sizeof(_value));
do {
greentea_parse_kv(_key, _value, sizeof(_key), sizeof(_value));
expected_key = strcmp(_key_const, _key);
} while (expected_key);
TEST_ASSERT_EQUAL_INT(echo_count, atoi(_value));

for (int i=0; i < echo_count; ++i) {
Expand All @@ -48,12 +53,10 @@ utest::v1::status_t greentea_failure_handler(const Case *const source, const fai

Case cases[] = {
Case("Echo server: x16", test_case_echo_server_x<16>, greentea_failure_handler),
Case("Echo server: x32", test_case_echo_server_x<32>, greentea_failure_handler),
Case("Echo server: x64", test_case_echo_server_x<64>, greentea_failure_handler),
};

utest::v1::status_t greentea_test_setup(const size_t number_of_cases) {
GREENTEA_SETUP(180, "echo");
GREENTEA_SETUP(30, "echo");
return greentea_test_setup_handler(number_of_cases);
}

Expand Down
132 changes: 132 additions & 0 deletions TESTS/mbed_drivers/sleep_lock/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@

/* mbed Microcontroller Library
* Copyright (c) 2017 ARM Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#if !DEVICE_SLEEP
#error [NOT_SUPPORTED] Sleep not supported for this target
#endif

#include "utest/utest.h"
#include "unity/unity.h"
#include "greentea-client/test_env.h"

#include "mbed.h"

using namespace utest::v1;

void deep_sleep_lock_lock_test()
{
TEST_ASSERT_EQUAL(true, sleep_manager_can_deep_sleep());
{
// Check basic usage works
DeepSleepLock lock;
TEST_ASSERT_EQUAL(false, sleep_manager_can_deep_sleep());
}

TEST_ASSERT_EQUAL(true, sleep_manager_can_deep_sleep());
{
// Check that unlock and lock change can deep sleep as expected
DeepSleepLock lock;
TEST_ASSERT_EQUAL(false, sleep_manager_can_deep_sleep());
lock.unlock();
TEST_ASSERT_EQUAL(true, sleep_manager_can_deep_sleep());
lock.lock();
TEST_ASSERT_EQUAL(false, sleep_manager_can_deep_sleep());
}

TEST_ASSERT_EQUAL(true, sleep_manager_can_deep_sleep());
{
// Check that unlock releases sleep based on count
DeepSleepLock lock;
lock.lock();
lock.lock();
lock.unlock();
TEST_ASSERT_EQUAL(false, sleep_manager_can_deep_sleep());
}

TEST_ASSERT_EQUAL(true, sleep_manager_can_deep_sleep());
{
// Check that unbalanced locks do not leave deep sleep locked
DeepSleepLock lock;
lock.lock();
TEST_ASSERT_EQUAL(false, sleep_manager_can_deep_sleep());
}
TEST_ASSERT_EQUAL(true, sleep_manager_can_deep_sleep());

}

void timer_lock_test()
{
TEST_ASSERT_EQUAL(true, sleep_manager_can_deep_sleep());
{
// Just creating a timer object does not lock sleep
Timer timer;
TEST_ASSERT_EQUAL(true, sleep_manager_can_deep_sleep());
}

TEST_ASSERT_EQUAL(true, sleep_manager_can_deep_sleep());
{
// Starting a timer does lock sleep
Timer timer;
timer.start();
TEST_ASSERT_EQUAL(false, sleep_manager_can_deep_sleep());
}

TEST_ASSERT_EQUAL(true, sleep_manager_can_deep_sleep());
{
// Stopping a timer after starting it allows sleep
Timer timer;
timer.start();
timer.stop();
TEST_ASSERT_EQUAL(true, sleep_manager_can_deep_sleep());
}

TEST_ASSERT_EQUAL(true, sleep_manager_can_deep_sleep());
{
// Starting a timer multiple times still lets you sleep
Timer timer;
timer.start();
timer.start();
}
TEST_ASSERT_EQUAL(true, sleep_manager_can_deep_sleep());

TEST_ASSERT_EQUAL(true, sleep_manager_can_deep_sleep());
{
// Stopping a timer multiple times still lets you sleep
Timer timer;
timer.start();
timer.stop();
timer.stop();
TEST_ASSERT_EQUAL(true, sleep_manager_can_deep_sleep());
}
TEST_ASSERT_EQUAL(true, sleep_manager_can_deep_sleep());
}

Case cases[] = {
Case("DeepSleepLock lock test", deep_sleep_lock_lock_test),
Case("timer lock test", timer_lock_test),
};

utest::v1::status_t greentea_test_setup(const size_t number_of_cases) {
GREENTEA_SETUP(20, "default_auto");
return greentea_test_setup_handler(number_of_cases);
}

Specification specification(greentea_test_setup, cases, greentea_test_teardown_handler);

int main() {
Harness::run(specification);
}
30 changes: 21 additions & 9 deletions TESTS/mbed_drivers/ticker/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ static const int total_ticks = 10;
DigitalOut led1(LED1);
DigitalOut led2(LED2);

Ticker *ticker1;
Ticker *ticker2;
Ticker *volatile ticker1;
Ticker *volatile ticker2;

volatile int ticker_count = 0;
volatile bool print_tick = false;
Expand All @@ -67,15 +67,21 @@ void ticker_callback_2_led(void) {

void ticker_callback_1_switch_to_2(void) {
++callback_trigger_count;
ticker1->detach();
ticker1->attach_us(ticker_callback_2_switch_to_1, ONE_MILLI_SEC);
// If ticker is NULL then it is being or has been deleted
if (ticker1) {
ticker1->detach();
ticker1->attach_us(ticker_callback_2_switch_to_1, ONE_MILLI_SEC);
}
ticker_callback_1_led();
}

void ticker_callback_2_switch_to_1(void) {
++callback_trigger_count;
ticker2->detach();
ticker2->attach_us(ticker_callback_1_switch_to_2, ONE_MILLI_SEC);
// If ticker is NULL then it is being or has been deleted
if (ticker2) {
ticker2->detach();
ticker2->attach_us(ticker_callback_1_switch_to_2, ONE_MILLI_SEC);
}
ticker_callback_2_led();
}

Expand Down Expand Up @@ -159,13 +165,19 @@ utest::v1::status_t two_ticker_case_setup_handler_t(const Case *const source, co
}

utest::v1::status_t one_ticker_case_teardown_handler_t(const Case *const source, const size_t passed, const size_t failed, const failure_t reason) {
delete ticker1;
Ticker *temp1 = ticker1;
ticker1 = NULL;
delete temp1;
return greentea_case_teardown_handler(source, passed, failed, reason);
}

utest::v1::status_t two_ticker_case_teardown_handler_t(const Case *const source, const size_t passed, const size_t failed, const failure_t reason) {
delete ticker1;
delete ticker2;
Ticker *temp1 = ticker1;
Ticker *temp2 = ticker2;
ticker1 = NULL;
ticker2 = NULL;
delete temp1;
delete temp2;
return greentea_case_teardown_handler(source, passed, failed, reason);
}

Expand Down
62 changes: 62 additions & 0 deletions TESTS/network/wifi/get_interface.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*
* Copyright (c) 2017, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include "mbed.h"

// Pick the correct driver based on mbed_app.json
#define INTERNAL 1
#define WIFI_ESP8266 2
#define X_NUCLEO_IDW01M1 3

#if MBED_CONF_APP_WIFI_DRIVER == INTERNAL

#if TARGET_UBLOX_EVK_ODIN_W2
#include "OdinWiFiInterface.h"
#define DRIVER OdinWiFiInterface

#elif TARGET_REALTEK_RTL8195AM
#include "RTWInterface.h"
#define DRIVER RTWInterface
#else
#error [NOT_SUPPORTED] Unsupported Wifi driver
#endif

#elif MBED_CONF_APP_WIFI_DRIVER == WIFI_ESP8266
#include "ESP8266Interface.h"
#define DRIVER ESP8266Interface

#elif MBED_CONF_APP_WIFI_DRIVER == X_NUCLEO_IDW01M1
#include "SpwfSAInterface.h"
#define DRIVER SpwfSAInterface
#else
#error [NOT_SUPPORTED] Unsupported Wifi driver
#endif

WiFiInterface *get_interface()
{
static WiFiInterface *interface = NULL;

if (interface)
delete interface;

#if MBED_CONF_APP_WIFI_DRIVER == INTERNAL
interface = new DRIVER();
#else
interface = new DRIVER(MBED_CONF_APP_WIFI_TX, MBED_CONF_APP_WIFI_RX);
#endif
return interface;
}
Loading