Skip to content

Commit c53d51f

Browse files
author
Cruz Monrreal
authored
Merge pull request #8341 from ARMmbed/release-candidate
Release candidate for mbed-os-5.10.1
2 parents 610e35d + 763f0f4 commit c53d51f

File tree

560 files changed

+50588
-15175
lines changed

Some content is hidden

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

560 files changed

+50588
-15175
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,3 +267,4 @@ matrix:
267267
script:
268268
- echo 'Checking that there is no GPL licence text in code'
269269
- ! git grep -q --ignore-case "gnu general public";
270+
- ! git grep -q --ignore-case "gnu library general public";

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,9 @@ We have a [developer website](https://os.mbed.com) for asking questions, engagin
3333
## Getting started for contributors
3434

3535
We also have a [contributing and publishing guide](https://os.mbed.com/contributing/) that covers licensing, contributor agreements and style guidelines.
36+
37+
## Documentation
38+
39+
For more information about Mbed OS, please see [our published documentation](https://os.mbed.com/docs/latest). It includes published Doxygen for our APIs, step-by-step tutorials, porting information and background reference materials about our architecture and tools.
40+
41+
To contribute to this documentation, please see the [mbed-os-5-docs repo](https://github.com/ARMmbed/mbed-os-5-docs).

TESTS/host_tests/system_reset.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ class SystemResetTest(BaseHostTest):
3636
def __init__(self):
3737
super(SystemResetTest, self).__init__()
3838
self.reset = False
39-
cycle_s = self.get_config_item('program_cycle_s')
40-
self.program_cycle_s = cycle_s if cycle_s is not None else DEFAULT_CYCLE_PERIOD
41-
4239
self.test_steps_sequence = self.test_steps()
4340
# Advance the coroutine to it's first yield statement.
4441
self.test_steps_sequence.send(None)
@@ -61,16 +58,18 @@ def test_steps(self):
6158
"""Reset the device and check the status
6259
"""
6360
system_reset = yield
64-
6561
self.reset = False
62+
63+
wait_after_reset = self.get_config_item('forced_reset_timeout')
64+
wait_after_reset = wait_after_reset if wait_after_reset is not None else DEFAULT_CYCLE_PERIOD
65+
6666
self.send_kv(MSG_KEY_DEVICE_RESET, MSG_VALUE_DUMMY)
67-
time.sleep(self.program_cycle_s)
67+
time.sleep(wait_after_reset)
6868
self.send_kv(MSG_KEY_SYNC, MSG_VALUE_DUMMY)
6969

7070
system_reset = yield
71-
7271
if self.reset == False:
7372
raise RuntimeError('Platform did not reset as expected.')
7473

7574
# The sequence is correct -- test passed.
76-
yield True
75+
yield True

TESTS/host_tests/trng_reset.py

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
"""
2+
Copyright (c) 2018 ARM Limited
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License.
14+
"""
15+
16+
"""
17+
This script is the host script for trng test sequence, it send the
18+
step signaling sequence and receive and transmit data to the device after
19+
reset if necesarry (default loading and storing mechanism while reseting the device
20+
is NVstore, in case NVstore isn't enabled we'll use current infrastructure,
21+
for more details see main.cpp file)
22+
"""
23+
24+
import time
25+
from mbed_host_tests import BaseHostTest
26+
from mbed_host_tests.host_tests_runner.host_test_default import DefaultTestSelector
27+
from time import sleep
28+
29+
DEFAULT_CYCLE_PERIOD = 1.0
30+
MSG_VALUE_DUMMY = '0'
31+
MSG_TRNG_READY = 'ready'
32+
MSG_TRNG_BUFFER = 'buffer'
33+
MSG_TRNG_TEST_STEP1 = 'check_step1'
34+
MSG_TRNG_TEST_STEP2 = 'check_step2'
35+
MSG_KEY_SYNC = '__sync'
36+
MSG_KEY_RESET_COMPLETE = 'reset_complete'
37+
MSG_KEY_TEST_SUITE_ENDED = 'Test_suite_ended'
38+
MSG_KEY_EXIT = 'exit'
39+
40+
class TRNGResetTest(BaseHostTest):
41+
"""Test for the TRNG API.
42+
"""
43+
44+
def __init__(self):
45+
super(TRNGResetTest, self).__init__()
46+
self.did_reset = False
47+
self.ready = False
48+
self.suite_ended = False
49+
self.buffer = 0
50+
self.test_steps_sequence = self.test_steps()
51+
# Advance the coroutine to it's first yield statement.
52+
self.test_steps_sequence.send(None)
53+
54+
#define callback functions for msg handling
55+
def setup(self):
56+
self.register_callback(MSG_TRNG_READY, self.cb_device_ready)
57+
self.register_callback(MSG_TRNG_BUFFER, self.cb_trng_buffer)
58+
self.register_callback(MSG_KEY_TEST_SUITE_ENDED, self.cb_device_test_suit_ended)
59+
self.register_callback(MSG_KEY_RESET_COMPLETE, self.cb_reset_complete)
60+
61+
#receive sent data from device before reset
62+
def cb_trng_buffer(self, key, value, timestamp):
63+
"""Acknowledge device rebooted correctly and feed the test execution
64+
"""
65+
self.buffer = value
66+
67+
try:
68+
if self.test_steps_sequence.send(value):
69+
self.notify_complete(True)
70+
except (StopIteration, RuntimeError) as exc:
71+
self.notify_complete(False)
72+
73+
def cb_device_ready(self, key, value, timestamp):
74+
"""Acknowledge device rebooted correctly and feed the test execution
75+
"""
76+
self.ready = True
77+
78+
try:
79+
if self.test_steps_sequence.send(value):
80+
self.notify_complete(True)
81+
except (StopIteration, RuntimeError) as exc:
82+
self.notify_complete(False)
83+
84+
def cb_reset_complete(self, key, value, timestamp):
85+
"""Acknowledge reset complete
86+
"""
87+
self.did_reset = True
88+
89+
try:
90+
if self.test_steps_sequence.send(value):
91+
self.notify_complete(True)
92+
except (StopIteration, RuntimeError) as exc:
93+
self.notify_complete(False)
94+
95+
def cb_device_test_suit_ended(self, key, value, timestamp):
96+
"""Acknowledge device finished a test step correctly and feed the test execution
97+
"""
98+
self.suite_ended = True
99+
100+
try:
101+
if self.test_steps_sequence.send(value):
102+
self.notify_complete(True)
103+
except (StopIteration, RuntimeError) as exc:
104+
self.notify_complete(False)
105+
106+
#define test steps and actions
107+
def test_steps(self):
108+
"""Test step 1
109+
"""
110+
wait_for_communication = yield
111+
112+
self.ready = False
113+
self.did_reset = False
114+
self.suite_ended = False
115+
self.send_kv(MSG_TRNG_TEST_STEP1, MSG_VALUE_DUMMY)
116+
wait_for_communication = yield
117+
if self.buffer == 0:
118+
raise RuntimeError('Phase 1: No buffer received.')
119+
120+
self.reset()
121+
122+
"""Test step 2 (After reset)
123+
"""
124+
wait_for_communication = yield
125+
if self.did_reset == False:
126+
raise RuntimeError('Phase 1: Platform did not reset as expected.')
127+
128+
self.send_kv(MSG_KEY_SYNC, MSG_VALUE_DUMMY)
129+
130+
wait_for_communication = yield
131+
132+
if self.ready == False:
133+
raise RuntimeError('Phase 1: Platform not ready as expected.')
134+
135+
self.send_kv(MSG_TRNG_TEST_STEP2, self.buffer)
136+
137+
wait_for_communication = yield
138+
139+
if self.suite_ended == False:
140+
raise RuntimeError('Test failed.')
141+
142+
self.send_kv(MSG_KEY_EXIT, MSG_VALUE_DUMMY)
143+
144+
# The sequence is correct -- test passed.
145+
yield

TESTS/mbed_hal/common_tickers/main.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,11 +473,14 @@ void ticker_speed_test(void)
473473

474474
/* ---- Test fire_interrupt function. ---- */
475475
counter = NUM_OF_CALLS;
476+
/* Disable ticker interrupt which would interfere with speed test */
477+
core_util_critical_section_enter();
476478
start = us_ticker_read();
477479
while (counter--) {
478480
intf->fire_interrupt();
479481
}
480482
stop = us_ticker_read();
483+
core_util_critical_section_exit();
481484

482485
TEST_ASSERT(diff_us(start, stop, us_ticker_info) < (NUM_OF_CALLS * (MAX_FUNC_EXEC_TIME_US + DELTA_FUNC_EXEC_TIME_US)));
483486

@@ -569,7 +572,7 @@ utest::v1::status_t lp_ticker_teardown(const Case *const source, const size_t pa
569572

570573
utest::v1::status_t test_setup(const size_t number_of_cases)
571574
{
572-
GREENTEA_SETUP(30, "default_auto");
575+
GREENTEA_SETUP(80, "default_auto");
573576
return verbose_test_setup_handler(number_of_cases);
574577
}
575578

0 commit comments

Comments
 (0)