Skip to content

Commit

Permalink
Merge pull request #11894 from ARMmbed/release-candidate
Browse files Browse the repository at this point in the history
Release candidate for mbed-os-5.14.2
  • Loading branch information
0xc0170 authored Nov 20, 2019
2 parents 679d248 + 918a0f5 commit cf4f12a
Show file tree
Hide file tree
Showing 942 changed files with 223,062 additions and 53,911 deletions.
1 change: 1 addition & 0 deletions .astyleignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@
^TESTS/mbed_hal/trng/pithy
^TESTS/mbed_hal/trng/pithy
^tools
^UNITTESTS
54 changes: 40 additions & 14 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
### Description
<!--
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).
-->
### Description (*required*)

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


### Pull request type
##### Documentation (*Details of any document updates required*)

----------------------------------------------------------------------------------------------------------------
### Pull request type (*required*)

<!--
Required
Expand All @@ -16,25 +23,44 @@
of them would change the meaning incorrectly. The only changes to be made are to add a description text under the
description heading and to add a 'x' to the correct box.
-->
[ ] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change
[] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

----------------------------------------------------------------------------------------------------------------
### Test results (*required*)

### Reviewers
<!--
Required
For example, add test results for new target
-->
[] No Tests required for this change (E.g docs only update)
[] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR


----------------------------------------------------------------------------------------------------------------
### Reviewers (*optional*)

<!--
Optional
Request additional reviewers with @username
-->

### Release Notes
----------------------------------------------------------------------------------------------------------------
### Release Notes (*required for feature/major PRs*)

