Skip to content

Configure CAN to preserve message order #4121

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
30 changes: 11 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,22 @@
# ARM mbed OS

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.
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.

mbed OS provides a platform that includes:
- Security foundations.
- Cloud management services.
- Drivers for sensors, I/O devices and connectivity.

mbed OS is modular, configurable software that you can customize it to your device and to reduce memory requirements by excluding unused software.

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.

## Release Notes

The [Release Notes](https://docs.mbed.com/docs/mbed-os-release-notes/en/latest/) detail the current release and previous versions.

## Continuous Integration Status
## Current release

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.

- Master branch [![Master Branch CI Badge](https://travis-ci.org/ARMmbed/mbed-os.svg?branch=master)](https://travis-ci.org/ARMmbed/mbed-os)
- Latest release [![Latest Tag CI Badge](https://travis-ci.org/ARMmbed/mbed-os.svg?branch=latest)](https://travis-ci.org/ARMmbed/mbed-os/branches)
The current release, along with a selection of previous versions are detailed here:
[Release Notes](https://docs.mbed.com/docs/mbed-os-release-notes/en/latest/)

## Getting Started for Developers

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/).
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:

- [Getting Started](https://docs.mbed.com/docs/mbed-os-handbook/en/latest/)

## Getting Started for Contributors

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

- Have a look in the docs directory
17 changes: 8 additions & 9 deletions TESTS/events/queue/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

using namespace utest::v1;

#define TEST_EQUEUE_SIZE 1024

// flag for called
volatile bool touched = false;
Expand Down Expand Up @@ -44,7 +43,7 @@ void func0() {

#define SIMPLE_POSTS_TEST(i, ...) \
void simple_posts_test##i() { \
EventQueue queue(TEST_EQUEUE_SIZE); \
EventQueue queue; \
\
touched = false; \
queue.call(func##i,##__VA_ARGS__); \
Expand Down Expand Up @@ -79,7 +78,7 @@ template <int N>
void call_in_test() {
Timer tickers[N];

EventQueue queue(TEST_EQUEUE_SIZE);
EventQueue queue;

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

EventQueue queue(TEST_EQUEUE_SIZE);
EventQueue queue;

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

void allocate_failure_test() {
EventQueue queue(TEST_EQUEUE_SIZE);
EventQueue queue;
int id;

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

template <int N>
void cancel_test1() {
EventQueue queue(TEST_EQUEUE_SIZE);
EventQueue queue;

int ids[N];

Expand Down Expand Up @@ -165,7 +164,7 @@ void count0() {

void event_class_test() {
counter = 0;
EventQueue queue(TEST_EQUEUE_SIZE);
EventQueue queue(2048);

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

void event_class_helper_test() {
counter = 0;
EventQueue queue(TEST_EQUEUE_SIZE);
EventQueue queue(2048);

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

void event_inference_test() {
counter = 0;
EventQueue queue(TEST_EQUEUE_SIZE);
EventQueue queue(2048);

queue.event(count5, 1, 1, 1, 1, 1).post();
queue.event(count5, 1, 1, 1, 1).post(1);
Expand Down
2 changes: 1 addition & 1 deletion TESTS/events/timing/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ void semaphore_timing_test() {

// Test setup
utest::v1::status_t test_setup(const size_t number_of_cases) {
GREENTEA_SETUP((number_of_cases+1)*TEST_EVENTS_TIMING_TIME/1000, "default_auto");
GREENTEA_SETUP((number_of_cases+1)*TEST_EVENTS_TIMING_TIME, "default_auto");
return verbose_test_setup_handler(number_of_cases);
}

Expand Down
12 changes: 6 additions & 6 deletions TESTS/mbed_drivers/race_test/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,22 @@
#include "SingletonPtr.h"
#include <stdio.h>

#ifndef MBED_RTOS_SINGLE_THREAD
#error [NOT_SUPPORTED] test not supported for single threaded enviroment
#endif

using namespace utest::v1;

#define TEST_STACK_SIZE 512
#define TEST_STACK_SIZE 1024
static uint32_t instance_count = 0;

class TestClass {
public:
TestClass() {
printf("TestClass ctor start\r\n");
Thread::wait(500);
instance_count++;
printf("TestClass ctor end\r\n");
}

void do_something() {
Thread::wait(100);
printf("Do something called\r\n");
}

~TestClass() {
Expand Down Expand Up @@ -67,6 +65,7 @@ static void main_class_race()

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

void test_case_class_race()
{
printf("Running class race test\r\n");
Callback<void()> cb(main_class_race);
Thread *t1 = new Thread(osPriorityNormal, TEST_STACK_SIZE);
Thread *t2 = new Thread(osPriorityNormal, TEST_STACK_SIZE);
Expand Down
7 changes: 6 additions & 1 deletion TESTS/mbed_drivers/stats/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ using namespace utest::v1;

#define ALLOCATION_SIZE_DEFAULT 564
#define ALLOCATION_SIZE_SMALL 124
#define ALLOCATION_SIZE_LARGE 700
#define ALLOCATION_SIZE_LARGE 790
#define ALLOCATION_SIZE_FAIL (1024 * 1024 *1024)

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

void test_case_malloc_free_size()
{
printf("Initial print to setup stdio buffers\n");
mbed_stats_heap_t stats_start;
mbed_stats_heap_t stats_current;
void *data;
Expand Down Expand Up @@ -126,22 +127,26 @@ void test_case_allocate_fail()

static void* thunk_malloc(uint32_t size)
{
printf("Malloc thunk\n");
return malloc(size);
}

static void* thunk_calloc_1(uint32_t size)
{
printf("Calloc thunk 1 byte\n");
return calloc(size / 1, 1);
}

static void* thunk_calloc_4(uint32_t size)
{
printf("Calloc thunk 4 bytes\n");
return calloc(size / 4, 4);
}


static void* thunk_realloc(uint32_t size)
{
printf("Realloc thunk\n");
return realloc(NULL, size);
}

Expand Down
50 changes: 34 additions & 16 deletions TESTS/mbed_drivers/stl_features/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,15 @@ using namespace utest::v1;
#define TABLE_SIZE(TAB) (sizeof(TAB) / sizeof(TAB[0]))

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


namespace {
int p_integers[] = {POSITIVE_INTEGERS};
int n_integers[] = {NEGATIVE_INTEGERS};
float floats[] = {FLOATS};

template <class T, class F>
void BubbleSort(T& _array, size_t array_size, F functor) {
Expand All @@ -54,49 +59,62 @@ void BubbleSort(T& _array, size_t array_size, F functor) {
}
}

struct printInt {
void operator()(int i) { printf("%d ", i); }
};

struct printFloat {
void operator()(float f) { printf("%f ", f); }
};

struct printString {
void operator()(const char* s) { printf("%s ", s); }
};

struct greaterAbs {
bool operator()(int a, int b) { return abs(a) > abs(b); }
};

} // namespace

void test_case_stl_equal() {
const int n_integers[] = {NEGATIVE_INTEGERS};
std::vector<int> v_pints(n_integers, n_integers + TABLE_SIZE(n_integers));
TEST_ASSERT_TRUE(std::equal(v_pints.begin(), v_pints.end(), n_integers));
std::vector<int> v_pints(p_integers, p_integers + TABLE_SIZE(p_integers));
TEST_ASSERT_TRUE(std::equal(v_pints.begin(), v_pints.end(), p_integers));
}

void test_case_stl_transform() {
const float floats[] = {FLOATS};
const char* floats_str[] = {FLOATS_STR};
float floats_transform[TABLE_SIZE(floats_str)] = {0.0};
std::transform(floats_str, floats_str + TABLE_SIZE(floats_str), floats_transform, atof);
//printf("stl_transform::floats_str: ");
//std::for_each(floats_str, floats_str + TABLE_SIZE(floats_str), printString());
//printf("stl_transform::floats_transform: ");
//std::for_each(floats_transform, floats_transform + TABLE_SIZE(floats_transform), printFloat());
//printf("\n");

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

void test_case_stl_sort_greater() {
int n_integers[] = {NEGATIVE_INTEGERS};
int n_integers2[] = {NEGATIVE_INTEGERS};
std::vector<int> v_nints_1(n_integers, n_integers + TABLE_SIZE(n_integers));
std::vector<int> v_nints_2(n_integers, n_integers + TABLE_SIZE(n_integers));

BubbleSort(n_integers, TABLE_SIZE(n_integers), std::greater<int>());
std::sort(n_integers2, n_integers2 + TABLE_SIZE(n_integers2), std::greater<int>());
BubbleSort(v_nints_1, v_nints_1.size(), std::greater<int>());
std::sort(v_nints_2.begin(), v_nints_2.end(), std::greater<int>());

TEST_ASSERT_TRUE(std::equal(n_integers2, n_integers2 + TABLE_SIZE(n_integers2), n_integers));
TEST_ASSERT_TRUE(std::equal(v_nints_1.begin(), v_nints_1.end(), v_nints_2.begin()));
}


void test_case_stl_sort_abs() {
int n_integers[] = {NEGATIVE_INTEGERS};
int n_integers2[] = {NEGATIVE_INTEGERS};
std::vector<int> v_nints_1(n_integers, n_integers + TABLE_SIZE(n_integers));
std::vector<int> v_nints_2(n_integers, n_integers + TABLE_SIZE(n_integers));

BubbleSort(n_integers, TABLE_SIZE(n_integers), greaterAbs());
std::sort(n_integers2, n_integers2 + TABLE_SIZE(n_integers2), greaterAbs());
BubbleSort(v_nints_1, v_nints_1.size(), greaterAbs());
std::sort(v_nints_2.begin(), v_nints_2.end(), greaterAbs());

TEST_ASSERT_TRUE(std::equal(n_integers2, n_integers2 + TABLE_SIZE(n_integers2), n_integers));
TEST_ASSERT_TRUE(std::equal(v_nints_1.begin(), v_nints_1.end(), v_nints_2.begin()));
}


utest::v1::status_t greentea_failure_handler(const Case *const source, const failure_t reason) {
greentea_case_failure_abort_handler(source, reason);
return STATUS_CONTINUE;
Expand Down
29 changes: 24 additions & 5 deletions TESTS/mbedmicro-rtos-mbed/basic/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,26 @@
#error [NOT_SUPPORTED] test not supported
#endif

#define TEST_STACK_SIZE 768
/*
* The stack size is defined in cmsis_os.h mainly dependent on the underlying toolchain and
* the C standard library. For GCC, ARM_STD and IAR it is defined with a size of 2048 bytes
* and for ARM_MICRO 512. Because of reduce RAM size some targets need a reduced stacksize.
*/
#if defined(TARGET_STM32F070RB) && defined(TOOLCHAIN_GCC)
#define STACK_SIZE DEFAULT_STACK_SIZE/2
#elif (defined(TARGET_EFM32HG_STK3400)) && !defined(TOOLCHAIN_ARM_MICRO)
#define STACK_SIZE 512
#elif (defined(TARGET_EFM32LG_STK3600) || defined(TARGET_EFM32WG_STK3800) || defined(TARGET_EFM32PG_STK3401)) && !defined(TOOLCHAIN_ARM_MICRO)
#define STACK_SIZE 768
#elif (defined(TARGET_EFM32GG_STK3700)) && !defined(TOOLCHAIN_ARM_MICRO)
#define STACK_SIZE 1536
#elif defined(TARGET_MCU_NRF51822) || defined(TARGET_MCU_NRF52832)
#define STACK_SIZE 768
#elif defined(TARGET_XDOT_L151CC)
#define STACK_SIZE 1024
#else
#define STACK_SIZE DEFAULT_STACK_SIZE
#endif

#define SIGNAL_PRINT_TICK 0x01

Expand All @@ -24,15 +43,15 @@ void print_tick_thread() {

int main() {
GREENTEA_SETUP(total_ticks + 5, "timing_drift_auto");

Thread tick_thread(osPriorityNormal, TEST_STACK_SIZE);
Thread tick_thread(osPriorityNormal, STACK_SIZE);
tick_thread.start(print_tick_thread);

for (int i = 0; i <= total_ticks; i++) {
Thread::wait(1000);
tick_thread.signal_set(SIGNAL_PRINT_TICK);
}

tick_thread.join();
GREENTEA_TESTSUITE_RESULT(1);
}
Loading