Skip to content

Commit cf4f12a

Browse files
authored
Merge pull request #11894 from ARMmbed/release-candidate
Release candidate for mbed-os-5.14.2
2 parents 679d248 + 918a0f5 commit cf4f12a

File tree

942 files changed

+223062
-53911
lines changed

Some content is hidden

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

942 files changed

+223062
-53911
lines changed

.astyleignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,4 @@
3131
^TESTS/mbed_hal/trng/pithy
3232
^TESTS/mbed_hal/trng/pithy
3333
^tools
34+
^UNITTESTS

.github/pull_request_template.md

Lines changed: 40 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
1-
### Description
1+
<!--
2+
For more information on the requirements for pull requests, please see [the contributing guidelines](https://os.mbed.com/docs/mbed-os/latest/contributing/workflow.html#pull-request-types).
3+
-->
4+
### Description (*required*)
25

36
<!--
47
Required
58
Add here detailed changes summary, testing results, dependencies
69
Good example: https://os.mbed.com/docs/mbed-os/latest/contributing/workflow.html (Pull request template)
710
-->
11+
##### Summary of change (*What the change is for and why*)
812

913

10-
### Pull request type
14+
##### Documentation (*Details of any document updates required*)
15+
16+
----------------------------------------------------------------------------------------------------------------
17+
### Pull request type (*required*)
1118

1219
<!--
1320
Required
@@ -16,25 +23,44 @@
1623
of them would change the meaning incorrectly. The only changes to be made are to add a description text under the
1724
description heading and to add a 'x' to the correct box.
1825
-->
19-
[ ] Fix
20-
[ ] Refactor
21-
[ ] Target update
22-
[ ] Functionality change
23-
[ ] Docs update
24-
[ ] Test update
25-
[ ] Breaking change
26+
[] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
27+
[] Feature update (New feature / Functionality change / New API)
28+
[] Major update (Breaking change E.g. Return code change / API behaviour change)
29+
30+
----------------------------------------------------------------------------------------------------------------
31+
### Test results (*required*)
2632

27-
### Reviewers
33+
<!--
34+
Required
35+
For example, add test results for new target
36+
-->
37+
[] No Tests required for this change (E.g docs only update)
38+
[] Covered by existing mbed-os tests (Greentea or Unittest)
39+
[] Tests / results supplied as part of this PR
40+
41+
42+
----------------------------------------------------------------------------------------------------------------
43+
### Reviewers (*optional*)
2844

2945
<!--
3046
Optional
3147
Request additional reviewers with @username
3248
-->
3349

34-
### Release Notes
50+
----------------------------------------------------------------------------------------------------------------
51+
### Release Notes (*required for feature/major PRs*)
3552

3653
<!--
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).
54+
All 3 sections are compulsory for Major PR types. For Feature PRs only the summary section is required.
55+
This section is automatically added to release notes. Please fill in each sub-section with sufficient detail for a user.
56+
For more information, please see [the contributing guidelines](https://os.mbed.com/docs/mbed-os/latest/contributing/workflow.html#pull-request-types).
4057
-->
58+
59+
##### Summary of changes
60+
61+
##### Impact of changes
62+
63+
##### Migration actions required
64+
65+
66+

TESTS/host_tests/reset_reason.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
"""
1717
import time
1818
from mbed_host_tests import BaseHostTest
19-
from mbed_host_tests.host_tests_runner.host_test_default import DefaultTestSelector
2019

2120
DEFAULT_SYNC_DELAY = 4.0
2221

@@ -32,6 +31,7 @@
3231
MSG_KEY_RESET_REASON = 'reason'
3332
MSG_KEY_DEVICE_RESET = 'reset'
3433
MSG_KEY_SYNC = '__sync'
34+
MSG_KEY_RESET_COMPLETE = 'reset_complete'
3535

3636
RESET_REASONS = {
3737
'POWER_ON': '0',
@@ -80,6 +80,7 @@ def setup(self):
8080
self.register_callback(MSG_KEY_RESET_REASON_RAW, self.cb_reset_reason_raw)
8181
self.register_callback(MSG_KEY_RESET_REASON, self.cb_reset_reason)
8282
self.register_callback(MSG_KEY_DEVICE_RESET, self.cb_reset_reason)
83+
self.register_callback(MSG_KEY_RESET_COMPLETE, self.cb_reset_reason)
8384

8485
def cb_device_ready(self, key, value, timestamp):
8586
"""Request a raw value of the reset_reason register.
@@ -142,7 +143,10 @@ def test_steps(self):
142143
__ignored_clear_ack = yield
143144

144145
# Reset the device using DAP.
145-
self.reset_dut(DefaultTestSelector.RESET_TYPE_SW_RST)
146+
self.reset()
147+
__ignored_reset_ack = yield # 'reset_complete'
148+
time.sleep(self.sync_delay)
149+
self.send_kv(MSG_KEY_SYNC, MSG_VALUE_DUMMY)
146150
reset_reason = yield
147151
raise_if_different(RESET_REASONS['PIN_RESET'], reset_reason, 'Wrong reset reason. ')
148152
self.send_kv(MSG_KEY_RESET_REASON, MSG_VALUE_RESET_REASON_CLEAR)

TESTS/integration/COMMON/common_defines_test.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
* See the License for the specific language governing permissions and
1717
* limitations under the License.
1818
*/
19+
#include "mbed_trace.h"
20+
21+
#define TRACE_GROUP "GRNT"
1922

2023
#define ETHERNET 1
2124
#define WIFI 2

TESTS/integration/COMMON/download_test.cpp

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include "unity/unity.h"
2626
#include "greentea-client/test_env.h"
2727
#include <string>
28+
#include "common_defines_test.h"
2829

2930
#define MAX_THREADS 5
3031

@@ -91,7 +92,7 @@ size_t download_test(NetworkInterface *interface, const unsigned char *data, siz
9192
break;
9293
}
9394
ThisThread::sleep_for(1000);
94-
printf("[NET-%d] Connection failed. Retry %d of %d\r\n", thread_id, tries, MAX_RETRIES);
95+
tr_info("[NET-%d] Connection failed. Retry %d of %d", thread_id, tries, MAX_RETRIES);
9596
}
9697
TEST_ASSERT_EQUAL_INT_MESSAGE(0, result, "failed to connect");
9798

