Skip to content

Commit 90c1f89

Browse files
authored
Merge pull request #1 from ARMmbed/master
sync with source repo
2 parents bb028ba + 8dc15ee commit 90c1f89

File tree

2,645 files changed

+529193
-385278
lines changed

Some content is hidden

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

2,645 files changed

+529193
-385278
lines changed

.github/issue_template.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,17 @@
3030

3131

3232
#### What version of Mbed-os are you using (tag or sha) ?
33+
<!--
34+
For a released version please provide the release tag (this can be found as per the instructions below)
35+
36+
mbed-os version can be found in /platform/mbed_version.h. The tag can be reconstructed as follows:
37+
mbed-os-MBED_MAJOR_VERSION.MBED_MINOR_VERSION.MBED_PATCH_VERSION
38+
39+
Master branch is indicated by 'mbed-os-99.99.99
40+
41+
For an issue found on Master please provide the sha being used.
42+
-->
43+
3344

3445
#### What version(s) of tools are you using. List all that apply (E.g. mbed-cli)
3546

.mergify.yml

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
#
2+
# Copyright (c) 2020, Arm Limited and affiliates.
3+
# SPDX-License-Identifier: Apache-2.0
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+
# Mergify follow our workflow: https://os.mbed.com/docs/mbed-os/latest/contributing/workflow.html
18+
# Inital state (needs: review) is done by internal reviewer bot
19+
20+
# Notes: conditions do not check if label is already there if we add or remove later, this is to limit Github API access to
21+
# minimum. If a label is already there and we add it again, nothing should happen (we do 1 less access to Github).
22+
# For instance for needs: work if CI failed, we just add a label as action, don't check if needs: works is already there.
23+
#
24+
# Reviewers request needs write access to block PR, otherwise it's just a suggestion on Github, not PR block
25+
26+
pull_request_rules:
27+
# From needs: review to needs: work - reviewers request
28+
- name: "label needs: work when changes were requested"
29+
conditions:
30+
# Reviewers
31+
- "#changes-requested-reviews-by>0"
32+
actions:
33+
label:
34+
add: ['needs: work']
35+
remove: ['needs: review', 'needs: CI']
36+
37+
# From needs: review to needs: work - CI failure
38+
- name: "label needs: work when travis-ci failed"
39+
conditions:
40+
# Travis failing
41+
- status-failure~=continuous-integration/travis-ci/pr
42+
actions:
43+
label:
44+
add: ['needs: work']
45+
remove: ['needs: review', 'needs: CI']
46+
47+
# From needs: review to needs: work - CI failure
48+
- name: "label needs: work when Jenkins CI failed - pr head"
49+
conditions:
50+
# Jenkins CI failing
51+
- status-failure~=continuous-integration/jenkins/pr-head
52+
actions:
53+
label:
54+
add: ['needs: work']
55+
remove: ['needs: review','needs: CI']
56+
57+
# From needs: review to needs: work - CI failure
58+
- name: "label needs: work when Jenkins CI failed - any of the pipeline"
59+
conditions:
60+
# Jenkins CI failing - any of the pipeline
61+
- status-failure~=^jenkins-ci
62+
actions:
63+
label:
64+
add: ['needs: work']
65+
remove: ['needs: review', 'needs: CI']
66+
67+
# From needs: review or needs: work to needs: CI. One approval means we should be good to start CI
68+
- name: "label needs: CI when at least one reviewers approval"
69+
conditions:
70+
# Labels
71+
- "label!=needs: preceding PR"
72+
73+
# Reviewers
74+
- "#changes-requested-reviews-by=0"
75+
- "#approved-reviews-by>=1"
76+
77+
# CI green policy, at least Travis should be green
78+
- status-success~=continuous-integration/travis-ci/pr
79+
# new CI needs to be done (neutral does not work, lets check if it failed or passed, if none, we need to run again)
80+
- -status-success~=continuous-integration/jenkins/pr-head
81+
- -status-failure~=continuous-integration/jenkins/pr-head
82+
actions:
83+
label:
84+
add: ['needs: CI']
85+
remove: ['needs: review', 'needs: work']
86+
87+
# Remove reviews after the branch is updated. This yet does not allow
88+
# any other action like labels, etc. See mergify-engine/issues/360
89+
- name: remove outdated reviews
90+
conditions: []
91+
actions:
92+
dismiss_reviews:
93+
approved: True
94+
changes_requested: True
95+
96+
# Conflict in the PR - needs: work and a comment to notify a user
97+
- name: "label needs: work when there is a conflict"
98+
conditions:
99+
- conflict
100+
actions:
101+
label:
102+
add: ['needs: work']
103+
remove: ['needs: review', 'needs: CI']
104+
105+
comment:
106+
message: This PR cannot be merged due to conflicts. Please rebase to resolve them.
107+
108+
- name: "add label feature branch for feature branch additions"
109+
conditions:
110+
- base~=^feature
111+
actions:
112+
label:
113+
add: ['release-version: feature branch']
114+
115+
# Ready for integration. Not yet auto merge, will be enabled once carefuly tested
116+
- name: label "ready for merge" when ready
117+
conditions:
118+
# Labels
119+
- "label!=do not merge"
120+
- "label=needs: CI"
121+
122+
# Reviewers
123+
- "#approved-reviews-by>=1"
124+
- "#changes-requested-reviews-by=0"
125+
126+
# CI green policy
127+
- status-success~=continuous-integration/travis-ci/pr
128+
# Internal Jenkins - we rely on PR head to provide status
129+
- status-success~=continuous-integration/jenkins/pr-head
130+
# any of the jenkins pipeline needs to be green. We rely on not failure means all good (if skipped or executed)
131+
- -status-failure~=^jenkins-ci
132+
actions:
133+
label:
134+
add: ['ready for merge']
135+
remove: ['needs: CI']
136+
137+
# Clean-up after merge
138+
- name: remove ready for merge when merged
139+
conditions:
140+
- merged
141+
- "label=ready for merge"
142+
actions:
143+
label:
144+
remove: ['ready for merge']
145+
146+
- name: add "do not merge" label when WIP is in title
147+
conditions:
148+
- title~=^(\[wip\]( |:) |\[WIP\]( |:) |wip( |:) |WIP( |:)).*
149+
actions:
150+
label:
151+
add: ['do not merge']
152+
153+
# Check if version label is applied
154+
- name: release version is a must for merged PRs
155+
conditions:
156+
- merged
157+
- -label~=^(release-version)
158+
- -label~=^(Release review required)
159+
actions:
160+
label:
161+
add: ['release version missing']
162+
comment:
163+
message: This PR does not contain release version label after merging.
164+
165+

