Skip to content

Commit e1bea44

Browse files
author
Cruz Monrreal
authored
Merge pull request #8479 from ARMmbed/release-candidate
Release candidate for mbed-os-5.10.2
2 parents c53d51f + 0b850b9 commit e1bea44

File tree

654 files changed

+72760
-4138
lines changed

Some content is hidden

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

654 files changed

+72760
-4138
lines changed

.github/issue_template.md

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
### Description
2-
<!--
2+
3+
<!--
34
Required
45
Add detailed description of what you are reporting.
56
Good example: https://os.mbed.com/docs/latest/reference/workflow.html
@@ -13,19 +14,15 @@
1314

1415

1516
### Issue request type
16-
<!--
17-
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.
2217

23-
[X] Question
24-
[ ] Enhancement
25-
[ ] Bug
18+
<!--
19+
Required
20+
Please add only one X to one of the following types. Do not fill multiple types (split the issue otherwise.)
21+
Please note this is not a GitHub task list, indenting the boxes or changing the format to add a '.' or '*' in front
22+
of them would change the meaning incorrectly. The only changes to be made are to add a description text under the
23+
description heading and to add a 'x' to the correct box.
2624
-->
27-
28-
[ ] Question
29-
[ ] Enhancement
30-
[ ] Bug
25+
[ ] Question
26+
[ ] Enhancement
27+
[ ] Bug
3128

.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: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ matrix:
8686

