Skip to content

Commit 6cc74c7

Browse files
committed
Merge tag 'mbed-os-5.1.4' into new-exporters
Release mbed-os-5.1.4 Changes: New Targets: 2504: [Disco_F769NI] adding new target [#2504] 2654: DELTA_DFBM_NQ620 platform porting [#2654] 2615: [MTM_MTCONNECT04S] Added support for MTM_MTCONNECT04S [#2615] 2548: Nucleof303ze [#2548] Fixes: 2678: Fixing NCS36510 compile on Linux #2678 2657: [MAX326xx] Removed echoing of characters and carriage return. #2657 2651: Use lp_timer to count time in the deepsleep tests #2651 2645: NUCLEO_F446ZE - Enable mbed5 release version #2645 2643: Fix thread self termination #2643 2634: Updated USBHost for library changes #2634 2633: Updated USBDevice to use Callback #2633 2630: Test names not dependent on disk location of root #2630 2624: CFSTORE Bugfix for realloc() moving KV area and cfstore_file_t data structures not being updated correctly #2624 2623: DISCO_L476VG - Add Serial Flow Control pins + add SERIAL_FC macro #2623 2617: STM32F2xx - Enable Serial Flow Control #2617 2613: Correctly providing directories to build_apis #2613 2607: Fix uvisor memory tracing #2607 2604: Tools - Fix fill section size variation #2604 2601: Adding ON Semiconductor copyright notice to source and header files. #2601 2597: [HAL] Fixed "intrinsic is deprecated" warnings #2597 2596: [HAL] Improve memory tracer #2596 2594: Fix TCPServer constructor #2594 2593: Add app config command line switch for test and make #2593 2589: [NUC472] Fix heap configuration error with armcc #2589 2588: Timing tests drift refactor #2588 2587: add PTEx pins as option for SPI on Hexiwear - for SD Card Interface #2587 2584: Set size of callback irq array to IrqCnt #2584 2583: github issue and PR templates #2583 2582: [GCC_CR] fix runtime hang for baremetal build #2582 2580: lwip - Add check for previously-bound socket #2580 2579: lwip - Fix handling of max sockets in socket_accept #2579 2578: Fix double free in NanostackInterface #2578 2576: Add smoke test that builds example programs with mbed-cli #2576 2575: tools-config! - Allow an empty or mal-formed config to be passed to the config system #2575 2562: Fix GCC lazy init race condition and add test #2562 2559: [utest]: Allow the linker to remove any part of utest if not used #2559 2545: Added define guards for SEQUENTIAL_FLASH_JOURNAL_MAX_LOGGED_BLOBS so #2545 2538: STM32F4xx - Add support of ADC internal channels (Temp, VRef, VBat) #2538 2521: [NUCLEO_F207ZG] Add MBED5 capability #2521 2514: Updated FlexCan and SAI SDK drivers #2514 2487: Runtime dynamic memory tracing #2487 2442: Malloc heap info #2442 2419: [STM32F1] Add asynchronous serial #2419 2393: [tools] Prevent trace-backs from incomplete args #2393 2245: Refactor export subsystem #2245 2130: stm32 : reduce number of device.h files #2130
2 parents c125e44 + 21dd700 commit 6cc74c7

File tree

492 files changed

+71453
-5481
lines changed

Some content is hidden

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

492 files changed

+71453
-5481
lines changed

.github/issue_template.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
Note: This is just a template, so feel free to use/remove the unnecessary things
2+
3+
### Description
4+
- Type: Bug | Enhancement | Question
5+
- Related issue: `#abc`
6+
- Priority: Blocker | Major | Minor
7+
8+
---------------------------------------------------------------
9+
## Bug
10+
11+
**Target**
12+
K64F|??
13+
14+
**Toolchain:**
15+
GCC_ARM|ARM|IAR
16+
17+
**Toolchain version:**
18+
19+
**mbed-cli version:**
20+
(`mbed --version`)
21+
22+
**meed-os sha:**
23+
(`git log -n1 --oneline`)
24+
25+
**DAPLink version:**
26+
27+
**Expected behavior**
28+
29+
**Actual behavior**
30+
31+
**Steps to reproduce**
32+
33+
----------------------------------------------------------------
34+
## Enhancement
35+
36+
**Reason to enhance or problem with existing solution**
37+
38+
**Suggested enhancement**
39+
40+
**Pros**
41+
42+
**Cons**
43+
44+
-----------------------------------------------------------------
45+
46+
## Question
47+
48+
**How to?**

.github/pull_request_template.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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
4+
5+
## Description
6+
A few sentences describing the overall goals of the pull request's commits.
7+
8+
9+
## Status
10+
**READY/IN DEVELOPMENT/HOLD**
11+
12+
13+
## Migrations
14+
If this PR changes any APIs or behaviors, give a short description of what *API users* should do when this PR is merged.
15+
16+
YES | NO
17+
18+
19+
## Related PRs
20+
List related PRs against other branches:
21+
22+
branch | PR
23+
------ | ------
24+
other_pr_production | [link]()
25+
other_pr_master | [link]()
26+
27+
28+
## Todos
29+
- [ ] Tests
30+
- [ ] Documentation
31+
32+
33+
## Deploy notes
34+
Notes regarding the deployment of this PR. These should note any
35+
required changes in the build environment, tools, compilers, etc.
36+
37+
38+
## Steps to test or reproduce
39+
Outline the steps to test or reproduce the PR here.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ mbed OS accelerates the process of creating a connected product by providing a p
88

99
Our current release series is mbed OS 5.1:
1010

11-
- [Release Note](https://docs.mbed.com/docs/mbed-os-release-notes/en/latest/5_1/release)
11+
- [Release Note](https://docs.mbed.com/docs/mbed-os-release-notes/en/latest/5_1/release/)
1212

1313
## Getting Started for Developers
1414

@@ -20,4 +20,4 @@ We have a getting started guide for developers using mbed OS in applications:
2020

2121
We have a getting started guide for contributors working on mbed OS:
2222

23-
- Have a look in the docs directory
23+
- Have a look in the docs directory

TESTS/host_tests/timing_drift_auto.py

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
"""
2+
mbed SDK
3+
Copyright (c) 2011-2013 ARM Limited
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
"""
17+
18+
from mbed_host_tests import BaseHostTest
19+
20+
21+
class TimingDriftTest(BaseHostTest):
22+
""" This test is reading single characters from stdio
23+
and measures time between their occurrences.
24+
"""
25+
__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))
53+
54+
55+
def setup(self):
56+
self.register_callback("end", self._callback_end)
57+
self.register_callback('tick', self._callback_tick)
58+
59+
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
99+
else:
100+
self.__result = True
101+
102+
return self.__result
103+
104+
105+
def teardown(self):
106+
pass

TESTS/integration/threaded_blinky/main.cpp

Lines changed: 0 additions & 29 deletions
This file was deleted.
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
/* mbed Microcontroller Library
2+
* Copyright (c) 2016 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+
*/
16+
17+
#if !DEVICE_LOWPOWERTIMER
18+
#error [NOT_SUPPORTED] Low power timer not supported for this target
19+
#endif
20+
21+
#include "utest/utest.h"
22+
#include "unity/unity.h"
23+
#include "greentea-client/test_env.h"
24+
25+
#include "mbed.h"
26+
#include "us_ticker_api.h"
27+
28+
using namespace utest::v1;
29+
30+
volatile static bool complete;
31+
static LowPowerTimeout lpt;
32+
33+
/* Timeouts are quite arbitrary due to large number of boards with varying level of accuracy */
34+
#define LONG_TIMEOUT (100000)
35+
#define SHORT_TIMEOUT (600)
36+
37+
void cb_done() {
38+
complete = true;
39+
}
40+
41+
#if DEVICE_SLEEP
42+
void lp_timeout_1s_deepsleep(void)
43+
{
44+
complete = false;
45+
46+
/*
47+
* We use here lp_ticker_read() instead of us_ticker_read() for start and
48+
* end because the microseconds timer might be disable during deepsleep.
49+
*/
50+
timestamp_t start = lp_ticker_read();
51+
lpt.attach(&cb_done, 1);
52+
deepsleep();
53+
while (!complete);
54+
timestamp_t end = lp_ticker_read();
55+
56+
/* It takes longer to wake up from deep sleep */
57+
TEST_ASSERT_UINT32_WITHIN(LONG_TIMEOUT, 1000000, end - start);
58+
TEST_ASSERT_TRUE(complete);
59+
}
60+
61+
void lp_timeout_1s_sleep(void)
62+
{
63+
complete = false;
64+
65+
timestamp_t start = us_ticker_read();
66+
lpt.attach(&cb_done, 1);
67+
sleep();
68+
while (!complete);
69+
timestamp_t end = us_ticker_read();
70+
71+
TEST_ASSERT_UINT32_WITHIN(LONG_TIMEOUT, 1000000, end - start);
72+
TEST_ASSERT_TRUE(complete);
73+
}
74+
#endif /* DEVICE_SLEEP */
75+
76+
void lp_timeout_us(uint32_t delay_us, uint32_t tolerance)
77+
{
78+
complete = false;
79+
80+
timestamp_t start = us_ticker_read();
81+
lpt.attach_us(&cb_done, delay_us);
82+
while (!complete);
83+
timestamp_t end = us_ticker_read();
84+
85+
/* Using RTC which is less accurate */
86+
TEST_ASSERT_UINT32_WITHIN(tolerance, delay_us, end - start);
87+
TEST_ASSERT_TRUE(complete);
88+
}
89+
90+
void lp_timeout_5s(void)
91+
{
92+
lp_timeout_us(5000000, LONG_TIMEOUT);
93+
}
94+
95+
void lp_timeout_1s(void)
96+
{
97+
lp_timeout_us(1000000, LONG_TIMEOUT);
98+
}
99+
100+
void lp_timeout_1ms(void)
101+
{
102+
lp_timeout_us(1000, SHORT_TIMEOUT);
103+
}
104+
105+
void lp_timeout_500us(void)
106+
{
107+
lp_timeout_us(500, SHORT_TIMEOUT);
108+
109+
}
110+
111+
status_t greentea_failure_handler(const Case *const source, const failure_t reason) {
112+
greentea_case_failure_abort_handler(source, reason);
113+
return STATUS_CONTINUE;
114+
}
115+
116+
Case cases[] = {
117+
Case("500us LowPowerTimeout", lp_timeout_500us, greentea_failure_handler),
118+
Case("1ms LowPowerTimeout", lp_timeout_1ms, greentea_failure_handler),
119+
Case("1sec LowPowerTimeout", lp_timeout_1s, greentea_failure_handler),
120+
Case("5sec LowPowerTimeout", lp_timeout_5s, greentea_failure_handler),
121+
#if DEVICE_SLEEP
122+
Case("1sec LowPowerTimeout from sleep", lp_timeout_1s_sleep, greentea_failure_handler),
123+
Case("1sec LowPowerTimeout from deepsleep", lp_timeout_1s_deepsleep, greentea_failure_handler),
124+
#endif /* DEVICE_SLEEP */
125+
};
126+
127+
status_t greentea_test_setup(const size_t number_of_cases) {
128+
GREENTEA_SETUP(20, "default_auto");
129+
return greentea_test_setup_handler(number_of_cases);
130+
}
131+
132+
Specification specification(greentea_test_setup, cases, greentea_test_teardown_handler);
133+
134+
int main() {
135+
Harness::run(specification);
136+
}

0 commit comments

Comments
 (0)