TESTS/configs/baremetal.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,24 @@
3737
"target_overrides": {
3838
"*": {
3939
"mbed-trace.fea-ipv6": false
40+
},
41+
"K64F": {
42+
"target.c_lib": "small"
43+
},
44+
"K66F": {
45+
"target.c_lib": "small"
46+
},
47+
"NUCLEO_F303RE": {
48+
"target.c_lib": "small"
49+
},
50+
"NUCLEO_F411RE": {
51+
"target.c_lib": "small"
52+
},
53+
"NUCLEO_F429ZI": {
54+
"target.c_lib": "small"
55+
},
56+
"DISCO_L475VG_IOT01A": {
57+
"target.c_lib": "small"
4058
}
4159
}
4260
}

TESTS/host_tests/reset_reason.py

Lines changed: 37 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
DEFAULT_SYNC_DELAY = 4.0
2121

22-
MSG_VALUE_WATCHDOG_PRESENT = 'wdg_present'
22+
MSG_VALUE_WATCHDOG_PRESENT = 1
2323
MSG_VALUE_DUMMY = '0'
2424
MSG_VALUE_RESET_REASON_GET = 'get'
2525
MSG_VALUE_RESET_REASON_CLEAR = 'clear'
@@ -66,6 +66,7 @@ class ResetReasonTest(BaseHostTest):
6666

6767
def __init__(self):
6868
super(ResetReasonTest, self).__init__()
69+
self.device_reasons = None
6970
self.device_has_watchdog = None
7071
self.raw_reset_reasons = set()
7172
self.sync_delay = DEFAULT_SYNC_DELAY
@@ -85,10 +86,13 @@ def setup(self):
8586
def cb_device_ready(self, key, value, timestamp):
8687
"""Request a raw value of the reset_reason register.
8788
88-
Additionally, save the device's watchdog status on the first call.
89+
Additionally, save the device's reset_reason capabilities
90+
and the watchdog status on the first call.
8991
"""
90-
if self.device_has_watchdog is None:
91-
self.device_has_watchdog = (value == MSG_VALUE_WATCHDOG_PRESENT)
92+
if self.device_reasons is None:
93+
reasons, wdg_status = (int(i, base=16) for i in value.split(','))
94+
self.device_has_watchdog = (wdg_status == MSG_VALUE_WATCHDOG_PRESENT)
95+
self.device_reasons = [k for k, v in RESET_REASONS.items() if (reasons & 1 << int(v))]
9296
self.send_kv(MSG_KEY_RESET_REASON_RAW, MSG_VALUE_RESET_REASON_GET)
9397

