Skip to content

Commit faac60c

Browse files
committed
Merge tag 'mbed-os-5.3.0-rc3' into feature_cmsis5_mbed_53
Release mbed OS 5.3.0-rc3 Ports for Upcoming Targets Fixes and Changes 3373: Fix DEBUG target keyword for GCC_ARM #3373 3374: Don't send events on close() #3374
2 parents a2f0645 + 7b974ca commit faac60c

File tree

456 files changed

+36696
-21750
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

456 files changed

+36696
-21750
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ python:
22
- "2.7"
33

44
script:
5+
- make -C events/equeue test clean
56
- PYTHONPATH=. python tools/test/config_test/config_test.py
67
- PYTHONPATH=. python tools/test/build_api/build_api_test.py
78
- python tools/test/pylint.py

TESTS/mbed_functional/callback/main.cpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,11 @@ template <typename T>
233233
T const_volatile_void_func5(const volatile void *t, T a0, T a1, T a2, T a3, T a4)
234234
{ return static_cast<const volatile Thing<T>*>(t)->t | a0 | a1 | a2 | a3 | a4; }
235235

236+
// Inheriting class
237+
template <typename T>
238+
class Thing2 : public Thing<T> {
239+
};
240+
236241

237242
// function call and result verification
238243
template <typename T>
@@ -315,15 +320,18 @@ struct Verifier {
315320
template <typename T>
316321
void test_dispatch0() {
317322
Thing<T> thing;
323+
Thing2<T> thing2;
318324
Verifier<T>::verify0(static_func0<T>);
319325
Verifier<T>::verify0(&thing, &Thing<T>::member_func0);
320326
Verifier<T>::verify0((const Thing<T>*)&thing, &Thing<T>::const_member_func0);
321327
Verifier<T>::verify0((volatile Thing<T>*)&thing, &Thing<T>::volatile_member_func0);
322328
Verifier<T>::verify0((const volatile Thing<T>*)&thing, &Thing<T>::const_volatile_member_func0);
329+
Verifier<T>::verify0(&thing2, &Thing2<T>::member_func0);
323330
Verifier<T>::verify0(&bound_func0<T>, &thing);
324331
Verifier<T>::verify0(&const_bound_func0<T>, (const Thing<T>*)&thing);
325332
Verifier<T>::verify0(&volatile_bound_func0<T>, (volatile Thing<T>*)&thing);
326333
Verifier<T>::verify0(&const_volatile_bound_func0<T>, (const volatile Thing<T>*)&thing);
334+
Verifier<T>::verify0(&bound_func0<T>, &thing2);
327335
Verifier<T>::verify0(&void_func0<T>, &thing);
328336
Verifier<T>::verify0(&const_void_func0<T>, (const Thing<T>*)&thing);
329337
Verifier<T>::verify0(&volatile_void_func0<T>, (volatile Thing<T>*)&thing);
@@ -342,15 +350,18 @@ void test_dispatch0() {
342350
template <typename T>
343351
void test_dispatch1() {
344352
Thing<T> thing;
353+
Thing2<T> thing2;
345354
Verifier<T>::verify1(static_func1<T>);
346355
Verifier<T>::verify1(&thing, &Thing<T>::member_func1);
347356
Verifier<T>::verify1((const Thing<T>*)&thing, &Thing<T>::const_member_func1);
348357
Verifier<T>::verify1((volatile Thing<T>*)&thing, &Thing<T>::volatile_member_func1);
349358
Verifier<T>::verify1((const volatile Thing<T>*)&thing, &Thing<T>::const_volatile_member_func1);
359+
Verifier<T>::verify1(&thing2, &Thing2<T>::member_func1);
350360
Verifier<T>::verify1(&bound_func1<T>, &thing);
351361
Verifier<T>::verify1(&const_bound_func1<T>, (const Thing<T>*)&thing);
352362
Verifier<T>::verify1(&volatile_bound_func1<T>, (volatile Thing<T>*)&thing);
353363
Verifier<T>::verify1(&const_volatile_bound_func1<T>, (const volatile Thing<T>*)&thing);
364+
Verifier<T>::verify1(&bound_func1<T>, &thing2);
354365
Verifier<T>::verify1(&void_func1<T>, &thing);
355366
Verifier<T>::verify1(&const_void_func1<T>, (const Thing<T>*)&thing);
356367
Verifier<T>::verify1(&volatile_void_func1<T>, (volatile Thing<T>*)&thing);
@@ -369,15 +380,18 @@ void test_dispatch1() {
369380
template <typename T>
370381
void test_dispatch2() {
371382
Thing<T> thing;
383+
Thing2<T> thing2;
372384
Verifier<T>::verify2(static_func2<T>);
373385
Verifier<T>::verify2(&thing, &Thing<T>::member_func2);
374386
Verifier<T>::verify2((const Thing<T>*)&thing, &Thing<T>::const_member_func2);
375387
Verifier<T>::verify2((volatile Thing<T>*)&thing, &Thing<T>::volatile_member_func2);
376388
Verifier<T>::verify2((const volatile Thing<T>*)&thing, &Thing<T>::const_volatile_member_func2);
389+
Verifier<T>::verify2(&thing2, &Thing2<T>::member_func2);
377390
Verifier<T>::verify2(&bound_func2<T>, &thing);
378391
Verifier<T>::verify2(&const_bound_func2<T>, (const Thing<T>*)&thing);
379392
Verifier<T>::verify2(&volatile_bound_func2<T>, (volatile Thing<T>*)&thing);
380393
Verifier<T>::verify2(&const_volatile_bound_func2<T>, (const volatile Thing<T>*)&thing);
394+
Verifier<T>::verify2(&bound_func2<T>, &thing2);
381395
Verifier<T>::verify2(&void_func2<T>, &thing);
382396
Verifier<T>::verify2(&const_void_func2<T>, (const Thing<T>*)&thing);
383397
Verifier<T>::verify2(&volatile_void_func2<T>, (volatile Thing<T>*)&thing);
@@ -396,15 +410,18 @@ void test_dispatch2() {
396410
template <typename T>
397411
void test_dispatch3() {
398412
Thing<T> thing;
413+
Thing2<T> thing2;
399414
Verifier<T>::verify3(static_func3<T>);
400415
Verifier<T>::verify3(&thing, &Thing<T>::member_func3);
401416
Verifier<T>::verify3((const Thing<T>*)&thing, &Thing<T>::const_member_func3);
402417
Verifier<T>::verify3((volatile Thing<T>*)&thing, &Thing<T>::volatile_member_func3);
403418
Verifier<T>::verify3((const volatile Thing<T>*)&thing, &Thing<T>::const_volatile_member_func3);
419+
Verifier<T>::verify3(&thing2, &Thing2<T>::member_func3);
404420
Verifier<T>::verify3(&bound_func3<T>, &thing);
405421
Verifier<T>::verify3(&const_bound_func3<T>, (const Thing<T>*)&thing);
406422
Verifier<T>::verify3(&volatile_bound_func3<T>, (volatile Thing<T>*)&thing);
407423
Verifier<T>::verify3(&const_volatile_bound_func3<T>, (const volatile Thing<T>*)&thing);
424+
Verifier<T>::verify3(&bound_func3<T>, &thing2);
408425
Verifier<T>::verify3(&void_func3<T>, &thing);
409426
Verifier<T>::verify3(&const_void_func3<T>, (const Thing<T>*)&thing);
410427
Verifier<T>::verify3(&volatile_void_func3<T>, (volatile Thing<T>*)&thing);
@@ -423,15 +440,18 @@ void test_dispatch3() {
423440
template <typename T>
424441
void test_dispatch4() {
425442
Thing<T> thing;
443+
Thing2<T> thing2;
426444
Verifier<T>::verify4(static_func4<T>);
427445
Verifier<T>::verify4(&thing, &Thing<T>::member_func4);
428446
Verifier<T>::verify4((const Thing<T>*)&thing, &Thing<T>::const_member_func4);
429447
Verifier<T>::verify4((volatile Thing<T>*)&thing, &Thing<T>::volatile_member_func4);
430448
Verifier<T>::verify4((const volatile Thing<T>*)&thing, &Thing<T>::const_volatile_member_func4);
449+
Verifier<T>::verify4(&thing2, &Thing2<T>::member_func4);
431450
Verifier<T>::verify4(&bound_func4<T>, &thing);
432451
Verifier<T>::verify4(&const_bound_func4<T>, (const Thing<T>*)&thing);
433452
Verifier<T>::verify4(&volatile_bound_func4<T>, (volatile Thing<T>*)&thing);
434453
Verifier<T>::verify4(&const_volatile_bound_func4<T>, (const volatile Thing<T>*)&thing);
454+
Verifier<T>::verify4(&bound_func4<T>, &thing2);
435455
Verifier<T>::verify4(&void_func4<T>, &thing);
436456
Verifier<T>::verify4(&const_void_func4<T>, (const Thing<T>*)&thing);
437457
Verifier<T>::verify4(&volatile_void_func4<T>, (volatile Thing<T>*)&thing);
@@ -450,15 +470,18 @@ void test_dispatch4() {
450470
template <typename T>
451471
void test_dispatch5() {
452472
Thing<T> thing;
473+
Thing2<T> thing2;
453474
Verifier<T>::verify5(static_func5<T>);
454475
Verifier<T>::verify5(&thing, &Thing<T>::member_func5);
455476
Verifier<T>::verify5((const Thing<T>*)&thing, &Thing<T>::const_member_func5);
456477
Verifier<T>::verify5((volatile Thing<T>*)&thing, &Thing<T>::volatile_member_func5);
457478
Verifier<T>::verify5((const volatile Thing<T>*)&thing, &Thing<T>::const_volatile_member_func5);
479+
Verifier<T>::verify5(&thing2, &Thing2<T>::member_func5);
458480
Verifier<T>::verify5(&bound_func5<T>, &thing);
459481
Verifier<T>::verify5(&const_bound_func5<T>, (const Thing<T>*)&thing);
460482
Verifier<T>::verify5(&volatile_bound_func5<T>, (volatile Thing<T>*)&thing);
461483
Verifier<T>::verify5(&const_volatile_bound_func5<T>, (const volatile Thing<T>*)&thing);
484+
Verifier<T>::verify5(&bound_func5<T>, &thing2);
462485
Verifier<T>::verify5(&void_func5<T>, &thing);
463486
Verifier<T>::verify5(&const_void_func5<T>, (const Thing<T>*)&thing);
464487
Verifier<T>::verify5(&volatile_void_func5<T>, (volatile Thing<T>*)&thing);

TESTS/network/wifi/main.cpp

Lines changed: 196 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,196 @@
1+
/* mbed Microcontroller Library
2+
* Copyright (c) 2016 ARM Limited
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
#include "utest/utest.h"
18+
#include "unity/unity.h"
19+
#include "greentea-client/test_env.h"
20+
21+
#include "mbed.h"
22+
23+
#if TARGET_UBLOX_EVK_ODIN_W2
24+
#include "OdinWiFiInterface.h"
25+
#else
26+
#error [NOT_SUPPORTED] Only built in WiFi modules are supported at this time.
27+
#endif
28+
29+
using namespace utest::v1;
30+
31+
/**
32+
* WiFi tests require following macros to be defined:
33+
* - MBED_CONF_APP_WIFI_SSID - SSID of a network the test will try connecting to
34+
* - MBED_CONF_APP_WIFI_PASSWORD - Passphrase that will be used to connecting to the network
35+
* - WIFI_TEST_NETWORKS - List of network that presence will be asserted e.g. "net1", "net2", "net3"
36+
*/
37+
#if !defined(MBED_CONF_APP_WIFI_SSID) || !defined(MBED_CONF_APP_WIFI_PASSWORD) || !defined(MBED_CONF_APP_WIFI_NETWORKS)
38+
#error [NOT_SUPPORTED] MBED_CONF_APP_WIFI_SSID, MBED_CONF_APP_WIFI_PASSWORD and MBED_CONF_APP_WIFI_NETWORKS have to be defined for this test.
39+
#endif
40+
41+
const char *networks[] = {MBED_CONF_APP_WIFI_NETWORKS, NULL};
42+
43+
WiFiInterface *wifi;
44+
45+
/* In normal circumstances the WiFi object could be global, but the delay introduced by WiFi initialization is an issue
46+
for the tests. It causes Greentea to timeout on syncing with the board. To solve it we defer the actual object
47+
creation till we actually need it.
48+
*/
49+
WiFiInterface *get_wifi()
50+
{
51+
if (wifi == NULL) {
52+
/* We don't really care about freeing this, as its lifetime is through the full test suit run. */
53+
#if TARGET_UBLOX_EVK_ODIN_W2
54+
wifi = new OdinWiFiInterface;
55+
#endif
56+
}
57+
58+
return wifi;
59+
}
60+
61+
void check_wifi(const char *ssid, bool *net_stat)
62+
{
63+
int i = 0;
64+
while(networks[i]) {
65+
if (strcmp(networks[i], ssid) == 0) {
66+
net_stat[i] = true;
67+
break;
68+
}
69+
i++;
70+
}
71+
}
72+
73+
void wifi_scan()
74+
{
75+
int count;
76+
WiFiAccessPoint *aps;
77+
const int net_len = sizeof(networks)/sizeof(networks[0]);
78+
bool net_stat[net_len - 1];
79+
80+
memset(net_stat, 0, sizeof(net_stat));
81+
82+
count = get_wifi()->scan(NULL, 0);
83+
TEST_ASSERT_MESSAGE(count >= 0, "WiFi interface returned error");
84+
TEST_ASSERT_MESSAGE(count > 0, "Scan result empty");
85+
86+
aps = new WiFiAccessPoint[count];
87+
count = get_wifi()->scan(aps, count);
88+
for(int i = 0; i < count; i++) {
89+
check_wifi(aps[i].get_ssid(), net_stat);
90+
}
91+
92+
delete[] aps;
93+
94+
for (unsigned i = 0; i < sizeof(net_stat); i++) {
95+
TEST_ASSERT_MESSAGE(net_stat[i] == true, "Not all required WiFi network detected");
96+
}
97+
}
98+
99+
void wifi_connect()
100+
{
101+
int ret;
102+
103+
ret = get_wifi()->connect(MBED_CONF_APP_WIFI_SSID, MBED_CONF_APP_WIFI_PASSWORD, NSAPI_SECURITY_WPA_WPA2);
104+
TEST_ASSERT_MESSAGE(ret == 0, "Connect failed");
105+
106+
ret = get_wifi()->disconnect();
107+
TEST_ASSERT_MESSAGE(ret == 0, "Disconnect failed");
108+
}
109+
110+
void wifi_connect_scan()
111+
{
112+
int ret;
113+
int count;
114+
WiFiAccessPoint *aps;
115+
const int net_len = sizeof(networks)/sizeof(networks[0]);
116+
bool net_stat[net_len - 1];
117+
118+
memset(net_stat, 0, sizeof(net_stat));
119+
120+
ret = get_wifi()->connect(MBED_CONF_APP_WIFI_SSID, MBED_CONF_APP_WIFI_PASSWORD, NSAPI_SECURITY_WPA_WPA2);
121+
TEST_ASSERT_MESSAGE(ret == 0, "Connect failed");
122+
123+
count = get_wifi()->scan(NULL, 0);
124+
TEST_ASSERT_MESSAGE(count >= 0, "WiFi interface returned error");
125+
TEST_ASSERT_MESSAGE(count > 0, "Scan result empty");
126+
127+
aps = new WiFiAccessPoint[count];
128+
count = get_wifi()->scan(aps, count);
129+
for(int i = 0; i < count; i++) {
130+
check_wifi(aps[i].get_ssid(), net_stat);
131+
}
132+
133+
delete[] aps;
134+
135+
ret = get_wifi()->disconnect();
136+
TEST_ASSERT_MESSAGE(ret == 0, "Disconnect failed");
137+
138+
for (unsigned i = 0; i < sizeof(net_stat); i++) {
139+
TEST_ASSERT_MESSAGE(net_stat[i] == true, "Not all required WiFi network detected");
140+
}
141+
}
142+
143+
void wifi_http()
144+
{
145+
TCPSocket socket;
146+
int ret;
147+
148+
ret = get_wifi()->connect(MBED_CONF_APP_WIFI_SSID, MBED_CONF_APP_WIFI_PASSWORD, NSAPI_SECURITY_WPA_WPA2);
149+
TEST_ASSERT_MESSAGE(ret == 0, "Connect failed");
150+
151+
// Open a socket on the network interface, and create a TCP connection to www.arm.com
152+
ret = socket.open(get_wifi());
153+
TEST_ASSERT_MESSAGE(ret == 0, "Socket open failed");
154+
ret = socket.connect("www.arm.com", 80);
155+
TEST_ASSERT_MESSAGE(ret == 0, "Socket connect failed");
156+
157+
// Send a simple http request
158+
char sbuffer[] = "GET / HTTP/1.1\r\nHost: www.arm.com\r\n\r\n";
159+
int scount = socket.send(sbuffer, sizeof sbuffer);
160+
TEST_ASSERT_MESSAGE(scount >= 0, "Socket send failed");
161+
162+
// Recieve a simple http response and check if it's not empty
163+
char rbuffer[64];
164+
int rcount = socket.recv(rbuffer, sizeof rbuffer);
165+
TEST_ASSERT_MESSAGE(rcount >= 0, "Socket recv error");
166+
TEST_ASSERT_MESSAGE(rcount > 0, "No data received");
167+
168+
ret = socket.close();
169+
TEST_ASSERT_MESSAGE(ret == 0, "Socket close failed");
170+
171+
ret = get_wifi()->disconnect();
172+
TEST_ASSERT_MESSAGE(ret == 0, "Disconnect failed");
173+
}
174+
175+
status_t greentea_failure_handler(const Case *const source, const failure_t reason) {
176+
greentea_case_failure_abort_handler(source, reason);
177+
return STATUS_CONTINUE;
178+
}
179+
180+
Case cases[] = {
181+
Case("Scan test", wifi_scan, greentea_failure_handler),
182+
Case("Connect test", wifi_connect, greentea_failure_handler),
183+
Case("Scan while connected test", wifi_connect_scan, greentea_failure_handler),
184+
Case("HTTP test", wifi_http, greentea_failure_handler),
185+
};
186+
187+
status_t greentea_test_setup(const size_t number_of_cases) {
188+
GREENTEA_SETUP(90, "default_auto");
189+
return greentea_test_setup_handler(number_of_cases);
190+
}
191+
192+
193+
int main() {
194+
Specification specification(greentea_test_setup, cases, greentea_test_teardown_handler);
195+
Harness::run(specification);
196+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"config": {
3+
"wifi-ssid": {
4+
"help": "WiFi SSID",
5+
"value": "\"SSID\""
6+
},
7+
"wifi-password": {
8+
"help": "WiFi Password",
9+
"value": "\"PASS\""
10+
},
11+
"wifi-networks": {
12+
"help": "WiFi SSIDs which presence will be asserted in the test",
13+
"value": "\"SSID1\",\"SSID2\",\"SSID3\""
14+
}
15+
},
16+
"target_overrides": {
17+
"UBLOX_EVK_ODIN_W2": {
18+
"target.device_has": ["EMAC"]
19+
}
20+
}
21+
}

cmsis/core_caFunc.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -811,6 +811,23 @@ __asm(
811811
__STATIC_INLINE void __v7_inv_dcache_all(void) {
812812
__v7_all_cache(0);
813813
}
814+
/** \brief Clean the whole D$
815+
816+
DCCSW. Clean by Set/Way
817+
*/
818+
819+
__STATIC_INLINE void __v7_clean_dcache_all(void) {
820+
__v7_all_cache(1);
821+
}
822+
823+
/** \brief Clean and invalidate the whole D$
824+
825+
DCCISW. Clean and Invalidate by Set/Way
826+
*/
827+
828+
__STATIC_INLINE void __v7_clean_inv_dcache_all(void) {
829+
__v7_all_cache(2);
830+
}
814831
/** \brief Clean and Invalidate D$ by MVA
815832
816833
DCCIMVAC. Data cache clean and invalidate by MVA to PoC

cmsis/core_cm0.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,9 @@ __STATIC_INLINE void NVIC_DisableIRQ(IRQn_Type IRQn)
625625
{
626626
if ((int32_t)(IRQn) >= 0)
627627
{
628-
NVIC->ICER[0U] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL));
628+
NVIC->ICER[0] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL));
629+
__DSB();
630+
__ISB();
629631
}
630632
}
631633

cmsis/core_cm0plus.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -742,6 +742,8 @@ __STATIC_INLINE void NVIC_DisableIRQ(IRQn_Type IRQn)
742742
if ((int32_t)(IRQn) >= 0)
743743
{
744744
NVIC->ICER[0U] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL));
745+
__DSB();
746+
__ISB();
745747
}
746748
}
747749

0 commit comments

Comments
 (0)