<!--
Optional
In case of breaking changes, functionality changes or refactors, please add release notes here.
For more information, please see [the contributing guidelines](https://os.mbed.com/docs/mbed-os/latest/contributing/workflow.html#pull-request-types).
All 3 sections are compulsory for Major PR types. For Feature PRs only the summary section is required.
This section is automatically added to release notes. Please fill in each sub-section with sufficient detail for a user.
For more information, please see [the contributing guidelines](https://os.mbed.com/docs/mbed-os/latest/contributing/workflow.html#pull-request-types).
-->

##### Summary of changes

##### Impact of changes

##### Migration actions required



8 changes: 6 additions & 2 deletions TESTS/host_tests/reset_reason.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"""
import time
from mbed_host_tests import BaseHostTest
from mbed_host_tests.host_tests_runner.host_test_default import DefaultTestSelector

DEFAULT_SYNC_DELAY = 4.0

Expand All @@ -32,6 +31,7 @@
MSG_KEY_RESET_REASON = 'reason'
MSG_KEY_DEVICE_RESET = 'reset'
MSG_KEY_SYNC = '__sync'
MSG_KEY_RESET_COMPLETE = 'reset_complete'

RESET_REASONS = {
'POWER_ON': '0',
Expand Down Expand Up @@ -80,6 +80,7 @@ def setup(self):
self.register_callback(MSG_KEY_RESET_REASON_RAW, self.cb_reset_reason_raw)
self.register_callback(MSG_KEY_RESET_REASON, self.cb_reset_reason)
self.register_callback(MSG_KEY_DEVICE_RESET, self.cb_reset_reason)
self.register_callback(MSG_KEY_RESET_COMPLETE, self.cb_reset_reason)

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

# Reset the device using DAP.
self.reset_dut(DefaultTestSelector.RESET_TYPE_SW_RST)
self.reset()
__ignored_reset_ack = yield # 'reset_complete'
time.sleep(self.sync_delay)
self.send_kv(MSG_KEY_SYNC, MSG_VALUE_DUMMY)
reset_reason = yield
raise_if_different(RESET_REASONS['PIN_RESET'], reset_reason, 'Wrong reset reason. ')
self.send_kv(MSG_KEY_RESET_REASON, MSG_VALUE_RESET_REASON_CLEAR)
Expand Down
3 changes: 3 additions & 0 deletions TESTS/integration/COMMON/common_defines_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "mbed_trace.h"

#define TRACE_GROUP "GRNT"

#define ETHERNET 1
#define WIFI 2
Expand Down
25 changes: 13 additions & 12 deletions TESTS/integration/COMMON/download_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "unity/unity.h"
#include "greentea-client/test_env.h"
#include <string>
#include "common_defines_test.h"

#define MAX_THREADS 5

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

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

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

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

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

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

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

timer.stop();
float f_received_bytes = float(received_bytes);
printf("[NET-%d] Downloaded: %.2fKB (%.2fKB/s, %.2f secs)\r\n", thread_id,
f_received_bytes / 1024.,
f_received_bytes / (timer.read() * 1024.),
timer.read());
tr_info("[NET-%d] Downloaded: %.2fKB (%.2fKB/s, %.2f secs)", thread_id,
f_received_bytes / 1024.,
f_received_bytes / (timer.read() * 1024.),
timer.read());

return received_bytes;
}
Expand Down
9 changes: 5 additions & 4 deletions TESTS/integration/COMMON/file_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

#include "mbed.h"
#include "unity/unity.h"
#include "common_defines_test.h"

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

timer.stop();
printf("[FS] Wrote: \"%s\" %.2fKB (%.2fKB/s, %.2f secs)\r\n", file,
float(data_length) / 1024, float(data_length) / timer.read() / 1024, timer.read());
tr_info("[FS] Wrote: \"%s\" %.2fKB (%.2fKB/s, %.2f secs)", file,
float(data_length) / 1024, float(data_length) / timer.read() / 1024, timer.read());
}

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

free(buffer);

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

6 changes: 3 additions & 3 deletions TESTS/integration/net-single/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ static control_t setup_network(const size_t call_count)
if (err == NSAPI_ERROR_OK) {
break;
} else {
printf("[ERROR] Connecting to network. Retrying %d of %d.\r\n", tries, MAX_RETRIES);
tr_error("[ERROR] Connecting to network. Retrying %d of %d.", tries, MAX_RETRIES);
}
}
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, err);
printf("[NET] IP address is '%s'\n", interface->get_ip_address());
printf("[NET] MAC address is '%s'\n", interface->get_mac_address());
tr_info("[NET] IP address is '%s'", interface->get_ip_address());
tr_info("[NET] MAC address is '%s'", interface->get_mac_address());
return CaseNext;
}

Expand Down
6 changes: 3 additions & 3 deletions TESTS/integration/net-threaded/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ static control_t setup_network(const size_t call_count)
if (err == NSAPI_ERROR_OK) {
break;
} else {
printf("[ERROR] Connecting to network. Retrying %d of %d.\r\n", tries, MAX_RETRIES);
tr_error("[ERROR] Connecting to network. Retrying %d of %d.", tries, MAX_RETRIES);
}
}
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, err);
printf("[NET] IP address is '%s'\n", net->get_ip_address());
printf("[NET] MAC address is '%s'\n", net->get_mac_address());
tr_info("[NET] IP address is '%s'", net->get_ip_address());
tr_info("[NET] MAC address is '%s'", net->get_mac_address());
return CaseNext;
}

Expand Down
8 changes: 4 additions & 4 deletions TESTS/integration/stress-net-fs/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ static control_t setup_network(const size_t call_count)
if (err == NSAPI_ERROR_OK) {
break;
} else {
printf("[ERROR] Connecting to network. Retrying %d of %d...\r\n", tries, MAX_RETRIES);
tr_error("[ERROR] Connecting to network. Retrying %d of %d...", tries, MAX_RETRIES);
}
}
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, err);
printf("[NET] IP address is '%s'\n", interface->get_ip_address());
printf("[NET] MAC address is '%s'\n", interface->get_mac_address());
tr_info("[NET] IP address is '%s'", interface->get_ip_address());
tr_info("[NET] MAC address is '%s'", interface->get_mac_address());
return CaseNext;
}

Expand Down Expand Up @@ -205,7 +205,7 @@ void test_malloc()

void *bufferTest = NULL;
TEST_ASSERT_MESSAGE(size > 0, "Size must not be zero for test");
printf("Allocating %d bytes", (int)size);
tr_info("Allocating %d bytes", (int)size);
bufferTest = malloc(size);
TEST_ASSERT(bufferTest != NULL);
free(bufferTest);
Expand Down
3 changes: 2 additions & 1 deletion TESTS/mbed_drivers/flashiap/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ void flashiap_cross_sector_program_test()
TEST_ASSERT_EQUAL_INT32(0, ret);

uint32_t page_size = flash_device.get_page_size();
uint8_t erase_value = flash_device.get_erase_value();

// Erase last two sectors
uint32_t address = flash_device.get_flash_start() + flash_device.get_flash_size();
Expand Down Expand Up @@ -170,7 +171,7 @@ void flashiap_cross_sector_program_test()
data[i] = rand() % 256;
}
for (uint32_t i = prog_size; i < aligned_prog_size; i++) {
data[i] = 0xFF;
data[i] = erase_value;
}

ret = flash_device.program(data, address, prog_size);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@
#define QSPI_SECTOR_COUNT 1024 // for MX25R3235F
#endif

#define QSPI_MIN_FREQUENCY 2000000

#endif // MBED_QSPI_FLASH_CONFIG_H
2 changes: 1 addition & 1 deletion TESTS/mbed_hal/qspi/flash_configs/flash_configs.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
#include "S25FL512S_config.h"

#elif defined(TARGET_CYW9P62S1_43012EVB_01)
#include "S25FS128S_config.h"
#include "S25FS512S_config.h"

#elif defined(TARGET_CY8CPROTO_064_SB)
#include "S25FL128S_config.h"
Expand Down
10 changes: 6 additions & 4 deletions TESTS/mbed_hal/qspi/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ using namespace utest::v1;



#ifndef QSPI_MIN_FREQUENCY
#define QSPI_MIN_FREQUENCY 1000000
#endif

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

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

do {
while (ret == QSPI_STATUS_OK && freq >= QSPI_MIN_FREQUENCY) {
// check if the memory is working properly
qspi.cmd.configure(MODE_1_1_1, ADDR_SIZE_24, ALT_SIZE_8);

ret = qspi_frequency(&qspi.handle, freq);
flash_init(qspi);
_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);

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

freq /= 2;
ret = qspi_frequency(&qspi.handle, freq);
} while (ret == QSPI_STATUS_OK && freq >= QSPI_MIN_FREQUENCY);
}

qspi_free(&qspi.handle);
}
Expand Down
Loading

0 comments on commit cf4f12a

Please sign in to comment.