@@ -109,7 +110,7 @@ size_t download_test(NetworkInterface *interface, const unsigned char *data, siz
109110
} else {
110111
TEST_ASSERT_MESSAGE(0, "wrong thread id");
111112
}
112-
printf("[NET-%d] Registered socket callback function\r\n", thread_id);
113+
tr_info("[NET-%d] Registered socket callback function", thread_id);
113114
event_fired[thread_id] = false;
114115

115116
/* setup request */
@@ -118,7 +119,7 @@ size_t download_test(NetworkInterface *interface, const unsigned char *data, siz
118119
/* construct request */
119120
size_t req_len = snprintf(request, REQ_BUF_SIZE - 1, req_template, dl_path, dl_host);
120121
request[req_len] = 0;
121-
printf("[NET-%d] Request header (%u): %s\r\n", thread_id, req_len, request);
122+
tr_info("[NET-%d] Request header (%u): %s", thread_id, req_len, request);
122123

123124
/* send request to server */
124125
result = tcpsocket.send(request, req_len);
@@ -128,7 +129,7 @@ size_t download_test(NetworkInterface *interface, const unsigned char *data, siz
128129
char *receive_buffer = &g_receive_buffer[thread_id * RECV_BUF_SIZE];
129130

130131
tcpsocket.set_blocking(false);
131-
printf("[NET-%d] Non-blocking socket mode set\r\n", thread_id);
132+
tr_info("[NET-%d] Non-blocking socket mode set", thread_id);
132133

133134
size_t received_bytes = 0;
134135
int body_index = -1;
@@ -164,7 +165,7 @@ size_t download_test(NetworkInterface *interface, const unsigned char *data, siz
164165
if (body_index < 0) {
165166
continue;
166167
} else {
167-
printf("[NET-%d] Found body index: %d\r\n", thread_id, body_index);
168+
tr_info("[NET-%d] Found body index: %d", thread_id, body_index);
168169

169170
/* remove header before comparison */
170171
memmove(receive_buffer, &receive_buffer[body_index + 4], result - body_index - 4);
@@ -184,9 +185,9 @@ size_t download_test(NetworkInterface *interface, const unsigned char *data, siz
184185
speed = float(received_bytes) / timer.read();
185186
percent = float(received_bytes) * 100 / float(data_length);
186187
time_left = (data_length - received_bytes) / speed;
187-
printf("[NET-%d] Received bytes: %u, (%.2f%%, %.2fKB/s, ETA: %02d:%02d:%02d)\r\n",
188-
thread_id, received_bytes, percent, speed / 1024,
189-
time_left / 3600, (time_left / 60) % 60, time_left % 60);
188+
tr_info("[NET-%d] Received bytes: %u, (%.2f%%, %.2fKB/s, ETA: %02d:%02d:%02d)",
189+
thread_id, received_bytes, percent, speed / 1024,
190+
time_left / 3600, (time_left / 60) % 60, time_left % 60);
190191
}
191192
} while ((result > 0) && (received_bytes < data_length));
192193
}
@@ -195,10 +196,10 @@ size_t download_test(NetworkInterface *interface, const unsigned char *data, siz
195196

196197
timer.stop();
197198
float f_received_bytes = float(received_bytes);
198-
printf("[NET-%d] Downloaded: %.2fKB (%.2fKB/s, %.2f secs)\r\n", thread_id,
199-
f_received_bytes / 1024.,
200-
f_received_bytes / (timer.read() * 1024.),
201-
timer.read());
199+
tr_info("[NET-%d] Downloaded: %.2fKB (%.2fKB/s, %.2f secs)", thread_id,
200+
f_received_bytes / 1024.,
201+
f_received_bytes / (timer.read() * 1024.),
202+
timer.read());
202203

203204
return received_bytes;
204205
}

TESTS/integration/COMMON/file_test.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
#include "mbed.h"
2525
#include "unity/unity.h"
26+
#include "common_defines_test.h"
2627

2728
void file_test_write(const char *file, size_t offset, const unsigned char *data, size_t data_length, size_t block_size)
2829
{
@@ -57,8 +58,8 @@ void file_test_write(const char *file, size_t offset, const unsigned char *data,
5758
TEST_ASSERT_EQUAL_INT_MESSAGE(0, result, "could not close file");
5859

5960
timer.stop();
60-
printf("[FS] Wrote: \"%s\" %.2fKB (%.2fKB/s, %.2f secs)\r\n", file,
61-
float(data_length) / 1024, float(data_length) / timer.read() / 1024, timer.read());
61+
tr_info("[FS] Wrote: \"%s\" %.2fKB (%.2fKB/s, %.2f secs)", file,
62+
float(data_length) / 1024, float(data_length) / timer.read() / 1024, timer.read());
6263
}
6364

6465
void file_test_read(const char *file, size_t offset, const unsigned char *data, size_t data_length, size_t block_size)
@@ -99,7 +100,7 @@ void file_test_read(const char *file, size_t offset, const unsigned char *data,
99100

100101
free(buffer);
101102

102-
printf("[FS] Read : \"%s\" %.2fKB (%.2fKB/s, %.2f secs)\r\n", file,
103-
float(data_length) / 1024, float(data_length) / timer.read() / 1024, timer.read());
103+
tr_info("[FS] Read : \"%s\" %.2fKB (%.2fKB/s, %.2f secs)", file,
104+
float(data_length) / 1024, float(data_length) / timer.read() / 1024, timer.read());
104105
}
105106

TESTS/integration/net-single/main.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@ static control_t setup_network(const size_t call_count)
6868
if (err == NSAPI_ERROR_OK) {
6969
break;
7070
} else {
71-
printf("[ERROR] Connecting to network. Retrying %d of %d.\r\n", tries, MAX_RETRIES);
71+
tr_error("[ERROR] Connecting to network. Retrying %d of %d.", tries, MAX_RETRIES);
7272
}
7373
}
7474
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, err);
75-
printf("[NET] IP address is '%s'\n", interface->get_ip_address());
76-
printf("[NET] MAC address is '%s'\n", interface->get_mac_address());
75+
tr_info("[NET] IP address is '%s'", interface->get_ip_address());
76+
tr_info("[NET] MAC address is '%s'", interface->get_mac_address());
7777
return CaseNext;
7878
}
7979

