Skip to content

Release candidate for mbed-os-5.7.5 #6057

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

Merged
merged 113 commits into from
Feb 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
50d4c25
Add GR_LYCHEE as a new target board in terget.json, build_travis.py a…
TomoYamanaka Jan 16, 2018
e54f6c7
Enable exporter for GR_LYCHEE is a Renesas new target board
TomoYamanaka Jan 16, 2018
e1b7f64
Add startup processing having CMSIS5/RTX5 been available on GR-LYCHEE
TomoYamanaka Jan 16, 2018
133f404
Add the definition for GR-LYCHEE in mbed_rtx.h
TomoYamanaka Jan 16, 2018
884d02d
Support TRNG function for GR-LYCHEE
TomoYamanaka Jan 16, 2018
856737c
Add license header on top in reserved_pins.h
TomoYamanaka Jan 19, 2018
32ed0f7
Modify the arrangement of "{" that shows the function start
TomoYamanaka Jan 19, 2018
5b25f79
RZ_A1LU: cmsis nvic include fix
TomoYamanaka Jan 19, 2018
73ed270
STM32 NUCLEO F413ZH and L433RC : STDIO configuration
jeromecoutant Jan 26, 2018
6e2584e
Correct return value of nsapi_dns_query_multiple
kjbracey Jan 26, 2018
454545a
Updated exporter for e2 studio: added new launch file
phyokyaw-renesas Jan 23, 2018
3a8da4c
Added pretty bar printing for compile output
geky Jan 23, 2018
035fe91
Fixed a bug with multiple Sub-Directories with same name
Jan 23, 2018
a457d71
Updated List comparision with shorter implementaion using python buil…
Jan 24, 2018
ee333a5
SMT32L4 : add missing ST HAL LPUART functions
jeromecoutant Jan 25, 2018
52dc677
Move FLM parsing to arm_pack_manager and regenerate index
sarahmarshy Jan 9, 2018
1a512c9
Add functions for getting sectors in Config class
sarahmarshy Jan 9, 2018
ce078b7
Fix typo in _generate_bootloader_build
sarahmarshy Jan 9, 2018
82c67ef
Align managed bootloader addresses on sector boundaries
sarahmarshy Jan 9, 2018
6df1256
Add pyelftools dependency
sarahmarshy Jan 9, 2018
dcaeae8
Error check existence of sectors
sarahmarshy Jan 11, 2018
9cdc6c7
Use Config class sector variable
sarahmarshy Jan 11, 2018
32b8cff
Introduce sector ceiling/floor rounding
sarahmarshy Jan 11, 2018
58b5970
Treat start variable as addrss in `generate_bootloader_build`
sarahmarshy Jan 22, 2018
d158c21
Change exception in ArmPackManager FLM reader
sarahmarshy Jan 22, 2018
fb26781
Adding MTB ublox NINA-B1 as a new target
Jan 12, 2018
3d0c222
Add license info
Jan 29, 2018
0e78e7e
STM32 : set all PinMap structures as weak
jeromecoutant Jan 29, 2018
8340f50
add support for STM32L443RC & WISE-1510
ithinuel Jan 17, 2018
a97e4d7
fix a silent conflict with PR #5947
ithinuel Jan 31, 2018
192de3f
Fix #5079. Add the support of call to mbedtls_xxx_finish even if mbed…
adustm Nov 30, 2017
143b448
Fix MD5 link issue
adustm Dec 14, 2017
acea1bd
Improve fix calling Accumulate function every time in finish function
adustm Jan 15, 2018
52eb2b7
Remove last code redundancy
adustm Jan 30, 2018
0a644d2
add support for the murata's module based on STM32L0
ithinuel Jan 18, 2018
584e6ee
STM32 serial: move init_uart function at the end of file
bcostm Jan 25, 2018
0c09ac7
STM32 serial: add get_uart_index utility function
bcostm Jan 25, 2018
f679754
STM32 serial: use get_uart_index function for F4 devices
bcostm Jan 25, 2018
327a378
STM32 serial: change serial_get_irq_n function for F4 devices
bcostm Jan 25, 2018
2c4d959
STM32 serial: use uart_name instead of uart_base
bcostm Jan 25, 2018
fb4d925
STM32 serial: fix linking error
bcostm Jan 25, 2018
8315767
STM32 serial: use uart_name in serial_irq_set function for F4
bcostm Jan 25, 2018
7cda4dd
STM32 serial: improve irq index management for F1 devices
bcostm Jan 25, 2018
d01cfb1
STM32 serial: coding style
bcostm Jan 29, 2018
2aadbb8
STM32 serial: improve irq index management for F2 devices
bcostm Jan 25, 2018
19fd049
STM32 serial: improve irq index management for F3 devices
bcostm Jan 26, 2018
32eff7d
STM32 serial: improve irq index management for F7 devices
bcostm Jan 26, 2018
37738fe
STM32 serial: improve irq index management for L1 devices
bcostm Jan 26, 2018
f5e76d3
STM32 serial: improve irq index management for L4 devices
bcostm Jan 26, 2018
e6e1441
STM32 serial: improve irq index management for F0 devices
bcostm Jan 29, 2018
82d7f9f
STM32 serial: improve irq index management for L0 devices
bcostm Jan 29, 2018
5f6ee5f
STM32 serial: improve index assignment in serial_init
bcostm Jan 29, 2018
bedc73d
STM32 serial: add missing function declaration
bcostm Jan 30, 2018
3610f91
Enable libraries to have boot loader configuration
theotherjimmy Jan 23, 2018
c2d4e9b
Configure boot loader after scanning
theotherjimmy Jan 23, 2018
7d20c0a
Handle target overrides that have a path correctly
theotherjimmy Jan 23, 2018
f94e061
Check that boot loader config works in libs
theotherjimmy Jan 24, 2018
b5577bd
Move region adding to mbedToolchain
theotherjimmy Jan 25, 2018
e7d29c6
Force config resolution in gnuarmeclipse exporter
theotherjimmy Jan 30, 2018
0376483
Correct SW4STM32 supported check
theotherjimmy Jan 31, 2018
aa2cb58
VS Code exporter: do not overwrite existing (launch|settings|tasks).json
amq Jan 29, 2018
6a3c694
EFM32: make peripherals conditional * MCUs within a family like EFM32…
amq Jan 31, 2018
f9ec628
Added macro: 1. string length and 2. variable argument count
Jan 31, 2018
85d08b1
make _sbrk() WEAK so the user can override it, e.g. to make malloc() …
bmcdonnell-ionx Dec 6, 2017
43c6f5b
BL STM32746xG: Update scatter/link files
bcostm Dec 19, 2017
e8eb8bc
BL NUCLEO_F746ZG: enable bootloader
bcostm Dec 19, 2017
a795699
BL NUCLEO_F746ZG: change scb->vector assignment
bcostm Jan 8, 2018
846bd72
NUCLEO_F767ZI: Add bootloader support
bcostm Jan 10, 2018
11f629f
Check cache before enabling it
bcostm Jan 9, 2018
d6e5fac
STM32F7: move cache initialization
bcostm Jan 30, 2018
a52d755
STM32F7 SPI - add missing HAL files
jeromecoutant Feb 2, 2018
4df67ef
STM32 SPI ASYNC - Add FIFO flush before transfer
jeromecoutant Feb 5, 2018
b137307
NXP: Add support for MIMXRT1050_EVK
mmahadevan108 Dec 19, 2017
866b669
Add Kernel::get_ms_count
kjbracey Nov 2, 2017
029751d
Add ConditionVariable::wait_until
kjbracey Nov 10, 2017
436301d
Add Mutex::trylock_until and trylock_for
kjbracey Nov 10, 2017
f740ece
Add Semaphore::wait_until
kjbracey Nov 10, 2017
8f521a4
Add Thread::wait_until
kjbracey Nov 10, 2017
5784c8a
Correct ConditionVariable ISR comments
kjbracey Jan 18, 2018
5bdf231
lpc546xx and ff_lpc546xx: create parent object MCU_LPC546XX
Jan 17, 2018
82b6c51
ff_lpc546xx: move property to parent
Jan 18, 2018
76329a7
Adding MTB_MTS_XDOT as a new target
Jan 30, 2018
9ce49a8
Workaround for insufficient heap on IAR+MTB_xDOT_GT
geky Feb 1, 2018
c65cd6b
Added LED2 definition for compilation of tests
cmonr Feb 3, 2018
e54d069
Update uvisor-tests.txt to disable EFM32 in Jenkins
Feb 6, 2018
bec8d75
Add FileHandle tests
maciejbocianski Jan 22, 2018
ecdd776
ARM: ARMC6: Specify CPU for ARM scatter file preprocessor
hosse005 Jan 5, 2018
d8edb99
ARM: ARMC6: Fix for ARM linker script cpu formatting
hosse005 Jan 8, 2018
76ccfc8
ARM: ARMC6: Copy headers along with the updated linker scatter file
hosse005 Jan 10, 2018
4a4891c
ARM: ARMC6: Update scatter file shebang include directory
hosse005 Jan 12, 2018
51d424f
Use relative path to scatter for include path
theotherjimmy Jan 31, 2018
1b222ac
Use OUTPUT_EXT in managed boot loader
theotherjimmy Feb 2, 2018
de983ce
Don't bother padding hex files for managed bl
theotherjimmy Feb 2, 2018
a5cd64e
STM32L476/486: change SRAM config for IAR
bcostm Feb 2, 2018
955a077
fix #5985 CLion exporter results in cmake build directory, causes com…
thinkberg Feb 2, 2018
04dd95f
Add missing flash device feature to the K82F board
Feb 5, 2018
0dc3132
Test for region list sanity (sizes all >= 0)
theotherjimmy Feb 5, 2018
c6810a6
Correct auto-sizing last region in bl
theotherjimmy Feb 5, 2018
9690089
Add Transaction class unit test.
mprse Jan 24, 2018
3c5af68
Add MTB_ADV_WISE_1570 target
Feb 2, 2018
caaed4f
Add WISE-1570 external pin names
Feb 5, 2018
d942bb6
Fix TRNG function
TomoYamanaka Jan 30, 2018
82d1629
rename MURATA type ABZ & WISE_1510 to their expected name
ithinuel Feb 6, 2018
1c30207
-march not required if -mcpu is set
Feb 7, 2018
2c617c5
test-mbed_drivers-ticker: fix ticker cross attach
maciejbocianski Jan 29, 2018
14e48e5
test-mbed_drivers-ticker: improve two ticker test accuracy
maciejbocianski Jan 29, 2018
685d495
Move TARGET_DISCO_L072CZ_LRWAN1 folder
bcostm Feb 7, 2018
5d1e58c
Fix CThunk error on Cortex-M23
ccli8 Feb 7, 2018
b07cecb
Adding LAIRD_BL600 MTB
Feb 1, 2018
79a2b61
Added MTB aliases & default SPI
Feb 6, 2018
8d517f7
Update Mbed version block for patch release
adbridge Feb 9, 2018
b812918
Correct test `socket_sigio`
betzw Nov 21, 2017
27109be
Revert "Correct test `socket_sigio`"
adbridge Feb 12, 2018
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
  •  
  •  
  •  
