Skip to content

Commit bc0fc2e

Browse files
committed
[NANO130] Align with mbed master
1. Remove RTX_CM_lib.h modification for NANO130 platform 2. Remove semaphore test code's speific modification for NANO130 platform 3. Fix duplicate definitions of __NVIC_SetVector/__NVIC_GetVector 4. Add spi_master_block_write()
2 parents 80b74f3 + 226af54 commit bc0fc2e

File tree

4,298 files changed

+870634
-334040
lines changed

Some content is hidden

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

4,298 files changed

+870634
-334040
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ dist
55

66
# MANIFEST file
77
MANIFEST
8+
doxygen_objdb_*
89

910
# Private settings
1011
mbed_settings.py

.travis.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@ python:
22
- "2.7"
33

44
script:
5+
- mkdir BUILD
6+
# Assert that the Doxygen build produced no warnings.
7+
# The strange command below asserts that the Doxygen command had an
8+
# output of zero length
9+
- |
10+
doxygen doxyfile_options 2>&1 | tee BUILD/doxygen.out && [ ! -s BUILD/doxygen.out ]
11+
# Assert that all binary libraries are named correctly
12+
# The strange command below asserts that there are exactly 0 libraries that do
13+
# not start with lib
14+
- |
15+
find "(" -name "*.a" -or -name "*.ar" ")" -and -not -name "lib*" | tee BUILD/badlibs | sed -e "s/^/Bad library name found: /" && [ ! -s BUILD/badlibs ]
516
- make -C events/equeue test clean
617
- PYTHONPATH=. python tools/test/config_test/config_test.py
718
- PYTHONPATH=. python tools/test/build_api/build_api_test.py
@@ -13,11 +24,13 @@ script:
1324
- python tools/build_travis.py
1425
before_install:
1526
- sudo add-apt-repository -y ppa:terry.guo/gcc-arm-embedded
27+
- sudo add-apt-repository -y ppa:libreoffice/libreoffice-4-2
1628
- sudo apt-get update -qq
17-
- sudo apt-get install -qq gcc-arm-none-eabi --force-yes
29+
- sudo apt-get install -qq gcc-arm-none-eabi doxygen --force-yes
1830
# Print versions we use
1931
- arm-none-eabi-gcc --version
2032
- python --version
33+
- doxygen --version
2134
install:
2235
- sudo pip install -r requirements.txt
2336
- sudo pip install pytest

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ All changes in code base should originate from GitHub Issues and take advantage
55
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.
66

