Skip to content

Commit 0063e5d

Browse files
authored
Merge pull request #10326 from ARMmbed/release-candidate
Release candidate for mbed-os-5.12.1
2 parents 6bf7fd3 + 869028c commit 0063e5d

File tree

595 files changed

+330580
-117654
lines changed

Some content is hidden

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

595 files changed

+330580
-117654
lines changed

.astyleignore

Lines changed: 29 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,29 @@
1-
BUILD
2-
cmsis
3-
features/cryptocell
4-
features/mbedtls
5-
features/lwipstack/lwip
6-
features/lwipstack/lwip-sys
7-
rtos/TARGET_CORTEX/rtx4
8-
features/storage/filesystem/littlefs/littlefs/
9-
features/storage/filesystem/fat/ChaN
10-
features/storage/FEATURE_STORAGE
11-
features/frameworks
12-
features/FEATURE_BLE
13-
features/unsupported/
14-
features/netsocket/emac-drivers
15-
hal/storage_abstraction
16-
TESTS/mbed_hal/trng/pithy
17-
features/nanostack/coap-service
18-
features/nanostack/sal-stack-nanostack
19-
features/nanostack/targets
20-
rtos/TARGET_CORTEX/rtx5
21-
TESTS/mbed_hal/trng/pithy
22-
targets
23-
components/802.15.4_RF
24-
components/wifi
25-
components/TARGET_PSA/TARGET_TFM
26-
tools
27-
components/TARGET_PSA/TESTS
28-
components/TARGET_PSA/services/attestation/COMPONENT_PSA_SRV_IMPL/tfm_impl
29-
components/TARGET_PSA/services/attestation/qcbor
30-
components/TARGET_PSA/services/attestation/attestation.h
1+
^BUILD
2+
^cmsis
3+
^components/802.15.4_RF
4+
^components/TARGET_PSA/services/attestation/attestation.h
5+
^components/TARGET_PSA/services/attestation/COMPONENT_PSA_SRV_IMPL/tfm_impl
6+
^components/TARGET_PSA/services/attestation/qcbor
7+
^components/TARGET_PSA/TARGET_TFM
8+
^components/TARGET_PSA/TESTS
9+
^features/cryptocell
10+
^features/FEATURE_BLE
11+
^features/frameworks
12+
^features/lwipstack/lwip
13+
^features/lwipstack/lwip-sys
14+
^features/mbedtls
15+
^features/nanostack/coap-service
16+
^features/nanostack/sal-stack-nanostack
17+
^features/nanostack/targets
18+
^features/netsocket/emac-drivers
19+
^features/storage/FEATURE_STORAGE
20+
^features/storage/filesystem/fat/ChaN
21+
^features/storage/filesystem/littlefs/littlefs/
22+
^features/unsupported/
23+
^hal/storage_abstraction
24+
^rtos/TARGET_CORTEX/rtx4
25+
^rtos/TARGET_CORTEX/rtx5
26+
^targets
27+
^TESTS/mbed_hal/trng/pithy
28+
^TESTS/mbed_hal/trng/pithy
29+
^tools

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ matrix:
169169
- NAME=astyle
170170
install:
171171
- >-
172-
curl -L0 https://mbed-os.s3-eu-west-1.amazonaws.com/builds/deps/astyle_3.1_linux.tar.gz --output astyle.tar.gz;
172+
curl -L0 https://mbed-os-ci.s3-eu-west-1.amazonaws.com/jenkins-ci/deps/astyle_3.1_linux.tar.gz --output astyle.tar.gz;
173173
mkdir -p BUILD && tar xf astyle.tar.gz -C BUILD;
174174
cd BUILD/astyle/build/gcc;
175175
make;
@@ -183,7 +183,7 @@ matrix:
183183
- >-
184184
git diff --name-only --diff-filter=d FETCH_HEAD..HEAD \
185185
| ( grep '.\(c\|cpp\|h\|hpp\)$' || true ) \
186-
| ( fgrep -v -f .astyleignore || true ) \
186+
| ( grep -v -f .astyleignore || true ) \
187187
| while read file; do astyle -n --options=.astylerc "${file}"; done
188188
- git diff --exit-code --diff-filter=d --color
189189