105 changes: 38 additions & 67 deletions TESTS/mbed_drivers/ticker/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,50 +38,36 @@ volatile uint32_t multi_counter;
DigitalOut led1(LED1);
DigitalOut led2(LED2);

Ticker *volatile ticker1;
Ticker *volatile ticker2;
Timer gtimer;

volatile int ticker_count = 0;
volatile bool print_tick = false;

void ticker_callback_1_switch_to_2(void);
void ticker_callback_2_switch_to_1(void);

void increment_ticker_counter(void)
{
++callback_trigger_count;
}

void switch_led1_state(void)
{
led1 = !led1;
// blink 3 times per second
if((callback_trigger_count % 333) == 0) {
led1 = !led1;
}
}

void switch_led2_state(void)
{
led2 = !led2;
// blink 3 times per second
// make led2 blink at the same callback_trigger_count value as led1
if(((callback_trigger_count - 1) % 333) == 0) {
led2 = !led2;
}
}

void ticker_callback_1_switch_to_2(void)
void ticker_callback_1(void)
{
++callback_trigger_count;
// If ticker is NULL then it is being or has been deleted
if (ticker1) {
ticker1->detach();
ticker1->attach_us(ticker_callback_2_switch_to_1, ONE_MILLI_SEC);
}
switch_led1_state();
}

