Skip to content

Commit cfa7938

Browse files
authored
Merge pull request #10469 from ARMmbed/release-candidate
Release candidate for mbed-os-5.12.2
2 parents 0063e5d + a3e7416 commit cfa7938

File tree

419 files changed

+159650
-133596
lines changed

Some content is hidden

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

419 files changed

+159650
-133596
lines changed

.travis.yml

Lines changed: 165 additions & 172 deletions
Large diffs are not rendered by default.

LICENSE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,4 @@ The Python modules used by Mbed tools are used under the following licenses:
5050
- [pycryptodome](https://pypi.org/project/pycryptodome) - BSD-2-Clause
5151
- [pyusb](https://pypi.org/project/pyusb/) - Apache-2.0
5252
- [cmsis-pack-manager](https://pypi.org/project/cmsis-pack-manager) - Apache-2.0
53+
- [hidapi](https://pypi.org/project/hidapi/) - BSD-style

TESTS/host_tests/usb_device_hid.py

Lines changed: 566 additions & 0 deletions
Large diffs are not rendered by default.

TESTS/mbed_drivers/lp_timeout/main.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,10 @@ Case cases[] = {
7474
Case("1 s delay during deepsleep (attach_us)", test_deepsleep<AttachUSTester<LowPowerTimeout>, 1000000, LONG_DELTA_US>,
7575
greentea_failure_handler),
7676
#endif
77-
77+
#if !defined(__ARM_FM) //FastModels not support time drifting test
7878
Case("Timing drift (attach)", test_drift<AttachTester<LowPowerTimeout> >),
7979
Case("Timing drift (attach_us)", test_drift<AttachUSTester<LowPowerTimeout> >),
80+
#endif
8081
};
8182

8283
utest::v1::status_t greentea_test_setup(const size_t number_of_cases)

TESTS/netsocket/README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -859,9 +859,6 @@ Within each loop, one `recvfrom()` may return the received packet size
859859
When `NSAPI_ERROR_WOULD_BLOCK` is received, check that time consumed is
860860
more that 100 milliseconds but less than 200 milliseconds.
861861

862-
After repeating for 10 times, at least 5 packets must have been
863-
received.
864-
865862

866863
### UDPSOCKET_SENDTO_TIMEOUT
867864

TESTS/netsocket/tcp/tcpsocket_echotest.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,16 @@ void TCPSOCKET_ECHOTEST()
6767

6868
int recvd;
6969
int sent;
70-
int x = 0;
71-
for (int pkt_s = pkt_sizes[x]; x < PKTS; pkt_s = pkt_sizes[x++]) {
70+
for (int s_idx = 0; s_idx < sizeof(pkt_sizes) / sizeof(*pkt_sizes); s_idx++) {
71+
int pkt_s = pkt_sizes[s_idx];
7272
fill_tx_buffer_ascii(tcp_global::tx_buffer, BUFF_SIZE);
7373
sent = sock.send(tcp_global::tx_buffer, pkt_s);
7474
if (sent < 0) {
75-
printf("[Round#%02d] network error %d\n", x, sent);
75+
printf("[Round#%02d] network error %d\n", s_idx, sent);
7676
TEST_FAIL();
7777
break;
7878
} else if (sent != pkt_s) {
79-
printf("[%02d] sock.send return size %d does not match the expectation %d\n", x, sent, pkt_s);
79+
printf("[%02d] sock.send return size %d does not match the expectation %d\n", s_idx, sent, pkt_s);
8080
TEST_FAIL();
8181
break;
8282
}
@@ -85,7 +85,7 @@ void TCPSOCKET_ECHOTEST()
8585
while (bytes2recv) {
8686
recvd = sock.recv(&(tcp_global::rx_buffer[sent - bytes2recv]), bytes2recv);
8787
if (recvd < 0) {
88-
printf("[Round#%02d] network error %d\n", x, recvd);
88+
printf("[Round#%02d] network error %d\n", s_idx, recvd);
8989
TEST_FAIL();
9090
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock.close());
9191
return;
@@ -143,7 +143,6 @@ void TCPSOCKET_ECHOTEST_NONBLOCK()
143143

144144
int bytes2send;
145145
int sent;
146-
int s_idx = 0;
147146
receive_error = false;
148147
unsigned char *stack_mem = (unsigned char *)malloc(tcp_global::TCP_OS_STACK_SIZE);
149148
TEST_ASSERT_NOT_NULL(stack_mem);
@@ -154,8 +153,8 @@ void TCPSOCKET_ECHOTEST_NONBLOCK()
154153

155154
TEST_ASSERT_EQUAL(osOK, receiver_thread->start(callback(&queue, &EventQueue::dispatch_forever)));
156155

157-
for (int pkt_s = pkt_sizes[s_idx]; s_idx < PKTS; ++s_idx) {
158-
pkt_s = pkt_sizes[s_idx];
156+
for (int s_idx = 0; s_idx < sizeof(pkt_sizes) / sizeof(*pkt_sizes); ++s_idx) {
157+
int pkt_s = pkt_sizes[s_idx];
159158
bytes2recv = pkt_s;
160159
bytes2recv_total = pkt_s;
161160

TESTS/netsocket/tls/tlssocket_echotest.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,17 @@ void TLSSOCKET_ECHOTEST()
7070

7171
int recvd;
7272
int sent;
73-
int x = 0;
74-
for (int pkt_s = pkt_sizes[x]; x < PKTS; pkt_s = pkt_sizes[x++]) {
73+
for (int s_idx = 0; s_idx < sizeof(pkt_sizes) / sizeof(*pkt_sizes); s_idx++) {
74+
int pkt_s = pkt_sizes[s_idx];
7575
fill_tx_buffer_ascii(tls_global::tx_buffer, BUFF_SIZE);
7676

7777
sent = sock->send(tls_global::tx_buffer, pkt_s);
7878
if (sent < 0) {
79-
printf("[Round#%02d] network error %d\n", x, sent);
79+
printf("[Round#%02d] network error %d\n", s_idx, sent);
8080
TEST_FAIL();
8181
break;
8282
} else if (sent != pkt_s) {
83-
printf("[%02d] sock.send return size %d does not match the expectation %d\n", x, sent, pkt_s);
83+
printf("[%02d] sock.send return size %d does not match the expectation %d\n", s_idx, sent, pkt_s);
8484
TEST_FAIL();
8585
break;
8686
}
@@ -89,7 +89,7 @@ void TLSSOCKET_ECHOTEST()
8989
while (bytes2recv) {
9090
recvd = sock->recv(&(tls_global::rx_buffer[sent - bytes2recv]), bytes2recv);
9191
if (recvd < 0) {
92-
printf("[Round#%02d] network error %d\n", x, recvd);
92+
printf("[Round#%02d] network error %d\n", s_idx, recvd);
9393
TEST_FAIL();
9494
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->close());
9595
return;
@@ -146,7 +146,7 @@ void TLSSOCKET_ECHOTEST_NONBLOCK()
146146

147147
int bytes2send;
148148
int sent;
149-
int s_idx = 0;
149+
;
150150
receive_error = false;
151151
unsigned char *stack_mem = (unsigned char *)malloc(tls_global::TLS_OS_STACK_SIZE);
152152
TEST_ASSERT_NOT_NULL(stack_mem);
@@ -158,8 +158,8 @@ void TLSSOCKET_ECHOTEST_NONBLOCK()
158158
event_queue = &queue;
159159
TEST_ASSERT_EQUAL(osOK, receiver_thread->start(callback(&queue, &EventQueue::dispatch_forever)));
160160

161-
for (int pkt_s = pkt_sizes[s_idx]; s_idx < PKTS; ++s_idx) {
162-
pkt_s = pkt_sizes[s_idx];
161+
for (int s_idx = 0; s_idx < sizeof(pkt_sizes) / sizeof(*pkt_sizes); ++s_idx) {
162+
int pkt_s = pkt_sizes[s_idx];
163163
bytes2recv = pkt_s;
164164
bytes2recv_total = pkt_s;
165165

TESTS/netsocket/tls/tlssocket_recv_timeout.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ using namespace utest::v1;
2828

2929
namespace {
3030
static const int SIGNAL_SIGIO = 0x1;
31-
static const int SIGIO_TIMEOUT = 20000; //[ms]
31+
static const int SIGIO_TIMEOUT = 50000; //[ms]
3232
}
3333

3434
static void _sigio_handler(osThreadId id)

TESTS/netsocket/udp/udpsocket_echotest.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,10 @@ void UDPSOCKET_ECHOTEST()
6868

6969
int recvd;
7070
int sent;
71-
int s_idx = 0;
7271
int packets_sent = 0;
7372
int packets_recv = 0;
74-
for (int pkt_s = pkt_sizes[s_idx]; s_idx < PKTS; pkt_s = ++s_idx) {
75-
pkt_s = pkt_sizes[s_idx];
73+
for (int s_idx = 0; s_idx < sizeof(pkt_sizes) / sizeof(*pkt_sizes); ++s_idx) {
74+
int pkt_s = pkt_sizes[s_idx];
7675

7776
fill_tx_buffer_ascii(tx_buffer, BUFF_SIZE);
7877

@@ -147,15 +146,14 @@ void UDPSOCKET_ECHOTEST_NONBLOCK()
147146
sock.sigio(callback(_sigio_handler));
148147

149148
int sent;
150-
int s_idx = 0;
151149
int packets_sent = 0;
152150
int packets_recv = 0;
153151
Thread *thread;
154152
unsigned char *stack_mem = (unsigned char *)malloc(OS_STACK_SIZE);
155153
TEST_ASSERT_NOT_NULL(stack_mem);
156154

157-
for (int pkt_s = pkt_sizes[s_idx]; s_idx < PKTS; ++s_idx) {
158-
pkt_s = pkt_sizes[s_idx];
155+
for (int s_idx = 0; s_idx < sizeof(pkt_sizes) / sizeof(*pkt_sizes); ++s_idx) {
156+
int pkt_s = pkt_sizes[s_idx];
159157

160158
thread = new Thread(osPriorityNormal,
161159
OS_STACK_SIZE,

TESTS/netsocket/udp/udpsocket_recv_timeout.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ using namespace utest::v1;
2727
namespace {
2828
static const int SIGNAL_SIGIO = 0x1;
2929
static const int SIGIO_TIMEOUT = 5000; //[ms]
30+
static const int PKT_NUM = 2;
3031
}
3132

3233
static void _sigio_handler(osThreadId id)
@@ -52,7 +53,7 @@ void UDPSOCKET_RECV_TIMEOUT()
5253
Timer timer;
5354
SocketAddress temp_addr;
5455
int pkt_success = 0;
55-
for (int i = 0; i < 10; i++) {
56+
for (int i = 0; i < PKT_NUM; i++) {
5657
TEST_ASSERT_EQUAL(DATA_LEN, sock.sendto(udp_addr, buff, DATA_LEN));
5758
timer.reset();
5859
timer.start();
@@ -75,6 +76,6 @@ void UDPSOCKET_RECV_TIMEOUT()
7576
pkt_success++;
7677
}
7778

78-
TEST_ASSERT(pkt_success >= 5);
79+
printf("MBED: %d out of %d packets were received.\n", pkt_success, PKT_NUM);
7980
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock.close());
8081
}

TESTS/network/wifi/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,12 @@ git checkout master
8787
cd ..
8888
```
8989

90+
Prepare an `mbed_app.json` configuration file with all the required definitions provided. See [template_mbed_app.txt](template_mbed_app.txt) file for the full list of necessary definitions.
91+
9092
Now build test binaries:
9193

9294
```.sh
93-
mbed test --compile -t <toolchain> -m <target> -n mbed-os-tests-network-wifi
95+
mbed test --compile -t <toolchain> -m <target> --app-config TESTS/network/wifi/template_mbed_app.txt -n mbed-os-tests-network-wifi
9496
```
9597

9698
Running tests

TESTS/psa/spm_client/COMPONENT_NSPE/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
#include "psa_manifest/sid.h"
2828

2929
#if defined(TARGET_TFM)
30-
#include "psa/service.h"
3130
#define MBED_CONF_SPM_IPC_MAX_NUM_OF_CHANNELS TFM_CONN_HANDLE_MAX_NUM
31+
#define PSA_MAX_IOVEC 4
3232
#endif
3333

3434
using namespace utest::v1;

TESTS/psa/spm_server/COMPONENT_NSPE/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#include "psa_manifest/sid.h"
2929

3030
#if defined(TARGET_TFM)
31-
#include "psa/service.h"
31+
#define PSA_MAX_IOVEC 4
3232
#endif
3333

3434
using namespace utest::v1;

TESTS/psa/spm_smoke/COMPONENT_NSPE/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#include "psa_manifest/sid.h"
3030

3131
#if defined(TARGET_TFM)
32-
#include "psa/service.h"
32+
#define PSA_MAX_IOVEC 4
3333
#endif
3434

3535
using namespace utest::v1;

TESTS/usb_device/hid/README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Testing the USB HID device with a Linux host
2+
3+
Before running `tests-usb_device-hid` test suite on a Linux machine, please
4+
make sure to install the `hidapi` Python module first, otherwise some test
5+
cases will be skipped. Due to external dependencies for Linux, this module
6+
is not installed during the initial setup, to keep the process as simple
7+
as possible.
8+
9+
For Debian-based Linux distros, the dependencies can be installed as follows
10+
(based on module's [README][1]):
11+
12+
```bash
13+
apt-get install python-dev libusb-1.0-0-dev libudev-dev
14+
pip install --upgrade setuptools
15+
```
16+
To install the `hidapi` module itself, please use the attached
17+
`TESTS/usb_device/hid/requirements.txt` file:
18+
```bash
19+
pip install -r requirements.txt
20+
```
21+
22+
[1]: https://github.com/trezor/cython-hidapi/blob/master/README.rst#install
23+

0 commit comments

Comments
 (0)