8787
- arm-none-eabi-gcc --version
8888
- python --version
89+
- pip list --verbose
8990
script:
9091
# Run local testing on tools
9192
- PYTHONPATH=. coverage run -a -m pytest tools/test
@@ -132,10 +133,10 @@ matrix:
132133
# update status if we succeeded, compare with master if possible
133134
- |
134135
CURR=$(cat astyle-branch.out | grep Formatted | wc -l)
135-
PREV=$(curl https://api.github.com/repos/$TRAVIS_REPO_SLUG/status/master \
136+
PREV=$(curl -u "$MBED_BOT" https://api.github.com/repos/$TRAVIS_REPO_SLUG/status/master \
136137
| jq -re "select(.sha != \"$TRAVIS_COMMIT\")
137138
| .statuses[] | select(.context == \"travis-ci/$NAME\").description
138-
| capture(\", (?<files>[0-9]+) files\").warnings" \
139+
| capture(\", (?<files>[0-9]+) files\").files" \
139140
|| echo 0)
140141
141142
STATUSM="Passed, ${CURR} files"

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/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);
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
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+
*/
16+
17+
#include "utest/utest.h"
18+
#include "unity/unity.h"
19+
#include "greentea-client/test_env.h"
20+
21+
#include "mbed.h"
22+
23+
using namespace utest::v1;
24+
25+
/**
26+
* This test is intended to gate devices that do not have enough RAM to run
27+
* Mbed os. Devices passing this test should have enough RAM to run all
28+
* other Mbed OS tests.
29+
*
30+
* If your device does not pass this test, then you should determine the
31+
* cause of high memory usage and fix it. If you cannot free enough memory,
32+
* then you should turn off Mbed OS support for this device.
33+
*/
34+
35+
#define MIN_HEAP_SIZE 2048
36+
#define MIN_DATA_SIZE 2048
37+
38+
volatile uint8_t test_buffer[MIN_DATA_SIZE];
39+
40+
static void minimum_heap_test()
41+
{
42+
void *mem = malloc(MIN_HEAP_SIZE);
43+
TEST_ASSERT_NOT_EQUAL(NULL, mem);
44+
free(mem);
45+
}
46+
47+
static void minimum_data_test()
48+
{
49+
// Use test buffer so it is not optimized away
50+
for (int i = 0; i < MIN_DATA_SIZE; i++) {
51+
test_buffer[i] = i & 0xFF;
52+
}
53+
}
54+
55+
56+
utest::v1::status_t greentea_test_setup(const size_t number_of_cases)
57+
{
58+
GREENTEA_SETUP(30, "default_auto");
59+
return greentea_test_setup_handler(number_of_cases);
60+
}
61+
62+
Case cases[] = {
63+
Case("Minimum heap test", minimum_heap_test),
64+
Case("Minimum data test", minimum_data_test),
65+
};
66+
67+
Specification specification(greentea_test_setup, cases, greentea_test_teardown_handler);
68+
69+
int main() {
70+
Harness::run(specification);
71+
}

TESTS/mbed_hal/sleep/main.cpp

Lines changed: 1 addition & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -25,26 +25,9 @@
2525
#include "greentea-client/test_env.h"
2626
#include "mbed_lp_ticker_wrapper.h"
2727

28+
#include "sleep_test_utils.h"
2829
#include "sleep_api_tests.h"
2930

30-
#define US_PER_S 1000000
31-
32-
/* Flush serial buffer before deep sleep
33-
*
34-
* Since deepsleep() may shut down the UART peripheral, we wait for some time
35-
* to allow for hardware serial buffers to completely flush.
36-
*
37-
* Take NUMAKER_PFM_NUC472 as an example:
38-
* Its UART peripheral has 16-byte Tx FIFO. With baud rate set to 9600, flush
39-
* Tx FIFO would take: 16 * 8 * 1000 / 9600 = 13.3 (ms). So set wait time to
40-
* 20ms here for safe.
41-
*
42-
* This should be replaced with a better function that checks if the
43-
* hardware buffers are empty. However, such an API does not exist now,
44-
* so we'll use the busy_wait_ms() function for now.
45-
*/
46-
#define SERIAL_FLUSH_TIME_MS 20
47-
4831
using namespace utest::v1;
4932

5033
static char info[512] = {0};
@@ -67,71 +50,6 @@ static const uint32_t sleep_mode_delta_us = (10 + 4 + 5);
6750
* delta = default 10 ms + worst ticker resolution + extra time for code execution */
6851
static const uint32_t deepsleep_mode_delta_us = (10000 + 125 + 5);
6952

70-
unsigned int ticks_to_us(unsigned int ticks, unsigned int freq)
71-
{
72-
return (unsigned int)((unsigned long long) ticks * US_PER_S / freq);
73-
}
74-
75-
unsigned int us_to_ticks(unsigned int us, unsigned int freq)
76-
{
77-
return (unsigned int)((unsigned long long) us * freq / US_PER_S);
78-
}
79-
80-
unsigned int overflow_protect(unsigned int timestamp, unsigned int ticker_width)
81-
{
82-
unsigned int counter_mask = ((1 << ticker_width) - 1);
83-
84-
return (timestamp & counter_mask);
85-
}
86-
87-
bool compare_timestamps(unsigned int delta_ticks, unsigned int ticker_width, unsigned int expected, unsigned int actual)
88-
{
89-
const unsigned int counter_mask = ((1 << ticker_width) - 1);
90-
91-
const unsigned int lower_bound = ((expected - delta_ticks) & counter_mask);
92-
const unsigned int upper_bound = ((expected + delta_ticks) & counter_mask);
93-
94-
if (lower_bound < upper_bound) {
95-
if (actual >= lower_bound && actual <= upper_bound) {
96-
return true;
97-
} else {
98-
return false;
99-
}
100-
} else {
101-
if ((actual >= lower_bound && actual <= counter_mask) || (actual >= 0 && actual <= upper_bound)) {
102-
return true;
103-
} else {
104-
return false;
105-
}
106-
}
107-
}
108-
109-
void busy_wait_ms(int ms)
110-
{
111-
const ticker_info_t *info = us_ticker_get_info();
112-
uint32_t mask = (1 << info->bits) - 1;
113-
int delay = (int)((uint64_t)ms * info->frequency / 1000);
114-
115-
uint32_t prev = us_ticker_read();
116-
while (delay > 0) {
117-
uint32_t next = us_ticker_read();
118-
delay -= (next - prev) & mask;
119-
prev = next;
120-
}
121-
}
122-
123-
void us_ticker_isr(const ticker_data_t *const ticker_data)
124-
{
125-
us_ticker_clear_interrupt();
126-
}
127-
128-
#ifdef DEVICE_LPTICKER
129-
void lp_ticker_isr(const ticker_data_t *const ticker_data)
130-
{
131-
lp_ticker_clear_interrupt();
132-
}
133-
#endif
134-
13553
/* Test that wake-up time from sleep should be less than 10 us and
13654
* high frequency ticker interrupt can wake-up target from sleep. */
13755
void sleep_usticker_test()
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
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+
*/
16+
17+
/**
18+
* @addtogroup hal_sleep_test_utils
19+
* @{
20+
*/
21+
22+
#ifndef MBED_SLEEP_TEST_UTILS_H
23+
#define MBED_SLEEP_TEST_UTILS_H
24+
25+
#include "hal/ticker_api.h"
26+
#include "hal/us_ticker_api.h"
27+
#include "hal/lp_ticker_api.h"
28+
29+
/* Flush serial buffer before deep sleep
30+
*
31+
* Since deepsleep() may shut down the UART peripheral, we wait for some time
32+
* to allow for hardware serial buffers to completely flush.
33+
*
34+
* Take NUMAKER_PFM_NUC472 as an example:
35+
* Its UART peripheral has 16-byte Tx FIFO. With baud rate set to 9600, flush
36+
* Tx FIFO would take: 16 * 8 * 1000 / 9600 = 13.3 (ms). So set wait time to
37+
* 20ms here for safe.
38+
*
39+
* This should be replaced with a better function that checks if the
40+
* hardware buffers are empty. However, such an API does not exist now,
41+
* so we'll use the busy_wait_ms() function for now.
42+
*/
43+
#define SERIAL_FLUSH_TIME_MS 20
44+
45+
#define US_PER_S 1000000
46+
47+
unsigned int ticks_to_us(unsigned int ticks, unsigned int freq)
48+
{
49+
return (unsigned int) ((unsigned long long) ticks * US_PER_S / freq);
50+
}
51+
52+
unsigned int us_to_ticks(unsigned int us, unsigned int freq)
53+
{
54+
return (unsigned int) ((unsigned long long) us * freq / US_PER_S);
55+
}
56+
57+
unsigned int overflow_protect(unsigned int timestamp, unsigned int ticker_width)
58+
{
59+
unsigned int counter_mask = ((1 << ticker_width) - 1);
60+
61+
return (timestamp & counter_mask);
62+
}
63+
64+
bool compare_timestamps(unsigned int delta_ticks, unsigned int ticker_width, unsigned int expected, unsigned int actual)
65+
{
66+
const unsigned int counter_mask = ((1 << ticker_width) - 1);
67+
68+
const unsigned int lower_bound = ((expected - delta_ticks) & counter_mask);
69+
const unsigned int upper_bound = ((expected + delta_ticks) & counter_mask);
70+
71+
if (lower_bound < upper_bound) {
72+
if (actual >= lower_bound && actual <= upper_bound) {
73+
return true;
74+
} else {
75+
return false;
76+
}
77+
} else {
78+
if ((actual >= lower_bound && actual <= counter_mask) || (actual >= 0 && actual <= upper_bound)) {
79+
return true;
80+
} else {
81+
return false;
82+
}
83+
}
84+
}
85+
86+
void busy_wait_ms(int ms)
87+
{
88+
const ticker_info_t *info = us_ticker_get_info();
89+
uint32_t mask = (1 << info->bits) - 1;
90+
int delay = (int) ((uint64_t) ms * info->frequency / 1000);
91+
92+
uint32_t prev = us_ticker_read();
93+
while (delay > 0) {
94+
uint32_t next = us_ticker_read();
95+
delay -= (next - prev) & mask;
96+
prev = next;
97+
}
98+
}
99+
100+
void us_ticker_isr(const ticker_data_t * const ticker_data)
101+
{
102+
us_ticker_clear_interrupt();
103+
}
104+
105+
#ifdef DEVICE_LPTICKER
106+
void lp_ticker_isr(const ticker_data_t * const ticker_data)
107+
{
108+
lp_ticker_clear_interrupt();
109+
}
110+
#endif
111+
112+
#endif
113+
114+
/** @}*/

0 commit comments

Comments
 (0)