Skip to content

Commit 1fc92cd

Browse files
committed
Merge tag 'mbed-os-5.5.6' of github.com:ARMmbed/mbed-os into 5.5.6
mbed OS 5.5.6 release We are pleased to announce the [mbed OS 5.5.6 release](https://github.com/ARMmbed/mbed-os/releases/tag/mbed-os-5.5.6) is now available. This release includes ... Known Issues The following list of known issues apply to this release: Contents Ports for Upcoming Targets [4608](ARMmbed#4608) Support Nuvoton's new target NUMAKER_PFM_M487 [4840](ARMmbed#4840) Add Support for TOSHIBA TMPM066 board Fixes and Changes [4801](ARMmbed#4801) STM32 CAN: Fix issue with speed function calculation [4808](ARMmbed#4808) Make HAL & US tickers idle safe [4812](ARMmbed#4812) Use DSPI SDK driver API's in SPI HAL driver [4832](ARMmbed#4832) NUC472/M453: Fix several startup and hal bugs [4842](ARMmbed#4842) Add call to DAC_Enable as this is no longer done as part [4849](ARMmbed#4849) Allow using of malloc() for reserving the Nanostack's heap. [4850](ARMmbed#4850) Add list of defines to vscode exporter [4863](ARMmbed#4863) Optimize memory usage of wifi scan for REALTEK_RTW8195AM [4869](ARMmbed#4869) HAL LPCs SPI: Fix mask bits for SPI clock rate [4873](ARMmbed#4873) Fix Cortex-A cache file [4878](ARMmbed#4878) STM32 : Separate internal ADC channels with new pinmap [4392](ARMmbed#4392) Enhance memap, and configure depth level [4895](ARMmbed#4895) Turn on doxygen for DEVICE_* features [4817](ARMmbed#4817) Move RTX error handlers into RTX handler file [4902](ARMmbed#4902) Using CMSIS/RTX Exclusive access macro [4923](ARMmbed#4923) fix export static_files to zip [4844](ARMmbed#4844) bd: Add ProfilingBlockDevice for measuring higher-level applications [4896](ARMmbed#4896) target BLUEPILL_F103C8 compile fix [4921](ARMmbed#4921) Update gcc-arm-embedded PPA in Travis [4926](ARMmbed#4926) STM32L053x8: Refactor NUCLEO_L053R8 and DISCO_L053C8 targets [4831](ARMmbed#4831) Remove excessive use of printf/scanf in mbed_fdopen/_open [4922](ARMmbed#4922) bug fix: xdot clock config [4935](ARMmbed#4935) STM32: fix F410RB vectors size [4940](ARMmbed#4940) Update mbed-coap to version 4.0.9 [4941](ARMmbed#4941) Update of MemoryPool.h header file. You can fetch this release from the [mbed-os GitHub](https://github.com/ARMmbed/mbed-os) repository, using the tag "mbed-os-5.5.6". Please feel free to ask any questions or provide feedback on this release [on the forum](https://forums.mbed.com/), or to contact us at [support@mbed.org](mailto:support@mbed.org).
2 parents dc60713 + 98ba8ac commit 1fc92cd

File tree

3,186 files changed

+741364
-254892
lines changed

Some content is hidden

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

3,186 files changed

+741364
-254892
lines changed

.github/issue_template.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ GCC_ARM|ARM|IAR
1919
**mbed-cli version:**
2020
(`mbed --version`)
2121

22-
**meed-os sha:**
22+
**mbed-os sha:**
2323
(`git log -n1 --oneline`)
2424

2525
**DAPLink version:**

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ dist
55

66
# MANIFEST file
77
MANIFEST
8+
doxygen_objdb_*
89

910
# Private settings
1011
mbed_settings.py

.travis.yml

+25-7
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,22 @@ python:
22
- "2.7"
33

44
script:
5+
- mkdir BUILD
6+
# Assert that the Doxygen build produced no warnings.
7+
# The strange command below asserts that the Doxygen command had an
8+
# output of zero length
9+
- |
10+
doxygen doxyfile_options 2>&1 | tee BUILD/doxygen.out && [ ! -s BUILD/doxygen.out ]
11+
# Assert that all binary libraries are named correctly
12+
# The strange command below asserts that there are exactly 0 libraries that do
13+
# not start with lib
14+
- |
15+
find "(" -name "*.a" -or -name "*.ar" ")" -and -not -name "lib*" | tee BUILD/badlibs | sed -e "s/^/Bad library name found: /" && [ ! -s BUILD/badlibs ]
16+
# Assert that all assebler files are named correctly
17+
# The strange command below asserts that there are exactly 0 libraries that do
18+
# end with .s
19+
- |
20+
find -name "*.s" | tee BUILD/badasm | sed -e "s/^/Bad Assembler file name found: /" && [ ! -s BUILD/badasm ]
521
- make -C events/equeue test clean
622
- PYTHONPATH=. python tools/test/config_test/config_test.py
723
- PYTHONPATH=. python tools/test/build_api/build_api_test.py
@@ -12,15 +28,17 @@ script:
1228
- python tools/project.py -S
1329
- python tools/build_travis.py
1430
before_install:
15-
- sudo add-apt-repository -y ppa:terry.guo/gcc-arm-embedded
31+
- sudo add-apt-repository -y ppa:team-gcc-arm-embedded/ppa
32+
- sudo add-apt-repository -y ppa:libreoffice/libreoffice-4-2
1633
- sudo apt-get update -qq
17-
- sudo apt-get install -qq gcc-arm-none-eabi --force-yes
34+
- sudo apt-get install -qq gcc-arm-embedded doxygen --force-yes
1835
# Print versions we use
1936
- arm-none-eabi-gcc --version
2037
- python --version
38+
- doxygen --version
2139
install:
22-
- sudo pip install -r requirements.txt
23-
- sudo pip install pytest
24-
- sudo pip install pylint
25-
- sudo pip install hypothesis
26-
- sudo pip install mock
40+
- pip install -r requirements.txt
41+
- pip install pytest
42+
- pip install pylint
43+
- pip install hypothesis
44+
- pip install mock

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ All changes in code base should originate from GitHub Issues and take advantage
55
Guidelines from this document are created to help new and existing contributors understand process workflow and align to project rules before pull request is submitted. It explains how a participant should do things like format code, test fixes, and submit patches.
66

77
## Where to get more information?
8-
You can for example read more in our ```docs``` section in [ARMmbed/mbed-os/doc](https://github.com/ARMmbed/mbed-os/tree/master/docs) directory.
8+
You can read more on our [documentation page](https://docs.mbed.com/docs/mbed-os-handbook/en/latest/cont/contributing/).
99

1010
# How to contribute
1111
We really appreciate your contributions! We are Open Source project and we need your help. We want to keep it as easy as possible to contribute changes that get things working in your environment. There are a few guidelines that we need contributors to follow so that we can have a chance of keeping on top of things.

Jenkinsfile

+1-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ def parallelSteps = mbed.createParalleSteps("mbed-os", targets, toolchains)
2424
mbed.compile(parallelSteps)
2525

2626
def testApps = [
27-
"mbed-os-cliapp",
28-
"mbed-client-testapp"
27+
"mbed-os-cliapp"
2928
]
3029

3130
// buildTestApps accepts array of test application names and a mbed-os branch or PR reference as parameters

TESTS/events/queue/main.cpp

+24-8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/* mbed Microcontroller Library
2+
* Copyright (c) 2017 ARM Limited
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
116
#include "mbed_events.h"
217
#include "mbed.h"
318
#include "rtos.h"
@@ -7,6 +22,7 @@
722

823
using namespace utest::v1;
924

25+
#define TEST_EQUEUE_SIZE 1024
1026

1127
// flag for called
1228
volatile bool touched = false;
@@ -43,7 +59,7 @@ void func0() {
4359

4460
#define SIMPLE_POSTS_TEST(i, ...) \
4561
void simple_posts_test##i() { \
46-
EventQueue queue; \
62+
EventQueue queue(TEST_EQUEUE_SIZE); \
4763
\
4864
touched = false; \
4965
queue.call(func##i,##__VA_ARGS__); \
@@ -78,7 +94,7 @@ template <int N>
7894
void call_in_test() {
7995
Timer tickers[N];
8096

81-
EventQueue queue;
97+
EventQueue queue(TEST_EQUEUE_SIZE);
8298

8399
for (int i = 0; i < N; i++) {
84100
tickers[i].start();
@@ -92,7 +108,7 @@ template <int N>
92108
void call_every_test() {
93109
Timer tickers[N];
94110

95-
EventQueue queue;
111+
EventQueue queue(TEST_EQUEUE_SIZE);
96112

97113
for (int i = 0; i < N; i++) {
98114
tickers[i].start();
@@ -103,7 +119,7 @@ void call_every_test() {
103119
}
104120

105121
void allocate_failure_test() {
106-
EventQueue queue;
122+
EventQueue queue(TEST_EQUEUE_SIZE);
107123
int id;
108124

109125
for (int i = 0; i < 100; i++) {
@@ -119,7 +135,7 @@ void no() {
119135

120136
template <int N>
121137
void cancel_test1() {
122-
EventQueue queue;
138+
EventQueue queue(TEST_EQUEUE_SIZE);
123139

124140
int ids[N];
125141

@@ -164,7 +180,7 @@ void count0() {
164180

165181
void event_class_test() {
166182
counter = 0;
167-
EventQueue queue(2048);
183+
EventQueue queue(TEST_EQUEUE_SIZE);
168184

169185
Event<void(int, int, int, int, int)> e5(&queue, count5);
170186
Event<void(int, int, int, int)> e4(&queue, count5, 1);
@@ -187,7 +203,7 @@ void event_class_test() {
187203

188204
void event_class_helper_test() {
189205
counter = 0;
190-
EventQueue queue(2048);
206+
EventQueue queue(TEST_EQUEUE_SIZE);
191207

192208
Event<void()> e5 = queue.event(count5, 1, 1, 1, 1, 1);
193209
Event<void()> e4 = queue.event(count4, 1, 1, 1, 1);
@@ -210,7 +226,7 @@ void event_class_helper_test() {
210226

211227
void event_inference_test() {
212228
counter = 0;
213-
EventQueue queue(2048);
229+
EventQueue queue(TEST_EQUEUE_SIZE);
214230

215231
queue.event(count5, 1, 1, 1, 1, 1).post();
216232
queue.event(count5, 1, 1, 1, 1).post(1);

TESTS/events/timing/main.cpp

+15
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/* mbed Microcontroller Library
2+
* Copyright (c) 2017 ARM Limited
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
116
#include "mbed_events.h"
217
#include "mbed.h"
318
#include "rtos.h"

TESTS/host_tests/timing_drift_auto.py

+103-74
Original file line numberDiff line numberDiff line change
@@ -16,91 +16,120 @@
1616
"""
1717

1818
from mbed_host_tests import BaseHostTest
19+
import time
1920

2021

21-
class TimingDriftTest(BaseHostTest):
22-
""" This test is reading single characters from stdio
23-
and measures time between their occurrences.
22+
class TimingDriftSync(BaseHostTest):
23+
"""
24+
This works as master-slave fashion
25+
1) Device says its booted up and ready to run the test, wait for host to respond
26+
2) Host sends the message to get the device current time i.e base time
27+
28+
#
29+
# *
30+
# * |
31+
#<---* DUT<- base_time | - round_trip_base_time ------
32+
# * | |
33+
# * - |
34+
# - |
35+
# | |
36+
# | |
37+
# | - measurement_stretch | - nominal_time
38+
# | |
39+
# | |
40+
# - |
41+
# * - |
42+
# * | |
43+
#<---* DUT <-final_time | - round_trip_final_time------
44+
# * |
45+
# * -
46+
#
47+
#
48+
# As we increase the measurement_stretch, the error because of transport delay diminishes.
49+
# The values of measurement_stretch is propotional to round_trip_base_time(transport delays)
50+
# by factor time_measurement_multiplier.This multiplier is used is 80 to tolerate 2 sec of
51+
# transport delay and test time ~ 180 secs
52+
#
53+
# Failure in timing can occur if we are ticking too fast or we are ticking too slow, hence we have
54+
# min_range and max_range. if we cross on either side tests would be marked fail. The range is a function of
55+
# tolerance/acceptable drift currently its 5%.
56+
#
57+
2458
"""
2559
__result = None
26-
27-
# This is calculated later: average_drift_max * number of tick events
28-
total_drift_max = None
29-
30-
average_drift_max = 0.05
31-
ticks = []
32-
start_time = None
33-
finish_time = None
34-
dut_seconds_passed = None
35-
total_time = None
36-
total_drift = None
37-
average_drift = None
38-
39-
def _callback_result(self, key, value, timestamp):
40-
# We should not see result data in this test
41-
self.__result = False
42-
43-
def _callback_end(self, key, value, timestamp):
44-
""" {{end;%s}}} """
45-
self.log("Received end event, timestamp: %f" % timestamp)
46-
self.notify_complete(result=self.result(print_stats=True))
47-
48-
49-
def _callback_tick(self, key, value, timestamp):
50-
""" {{tick;%d}}} """
51-
self.log("tick! %f" % timestamp)
52-
self.ticks.append((key, value, timestamp))
60+
mega = 1000000.0
61+
max_measurement_time = 180
5362

63+
# this value is obtained for measurements when there is 0 transport delay and we want accurancy of 5%
64+
time_measurement_multiplier = 80
5465

55-
def setup(self):
56-
self.register_callback("end", self._callback_end)
57-
self.register_callback('tick', self._callback_tick)
66+
def _callback_timing_drift_check_start(self, key, value, timestamp):
67+
self.round_trip_base_start = timestamp
68+
self.send_kv("base_time", 0)
5869

70+
def _callback_base_time(self, key, value, timestamp):
71+
self.round_trip_base_end = timestamp
72+
self.device_time_base = float(value)
73+
self.round_trip_base_time = self.round_trip_base_end - self.round_trip_base_start
5974

60-
def result(self, print_stats=True):
61-
self.dut_seconds_passed = len(self.ticks) - 1
62-
63-
if self.dut_seconds_passed < 1:
64-
if print_stats:
65-
self.log("FAIL: failed to receive at least two tick events")
66-
self.__result = False
67-
return self.__result
68-
69-
self.total_drift_max = self.dut_seconds_passed * self.average_drift_max
70-
71-
self.start_time = self.ticks[0][2]
72-
self.finish_time = self.ticks[-1][2]
73-
self.total_time = self.finish_time - self.start_time
74-
self.total_drift = self.total_time - self.dut_seconds_passed
75-
self.average_drift = self.total_drift / self.dut_seconds_passed
76-
77-
if print_stats:
78-
self.log("Start: %f" % self.start_time)
79-
self.log("Finish: %f" % self.finish_time)
80-
self.log("Total time taken: %f" % self.total_time)
81-
82-
total_drift_ratio_string = "Total drift/Max total drift: %f/%f"
83-
self.log(total_drift_ratio_string % (self.total_drift,
84-
self.total_drift_max))
85-
86-
average_drift_ratio_string = "Average drift/Max average drift: %f/%f"
87-
self.log(average_drift_ratio_string % (self.average_drift,
88-
self.average_drift_max))
89-
90-
91-
if abs(self.total_drift) > self.total_drift_max:
92-
if print_stats:
93-
self.log("FAIL: Total drift exceeded max total drift")
94-
self.__result = False
95-
elif self.average_drift > self.average_drift_max:
96-
if print_stats:
97-
self.log("FAIL: Average drift exceeded max average drift")
98-
self.__result = False
75+
self.log("Device base time {}".format(value))
76+
measurement_stretch = (self.round_trip_base_time * self.time_measurement_multiplier) + 5
77+
78+
if measurement_stretch > self.max_measurement_time:
79+
self.log("Time required {} to determine device timer is too high due to transport delay, skipping".format(measurement_stretch))
9980
else:
81+
self.log("sleeping for {} to measure drift accurately".format(measurement_stretch))
82+
time.sleep(measurement_stretch)
83+
self.round_trip_final_start = time.time()
84+
self.send_kv("final_time", 0)
85+
86+
def _callback_final_time(self, key, value, timestamp):
87+
self.round_trip_final_end = timestamp
88+
self.device_time_final = float(value)
89+
self.round_trip_final_time = self.round_trip_final_end - self.round_trip_final_start
90+
self.log("Device final time {} ".format(value))
91+
92+
# compute the test results and send to device
93+
results = "pass" if self.compute_parameter() else "fail"
94+
self.send_kv(results, "0")
95+
96+
def setup(self):
97+
self.register_callback('timing_drift_check_start', self._callback_timing_drift_check_start)
98+
self.register_callback('base_time', self._callback_base_time)
99+
self.register_callback('final_time', self._callback_final_time)
100+
101+
def compute_parameter(self, failure_criteria=0.05):
102+
t_max = self.round_trip_final_end - self.round_trip_base_start
103+
t_min = self.round_trip_final_start - self.round_trip_base_end
104+
t_max_hi = t_max * (1 + failure_criteria)
105+
t_max_lo = t_max * (1 - failure_criteria)
106+
t_min_hi = t_min * (1 + failure_criteria)
107+
t_min_lo = t_min * (1 - failure_criteria)
108+
device_time = (self.device_time_final - self.device_time_base) / self.mega
109+
110+
self.log("Compute host events")
111+
self.log("Transport delay 0: {}".format(self.round_trip_base_time))
112+
self.log("Transport delay 1: {}".format(self.round_trip_final_time))
113+
self.log("DUT base time : {}".format(self.device_time_base))
114+
self.log("DUT end time : {}".format(self.device_time_final))
115+
116+
self.log("min_pass : {} , max_pass : {} for {}%%".format(t_max_lo, t_min_hi, failure_criteria * 100))
117+
self.log("min_inconclusive : {} , max_inconclusive : {}".format(t_min_lo, t_max_hi))
118+
self.log("Time reported by device: {}".format(device_time))
119+
120+
if t_max_lo <= device_time <= t_min_hi:
121+
self.log("Test passed !!!")
100122
self.__result = True
101-
123+
elif t_min_lo <= device_time <= t_max_hi:
124+
self.log("Test inconclusive due to transport delay, retrying")
125+
self.__result = False
126+
else:
127+
self.log("Time outside of passing range. Timing drift seems to be present !!!")
128+
self.__result = False
102129
return self.__result
103130

131+
def result(self):
132+
return self.__result
104133

105134
def teardown(self):
106-
pass
135+
pass

0 commit comments

Comments
 (0)