Skip to content

Commit 91e6db1

Browse files
authored
Merge pull request #6201 from ARMmbed/release-candidate
Release candidate for mbed-os-5.7.6
2 parents 569159b + ca082bd commit 91e6db1

File tree

627 files changed

+31169
-22790
lines changed

Some content is hidden

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

627 files changed

+31169
-22790
lines changed

.github/pull_request_template.md

Lines changed: 8 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,11 @@
1-
Notes:
2-
- Pull requests will not be accepted until the submitter has agreed to the [contributer agreement](https://github.com/ARMmbed/mbed-os/blob/master/CONTRIBUTING.md).
3-
- This is just a template, so feel free to use/remove the unnecessary things
1+
# Description
42

5-
## Description
3+
> Detailed changes summary | testing | dependencies
4+
> Good example: https://os.mbed.com/docs/latest/reference/guidelines.html#workflow (Pull request template)
65
7-
A few sentences describing the overall goals of the pull request's commits.
6+
# Pull request type
87

9-
## Status
10-
11-
**READY/IN DEVELOPMENT/HOLD**
12-
13-
## Migrations
14-
15-
If this PR changes any APIs or behaviors, give a short description of what *API users* should do when this PR is merged.
16-
17-
YES | NO
18-
19-
## Related PRs
20-
21-
List related PRs against other branches:
22-
23-
branch | PR
24-
------ | ------
25-
other_pr_production | [link]()
26-
other_pr_master | [link]()
27-
28-
## Todos
29-
30-
- [ ] Tests
31-
- [ ] Documentation
32-
33-
## Deploy notes
34-
35-
Notes regarding the deployment of this PR. These should note any required changes in the build environment, tools, compilers and so on.
36-
37-
## Steps to test or reproduce
38-
39-
Outline the steps to test or reproduce the PR here.
8+
- [ ] Fix
9+
- [ ] Refactor
10+
- [ ] New Target
11+
- [ ] Feature

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ BUILD/
1616
.mbed
1717
venv/
1818

19+
# Mbedls
20+
.mbedls-mock.lock
21+
1922
# Eclipse Project Files
2023
.cproject
2124
.project
@@ -44,6 +47,8 @@ pip-log.txt
4447
.coverage
4548
.tox
4649
nosetests.xml
50+
.cache
51+
.hypothesis
4752

4853
# Translations
4954
*.mo
@@ -72,6 +77,9 @@ debug.log
7277
# Cscope
7378
cscope.*
7479

80+
# Ctags
81+
tags
82+
7583
# vim swap files
7684
*.swp
7785
*~

.travis.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ python:
55
env:
66
global:
77
- >
8-
STATUS=$'curl -so/dev/null --user $MBED_BOT --request POST
8+
STATUS=$'curl -so/dev/null --user "$MBED_BOT" --request POST
99
https://api.github.com/repos/$TRAVIS_REPO_SLUG/statuses/${TRAVIS_PULL_REQUEST_SHA:-$TRAVIS_COMMIT}
1010
--data @- << DATA\n{
1111
"state": "$0",
@@ -30,7 +30,8 @@ before_install:
3030
- sudo ln -s $HOME/.cache/apt /var/cache/apt/archives
3131
# Setup ppa to make sure arm-none-eabi-gcc is correct version
3232
- sudo add-apt-repository -y ppa:team-gcc-arm-embedded/ppa
33-
- sudo apt-get update -qq
33+
# Loop until update succeeds (timeouts can occur)
34+
- while [ -n "$(sudo apt-get update 2>&1 |grep Failed)" ]; do :; done
3435

3536
after_success:
3637
- bash -c "$STATUS" success "Local $NAME testing has passed"
@@ -108,6 +109,10 @@ matrix:
108109
# Check that example compiles
109110
- sed -n '/``` cpp/,/```/{/```$/Q;/```/d;p;}' $EVENTS/README.md > main.cpp
110111
- python tools/make.py -t GCC_ARM -m K64F --source=. --build=BUILD/K64F/GCC_ARM -j0
112+
# Check that example compiles without rtos
113+
- sed -n '/``` cpp/,/```/{/```$/Q;/```/d;p;}' $EVENTS/README.md > main.cpp
114+
- rm -r rtos features/netsocket features/frameworks BUILD
115+
- python tools/make.py -t GCC_ARM -m DISCO_F401VC --source=. --build=BUILD/DISCO_F401VC/GCC_ARM -j0
111116
# Run local equeue tests
112117
- make -C $EVENTS/equeue test
113118

TESTS/events/timing/main.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,10 @@ void semaphore_timing_test() {
107107
equeue_sema_wait(&sema, delay);
108108
int taken = timer.read_us() - start;
109109

110-
printf("delay %dms => error %dus\r\n", delay, abs(1000*delay - taken));
110+
if (taken < (delay * 1000 - 5000) || taken > (delay * 1000 + 5000)) {
111+
printf("delay %dms => error %dus\r\n", delay, abs(1000 * delay - taken));
112+
}
113+
111114
TEST_ASSERT_INT_WITHIN(5000, taken, delay * 1000);
112115

113116
led = !led;

TESTS/mbed_hal/sleep_manager_racecondition/main.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,12 @@ void sleep_manager_irq_test()
6767
Ticker ticker1;
6868
Timer timer;
6969

70-
ticker1.attach_us(&sleep_manager_locking_irq_test, 500);
70+
ticker1.attach_us(&sleep_manager_locking_irq_test, 1000);
7171

72-
// run this for 5 seconds
72+
// run this for 10 seconds
7373
timer.start();
7474
int start = timer.read();
75-
int end = start + 5;
75+
int end = start + 10;
7676
while (timer.read() < end) {
7777
sleep_manager_locking_irq_test();
7878
}

TESTS/netsocket/tcp_echo/main.cpp

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717

1818
#ifndef MBED_CONF_APP_CONNECT_STATEMENT
19-
#error [NOT_SUPPORTED] No network configuration found for this target.
19+
#error [NOT_SUPPORTED] No network configuration found for this target.
2020
#endif
2121

2222
#include "mbed.h"
@@ -32,18 +32,21 @@ using namespace utest::v1;
3232
#define MBED_CONF_APP_TCP_CLIENT_ECHO_BUFFER_SIZE 256
3333
#endif
3434

35-
namespace {
36-
char tx_buffer[MBED_CONF_APP_TCP_CLIENT_ECHO_BUFFER_SIZE] = {0};
37-
char rx_buffer[MBED_CONF_APP_TCP_CLIENT_ECHO_BUFFER_SIZE] = {0};
35+
namespace
36+
{
37+
char tx_buffer[MBED_CONF_APP_TCP_CLIENT_ECHO_BUFFER_SIZE] = {0};
38+
char rx_buffer[MBED_CONF_APP_TCP_CLIENT_ECHO_BUFFER_SIZE] = {0};
3839
}
3940

40-
void prep_buffer(char *tx_buffer, size_t tx_size) {
41-
for (size_t i=0; i<tx_size; ++i) {
41+
void prep_buffer(char *tx_buffer, size_t tx_size)
42+
{
43+
for (size_t i = 0; i < tx_size; ++i) {
4244
tx_buffer[i] = (rand() % 10) + '0';
4345
}
4446
}
4547

46-
void test_tcp_echo() {
48+
void test_tcp_echo()
49+
{
4750
int n = 0;
4851
NetworkInterface* net = MBED_CONF_APP_OBJECT_CONSTRUCTION;
4952
int err = MBED_CONF_APP_CONNECT_STATEMENT;
@@ -119,7 +122,8 @@ void test_tcp_echo() {
119122

120123

121124
// Test setup
122-
utest::v1::status_t test_setup(const size_t number_of_cases) {
125+
utest::v1::status_t test_setup(const size_t number_of_cases)
126+
{
123127
GREENTEA_SETUP(240, "tcp_echo");
124128
return verbose_test_setup_handler(number_of_cases);
125129
}
@@ -130,6 +134,7 @@ Case cases[] = {
130134

131135
Specification specification(test_setup, cases);
132136

133-
int main() {
137+
int main()
138+
{
134139
return !Harness::run(specification);
135140
}

TESTS/netsocket/tcp_echo_parallel/main.cpp

Lines changed: 53 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
* limitations under the License.
1616
*/
1717

18-
#ifndef MBED_CONF_APP_CONNECT_STATEMENT
19-
#error [NOT_SUPPORTED] No network configuration found for this target.
20-
#endif
18+
#ifndef MBED_CONF_APP_CONNECT_STATEMENT
19+
#error [NOT_SUPPORTED] No network configuration found for this target.
20+
#endif
2121

2222
#ifndef MBED_EXTENDED_TESTS
23-
#error [NOT_SUPPORTED] Parallel tests are not supported by default
23+
#error [NOT_SUPPORTED] Parallel tests are not supported by default
2424
#endif
2525

2626
#include "mbed.h"
@@ -33,12 +33,12 @@
3333
using namespace utest::v1;
3434

3535

36-
#ifndef MBED_CFG_TCP_CLIENT_ECHO_BUFFER_SIZE
37-
#define MBED_CFG_TCP_CLIENT_ECHO_BUFFER_SIZE 64
36+
#ifndef MBED_CONF_APP_TCP_CLIENT_ECHO_BUFFER_SIZE
37+
#define MBED_CONF_APP_TCP_CLIENT_ECHO_BUFFER_SIZE 64
3838
#endif
3939

40-
#ifndef MBED_CFG_TCP_CLIENT_ECHO_THREADS
41-
#define MBED_CFG_TCP_CLIENT_ECHO_THREADS 3
40+
#ifndef MBED_CONF_APP_TCP_CLIENT_ECHO_THREADS
41+
#define MBED_CONF_APP_TCP_CLIENT_ECHO_THREADS 3
4242
#endif
4343

4444
#define STRINGIZE(x) STRINGIZE2(x)
@@ -49,51 +49,59 @@ NetworkInterface* net;
4949
SocketAddress tcp_addr;
5050
Mutex iomutex;
5151

52-
void prep_buffer(char *tx_buffer, size_t tx_size) {
53-
for (size_t i=0; i<tx_size; ++i) {
52+
void prep_buffer(char *tx_buffer, size_t tx_size)
53+
{
54+
for (size_t i = 0; i < tx_size; ++i) {
5455
tx_buffer[i] = (rand() % 10) + '0';
5556
}
5657
}
5758

5859

5960
// Each echo class is in charge of one parallel transaction
60-
class Echo {
61+
class Echo
62+
{
6163
private:
62-
char tx_buffer[MBED_CFG_TCP_CLIENT_ECHO_BUFFER_SIZE];
63-
char rx_buffer[MBED_CFG_TCP_CLIENT_ECHO_BUFFER_SIZE];
64+
char tx_buffer[MBED_CONF_APP_TCP_CLIENT_ECHO_BUFFER_SIZE];
65+
char rx_buffer[MBED_CONF_APP_TCP_CLIENT_ECHO_BUFFER_SIZE];
6466

6567
TCPSocket sock;
6668
Thread thread;
6769

6870
public:
6971
// Limiting stack size to 1k
70-
Echo(): thread(osPriorityNormal, 1024) {
72+
Echo(): thread(osPriorityNormal, 1024)
73+
{
7174
}
7275

73-
void start() {
76+
void start()
77+
{
7478
osStatus status = thread.start(callback(this, &Echo::echo));
7579
TEST_ASSERT_EQUAL(osOK, status);
7680
}
7781

78-
void join() {
82+
void join()
83+
{
7984
osStatus status = thread.join();
8085
TEST_ASSERT_EQUAL(osOK, status);
8186
}
8287

83-
void echo() {
88+
void echo()
89+
{
8490
int err = sock.open(net);
8591
TEST_ASSERT_EQUAL(0, err);
8692

8793
err = sock.connect(tcp_addr);
8894
TEST_ASSERT_EQUAL(0, err);
8995

96+
#if defined(MBED_CONF_APP_TCP_ECHO_PREFIX)
9097
//recv connection prefix message
9198
sock.recv(rx_buffer, sizeof(MBED_CONF_APP_TCP_ECHO_PREFIX));
99+
#endif /* MBED_CONF_APP_TCP_ECHO_PREFIX */
92100
memset(rx_buffer, 0, sizeof(rx_buffer));
93101

94102
iomutex.lock();
95103
printf("HTTP: Connected to %s:%d\r\n",
96-
tcp_addr.get_ip_address(), tcp_addr.get_port());
104+
tcp_addr.get_ip_address(), tcp_addr.get_port());
97105
printf("tx_buffer buffer size: %u\r\n", sizeof(tx_buffer));
98106
printf("rx_buffer buffer size: %u\r\n", sizeof(rx_buffer));
99107
iomutex.unlock();
@@ -112,26 +120,45 @@ class Echo {
112120
}
113121
};
114122

115-
Echo *echoers[MBED_CFG_TCP_CLIENT_ECHO_THREADS];
123+
Echo *echoers[MBED_CONF_APP_TCP_CLIENT_ECHO_THREADS];
116124

117125

118-
void test_tcp_echo_parallel() {
126+
void test_tcp_echo_parallel()
127+
{
119128
net = MBED_CONF_APP_OBJECT_CONSTRUCTION;
120129
int err = MBED_CONF_APP_CONNECT_STATEMENT;
121130
TEST_ASSERT_EQUAL(0, err);
122131

123132
printf("MBED: TCPClient IP address is '%s'\n", net->get_ip_address());
124133

134+
#if defined(MBED_CONF_APP_ECHO_SERVER_ADDR) && defined(MBED_CONF_APP_ECHO_SERVER_PORT)
125135
tcp_addr.set_ip_address(MBED_CONF_APP_ECHO_SERVER_ADDR);
126136
tcp_addr.set_port(MBED_CONF_APP_ECHO_SERVER_PORT);
137+
#else /* MBED_CONF_APP_ECHO_SERVER_ADDR && MBED_CONF_APP_ECHO_SERVER_PORT */
138+
char recv_key[] = "host_port";
139+
char ipbuf[60] = {0};
140+
char portbuf[16] = {0};
141+
unsigned int port = 0;
142+
143+
greentea_send_kv("target_ip", net->get_ip_address());
144+
greentea_send_kv("host_ip", " ");
145+
greentea_parse_kv(recv_key, ipbuf, sizeof(recv_key), sizeof(ipbuf));
146+
147+
greentea_send_kv("host_port", " ");
148+
greentea_parse_kv(recv_key, portbuf, sizeof(recv_key), sizeof(ipbuf));
149+
sscanf(portbuf, "%u", &port);
150+
151+
tcp_addr.set_ip_address(ipbuf);
152+
tcp_addr.set_port(port);
153+
#endif /* MBED_CONF_APP_ECHO_SERVER_ADDR && MBED_CONF_APP_ECHO_SERVER_PORT */
127154

128155
// Startup echo threads in parallel
129-
for (int i = 0; i < MBED_CFG_TCP_CLIENT_ECHO_THREADS; i++) {
156+
for (int i = 0; i < MBED_CONF_APP_TCP_CLIENT_ECHO_THREADS; i++) {
130157
echoers[i] = new Echo;
131158
echoers[i]->start();
132159
}
133160

134-
for (int i = 0; i < MBED_CFG_TCP_CLIENT_ECHO_THREADS; i++) {
161+
for (int i = 0; i < MBED_CONF_APP_TCP_CLIENT_ECHO_THREADS; i++) {
135162
echoers[i]->join();
136163
delete echoers[i];
137164
}
@@ -140,7 +167,8 @@ void test_tcp_echo_parallel() {
140167
}
141168

142169
// Test setup
143-
utest::v1::status_t test_setup(const size_t number_of_cases) {
170+
utest::v1::status_t test_setup(const size_t number_of_cases)
171+
{
144172
GREENTEA_SETUP(120, "tcp_echo");
145173
return verbose_test_setup_handler(number_of_cases);
146174
}
@@ -151,6 +179,7 @@ Case cases[] = {
151179

152180
Specification specification(test_setup, cases);
153181

154-
int main() {
182+
int main()
183+
{
155184
return !Harness::run(specification);
156185
}

0 commit comments

Comments
 (0)