Skip to content

Commit 51d5550

Browse files
authored
Merge pull request #9805 from ARMmbed/release-candidate
Release candidate for mbed-os-5.11.5
2 parents bc132a6 + b83fb2b commit 51d5550

File tree

313 files changed

+13752
-5680
lines changed

Some content is hidden

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

313 files changed

+13752
-5680
lines changed

.github/pull_request_template.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
### Description
22

3-
<!--
3+
<!--
44
Required
5-
Add here detailed changes summary, testing results, dependencies
5+
Add here detailed changes summary, testing results, dependencies
66
Good example: https://os.mbed.com/docs/mbed-os/latest/contributing/workflow.html (Pull request template)
77
-->
88

99

1010
### Pull request type
1111

12-
<!--
12+
<!--
1313
Required
1414
Please add only one X to one of the following types. Do not fill multiple types (split the pull request otherwise).
1515
Please note this is not a GitHub task list, indenting the boxes or changing the format to add a '.' or '*' in front
@@ -26,8 +26,15 @@
2626

2727
### Reviewers
2828

29-
<!--
29+
<!--
3030
Optional
3131
Request additional reviewers with @username
3232
-->
3333

34+
### Release Notes
35+
36+
<!--
37+
Optional
38+
In case of breaking changes, functionality changes or refactors, please add release notes here.
39+
For more information, please see [the contributing guidelines](https://os.mbed.com/docs/mbed-os/latest/contributing /workflow.html#pull-request-types).
40+
-->
File renamed without changes.

LICENSE.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Unless specifically indicated otherwise in a file, files are licensed under the Apache 2.0 license,
2+
as can be found in: LICENSE-apache-2.0.txt
3+
4+
Folders containing files under different permissive license than Apache 2.0 are listed below. Each folder should contain its own README file with license specified for its files. The original license text is included in those source files.
5+
6+
- [cmsis](./cmsis) - MIT, BSD-3-Clause
7+
- [components/802.15.4_RF/mcr20a-rf-driver](./components/802.15.4_RF/mcr20a-rf-driver) - BSD-3-Clause
8+
- [features/cryptocell/FEATURE_CRYPTOCELL310](./features/cryptocell/FEATURE_CRYPTOCELL310) - ARM Object Code and Header Files License
9+
- [features/FEATURE_BOOTLOADER](./features/FEATURE_BOOTLOADER) - PBL
10+
- [features/FEATURE_BLE/targets](./features/FEATURE_BLE/targets) - BSD-style, PBL, MIT-style
11+
- [features/lorawan](./features/lorawan) - Revised BSD
12+
- [features/lwipstack](./features/lwipstack) - BSD-style, MIT-style
13+
- [features/nanostack/sal-stack-nanostack](./features/nanostack/sal-stack-nanostack) - BSD-3-Clause
14+
- [features/storage](./features/storage) - BSD-style, MIT
15+
- [features/netsocket/emac-drivers](./features/netsocket/emac-drivers) - BSD-style
16+
- [features/frameworks/unity/unity](./features/frameworks/unity/unity) - MIT
17+
- [features/unsupported](./features/unsupported) - MIT-style, BSD-style
18+
- [rtos](./rtos) - MIT
19+
- [drivers](./drivers) - MIT
20+
- [TESTS/mbed_hal/trng/pithy](./TESTS/mbed_hal/trng/pithy) - BSD-3-Clause
21+
- [tools/data/rpc](./tools/data/rpc) - MIT
22+
- [targets](./targets) - PBL, BSD-style, MIT-style, Zlib-style, Public-domain

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,11 @@ The [release notes](https://os.mbed.com/releases) detail the current release. Yo
2929

3030
## License and contributions
3131

32-
The software is provided under [Apache-2.0 license](LICENSE). Contributions to this project are accepted under the same license. Please see [contributing.md](CONTRIBUTING.md) for more info.
32+
The software is provided under the [Apache-2.0 license](LICENSE-apache-2.0.txt). Contributions to this project are accepted under the same license. Please see [contributing.md](CONTRIBUTING.md) for more information.
3333

34-
This project contains code from other projects. The original license text is included in those source files. They must comply with our [license guide](https://os.mbed.com/docs/latest/reference/license.html)
34+
This project contains code from other projects. The original license text is included in those source files. They must comply with our [license guide](https://os.mbed.com/docs/latest/reference/license.html).
35+
36+
Folders containing files under different permissive license than Apache 2.0 are listed in the [LICENSE](LICENSE) file.
3537

3638
## Getting started for developers
3739

TESTS/mbed_drivers/flashiap/main.cpp

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,17 @@
2929

3030
#include "mbed.h"
3131

32+
// Debug available
33+
#ifndef FLASHIAP_DEBUG
34+
#define FLASHIAP_DEBUG 0
35+
#endif
36+
37+
#if FLASHIAP_DEBUG
38+
#define DEBUG_PRINTF(...) printf(__VA_ARGS__)
39+
#else
40+
#define DEBUG_PRINTF(...)
41+
#endif
42+
3243
using namespace utest::v1;
3344

3445

@@ -37,6 +48,21 @@ void flashiap_init_test()
3748
FlashIAP flash_device;
3849
uint32_t ret = flash_device.init();
3950
TEST_ASSERT_EQUAL_INT32(0, ret);
51+
52+
uint32_t flash_start = flash_device.get_flash_start();
53+
uint32_t flash_size = flash_device.get_flash_size();
54+
utest_printf("Flash address: 0x%08x, size: %d\n", flash_start, flash_size);
55+
uint32_t address = flash_start;
56+
int num = 0;
57+
while (flash_size) {
58+
uint32_t sector_size = flash_device.get_sector_size(address);
59+
// Make sure all sectors sum up to the total flash size
60+
TEST_ASSERT(flash_size >= sector_size);
61+
DEBUG_PRINTF("\tsector %3d: address 0x%08x, size %8d\n", num++, address, sector_size);
62+
flash_size -= sector_size;
63+
address += sector_size;
64+
}
65+
4066
ret = flash_device.deinit();
4167
TEST_ASSERT_EQUAL_INT32(0, ret);
4268
}

TESTS/mbedmicro-mbed/attributes/attributes.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/*
2+
* Copyright (c) 2016-2019 ARM Limited. All rights reserved.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the License); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
14+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
118
#include "mbed_toolchain.h"
219

320
#include <stdio.h>

TESTS/mbedmicro-mbed/attributes/weak.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/*
2+
* Copyright (c) 2016-2019 ARM Limited. All rights reserved.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the License); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
14+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
118
#include "mbed_toolchain.h"
219

320
int testWeak1()

TESTS/mbedmicro-mbed/static_assert/test_c.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/*
2+
* Copyright (c) 2015-2019 ARM Limited. All rights reserved.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the License); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
14+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
118
#include "mbed_assert.h"
219
#define THE_ANSWER 42
320

TESTS/mbedmicro-mbed/static_assert/test_cpp.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/*
2+
* Copyright (c) 2016-2019 ARM Limited. All rights reserved.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the License); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
14+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
118
#include "mbed_assert.h"
219
#define THE_ANSWER 42
320

TESTS/netsocket/dns/asynchronous_dns_cancel.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ void ASYNCHRONOUS_DNS_CANCEL()
4242
count++;
4343
} else {
4444
// No memory to initiate DNS query, callback will not be called
45+
printf("Error: No memory to initiate DNS query for %s\n", dns_test_hosts[i]);
4546
data[i].result = NSAPI_ERROR_NO_MEMORY;
4647
data[i].value_set = true;
4748
}

TESTS/netsocket/tcp/main.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,15 @@ void drop_bad_packets(TCPSocket &sock, int orig_timeout)
5757
sock.set_timeout(orig_timeout);
5858
}
5959

60+
nsapi_version_t get_ip_version()
61+
{
62+
SocketAddress test;
63+
if (!test.set_ip_address(NetworkInterface::get_default_instance()->get_ip_address())) {
64+
return NSAPI_UNSPEC;
65+
}
66+
return test.get_ip_version();
67+
}
68+
6069
static void _ifup()
6170
{
6271
NetworkInterface *net = NetworkInterface::get_default_instance();

TESTS/netsocket/tcp/tcp_tests.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
NetworkInterface *get_interface();
2222
void drop_bad_packets(TCPSocket &sock, int orig_timeout);
23+
nsapi_version_t get_ip_version();
2324
void fill_tx_buffer_ascii(char *buff, size_t len);
2425
nsapi_error_t tcpsocket_connect_to_echo_srv(TCPSocket &sock);
2526
nsapi_error_t tcpsocket_connect_to_discard_srv(TCPSocket &sock);

TESTS/netsocket/tcp/tcpsocket_bind_address_invalid.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,14 @@ void TCPSOCKET_BIND_ADDRESS_INVALID()
3939
return;
4040
}
4141
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->open(NetworkInterface::get_default_instance()));
42-
nsapi_error_t bind_result = sock->bind("190.2.3.4", 1024);
42+
nsapi_error_t bind_result = NSAPI_ERROR_OK;
43+
if (get_ip_version() == NSAPI_IPv4) {
44+
bind_result = sock->bind("190.2.3.4", 1024);
45+
} else if (get_ip_version() == NSAPI_IPv6) {
46+
bind_result = sock->bind("fe80::ff01", 1024);
47+
} else {
48+
TEST_FAIL_MESSAGE("This stack is neither IPv4 nor IPv6");
49+
}
4350
if (bind_result == NSAPI_ERROR_UNSUPPORTED) {
4451
TEST_IGNORE_MESSAGE("bind() not supported");
4552
} else {

TESTS/netsocket/tcp/tcpsocket_bind_wrong_type.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,14 @@ void TCPSOCKET_BIND_WRONG_TYPE()
4040
}
4141
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->open(NetworkInterface::get_default_instance()));
4242
char addr_bytes[16] = {0xfe, 0x80, 0xff, 0x1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
43-
SocketAddress sockAddr = SocketAddress(addr_bytes, NSAPI_IPv4, 80);
43+
SocketAddress sockAddr;
44+
if (get_ip_version() == NSAPI_IPv4) {
45+
sockAddr = SocketAddress(addr_bytes, NSAPI_IPv4, 80);
46+
} else if (get_ip_version() == NSAPI_IPv6) {
47+
sockAddr = SocketAddress(addr_bytes, NSAPI_IPv6, 80);
48+
} else {
49+
TEST_FAIL_MESSAGE("This stack is neither IPv4 nor IPv6");
50+
}
4451
nsapi_error_t bind_result = sock->bind(sockAddr);
4552
if (bind_result == NSAPI_ERROR_UNSUPPORTED) {
4653
TEST_IGNORE_MESSAGE("bind() not supported");

TESTS/netsocket/tls/main.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,12 @@ Case cases[] = {
195195
Case("TLSSOCKET_SEND_REPEAT", TLSSOCKET_SEND_REPEAT),
196196
Case("TLSSOCKET_SEND_TIMEOUT", TLSSOCKET_SEND_TIMEOUT),
197197
Case("TLSSOCKET_NO_CERT", TLSSOCKET_NO_CERT),
198-
#ifndef __IAR_SYSTEMS_ICC__
199-
Case("TLSSOCKET_SIMULTANEOUS", TLSSOCKET_SIMULTANEOUS)
200-
#endif
198+
// Temporarily removing this test, as TLS library consumes too much memory
199+
// and we see frequent memory allocation failures on architectures with less
200+
// RAM such as DISCO_L475VG_IOT1A and NUCLEO_F207ZG (both have 128 kB RAM)
201+
// This test also fails for IAR, due to wrong heap configuration in the linker
202+
// script - see https://github.com/ARMmbed/mbed-os/issues/8306
203+
// Case("TLSSOCKET_SIMULTANEOUS", TLSSOCKET_SIMULTANEOUS)
201204
};
202205

203206
Specification specification(greentea_setup, cases, greentea_teardown, greentea_continue_handlers);

TESTS/netsocket/tls/tlssocket_echotest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ void TLSSOCKET_ECHOTEST()
6363
if (tlssocket_connect_to_echo_srv(*sock) != NSAPI_ERROR_OK) {
6464
printf("Error from tlssocket_connect_to_echo_srv\n");
6565
TEST_FAIL();
66-
return;
6766
delete sock;
67+
return;
6868
}
6969

7070
int recvd;

TESTS/netsocket/tls/tlssocket_handshake_invalid.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ void TLSSOCKET_HANDSHAKE_INVALID()
3131
TLSSocket sock;
3232
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock.open(NetworkInterface::get_default_instance()));
3333
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock.set_root_ca_cert(tls_global::cert));
34-
TEST_ASSERT_EQUAL(NSAPI_ERROR_NO_CONNECTION,
35-
sock.connect("google.com", MBED_CONF_APP_ECHO_SERVER_DISCARD_PORT_TLS));
34+
TEST_ASSERT_EQUAL(NSAPI_ERROR_AUTH_FAILURE,
35+
sock.connect("google.com", 443)); // 443 is https port.
3636
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock.close());
3737
}
3838

TESTS/netsocket/udp/main.cpp

Lines changed: 33 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,26 @@
3333

3434
using namespace utest::v1;
3535

36+
namespace {
37+
Timer tc_bucket; // Timer to limit a test cases run time
38+
}
39+
3640
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
3741
mbed_stats_socket_t udp_stats[MBED_CONF_NSAPI_SOCKET_STATS_MAX_COUNT];
3842
#endif
3943

44+
void drop_bad_packets(UDPSocket &sock, int orig_timeout)
45+
{
46+
nsapi_error_t err;
47+
sock.set_timeout(0);
48+
while (true) {
49+
err = sock.recv(NULL, 0);
50+
if (err == NSAPI_ERROR_WOULD_BLOCK) {
51+
break;
52+
}
53+
}
54+
sock.set_timeout(orig_timeout);
55+
}
4056
static void _ifup()
4157
{
4258
NetworkInterface *net = NetworkInterface::get_default_instance();
@@ -51,17 +67,14 @@ static void _ifdown()
5167
printf("MBED: ifdown\n");
5268
}
5369

54-
void drop_bad_packets(UDPSocket &sock, int orig_timeout)
70+
71+
nsapi_version_t get_ip_version()
5572
{
56-
nsapi_error_t err;
57-
sock.set_timeout(0);
58-
while (true) {
59-
err = sock.recvfrom(NULL, 0, 0);
60-
if (err == NSAPI_ERROR_WOULD_BLOCK) {
61-
break;
62-
}
73+
SocketAddress test;
74+
if (!test.set_ip_address(NetworkInterface::get_default_instance()->get_ip_address())) {
75+
return NSAPI_UNSPEC;
6376
}
64-
sock.set_timeout(orig_timeout);
77+
return test.get_ip_version();
6578
}
6679

6780
void fill_tx_buffer_ascii(char *buff, size_t len)
@@ -71,6 +84,11 @@ void fill_tx_buffer_ascii(char *buff, size_t len)
7184
}
7285
}
7386

87+
int split2half_rmng_udp_test_time()
88+
{
89+
return (udp_global::TESTS_TIMEOUT - tc_bucket.read()) / 2;
90+
}
91+
7492
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
7593
int fetch_stats()
7694
{
@@ -81,20 +99,20 @@ int fetch_stats()
8199
// Test setup
82100
utest::v1::status_t greentea_setup(const size_t number_of_cases)
83101
{
84-
GREENTEA_SETUP(480, "default_auto");
102+
GREENTEA_SETUP(udp_global::TESTS_TIMEOUT, "default_auto");
85103
_ifup();
104+
tc_bucket.start();
86105
return greentea_test_setup_handler(number_of_cases);
87106
}
88107

89108
void greentea_teardown(const size_t passed, const size_t failed, const failure_t failure)
90109
{
110+
tc_bucket.stop();
91111
_ifdown();
92112
return greentea_test_teardown_handler(passed, failed, failure);
93113
}
94114

95115
Case cases[] = {
96-
Case("UDPSOCKET_ECHOTEST", UDPSOCKET_ECHOTEST),
97-
Case("UDPSOCKET_ECHOTEST_NONBLOCK", UDPSOCKET_ECHOTEST_NONBLOCK),
98116
Case("UDPSOCKET_OPEN_CLOSE_REPEAT", UDPSOCKET_OPEN_CLOSE_REPEAT),
99117
Case("UDPSOCKET_OPEN_LIMIT", UDPSOCKET_OPEN_LIMIT),
100118
Case("UDPSOCKET_RECV_TIMEOUT", UDPSOCKET_RECV_TIMEOUT),
@@ -110,10 +128,11 @@ Case cases[] = {
110128
Case("UDPSOCKET_BIND_WRONG_TYPE", UDPSOCKET_BIND_WRONG_TYPE),
111129
Case("UDPSOCKET_BIND_UNOPENED", UDPSOCKET_BIND_UNOPENED),
112130
Case("UDPSOCKET_SENDTO_INVALID", UDPSOCKET_SENDTO_INVALID),
113-
Case("UDPSOCKET_ECHOTEST", UDPSOCKET_ECHOTEST),
114-
Case("UDPSOCKET_ECHOTEST_BURST", UDPSOCKET_ECHOTEST_BURST),
131+
Case("UDPSOCKET_ECHOTEST_NONBLOCK", UDPSOCKET_ECHOTEST_NONBLOCK),
115132
Case("UDPSOCKET_ECHOTEST_BURST_NONBLOCK", UDPSOCKET_ECHOTEST_BURST_NONBLOCK),
116133
Case("UDPSOCKET_SENDTO_REPEAT", UDPSOCKET_SENDTO_REPEAT),
134+
Case("UDPSOCKET_ECHOTEST", UDPSOCKET_ECHOTEST),
135+
Case("UDPSOCKET_ECHOTEST_BURST", UDPSOCKET_ECHOTEST_BURST),
117136
};
118137

119138
Specification specification(greentea_setup, cases, greentea_teardown, greentea_continue_handlers);

0 commit comments

Comments
 (0)