TESTS/integration/net-threaded/main.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@ static control_t setup_network(const size_t call_count)
6868
if (err == NSAPI_ERROR_OK) {
6969
break;
7070
} else {
71-
printf("[ERROR] Connecting to network. Retrying %d of %d.\r\n", tries, MAX_RETRIES);
71+
tr_error("[ERROR] Connecting to network. Retrying %d of %d.", tries, MAX_RETRIES);
7272
}
7373
}
7474
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, err);
75-
printf("[NET] IP address is '%s'\n", net->get_ip_address());
76-
printf("[NET] MAC address is '%s'\n", net->get_mac_address());
75+
tr_info("[NET] IP address is '%s'", net->get_ip_address());
76+
tr_info("[NET] MAC address is '%s'", net->get_mac_address());
7777
return CaseNext;
7878
}
7979

TESTS/integration/stress-net-fs/main.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,12 @@ static control_t setup_network(const size_t call_count)
7272
if (err == NSAPI_ERROR_OK) {
7373
break;
7474
} else {
75-
printf("[ERROR] Connecting to network. Retrying %d of %d...\r\n", tries, MAX_RETRIES);
75+
tr_error("[ERROR] Connecting to network. Retrying %d of %d...", tries, MAX_RETRIES);
7676
}
7777
}
7878
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, err);
79-
printf("[NET] IP address is '%s'\n", interface->get_ip_address());
80-
printf("[NET] MAC address is '%s'\n", interface->get_mac_address());
79+
tr_info("[NET] IP address is '%s'", interface->get_ip_address());
80+
tr_info("[NET] MAC address is '%s'", interface->get_mac_address());
8181
return CaseNext;
8282
}
8383

