Skip to content

Commit 614d058

Browse files
authored
Merge pull request #1 from ARMmbed/master
catch up from master
2 parents 8b62315 + 0404701 commit 614d058

File tree

1,543 files changed

+243572
-15052
lines changed

Some content is hidden

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

1,543 files changed

+243572
-15052
lines changed

.astyleignore

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,22 @@ cmsis
33
features/cryptocell
44
features/mbedtls
55
features/lwipstack/lwip
6+
features/lwipstack/lwip-sys
67
rtos/TARGET_CORTEX/rtx4
7-
features/filesystem/littlefs/littlefs
8-
features/filesystem/fat/ChaN
8+
features/storage/filesystem/littlefs/littlefs/
9+
features/storage/filesystem/fat/ChaN
10+
features/storage/FEATURE_STORAGE
911
features/frameworks
10-
features/FEATURE_BLE/targets
12+
features/FEATURE_BLE
1113
features/unsupported/
12-
features/FEATURE_COMMON_PAL/
14+
features/netsocket/emac-drivers
1315
hal/storage_abstraction
14-
FEATURE_NANOSTACK/coap-service
15-
FEATURE_NANOSTACK/sal-stack-nanostack
16+
TESTS/mbed_hal/trng/pithy
17+
features/nanostack/coap-service
18+
features/nanostack/sal-stack-nanostack
1619
rtos/TARGET_CORTEX/rtx5
20+
TESTS/mbed_hal/trng/pithy
1721
targets
22+
components/802.15.4_RF
23+
components/wifi
1824
tools

.github/issue_template.md

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
1+
<!--
2+
3+
************************************** WARNING **************************************
4+
5+
The ciarcom bot parses this header automatically. Any deviation from the
6+
template may cause the bot to automatically correct this header or may result in a
7+
warning message, requesting updates.
8+
9+
Please ensure that nothing follows the Issue request type section, all
10+
issue details are within the Description section and no changes are made to the
11+
template format (as detailed below).
12+
13+
*************************************************************************************
14+
15+
-->
16+
117
### Description
2-
<!--
18+
19+
<!--
320
Required
421
Add detailed description of what you are reporting.
522
Good example: https://os.mbed.com/docs/latest/reference/workflow.html
@@ -13,19 +30,15 @@
1330

1431

1532
### Issue request type
16-
<!--
33+
34+
<!--
1735
Required
18-
Please add only one X to one of the following types. Do not fill multiple types. (Split the issue otherwise.)
19-
Please note this is not a GitHub task list; indenting the boxes or changing the format to add a '.' or '*' in front
20-
of them changes the meaning incorrectly. The only changes to make are to add a description under the
21-
description heading and to add an 'x' to the correct box.
22-
23-
[X] Question
24-
[ ] Enhancement
25-
[ ] Bug
36+
Please add only one X to one of the following types. Do not fill multiple types (split the issue otherwise.)
37+
Please note this is not a GitHub task list, indenting the boxes or changing the format to add a '.' or '*' in front
38+
of them would change the meaning incorrectly. The only changes to be made are to add a description text under the
39+
description heading and to add a 'x' to the correct box.
2640
-->
27-
28-
[ ] Question
29-
[ ] Enhancement
30-
[ ] Bug
41+
[ ] Question
42+
[ ] Enhancement
43+
[ ] Bug
3144

.github/pull_request_template.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,7 @@
2020
[ ] Refactor
2121
[ ] Target update
2222
[ ] Functionality change
23+
[ ] Docs update
24+
[ ] Test update
2325
[ ] Breaking change
2426

.travis.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,25 @@ matrix:
5151
# Print versions we use
5252
- doxygen --version
5353
before_script:
54+
# Build doxygen
55+
- >
56+
(git clone --depth=1 --single-branch --branch Release_1_8_14 https://github.com/doxygen/doxygen;
57+
cd doxygen;
58+
mkdir build;
59+
cd build;
60+
cmake -G "Unix Makefiles" ..;
61+
make;
62+
sudo make install)
5463
# Create BUILD directory for tests
5564
- mkdir BUILD
5665
script:
5766
# Assert that the Doxygen build produced no warnings.
5867
# The strange command below asserts that the Doxygen command had an
5968
# output of zero length
60-
- >
61-
doxygen doxyfile_options 2>&1 |
62-
tee BUILD/doxygen.out && [ ! -s BUILD/doxygen.out ]
69+
- doxygen doxyfile_options 2>&1
70+
# Once Mbed OS has been fixed, enable the full test by replacing the top line with this:
71+
# - ( ! doxygen doxyfile_options 2>&1 | grep . )
72+
6373
# Assert that all binary libraries are named correctly
6474
# The strange command below asserts that there are exactly 0 libraries
6575
# that do not start with lib
@@ -86,6 +96,7 @@ matrix:
8696