9498
def cb_reset_reason_raw(self, key, value, timestamp):
@@ -133,35 +137,45 @@ def test_steps(self):
133137
__ignored_clear_ack = yield
134138

135139
# Request a NVIC_SystemReset() call.
136-
self.send_kv(MSG_KEY_DEVICE_RESET, MSG_VALUE_DEVICE_RESET_NVIC)
137-
__ignored_reset_ack = yield
138-
time.sleep(self.sync_delay)
139-
self.send_kv(MSG_KEY_SYNC, MSG_VALUE_DUMMY)
140-
reset_reason = yield
141-
raise_if_different(RESET_REASONS['SOFTWARE'], reset_reason, 'Wrong reset reason. ')
142-
self.send_kv(MSG_KEY_RESET_REASON, MSG_VALUE_RESET_REASON_CLEAR)
143-
__ignored_clear_ack = yield
140+
expected_reason = 'SOFTWARE'
141+
if expected_reason not in self.device_reasons:
142+
self.log('Skipping the {} reset reason -- not supported.'.format(expected_reason))
143+
else:
144+
# Request a NVIC_SystemReset() call.
145+
self.send_kv(MSG_KEY_DEVICE_RESET, MSG_VALUE_DEVICE_RESET_NVIC)
146+
__ignored_reset_ack = yield
147+
time.sleep(self.sync_delay)
148+
self.send_kv(MSG_KEY_SYNC, MSG_VALUE_DUMMY)
149+
reset_reason = yield
150+
raise_if_different(RESET_REASONS[expected_reason], reset_reason, 'Wrong reset reason. ')
151+
self.send_kv(MSG_KEY_RESET_REASON, MSG_VALUE_RESET_REASON_CLEAR)
152+
__ignored_clear_ack = yield
144153

145154
# Reset the device using DAP.
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)
150-
reset_reason = yield
151-
raise_if_different(RESET_REASONS['PIN_RESET'], reset_reason, 'Wrong reset reason. ')
152-
self.send_kv(MSG_KEY_RESET_REASON, MSG_VALUE_RESET_REASON_CLEAR)
153-
__ignored_clear_ack = yield
155+
expected_reason = 'PIN_RESET'
156+
if expected_reason not in self.device_reasons:
157+
self.log('Skipping the {} reset reason -- not supported.'.format(expected_reason))
158+
else:
159+
self.reset()
160+
__ignored_reset_ack = yield # 'reset_complete'
161+
time.sleep(self.sync_delay)
162+
self.send_kv(MSG_KEY_SYNC, MSG_VALUE_DUMMY)
163+
reset_reason = yield
164+
raise_if_different(RESET_REASONS[expected_reason], reset_reason, 'Wrong reset reason. ')
165+
self.send_kv(MSG_KEY_RESET_REASON, MSG_VALUE_RESET_REASON_CLEAR)
166+
__ignored_clear_ack = yield
154167

155168
# Start a watchdog timer and wait for it to reset the device.
156-
if not self.device_has_watchdog:
157-
self.log('DUT does not have a watchdog. Skipping this reset reason.')
169+
expected_reason = 'WATCHDOG'
170+
if expected_reason not in self.device_reasons or not self.device_has_watchdog:
171+
self.log('Skipping the {} reset reason -- not supported.'.format(expected_reason))
158172
else:
159173
self.send_kv(MSG_KEY_DEVICE_RESET, MSG_VALUE_DEVICE_RESET_WATCHDOG)
160174
__ignored_reset_ack = yield
161175
time.sleep(self.sync_delay)
162176
self.send_kv(MSG_KEY_SYNC, MSG_VALUE_DUMMY)
163177
reset_reason = yield
164-
raise_if_different(RESET_REASONS['WATCHDOG'], reset_reason, 'Wrong reset reason. ')
178+
raise_if_different(RESET_REASONS[expected_reason], reset_reason, 'Wrong reset reason. ')
165179

166180
# The sequence is correct -- test passed.
167181
yield True

0 commit comments

Comments
 (0)