77
## Where to get more information?
8-
You can for example read more in our ```docs``` section in [ARMmbed/mbed-os/doc](https://github.com/ARMmbed/mbed-os/tree/master/docs) directory.
8+
You can read more on our [documentation page](https://docs.mbed.com/).
99

1010
# How to contribute
1111
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.

Jenkinsfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ def parallelSteps = mbed.createParalleSteps("mbed-os", targets, toolchains)
2424
mbed.compile(parallelSteps)
2525

2626
def testApps = [
27-
"mbed-os-cliapp",
28-
"mbed-client-testapp"
27+
"mbed-os-cliapp"
2928
]
3029

3130
// buildTestApps accepts array of test application names and a mbed-os branch or PR reference as parameters

README.md

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,30 @@
11
# ARM mbed OS
22

3-
mbed OS is an open-source embedded operating system designed specifically for the "things" in the Internet of Things (IoT). It includes all the features you need to develop a connected product based on an ARM Cortex-M microcontroller.
3+
mbed OS is an open-source embedded operating system designed for the "things" in the Internet of Things (IoT). mbed OS includes the features you need to develop a connected product using an ARM Cortex-M microcontroller.
44

5-
mbed OS accelerates the process of creating a connected product by providing a platform operating system that includes robust security foundations, standards based communication capabilities, built-in cloud management services, and drivers for sensors, I/O devices and connectivity. mbed OS is built as a modular, configurable software stack so that you can readily customize it to the device you're developing for, and reduce memory requirements by excluding unnecessary software components.
5+
mbed OS provides a platform that includes:
6+
- Security foundations.
7+
- Cloud management services.
8+
- Drivers for sensors, I/O devices and connectivity.
9+
10+
mbed OS is modular, configurable software that you can customize it to your device and to reduce memory requirements by excluding unused software.
11+
612

7-
## Current release
13+
## Release Notes
14+
15+
The [Release Notes](https://docs.mbed.com/docs/mbed-os-release-notes/en/latest/) detail the current release and previous versions.
16+
17+
## Continuous Integration Status
818

9-
The current release, along with a selection of previous versions are detailed here:
10-
[Release Notes](https://docs.mbed.com/docs/mbed-os-release-notes/en/latest/)
19+
We run continuous integration on all of our branches and pull requests to verify the stability of mbed OS. The following are the Travis CI indicators for mbed OS.
20+
21+
- Master branch [![Master Branch CI Badge](https://travis-ci.org/ARMmbed/mbed-os.svg?branch=master)](https://travis-ci.org/ARMmbed/mbed-os)
22+
- Latest release [![Latest Tag CI Badge](https://travis-ci.org/ARMmbed/mbed-os.svg?branch=latest)](https://travis-ci.org/ARMmbed/mbed-os/branches)
1123

1224
## Getting Started for Developers
1325

14-
Please note that you will require [mbed CLI](https://github.com/ARMmbed/mbed-cli) to build mbed OS. For more details, please read the getting started guide for developers using mbed OS in applications:
15-
16-
- [Getting Started](https://docs.mbed.com/docs/mbed-os-handbook/en/latest/)
26+
You need [mbed CLI](https://github.com/ARMmbed/mbed-cli) to build mbed OS. For more details, read the [mbed OS Handbook](https://docs.mbed.com/docs/mbed-os-handbook/en/latest/).
1727

1828
## Getting Started for Contributors
1929

20-
We have a getting started guide for contributors working on mbed OS:
21-
22-
- Have a look in the docs directory
30+
We have a [Contributing and Publishing Guide](https://docs.mbed.com/docs/mbed-os-handbook/en/latest/cont/contributing/) in the mbed OS Handbook.

TESTS/events/queue/main.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
using namespace utest::v1;
99

10+
#define TEST_EQUEUE_SIZE 1024
1011

1112
// flag for called
1213
volatile bool touched = false;
@@ -43,7 +44,7 @@ void func0() {
4344

4445
#define SIMPLE_POSTS_TEST(i, ...) \
4546
void simple_posts_test##i() { \
46-
EventQueue queue; \
47+
EventQueue queue(TEST_EQUEUE_SIZE); \
4748
\
4849
touched = false; \
4950
queue.call(func##i,##__VA_ARGS__); \
@@ -78,7 +79,7 @@ template <int N>
7879
void call_in_test() {
7980
Timer tickers[N];
8081

81-
EventQueue queue;
82+
EventQueue queue(TEST_EQUEUE_SIZE);
8283

8384
for (int i = 0; i < N; i++) {
8485
tickers[i].start();
@@ -92,7 +93,7 @@ template <int N>
9293
void call_every_test() {
9394
Timer tickers[N];
9495

95-
EventQueue queue;
96+
EventQueue queue(TEST_EQUEUE_SIZE);
9697

9798
for (int i = 0; i < N; i++) {
9899
tickers[i].start();
@@ -103,7 +104,7 @@ void call_every_test() {
103104
}
104105

105106
void allocate_failure_test() {
106-
EventQueue queue;
107+
EventQueue queue(TEST_EQUEUE_SIZE);
107108
int id;
108109

109110
for (int i = 0; i < 100; i++) {
@@ -119,7 +120,7 @@ void no() {
119120

120121
template <int N>
121122
void cancel_test1() {
122-
EventQueue queue;
123+
EventQueue queue(TEST_EQUEUE_SIZE);
123124

124125
int ids[N];
125126

@@ -164,7 +165,7 @@ void count0() {
164165

165166
void event_class_test() {
166167
counter = 0;
167-
EventQueue queue(2048);
168+
EventQueue queue(TEST_EQUEUE_SIZE);
168169

169170
Event<void(int, int, int, int, int)> e5(&queue, count5);
170171
Event<void(int, int, int, int)> e4(&queue, count5, 1);
@@ -187,7 +188,7 @@ void event_class_test() {
187188

188189
void event_class_helper_test() {
189190
counter = 0;
190-
EventQueue queue(2048);
191+
EventQueue queue(TEST_EQUEUE_SIZE);
191192

192193
Event<void()> e5 = queue.event(count5, 1, 1, 1, 1, 1);
193194
Event<void()> e4 = queue.event(count4, 1, 1, 1, 1);
@@ -210,7 +211,7 @@ void event_class_helper_test() {
210211

211212
void event_inference_test() {
212213
counter = 0;
213-
EventQueue queue(2048);
214+
EventQueue queue(TEST_EQUEUE_SIZE);
214215

215216
queue.event(count5, 1, 1, 1, 1, 1).post();
216217
queue.event(count5, 1, 1, 1, 1).post(1);

TESTS/events/timing/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ void semaphore_timing_test() {
104104

105105
// Test setup
106106
utest::v1::status_t test_setup(const size_t number_of_cases) {
107-
GREENTEA_SETUP((number_of_cases+1)*TEST_EVENTS_TIMING_TIME, "default_auto");
107+
GREENTEA_SETUP((number_of_cases+1)*TEST_EVENTS_TIMING_TIME/1000, "default_auto");
108108
return verbose_test_setup_handler(number_of_cases);
109109
}
110110

TESTS/mbed_drivers/race_test/main.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,24 @@
2222
#include "SingletonPtr.h"
2323
#include <stdio.h>
2424

25+
#ifdef MBED_RTOS_SINGLE_THREAD
26+
#error [NOT_SUPPORTED] test not supported for single threaded enviroment
27+
#endif
28+
2529
using namespace utest::v1;
2630

27-
#define TEST_STACK_SIZE 1024
31+
#define TEST_STACK_SIZE 512
2832
static uint32_t instance_count = 0;
2933

3034
class TestClass {
3135
public:
3236
TestClass() {
33-
printf("TestClass ctor start\r\n");
3437
Thread::wait(500);
3538
instance_count++;
36-
printf("TestClass ctor end\r\n");
3739
}
3840

3941
void do_something() {
40-
printf("Do something called\r\n");
42+
Thread::wait(100);
4143
}
4244

4345
~TestClass() {
@@ -65,7 +67,6 @@ static void main_class_race()
6567

6668
void test_case_func_race()
6769
{
68-
printf("Running function race test\r\n");
6970
Callback<void()> cb(main_func_race);
7071
Thread *t1 = new Thread(osPriorityNormal, TEST_STACK_SIZE);
7172
Thread *t2 = new Thread(osPriorityNormal, TEST_STACK_SIZE);
@@ -91,7 +92,6 @@ void test_case_func_race()
9192

9293
void test_case_class_race()
9394
{
94-
printf("Running class race test\r\n");
9595
Callback<void()> cb(main_class_race);
9696
Thread *t1 = new Thread(osPriorityNormal, TEST_STACK_SIZE);
9797
Thread *t2 = new Thread(osPriorityNormal, TEST_STACK_SIZE);

TESTS/mbed_drivers/stats/main.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ using namespace utest::v1;
3030

3131
#define ALLOCATION_SIZE_DEFAULT 564
3232
#define ALLOCATION_SIZE_SMALL 124
33-
#define ALLOCATION_SIZE_LARGE 790
33+
#define ALLOCATION_SIZE_LARGE 700
3434
#define ALLOCATION_SIZE_FAIL (1024 * 1024 *1024)
3535

3636
typedef void* (*malloc_cb_t) (uint32_t size);
@@ -49,7 +49,6 @@ malloc_cb_t malloc_thunk_array[] = {
4949

5050
void test_case_malloc_free_size()
5151
{
52-
printf("Initial print to setup stdio buffers\n");
5352
mbed_stats_heap_t stats_start;
5453
mbed_stats_heap_t stats_current;
5554
void *data;
@@ -127,26 +126,22 @@ void test_case_allocate_fail()
127126

128127
static void* thunk_malloc(uint32_t size)
129128
{
130-
printf("Malloc thunk\n");
131129
return malloc(size);
132130
}
133131

134132
static void* thunk_calloc_1(uint32_t size)
135133
{
136-
printf("Calloc thunk 1 byte\n");
137134
return calloc(size / 1, 1);
138135
}
139136

140137
static void* thunk_calloc_4(uint32_t size)
141138
{
142-
printf("Calloc thunk 4 bytes\n");
143139
return calloc(size / 4, 4);
144140
}
145141

146142

147143
static void* thunk_realloc(uint32_t size)
148144
{
149-
printf("Realloc thunk\n");
150145
return realloc(NULL, size);
151146
}
152147

TESTS/mbed_drivers/stl_features/main.cpp

Lines changed: 16 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,10 @@ using namespace utest::v1;
3232
#define TABLE_SIZE(TAB) (sizeof(TAB) / sizeof(TAB[0]))
3333

3434
#define NEGATIVE_INTEGERS -32768,-3214,-999,-100,-1,0,1,4231,999,4123,32760,99999
35-
#define POSITIVE_INTEGERS 32768,3214,999,100,1,0,1,4231,999,4123,32760,99999
3635
#define FLOATS 0.002,0.92430,15.91320,791.77368,6208.2,25719.4952,426815.982588,6429271.046,42468024.93,212006462.910
3736
#define FLOATS_STR "0.002","0.92430","15.91320","791.77368","6208.2","25719.4952","426815.982588","6429271.046","42468024.93","212006462.910"
3837

39-
4038
namespace {
41-
int p_integers[] = {POSITIVE_INTEGERS};
42-
int n_integers[] = {NEGATIVE_INTEGERS};
43-
float floats[] = {FLOATS};
4439

4540
template <class T, class F>
4641
void BubbleSort(T& _array, size_t array_size, F functor) {
@@ -59,62 +54,49 @@ void BubbleSort(T& _array, size_t array_size, F functor) {
5954
}
6055
}
6156

62-
struct printInt {
63-
void operator()(int i) { printf("%d ", i); }
64-
};
65-
66-
struct printFloat {
67-
void operator()(float f) { printf("%f ", f); }
68-
};
69-
70-
struct printString {
71-
void operator()(const char* s) { printf("%s ", s); }
72-
};
73-
7457
struct greaterAbs {
7558
bool operator()(int a, int b) { return abs(a) > abs(b); }
7659
};
7760

7861
} // namespace
7962

8063
void test_case_stl_equal() {
81-
std::vector<int> v_pints(p_integers, p_integers + TABLE_SIZE(p_integers));
82-
TEST_ASSERT_TRUE(std::equal(v_pints.begin(), v_pints.end(), p_integers));
64+
const int n_integers[] = {NEGATIVE_INTEGERS};
65+
std::vector<int> v_pints(n_integers, n_integers + TABLE_SIZE(n_integers));
66+
TEST_ASSERT_TRUE(std::equal(v_pints.begin(), v_pints.end(), n_integers));
8367
}
8468

8569
void test_case_stl_transform() {
70+
const float floats[] = {FLOATS};
8671
const char* floats_str[] = {FLOATS_STR};
8772
float floats_transform[TABLE_SIZE(floats_str)] = {0.0};
8873
std::transform(floats_str, floats_str + TABLE_SIZE(floats_str), floats_transform, atof);
89-
//printf("stl_transform::floats_str: ");
90-
//std::for_each(floats_str, floats_str + TABLE_SIZE(floats_str), printString());
91-
//printf("stl_transform::floats_transform: ");
92-
//std::for_each(floats_transform, floats_transform + TABLE_SIZE(floats_transform), printFloat());
93-
//printf("\n");
9474

9575
TEST_ASSERT_TRUE(std::equal(floats_transform, floats_transform + TABLE_SIZE(floats_transform), floats));
9676
}
9777

9878
void test_case_stl_sort_greater() {
99-
std::vector<int> v_nints_1(n_integers, n_integers + TABLE_SIZE(n_integers));
100-
std::vector<int> v_nints_2(n_integers, n_integers + TABLE_SIZE(n_integers));
79+
int n_integers[] = {NEGATIVE_INTEGERS};
80+
int n_integers2[] = {NEGATIVE_INTEGERS};
10181

102-
BubbleSort(v_nints_1, v_nints_1.size(), std::greater<int>());
103-
std::sort(v_nints_2.begin(), v_nints_2.end(), std::greater<int>());
82+
BubbleSort(n_integers, TABLE_SIZE(n_integers), std::greater<int>());
83+
std::sort(n_integers2, n_integers2 + TABLE_SIZE(n_integers2), std::greater<int>());
10484

105-
TEST_ASSERT_TRUE(std::equal(v_nints_1.begin(), v_nints_1.end(), v_nints_2.begin()));
85+
TEST_ASSERT_TRUE(std::equal(n_integers2, n_integers2 + TABLE_SIZE(n_integers2), n_integers));
10686
}
10787

88+
10889
void test_case_stl_sort_abs() {
109-
std::vector<int> v_nints_1(n_integers, n_integers + TABLE_SIZE(n_integers));
110-
std::vector<int> v_nints_2(n_integers, n_integers + TABLE_SIZE(n_integers));
90+
int n_integers[] = {NEGATIVE_INTEGERS};
91+
int n_integers2[] = {NEGATIVE_INTEGERS};
11192

112-
BubbleSort(v_nints_1, v_nints_1.size(), greaterAbs());
113-
std::sort(v_nints_2.begin(), v_nints_2.end(), greaterAbs());
93+
BubbleSort(n_integers, TABLE_SIZE(n_integers), greaterAbs());
94+
std::sort(n_integers2, n_integers2 + TABLE_SIZE(n_integers2), greaterAbs());
11495

115-
TEST_ASSERT_TRUE(std::equal(v_nints_1.begin(), v_nints_1.end(), v_nints_2.begin()));
96+
TEST_ASSERT_TRUE(std::equal(n_integers2, n_integers2 + TABLE_SIZE(n_integers2), n_integers));
11697
}
11798

99+
118100
utest::v1::status_t greentea_failure_handler(const Case *const source, const failure_t reason) {
119101
greentea_case_failure_abort_handler(source, reason);
120102
return STATUS_CONTINUE;

TESTS/mbed_hal/flash/functional_tests/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424

2525
#include "mbed.h"
2626
#include "flash_api.h"
27-
#include "flash_data.h"
2827

2928
using namespace utest::v1;
3029

@@ -49,6 +48,7 @@ static void erase_range(flash_t *flash, uint32_t addr, uint32_t size)
4948
TEST_ASSERT_NOT_EQUAL(0, sector_size);
5049
int32_t ret = flash_erase_sector(flash, addr);
5150
TEST_ASSERT_EQUAL_INT32(0, ret);
51+
addr += sector_size;
5252
size = size > sector_size ? size - sector_size : 0;
5353
}
5454
}

0 commit comments

Comments
 (0)