@@ -205,7 +205,7 @@ void test_malloc()
205205

206206
void *bufferTest = NULL;
207207
TEST_ASSERT_MESSAGE(size > 0, "Size must not be zero for test");
208-
printf("Allocating %d bytes", (int)size);
208+
tr_info("Allocating %d bytes", (int)size);
209209
bufferTest = malloc(size);
210210
TEST_ASSERT(bufferTest != NULL);
211211
free(bufferTest);

TESTS/mbed_drivers/flashiap/main.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ void flashiap_cross_sector_program_test()
143143
TEST_ASSERT_EQUAL_INT32(0, ret);
144144

145145
uint32_t page_size = flash_device.get_page_size();
146+
uint8_t erase_value = flash_device.get_erase_value();
146147

147148
// Erase last two sectors
148149
uint32_t address = flash_device.get_flash_start() + flash_device.get_flash_size();
@@ -170,7 +171,7 @@ void flashiap_cross_sector_program_test()
170171
data[i] = rand() % 256;
171172
}
172173
for (uint32_t i = prog_size; i < aligned_prog_size; i++) {
173-
data[i] = 0xFF;
174+
data[i] = erase_value;
174175
}
175176

176177
ret = flash_device.program(data, address, prog_size);

TESTS/mbed_hal/qspi/flash_configs/SiliconLabs/EFM32GG11_STK3701/flash_config.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,6 @@
2323
#define QSPI_SECTOR_COUNT 1024 // for MX25R3235F
2424
#endif
2525

26+
#define QSPI_MIN_FREQUENCY 2000000
27+
2628
#endif // MBED_QSPI_FLASH_CONFIG_H

TESTS/mbed_hal/qspi/flash_configs/flash_configs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
#include "S25FL512S_config.h"
8383

8484
#elif defined(TARGET_CYW9P62S1_43012EVB_01)
85-
#include "S25FS128S_config.h"
85+
#include "S25FS512S_config.h"
8686

8787
#elif defined(TARGET_CY8CPROTO_064_SB)
8888
#include "S25FL128S_config.h"

TESTS/mbed_hal/qspi/main.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ using namespace utest::v1;
4242

4343

4444

45+
#ifndef QSPI_MIN_FREQUENCY
4546
#define QSPI_MIN_FREQUENCY 1000000
47+
#endif
4648

4749
// max write size is usually page size
4850
#define DATA_SIZE_256 (QSPI_PAGE_SIZE)
@@ -82,6 +84,7 @@ static uint32_t gen_flash_address()
8284
{
8385
srand(ticker_read(get_us_ticker_data()));
8486
uint32_t address = (((uint32_t)rand()) % QSPI_SECTOR_COUNT) * QSPI_SECTOR_SIZE;
87+
address &= 0xFFFFFF; // Ensure address is within 24 bits so as to not have to deal with 4-byte addressing
8588
return address;
8689
}
8790

@@ -344,18 +347,17 @@ void qspi_frequency_test(void)
344347
ret = qspi_init(&qspi.handle, QPIN_0, QPIN_1, QPIN_2, QPIN_3, QSCK, QCSN, freq, 0);
345348
TEST_ASSERT_EQUAL(QSPI_STATUS_OK, ret);
346349

347-
do {
350+
while (ret == QSPI_STATUS_OK && freq >= QSPI_MIN_FREQUENCY) {
348351
// check if the memory is working properly
349352
qspi.cmd.configure(MODE_1_1_1, ADDR_SIZE_24, ALT_SIZE_8);
350-
353+
ret = qspi_frequency(&qspi.handle, freq);
351354
flash_init(qspi);
352355
_qspi_write_read_test(qspi, WRITE_1_1_1, ADDR_SIZE_24, ALT_SIZE_8, WRITE_SINGLE, READ_1_1_1, ADDR_SIZE_24, ALT_SIZE_8, READ_SINGLE, TEST_REPEAT_SINGLE, DATA_SIZE_256, TEST_FLASH_ADDRESS);
353356

354357
utest_printf("frequency setting %d [Hz] - OK\r\n", freq);
355358

356359
freq /= 2;
357-
ret = qspi_frequency(&qspi.handle, freq);
358-
} while (ret == QSPI_STATUS_OK && freq >= QSPI_MIN_FREQUENCY);
360+
}
359361

360362
qspi_free(&qspi.handle);
361363
}

0 commit comments

Comments
 (0)