8797
- arm-none-eabi-gcc --version
8898
- python --version
99+
- pip list --verbose
89100
script:
90101
# Run local testing on tools
91102
- PYTHONPATH=. coverage run -a -m pytest tools/test
@@ -132,10 +143,10 @@ matrix:
132143
# update status if we succeeded, compare with master if possible
133144
- |
134145
CURR=$(cat astyle-branch.out | grep Formatted | wc -l)
135-
PREV=$(curl https://api.github.com/repos/$TRAVIS_REPO_SLUG/status/master \
146+
PREV=$(curl -u "$MBED_BOT" https://api.github.com/repos/$TRAVIS_REPO_SLUG/status/master \
136147
| jq -re "select(.sha != \"$TRAVIS_COMMIT\")
137148
| .statuses[] | select(.context == \"travis-ci/$NAME\").description
138-
| capture(\", (?<files>[0-9]+) files\").warnings" \
149+
| capture(\", (?<files>[0-9]+) files\").files" \
139150
|| echo 0)
140151
141152
STATUSM="Passed, ${CURR} files"

CONTRIBUTING.md

Lines changed: 3 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,5 @@
1-
# Description
2-
This document is cheat sheet for everyone who wants to contribute to [ARMmbed/mbed-os](https://github.com/ARMmbed/mbed-os) GitHub repository at GitHub.
3-
All changes in code base should originate from GitHub Issues and take advantage of existing GitHub flows. Goal is to attract contributors and allow them contribute to code and documentation at the same time.
1+
# Contributing to Mbed OS
42

5-
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.
3+
Mbed OS is an open-source, device software platform for the Internet of Things. Contributions are an important part of the platform, and our goal is to make it as simple as possible to become a contributor.
64

7-
## Where to get more information?
8-
You can read more on our [documentation page](https://docs.mbed.com/docs/mbed-os-handbook/en/latest/cont/contributing/).
9-
10-
# How to contribute
11-
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.
12-
13-
Before a pull request will be merged, the [mbed Contributor Agreement](http://developer.mbed.org/contributor_agreement/) must be signed.
14-
15-
You can pick up existing [mbed-os GitHub Issue](https://github.com/ARMmbed/mbed-os/issues) and solve it or implement new feature you find important, attractive or just necessary. We will review your proposal via pull request mechanism, give you comments and merge your changes if we decide your contribution satisfy criteria such as quality.
16-
17-
# Enhancements vs Bugs
18-
Enhancements are:
19-
* New features implementation.
20-
* Code refactoring.
21-
* Coding rules, coding styles improvements.
22-
* Code comments improvement.
23-
* Documentation work.
24-
25-
Bugs are:
26-
* Issues rose internally or externally by [ARMmbed/mbed-os](https://github.com/ARMmbed/mbed-os) users.
27-
* Internally (within mbed team) created issues from Continuous Integration pipeline and build servers.
28-
* Issues detected using automation tools such as compilers, sanitizers, static code analysis tools etc.
29-
30-
# Gate Keeper role
31-
Gate Keeper is a person responsible for GitHub process workflow execution and is responsible for repository / project code base. Gate Keeper is also responsible for code (pull request) quality stamp and approves or rejects code changes in project’s code base.
32-
33-
Gate Keepers will review your pull request code, give you comments in pull request comment section and in the end if everything goes well merge your pull request to one of our branches (most probably default ```master``` branch).
34-
35-
Please be patient, digest Gate Keeper's feedback and respond promptly :)
36-
37-
# mbed SDK porting
38-
* For more information regarding mbed SDK porting please refer to [mbed SDK porting](http://developer.mbed.org/handbook/mbed-SDK-porting) handbook.
39-
* Before starting the mbed SDK porting, you might want to familiarize with the [mbed SDK library internals](http://developer.mbed.org/handbook/mbed-library-internals) first.
40-
41-
# Glossary
42-
* Gate Keeper – persons responsible for overall code-base quality of [ARMmbed/mbed-os](https://github.com/ARMmbed/mbed-os) project.
43-
* Enhancement – New feature deployment, code refactoring actions or existing code improvements.
44-
* Bugfix – Issues originated from GitHub Issues pool, raised internally within mbed classic team or issues from automated code validators like linters, static code analysis tools etc.
45-
* Mbed classic – mbed SDK 2.0 located in GitHub at [ARMmbed/mbed-os](https://github.com/ARMmbed/mbed-os).
5+
To encourage productive collaboration, as well as robust, consistent and maintainable code, we have a set of guidelines for [contributing to Mbed OS](https://os.mbed.com/docs/latest/reference/contributing.html).

README.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,20 @@
1919
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.
2020

2121
Mbed OS provides a platform that includes:
22-
* Security foundations.
23-
* Cloud management services.
24-
* Drivers for sensors, I/O devices and connectivity.
22+
23+
- Security foundations.
24+
- Cloud management services.
25+
- Drivers for sensors, I/O devices and connectivity.
2526

2627
## Release notes
2728
The [release notes](https://os.mbed.com/releases) detail the current release. You can also find information about previous versions.
2829

30+
## License and contributions
31+
32+
The software is provided under [Apache-2.0 license](LICENSE). Contributions to this project are accepted under the same license. Please see [contributing.md](CONTRIBUTING.md) for more info.
33+
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)
35+
2936
## Getting started for developers
3037

3138
We have a [developer website](https://os.mbed.com) for asking questions, engaging with others, finding information on boards and components, using an online IDE and compiler, reading the documentation and learning about what's new and what's coming next in Mbed OS.
@@ -36,6 +43,7 @@ We also have a [contributing and publishing guide](https://os.mbed.com/contribut
3643

3744
## Documentation
3845

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.
46+
For more information about Mbed OS, please see [our published documentation](https://os.mbed.com/docs/latest). It includes Doxygen for our APIs, step-by-step tutorials, porting information and background reference materials about our architecture and tools.
47+
48+
To contribute to this documentation, please see the [mbed-os-5-docs repository](https://github.com/ARMmbed/mbed-os-5-docs).
4049

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/rtc_reset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class RtcResetTest(BaseHostTest):
2929
"""
3030

3131
"""Start of the RTC"""
32-
START_TIME = 50000
32+
START_TIME = 1537789823 # GMT: Monday, 24 September 2018 11:50:23
3333
START_TIME_TOLERANCE = 10
3434
"""Time to delay after sending reset"""
3535
DELAY_TIME = 5.0

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/lorawan/loraradio/main.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838

3939

4040
using namespace utest::v1;
41+
using namespace mbed;
4142

4243
static LoRaRadio *radio = NULL;
4344
rtos::Semaphore event_sem(0);

TESTS/mbed_drivers/crc/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ void test_thread(void)
130130
char test[] = "123456789";
131131
uint32_t crc;
132132
MbedCRC<POLY_32BIT_ANSI, 32> ct;
133-
TEST_ASSERT_EQUAL(0, ct.compute((void *)test, strlen((const char*)test), &crc));
133+
TEST_ASSERT_EQUAL(0, ct.compute((void *)test, strlen((const char *)test), &crc));
134134
TEST_ASSERT_EQUAL(0xCBF43926, crc);
135135
}
136136

TESTS/mbed_drivers/flashiap/main.cpp

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@ void flashiap_program_test()
5555
TEST_ASSERT_TRUE(sector_size % page_size == 0);
5656
uint32_t prog_size = std::max(page_size, (uint32_t)8);
5757
uint8_t *data = new uint8_t[prog_size + 2];
58-
for (uint32_t i = 0; i < prog_size + 2; i++) {
59-
data[i] = i;
60-
}
6158

6259
// the one before the last sector in the system
6360
uint32_t address = (flash_device.get_flash_start() + flash_device.get_flash_size()) - (sector_size);
@@ -68,14 +65,27 @@ void flashiap_program_test()
6865
ret = flash_device.erase(address, sector_size);
6966
TEST_ASSERT_EQUAL_INT32(0, ret);
7067

68+
uint8_t erase_val = flash_device.get_erase_value();
69+
memset(data, erase_val, prog_size);
70+
71+
uint8_t *data_flashed = new uint8_t[prog_size];
72+
for (uint32_t i = 0; i < sector_size / prog_size; i++) {
73+
uint32_t page_addr = address + i * prog_size;
74+
ret = flash_device.read(data_flashed, page_addr, prog_size);
75+
TEST_ASSERT_EQUAL_INT32(0, ret);
76+
TEST_ASSERT_EQUAL_UINT8_ARRAY(data, data_flashed, prog_size);
77+
}
78+
79+
for (uint32_t i = 0; i < prog_size + 2; i++) {
80+
data[i] = i;
81+
}
7182

7283
for (uint32_t i = 0; i < sector_size / prog_size; i++) {
7384
uint32_t prog_addr = address + i * prog_size;
7485
ret = flash_device.program(data, prog_addr, prog_size);
7586
TEST_ASSERT_EQUAL_INT32(0, ret);
7687
}
7788

78-
uint8_t *data_flashed = new uint8_t[prog_size];
7989
for (uint32_t i = 0; i < sector_size / prog_size; i++) {
8090
uint32_t page_addr = address + i * prog_size;
8191
ret = flash_device.read(data_flashed, page_addr, prog_size);

TESTS/mbed_drivers/lp_ticker/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ void test_multi_ticker(void)
7979
ticker[i].attach_us(callback(increment_multi_counter), MULTI_TICKER_TIME_MS * 1000);
8080
}
8181

82-
Thread::wait(MULTI_TICKER_TIME_MS + extra_wait);
82+
ThisThread::sleep_for(MULTI_TICKER_TIME_MS + extra_wait);
8383
TEST_ASSERT_EQUAL(TICKER_COUNT, multi_counter);
8484

8585
for (int i = 0; i < TICKER_COUNT; i++) {
@@ -95,7 +95,7 @@ void test_multi_ticker(void)
9595
ticker[i].attach_us(callback(increment_multi_counter), (MULTI_TICKER_TIME_MS + i) * 1000);
9696
}
9797

98-
Thread::wait(MULTI_TICKER_TIME_MS + TICKER_COUNT + extra_wait);
98+
ThisThread::sleep_for(MULTI_TICKER_TIME_MS + TICKER_COUNT + extra_wait);
9999
TEST_ASSERT_EQUAL(TICKER_COUNT, multi_counter);
100100

101101
for (int i = 0; i < TICKER_COUNT; i++) {

TESTS/mbed_drivers/mem_trace/main.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
#include <stdio.h>
2525
#include <stdarg.h>
2626

27-
#if !MBED_MEM_TRACING_ENABLED
28-
#error [NOT_SUPPORTED] test not supported
27+
#ifndef MBED_MEM_TRACING_ENABLED
28+
#error [NOT_SUPPORTED] test not supported
2929
#endif
3030

3131
using utest::v1::Case;
@@ -391,7 +391,7 @@ static void test_case_multithread_malloc_free()
391391
threads[i].start(callback(malloc_free, &threads_continue));
392392
}
393393

394-
Thread::wait(wait_time_us);
394+
ThisThread::sleep_for(wait_time_us);
395395
threads_continue = false;
396396

397397
for (int i = 0; i < NUM_TEST_THREADS; i++) {

TESTS/mbed_drivers/race_test/main.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ class TestClass {
3939
public:
4040
TestClass()
4141
{
42-
Thread::wait(500);
42+
ThisThread::sleep_for(500);
4343
instance_count++;
4444
}
4545

4646
void do_something()
4747
{
48-
Thread::wait(100);
48+
ThisThread::sleep_for(100);
4949
}
5050

5151
~TestClass()
@@ -83,7 +83,7 @@ void test_case_func_race()
8383
// Start start first thread
8484
t1.start(cb);
8585
// Start second thread while the first is inside the constructor
86-
Thread::wait(250);
86+
ThisThread::sleep_for(250);
8787
t2.start(cb);
8888

8989
// Wait for the threads to finish
@@ -105,7 +105,7 @@ void test_case_class_race()
105105
// Start start first thread
106106
t1.start(cb);
107107
// Start second thread while the first is inside the constructor
108-
Thread::wait(250);
108+
ThisThread::sleep_for(250);
109109
t2.start(cb);
110110

111111
// Wait for the threads to finish

0 commit comments

Comments
 (0)