LICENSE.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,31 @@ Folders containing files under different permissive license than Apache 2.0 are
2222
- [TESTS/mbed_hal/trng/pithy](./TESTS/mbed_hal/trng/pithy) - BSD-3-Clause
2323
- [tools/data/rpc](./tools/data/rpc) - MIT
2424
- [targets](./targets) - PBL, BSD-style, MIT-style, Zlib-style, Public-domain
25+
26+
The Python modules used by Mbed tools are used under the following licenses:
27+
28+
- [colorama](https://pypi.org/project/colorama) - BSD-3-Clause
29+
- [urllib3](https://pypi.org/project/urllib3) - MIT
30+
- [secure](https://pypi.org/project/secure) - MIT
31+
- [prettytable](https://pypi.org/project/prettytable) - BSD-3-Clause
32+
- [junit-xml](https://pypi.org/project/junit-xml) - MIT
33+
- [pyyaml](https://pypi.org/project/pyyaml) - MIT
34+
- [jsonschema](https://pypi.org/project/jsonschema) - MIT
35+
- [future](https://pypi.org/project/future) - MIT
36+
- [six](https://pypi.org/project/six) - MIT
37+
- [mbed-cloud-sdk](https://pypi.org/project/mbed-cloud-sdk) - Apache 2.0
38+
- [requests](https://pypi.org/project/requests) - Apache-2.0
39+
- [idna](https://pypi.org/project/idna) - BSD-3-Clause
40+
- [pyserial](https://pypi.org/project/pyserial) - BSD-3-Clause
41+
- [Jinja2](https://pypi.org/project/Jinja2) - BSD-3-Clause
42+
- [intelhex](https://pypi.org/project/intelhex) - BSD
43+
- [mbed-ls](https://pypi.org/project/mbed-ls) - Apache-2.0
44+
- [mbed-host-tests](https://pypi.org/project/mbed-host-tests) - Apache-2.0
45+
- [mbed-greentea](https://pypi.org/project/mbed-greentea) - Apache-2.0
46+
- [beautifulsoup4](https://pypi.org/project/beautifulsoup4) - MIT
47+
- [pyelftools](https://pypi.org/project/pyelftools) - Public Domain
48+
- [manifest-tool](https://pypi.org/project/manifest-tool) - Apache-2.0
49+
- [icetea](https://pypi.org/project/icetea) - Apache-2.0
50+
- [pycryptodome](https://pypi.org/project/pycryptodome) - BSD-2-Clause
51+
- [pyusb](https://pypi.org/project/pyusb/) - Apache-2.0
52+
- [cmsis-pack-manager](https://pypi.org/project/cmsis-pack-manager) - Apache-2.0

README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
[![Build status release][mbed-travis-release-svg]][mbed-travis-release]
44
[![Build status master][mbed-travis-master-svg]][mbed-travis-master]
55
[![Tools coverage status][mbed-coveralls-tools-svg]][mbed-coveralls-tools]
6-
[![PR progress][mbed-waffle-svg]][mbed-waffle]
76

87
[mbed-os-logo]: logo.png
98
[mbed-os-link]: https://www.mbed.com/en/platform/mbed-os/
@@ -13,8 +12,6 @@
1312
[mbed-travis-release-svg]: https://travis-ci.org/ARMmbed/mbed-os.svg?branch=latest
1413
[mbed-coveralls-tools]: https://coveralls.io/github/ARMmbed/mbed-os?branch=master
1514
[mbed-coveralls-tools-svg]: https://coveralls.io/repos/github/ARMmbed/mbed-os/badge.svg?branch=master
16-
[mbed-waffle]: https://waffle.io/ARMmbed/mbed-os
17-
[mbed-waffle-svg]: https://badge.waffle.io/ARMmbed/mbed-os.svg?columns=all
1815

1916
Arm Mbed OS is an open source embedded operating system designed specifically for the "things" in the Internet of Things. It includes all the features you need to develop a connected product based on an Arm Cortex-M microcontroller, including security, connectivity, an RTOS and drivers for sensors and I/O devices.
2017

@@ -31,7 +28,7 @@ The [release notes](https://os.mbed.com/releases) detail the current release. Yo
3128

3229
The software is provided under the [Apache-2.0 license](LICENSE-apache-2.0.txt). Contributions to this project are accepted under the same license. Please see [contributing.md](CONTRIBUTING.md) for more information.
3330

34-
This project contains code from other projects. The original license text is included in those source files. They must comply with our [license guide](https://os.mbed.com/docs/latest/reference/license.html).
31+
This project contains code from other projects. The original license text is included in those source files. They must comply with our [license guide](https://os.mbed.com/docs/mbed-os/latest/contributing/license.html).
3532

3633
Folders containing files under different permissive license than Apache 2.0 are listed in the [LICENSE](LICENSE) file.
3734

TESTS/host_tests/pyusb_msd.py

Lines changed: 240 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,240 @@
1+
"""
2+
Copyright (c) 2019, 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+
18+
from mbed_host_tests import BaseHostTest
19+
import time
20+
import psutil
21+
import tempfile
22+
import uuid
23+
import os
24+
import platform
25+
import subprocess
26+
import sys
27+
system_name = platform.system()
28+
if system_name == "Windows":
29+
import wmi
30+
31+
32+
class PyusbMSDTest(BaseHostTest):
33+
"""Host side test for USB MSD class."""
34+
35+
__result = None
36+
MOUNT_WAIT_TIME = 25 # in [s]
37+
initial_disk_list = None
38+
msd_disk = None
39+
serial_number = None
40+
41+
def _callback_device_ready(self, key, value, timestamp):
42+
"""Send a unique USB SN to the device.
43+
DUT uses this SN every time it connects to host as a USB device.
44+
"""
45+
self.serial_number = uuid.uuid4().hex # 32 hex digit string
46+
self.send_kv("serial_number", self.serial_number)
47+
48+
def _callback_check_file_exist(self, key, value, timestamp):
49+
"""Check if file exist.
50+
51+
"""
52+
folder_name, file_name, file_content = value.split(' ')
53+
msd_disk = MSDUtils.disk_path(self.serial_number)
54+
file_path = os.path.join(msd_disk, folder_name, file_name)
55+
try:
56+
file = open(file_path, 'r')
57+
line = file.readline()
58+
file.close()
59+
time.sleep(2) # wait for msd communication done
60+
if line == file_content:
61+
self.send_kv("exist", "0")
62+
return
63+
self.report_error("file content invalid")
64+
except IOError as err:
65+
self.log('{} !!!'.format(err))
66+
self.send_kv("non-exist", "0")
67+
68+
def _callback_delete_files(self, key, value, timestamp):
69+
"""Delete test file.
70+
71+
"""
72+
dir_name, file_name = value.split(' ')
73+
msd_disk = MSDUtils.disk_path(self.serial_number)
74+
try:
75+
os.remove(os.path.join(msd_disk, dir_name, file_name))
76+
except:
77+
self.report_error("delete files")
78+
return
79+
time.sleep(2) # wait for msd communication done
80+
self.report_success()
81+
82+
def _callback_check_if_mounted(self, key, value, timestamp):
83+
"""Check if disk was mounted.
84+
85+
"""
86+
wait_time = self.MOUNT_WAIT_TIME
87+
while wait_time != 0:
88+
msd_disk = MSDUtils.disk_path(self.serial_number)
89+
if msd_disk is not None:
90+
# MSD disk found
91+
time.sleep(2) # wait for msd communication done
92+
self.report_success()
93+
return
94+
wait_time -= 1
95+
time.sleep(1) # wait 1s and try again
96+
self.report_error("mount check")
97+
98+
def _callback_check_if_not_mounted(self, key, value, timestamp):
99+
"""Check if disk was unmouted.
100+
101+
"""
102+
wait_time = self.MOUNT_WAIT_TIME
103+
while wait_time != 0:
104+
msd_disk = MSDUtils.disk_path(self.serial_number)
105+
if msd_disk is None:
106+
#self.msd_disk = None
107+
time.sleep(2) # wait for msd communication done
108+
self.report_success()
109+
return
110+
wait_time -= 1
111+
time.sleep(1) # wait 1s and try again
112+
self.report_error("unmount check")
113+
114+
def _callback_get_mounted_fs_size(self, key, value, timestamp):
115+
"""Record visible filesystem size.
116+
117+
"""
118+
stats = psutil.disk_usage(MSDUtils.disk_path(self.serial_number))
119+
self.send_kv("{}".format(stats.total), "0")
120+
121+
def _callback_unmount(self, key, value, timestamp):
122+
"""Disk unmount.
123+
124+
"""
125+
if MSDUtils.unmount(serial=self.serial_number):
126+
self.report_success()
127+
else:
128+
self.report_error("unmount")
129+
130+
def setup(self):
131+
self.register_callback("get_serial_number", self._callback_device_ready)
132+
self.register_callback('check_if_mounted', self._callback_check_if_mounted)
133+
self.register_callback('check_if_not_mounted', self._callback_check_if_not_mounted)
134+
self.register_callback('get_mounted_fs_size', self._callback_get_mounted_fs_size)
135+
self.register_callback('check_file_exist', self._callback_check_file_exist)
136+
self.register_callback('delete_files', self._callback_delete_files)
137+
self.register_callback('unmount', self._callback_unmount)
138+
139+
def report_success(self):
140+
self.send_kv("passed", "0")
141+
142+
def report_error(self, msg):
143+
self.log('{} failed !!!'.format(msg))
144+
self.send_kv("failed", "0")
145+
146+
def result(self):
147+
return self.__result
148+
149+
def teardown(self):
150+
pass
151+
152+
153+
class MSDUtils(object):
154+
155+
@staticmethod
156+
def disk_path(serial):
157+
system_name = platform.system()
158+
if system_name == "Windows":
159+
return MSDUtils._disk_path_windows(serial)
160+
elif system_name == "Linux":
161+
return MSDUtils._disk_path_linux(serial)
162+
elif system_name == "Darwin":
163+
return MSDUtils._disk_path_mac(serial)
164+
return None
165+
166+
@staticmethod
167+
def unmount(serial):
168+
system_name = platform.system()
169+
if system_name == "Windows":
170+
return MSDUtils._unmount_windows(serial)
171+
elif system_name == "Linux":
172+
return MSDUtils._unmount_linux(serial)
173+
elif system_name == "Darwin":
174+
return MSDUtils._unmount_mac(serial)
175+
return False
176+
177+
@staticmethod
178+
def _disk_path_windows(serial):
179+
serial_decoded = serial.encode("ascii")
180+
c = wmi.WMI()
181+
for physical_disk in c.Win32_DiskDrive():
182+
if serial_decoded == physical_disk.SerialNumber:
183+
for partition in physical_disk.associators("Win32_DiskDriveToDiskPartition"):
184+
for logical_disk in partition.associators("Win32_LogicalDiskToPartition"):
185+
return logical_disk.Caption
186+
return None
187+
188+
@staticmethod
189+
def _disk_path_linux(serial):
190+
output = subprocess.check_output(['lsblk', '-dnoserial,mountpoint']).split('\n')
191+
for line in output:
192+
serial_and_mount_point = line.split()
193+
if len(serial_and_mount_point) == 2:
194+
if serial_and_mount_point[0] == str(serial):
195+
return serial_and_mount_point[1]
196+
return None
197+
198+
@staticmethod
199+
def _disk_path_mac(serial):
200+
# TODO:
201+
# add implementation
202+
return None
203+
204+
@staticmethod
205+
def _unmount_windows(serial):
206+
disk_path = MSDUtils._disk_path_windows(serial)
207+
tmp_file = tempfile.NamedTemporaryFile(suffix='.ps1', delete=False)
208+
try:
209+
# create unmount script
210+
tmp_file.write('$disk_leter=$args[0]\n')
211+
tmp_file.write('$driveEject = New-Object -comObject Shell.Application\n')
212+
tmp_file.write('$driveEject.Namespace(17).ParseName($disk_leter).InvokeVerb("Eject")\n')
213+
# close to allow open by other process
214+
tmp_file.close()
215+
216+
try_count = 10
217+
while try_count:
218+
p = subprocess.Popen(["powershell.exe", tmp_file.name + " " + disk_path], stdout=sys.stdout)
219+
p.communicate()
220+
try_count -= 1
221+
if MSDUtils._disk_path_windows(serial) is None:
222+
return True
223+
time.sleep(1)
224+
finally:
225+
os.remove(tmp_file.name)
226+
227+
return False
228+
229+
@staticmethod
230+
def _unmount_linux(serial):
231+
disk_path = MSDUtils._disk_path_linux(serial)
232+
os.system("umount " + disk_path)
233+
return MSDUtils._disk_path_linux(serial) is None
234+
235+
@staticmethod
236+
def _unmount_mac(serial):
237+
disk_path = MSDUtils._disk_path_mac(serial)
238+
os.system("diskutil unmount " + disk_path)
239+
disks = set(MSDUtils._disks_mac())
240+
return MSDUtils._disk_path_mac(serial) is None

TESTS/mbed-crypto/sanity/main.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,9 +438,7 @@ utest::v1::status_t case_teardown_handler(const Case *const source, const size_t
438438

439439
utest::v1::status_t test_setup(const size_t number_of_cases)
440440
{
441-
#ifndef NO_GREENTEA
442441
GREENTEA_SETUP(120, "default_auto");
443-
#endif
444442
return verbose_test_setup_handler(number_of_cases);
445443
}
446444

TESTS/mbed_hal/spm/main.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,7 @@ Case cases[] = {
150150

151151
utest::v1::status_t greentea_test_setup(const size_t number_of_cases)
152152
{
153-
#ifndef NO_GREENTEA
154153
GREENTEA_SETUP(20, "default_auto");
155-
#endif
156154
return greentea_test_setup_handler(number_of_cases);
157155
}
158156

0 commit comments

Comments
 (0)