void ticker_callback_2_switch_to_1(void)
void ticker_callback_2(void)
{
++callback_trigger_count;
// If ticker is NULL then it is being or has been deleted
if (ticker2) {
ticker2->detach();
ticker2->attach_us(ticker_callback_1_switch_to_2, ONE_MILLI_SEC);
}
switch_led2_state();
}

Expand All @@ -106,9 +92,8 @@ void increment_multi_counter(void)

/* Tests is to measure the accuracy of Ticker over a period of time
*
* 1) DUT would start to update callback_trigger_count every milli sec, in 2x callback we use 2 tickers
* to update the count alternatively.
* 2) Host would query what is current count base_time, Device responds by the callback_trigger_count
* 1) DUT would start to update callback_trigger_count every milli sec
* 2) Host would query what is current count base_time, Device responds by the callback_trigger_count.
* 3) Host after waiting for measurement stretch. It will query for device time again final_time.
* 4) Host computes the drift considering base_time, final_time, transport delay and measurement stretch
* 5) Finally host send the results back to device pass/fail based on tolerance.
Expand All @@ -119,9 +104,14 @@ void test_case_1x_ticker()
char _key[11] = { };
char _value[128] = { };
int expected_key = 1;
Ticker ticker;

led1 = 1;
led2 = 1;
callback_trigger_count = 0;

greentea_send_kv("timing_drift_check_start", 0);
ticker1->attach_us(&increment_ticker_counter, ONE_MILLI_SEC);
ticker.attach_us(&ticker_callback_1, ONE_MILLI_SEC);

// wait for 1st signal from host
do {
Expand All @@ -140,18 +130,32 @@ void test_case_1x_ticker()
TEST_ASSERT_EQUAL_STRING_MESSAGE("pass", _key,"Host side script reported a fail...");
}

void test_case_2x_callbacks()
/* Tests is to measure the accuracy of Ticker over a period of time
*
* 1) DUT would start to update callback_trigger_count every milli sec, we use 2 tickers
* to update the count alternatively.
* 2) Host would query what is current count base_time, Device responds by the callback_trigger_count
* 3) Host after waiting for measurement stretch. It will query for device time again final_time.
* 4) Host computes the drift considering base_time, final_time, transport delay and measurement stretch
* 5) Finally host send the results back to device pass/fail based on tolerance.
* 6) More details on tests can be found in timing_drift_auto.py
*/
void test_case_2x_ticker()
{
char _key[11] = { };
char _value[128] = { };
int expected_key = 1;
Ticker ticker1, ticker2;

led1 = 0;
led2 = 0;
led2 = 1;
callback_trigger_count = 0;

ticker1.attach_us(ticker_callback_1, 2 * ONE_MILLI_SEC);
// delay second ticker to have a pair of tickers tick every one millisecond
wait_us(ONE_MILLI_SEC);
greentea_send_kv("timing_drift_check_start", 0);
ticker1->attach_us(ticker_callback_1_switch_to_2, ONE_MILLI_SEC);
ticker2.attach_us(ticker_callback_2, 2 * ONE_MILLI_SEC);

// wait for 1st signal from host
do {
Expand Down Expand Up @@ -303,39 +307,6 @@ void test_attach_us_time(void)
}


utest::v1::status_t one_ticker_case_setup_handler_t(const Case *const source, const size_t index_of_case)
{
ticker1 = new Ticker();
return greentea_case_setup_handler(source, index_of_case);
}

utest::v1::status_t two_ticker_case_setup_handler_t(const Case *const source, const size_t index_of_case)
{
ticker1 = new Ticker();
ticker2 = new Ticker();
return utest::v1::greentea_case_setup_handler(source, index_of_case);
}

utest::v1::status_t one_ticker_case_teardown_handler_t(const Case *const source, const size_t passed, const size_t failed, const utest::v1::failure_t reason)
{
Ticker *temp1 = ticker1;
ticker1 = NULL;
delete temp1;
return utest::v1::greentea_case_teardown_handler(source, passed, failed, reason);
}

utest::v1::status_t two_ticker_case_teardown_handler_t(const Case *const source, const size_t passed, const size_t failed, const utest::v1::failure_t reason)
{
Ticker *temp1 = ticker1;
Ticker *temp2 = ticker2;
ticker1 = NULL;
ticker2 = NULL;
delete temp1;
delete temp2;
return utest::v1::greentea_case_teardown_handler(source, passed, failed, reason);
}


// Test cases
Case cases[] = {
Case("Test attach for 0.01s and time measure", test_attach_time<10000>),
Expand All @@ -347,8 +318,8 @@ Case cases[] = {
Case("Test detach", test_detach),
Case("Test multi call and time measure", test_multi_call_time),
Case("Test multi ticker", test_multi_ticker),
Case("Test timers: 1x ticker", one_ticker_case_setup_handler_t,test_case_1x_ticker, one_ticker_case_teardown_handler_t),
Case("Test timers: 2x callbacks", two_ticker_case_setup_handler_t,test_case_2x_callbacks, two_ticker_case_teardown_handler_t)
Case("Test timers: 1x ticker", test_case_1x_ticker),
Case("Test timers: 2x ticker", test_case_2x_ticker)
};

utest::v1::status_t greentea_test_setup(const size_t number_of_cases)
Expand Down
145 changes: 145 additions & 0 deletions TESTS/mbed_platform/FileHandle/TestFile.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
/* mbed Microcontroller Library
* Copyright (c) 2018 ARM Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef MBED_TESTFILEHANDLE_H
#define MBED_TESTFILEHANDLE_H

#include "platform/FileHandle.h"


#define POS_IS_VALID(pos) (pos >= 0 && pos < _end)
#define NEW_POS_IS_VALID(pos) (pos >= 0 && pos < (int32_t)FILE_SIZE)
#define SEEK_POS_IS_VALID(pos) (pos >= 0 && pos <= _end)
#define INVALID_POS (-1)

template<uint32_t FILE_SIZE>
class TestFile : public FileHandle {
public:
TestFile(): _pos(0), _end(0) {}
~TestFile() {}

enum FunctionName {
fnNone, fnRead, fnWrite, fnSeek, fnClose, fnIsatty
};

virtual ssize_t read(void *buffer, size_t size)
{
ssize_t read;
_fnCalled = fnRead;

for(read = 0; (size_t)read < size; read++)
{
if(POS_IS_VALID(_pos)) {
((uint8_t*)buffer)[read] = _data[_pos++];
} else {
break;
}
} // for
return read;
}

virtual ssize_t write(const void *buffer, size_t size)
{
ssize_t written;
_fnCalled = fnWrite;

for(written = 0; (size_t)written < size; written++)
{
if(NEW_POS_IS_VALID(_pos)) {
_data[_pos++] = ((uint8_t*)buffer)[written];
} else {
if(0 == written) {
return -ENOSPC;
}
break;
}
if(_end < _pos) {
_end++;
}
} // for
return written;
}

virtual off_t seek(off_t offset, int whence)
{
_fnCalled = fnSeek;
int32_t new_pos = INVALID_POS;

switch(whence)
{
case SEEK_SET:
new_pos = offset;
break;

case SEEK_CUR:
new_pos = _pos + offset;
break;

case SEEK_END:
new_pos = _end - offset;
break;

default:
// nothing todo
break;
}

if(SEEK_POS_IS_VALID(new_pos)) {
_pos = new_pos;
} else {
return -EINVAL;
}

return _pos;
}

virtual int close()
{
_fnCalled = fnClose;
return 0;
}


static void resetFunctionCallHistory()
{
_fnCalled = fnNone;
}

static bool functionCalled(FunctionName name)
{
return (name == _fnCalled);
}

static FunctionName getFunctionCalled()
{
return _fnCalled;
}

private:

// stores last function call name
static FunctionName _fnCalled;

// file storage
uint8_t _data[FILE_SIZE];

int32_t _pos, _end;
};

template<uint32_t FILE_SIZE>
typename TestFile<FILE_SIZE>::FunctionName TestFile<FILE_SIZE>::_fnCalled;


#endif // MBED_TESTFILEHANDLE_H
Loading