Skip to content

Release candidate for mbed-os-5.5.4 #4824

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 104 commits into from
Aug 2, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
6607299
RTOS: Thread: Update docs; make singal_clr static as it's affects run…
bulislaw Jun 21, 2017
c6ebb10
RTOS: Thread: Fix return value for signal_wait
bulislaw Jun 21, 2017
8b3a6d6
RTOS: Thread: Fix how free stack is calculated
bulislaw Jun 21, 2017
ccc7578
RTOS: Thread: Update thread state docs
bulislaw Jun 22, 2017
36d28e8
RTOS: Thread: Rework and extend test suite
bulislaw Jun 21, 2017
5e23ff2
initial commit of xDot bootloader
chrissnow Jun 11, 2017
7e1ce93
added flash algorithm
chrissnow Jun 12, 2017
229e19f
VTOR bootloader aware Attempt to add flash API but not working properly
chrissnow Jun 15, 2017
4b4c70f
GCC_ARM VTOR fixed, doesnt fit in the bootloader region though..
chrissnow Jun 16, 2017
db5f679
clear additional flags on erase to prevent errors
chrissnow Jun 26, 2017
df77990
added missing FLASH_FLAG_OPTVERR
chrissnow Jun 26, 2017
9ee4ab4
Formatting tidy up.
chrissnow Jun 27, 2017
b5ce1d2
uArm Bootloader support
chrissnow Jun 27, 2017
adb6246
IAR Bootloader support
chrissnow Jun 27, 2017
a2852e7
GCC Bootloader support
chrissnow Jun 27, 2017
8c3a5fd
Incorrect comments removed.
chrissnow Jun 28, 2017
c8b0692
Code tidy
chrissnow Jun 30, 2017
9012461
Tidy from rebase
chrissnow Jun 30, 2017
5c74203
Fixing the problem where the CAN is initialized to the wrong frequenc…
Jun 28, 2017
b9a4ae2
STM32 Fuly disable GPIO irq settings
LMESTM Jun 30, 2017
f939edc
STM32: Raise error in case of spurious interrupt
LMESTM Jun 30, 2017
7384257
STM32: Store and restore rising falling config of gpio_irq
LMESTM Jun 30, 2017
933d7b5
Fix alignement
LMESTM Jul 7, 2017
05f5147
Test: RTOS: Semaphore: Rework tests
bulislaw Jun 27, 2017
ec3e8c6
RTOS: Semaphore: Improve API docs
bulislaw Jul 11, 2017
1015105
STM: cleanup mbed_rtx.h file
bcostm Jul 3, 2017
8678209
Enable greentea testing on CM3DS_MPS2 target
matetothpal Jul 4, 2017
294beb1
Prevent double define in very old builds
theotherjimmy Jul 10, 2017
72d812d
Toolchain: Added a note about weak functions and header files
geky Jul 6, 2017
f7ad960
Correct DAC pin assignment
theotherjimmy Jul 10, 2017
5c4178e
UBLOX_C030: correct UART 3 Tx & Rx pins (they were the wrong way arou…
RobMeades Jul 8, 2017
c66763c
Unsupported RTC delete rtc_api.c -> PWM3 pin enable
Jul 12, 2017
11c3453
Remove redundant ODIN-W2 target folder
Jul 12, 2017
7498284
BLE/HRS: Fix #4661
Nodraak Jun 28, 2017
2939ce0
BLE/GattCharacteristic: Add explanatory note for a parameter
Nodraak Jul 4, 2017
2bf0882
STM32F0 : json clock source configuration
jeromecoutant Jul 7, 2017
93e1678
STM32F1 : json clock source configuration
jeromecoutant Jul 10, 2017
f3ce275
STM32F2 : json clock source configuration
jeromecoutant Jul 10, 2017
9a41fd7
STM32F3 : json clock source configuration
jeromecoutant Jul 10, 2017
c659a0d
STM32F7 : json clock source configuration
jeromecoutant Jul 10, 2017
36431bd
STM32L0 : json clock source configuration
jeromecoutant Jul 10, 2017
254fb39
STM32L1 : json clock source configuration
jeromecoutant Jul 11, 2017
605562f
STM32L4 : json clock source configuration
jeromecoutant Jul 11, 2017
7435b34
Add mbed support for LPCXpresso54114 board
mmahadevan108 Dec 15, 2016
ef33371
Add support for LPC54608
mmahadevan108 Jun 6, 2017
fb97d8b
LPC: Move platform specific code out of sleep api file
mmahadevan108 May 12, 2017
5b85962
LPC: Move platform specific code out of the analog api file
mmahadevan108 May 12, 2017
b86fc42
MAX32630: Map UART IRQ to serial object.
pan- Jul 3, 2017
c870fc1
MAX32630: clear uart interrupt flag prior to handler call.
pan- Jul 3, 2017
3c8fbbe
MAX32630: Apply correct configuration for CTS/RTS lines.
pan- Jul 3, 2017
acf411c
Max32630 UART: Fix P5_5 mapping.
pan- Jul 11, 2017
2a8bae3
Add set_baud() method to UARTSerial().
RobMeades Jun 22, 2017
0501f99
Fix inconsistent mbed-trace dummy defines and original function decla…
Jul 5, 2017
147ec27
REALTEK_RTL8195AM: FlashIAP read and address scope
Jul 6, 2017
8697d92
STM32: Remove i2c_read() and i2c_write() redirects to HAL_I2C_IsDevic…
bscott-zebra Jul 5, 2017
eb00f46
Update ATCmdParser example code.
sarahmarshy Jul 7, 2017
2aa9816
Boot: Provide dynamic mutexes for ARM toolchain
bulislaw Jul 10, 2017
6031889
STM32: Serial - do no clear RXNE flag
LMESTM Jul 10, 2017
5c65268
STM32: Serial - use TXE as tx_irq instead of TC
LMESTM Jul 10, 2017
fa193fc
Resolve TLS handshake failing issue
Archcady Jul 13, 2017
8e989b0
Fix #4613: remove duplicated startup files for MICRONFCBOARD
0xc0170 Jul 13, 2017
70c5407
STM32L4 AnalogIn init issue with _ALT pins
jeromecoutant Jul 17, 2017
7f9f279
DISCO_L475VG_IOT: remove unavailable pins
jeromecoutant Jul 17, 2017
a846199
STM32F0 : remove unavailable pins
jeromecoutant Jul 17, 2017
be1d14c
Add support for runtime test specification
c1728p9 Jul 3, 2017
e530d12
Fix non-portable defines
c1728p9 Jul 4, 2017
a1810d4
Add AES HW encryption for NUCLEO_F756ZG in mbedtls
adustm Mar 7, 2017
2d259e0
fix typo in directory name
adustm Mar 16, 2017
b4e83da
Change 'macros' to 'macros_add' for NUCLEO_F756ZG
c1728p9 Jul 19, 2017
d1983e2
mbed-hal: Fixed flash test
Jul 19, 2017
653b0e9
STM32 I2C : correct async issue
jeromecoutant Jul 19, 2017
82176e1
NUCLEO_F767ZI : boot issue with GCC
jeromecoutant Jul 21, 2017
18e17ff
REALTEK_RTL8195AM: Expose SystemCoreClock via cmsis.h
bulislaw Jul 5, 2017
5d2c5ff
sara_nbiot_evk: Expose SystemCoreClock via cmsis.h
bulislaw Jul 5, 2017
66c9f44
Allow user to set dummy tranfer byte for block read
Jul 11, 2017
84d14ee
Closed review comments
Jul 11, 2017
5832307
LPC MCUXpresso: fix write_fill argument for block write function
0xc0170 Jul 25, 2017
7af22d0
Remove unusable exporters
theotherjimmy Jul 11, 2017
ccc2105
Create deprecated exporter class decorator
theotherjimmy Jul 11, 2017
66fa34c
Deprecate Atmel Studio
theotherjimmy Jul 11, 2017
4407b00
Deprecate Coide
theotherjimmy Jul 11, 2017
cc53dd7
Deprecate e2studio
theotherjimmy Jul 11, 2017
423959d
Deprecate KDS
theotherjimmy Jul 11, 2017
f671023
Deprecate LPCXpresso
theotherjimmy Jul 11, 2017
1f58726
Deprecate Simplicity Version 3
theotherjimmy Jul 11, 2017
623c7ae
RTOS: Mutex: Rework tests
bulislaw Jul 10, 2017
efc28a2
RTOS: Mutex: Improve API docs
bulislaw Jul 11, 2017
2813d8d
Squashed 'features/FEATURE_COMMON_PAL/nanostack-libservice/' changes …
kjbracey Jul 6, 2017
d7f3820
ONME-3113: Fix GCC_ARM and ARM compiler warnings from mbed-mesh-api
KariHaapalehto Jun 30, 2017
f148046
Change HSE for blupill,can only be XTAL
LordGuilly Jul 24, 2017
68607e2
Add support for the VBLUno52 board
iotmember Jul 22, 2017
d16ea8c
Improve documentation for memory stat ops
bulislaw Jul 20, 2017
a5148ec
Fix infinite calling loop
Nodraak Jul 24, 2017
f0b3506
Copy static files only
johanstokking Jul 24, 2017
f16c4d0
Copy static files also when zipping
johanstokking Jul 24, 2017
4e5a68e
ZIP export static files
johanstokking Jul 25, 2017
035ed58
Use immutable tuple instead of mutable list
johanstokking Jul 25, 2017
200b4e3
Updated MBED versionning block for patch release
0xc0170 Jul 28, 2017
8ff0c39
uVisor: importer: Copy uvisor-tests pointer
Patater Jun 27, 2017
3e55bdc
uVisor: Import v0.29.0
Patater Jul 13, 2017
a0b2743
Travis: fix install phase - not use sudo
0xc0170 Jul 29, 2017
1792f02
Collect ignores from scan resources and use in exporetrs
theotherjimmy Jul 19, 2017
abe3553
Correct supported check in exporter tests
theotherjimmy Jul 31, 2017
c511e96
Add missing collect_include passing
theotherjimmy Aug 1, 2017
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
  •  
  •  
  •  
10 changes: 5 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ before_install:
- python --version
- doxygen --version
install:
- sudo pip install -r requirements.txt
- sudo pip install pytest
- sudo pip install pylint
- sudo pip install hypothesis
- sudo pip install mock
- pip install -r requirements.txt
- pip install pytest
- pip install pylint
- pip install hypothesis
- pip install mock
16 changes: 13 additions & 3 deletions TESTS/mbed_hal/flash/functional_tests/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ void flash_mapping_alignment_test()
TEST_ASSERT_EQUAL(0, sector_start % sector_size);
// All address in a sector must return the same sector size
TEST_ASSERT_EQUAL(sector_size, end_sector_size);

}

// Make sure unmapped flash is reported correctly
Expand Down Expand Up @@ -185,6 +184,7 @@ void flash_program_page_test()

uint32_t test_size = flash_get_page_size(&test_flash);
uint8_t *data = new uint8_t[test_size];
uint8_t *data_flashed = new uint8_t[test_size];
for (uint32_t i = 0; i < test_size; i++) {
data[i] = 0xCE;
}
Expand All @@ -199,7 +199,9 @@ void flash_program_page_test()

ret = flash_program_page(&test_flash, address, data, test_size);
TEST_ASSERT_EQUAL_INT32(0, ret);
uint8_t *data_flashed = (uint8_t *)address;

ret = flash_read(&test_flash, address, data_flashed, test_size);
TEST_ASSERT_EQUAL_INT32(0, ret);
TEST_ASSERT_EQUAL_UINT8_ARRAY(data, data_flashed, test_size);

// sector size might not be same as page size
Expand All @@ -213,11 +215,15 @@ void flash_program_page_test()
}
ret = flash_program_page(&test_flash, address, data, test_size);
TEST_ASSERT_EQUAL_INT32(0, ret);

ret = flash_read(&test_flash, address, data_flashed, test_size);
TEST_ASSERT_EQUAL_INT32(0, ret);
TEST_ASSERT_EQUAL_UINT8_ARRAY(data, data_flashed, test_size);

ret = flash_free(&test_flash);
TEST_ASSERT_EQUAL_INT32(0, ret);
delete[] data;
delete[] data_flashed;
}

// make sure programming works with an unaligned data buffer
Expand All @@ -230,6 +236,7 @@ void flash_buffer_alignment_test()
const uint32_t page_size = flash_get_page_size(&test_flash);
const uint32_t buf_size = page_size + 4;
uint8_t *data = new uint8_t[buf_size];
uint8_t *data_flashed = new uint8_t[buf_size];
for (uint32_t i = 0; i < buf_size; i++) {
data[i] = i & 0xFF;
}
Expand All @@ -245,13 +252,16 @@ void flash_buffer_alignment_test()
const uint32_t addr = test_addr + i * page_size;
ret = flash_program_page(&test_flash, addr, data + i, page_size);
TEST_ASSERT_EQUAL_INT32(0, ret);
uint8_t *data_flashed = (uint8_t *)addr;

ret = flash_read(&test_flash, addr, data_flashed, page_size);
TEST_ASSERT_EQUAL_INT32(0, ret);
TEST_ASSERT_EQUAL_UINT8_ARRAY(data + i, data_flashed, page_size);
}

ret = flash_free(&test_flash);
TEST_ASSERT_EQUAL_INT32(0, ret);
delete[] data;
delete[] data_flashed;
}

// check the execution speed at the start and end of the test to make sure
Expand Down
159 changes: 115 additions & 44 deletions TESTS/mbedmicro-rtos-mbed/mutex/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,51 +12,62 @@ using namespace utest::v1;

#define TEST_STACK_SIZE 512

#define TEST_ONE_SEC_MS (1000)
#define TEST_HALF_SEC_MS (500)
#define TEST_HALF_SEC_US (500000)
#define TEST_ONE_MS_US (1000)

#define THREAD_DELAY 50
#define SIGNALS_TO_EMIT 100
#define TEST_LONG_DELAY 20
#define TEST_DELAY 10
#define SIGNALS_TO_EMIT 100

Mutex stdio_mutex;

volatile int change_counter = 0;
volatile bool changing_counter = false;
volatile bool mutex_defect = false;

bool manipulate_protected_zone(const int thread_delay) {
bool manipulate_protected_zone(const int thread_delay)
{
bool result = true;

osStatus stat = stdio_mutex.lock();
TEST_ASSERT_EQUAL(stat, osOK);
TEST_ASSERT_EQUAL(osOK, stat);

core_util_critical_section_enter();
if (changing_counter == true) {
result = false;
mutex_defect = true;
}
changing_counter = true;

change_counter++;
core_util_critical_section_exit();

Thread::wait(thread_delay);

core_util_critical_section_enter();
changing_counter = false;
core_util_critical_section_exit();

stat = stdio_mutex.unlock();
TEST_ASSERT_EQUAL(stat, osOK);
TEST_ASSERT_EQUAL(osOK, stat);
return result;
}

void test_thread(int const *thread_delay) {
void test_thread(int const *thread_delay)
{
while (true) {
manipulate_protected_zone(*thread_delay);
}
}

/** Test multiple thread

Given 3 threads started with different delays and a section protected with a mutex
when each thread runs it tries to lock the mutex
then no more than one thread should be able to access protected region
*/
void test_multiple_threads(void)
{
const int t1_delay = THREAD_DELAY * 1;
const int t2_delay = THREAD_DELAY * 2;
const int t3_delay = THREAD_DELAY * 3;
const int t1_delay = TEST_DELAY * 1;
const int t2_delay = TEST_DELAY * 2;
const int t3_delay = TEST_DELAY * 3;

Thread t2(osPriorityNormal, TEST_STACK_SIZE);
Thread t3(osPriorityNormal, TEST_STACK_SIZE);
Expand All @@ -69,34 +80,51 @@ void test_multiple_threads(void)
Thread::wait(t1_delay);
manipulate_protected_zone(t1_delay);

core_util_critical_section_enter();
if (change_counter >= SIGNALS_TO_EMIT or mutex_defect == true) {
core_util_critical_section_exit();
t2.terminate();
t3.terminate();
break;
}
core_util_critical_section_exit();
}

TEST_ASSERT_EQUAL(mutex_defect, false);
TEST_ASSERT_EQUAL(false, mutex_defect);
}

void test_dual_thread_nolock_lock_thread(Mutex *mutex)
{
bool stat_b = mutex->trylock();
TEST_ASSERT_EQUAL(stat_b, true);
osStatus stat = mutex->lock(osWaitForever);
TEST_ASSERT_EQUAL(osOK, stat);

osStatus stat = mutex->unlock();
TEST_ASSERT_EQUAL(stat, osOK);
stat = mutex->unlock();
TEST_ASSERT_EQUAL(osOK, stat);
}

void test_dual_thread_nolock_trylock_thread(Mutex *mutex)
{
bool stat_b = mutex->trylock();
TEST_ASSERT_EQUAL(stat_b, true);
TEST_ASSERT_EQUAL(true, stat_b);

osStatus stat = mutex->unlock();
TEST_ASSERT_EQUAL(stat, osOK);
TEST_ASSERT_EQUAL(osOK, stat);
}

/** Test dual thread no-lock

Test dual thread second thread lock
Given two threads A & B and a mutex
When thread A creates a mutex and starts thread B
and thread B calls @a lock and @a unlock
Then returned statuses are osOK

Test dual thread second thread trylock
Given two threads A & B and a mutex
When thread A creates a mutex and starts thread B
and thread B calls @a trylock and @a unlock
Then returned statuses are true and osOK
*/
template <void (*F)(Mutex *)>
void test_dual_thread_nolock(void)
{
Expand All @@ -105,47 +133,70 @@ void test_dual_thread_nolock(void)

thread.start(callback(F, &mutex));

wait_us(TEST_HALF_SEC_MS);
wait_ms(TEST_DELAY);
}

void test_dual_thread_lock_unlock_thread(Mutex *mutex)
{
osStatus stat = mutex->lock(osWaitForever);
TEST_ASSERT_EQUAL(stat, osOK);
TEST_ASSERT_EQUAL(osOK, stat);
}

/** Test dual thread lock unlock

Given two threads and a lock
When thread A locks the lock and starts thread B
and thread B calls @a lock on the mutex
Then thread B waits for thread A to unlock the lock
When thread A calls @a unlock on the mutex
Then thread B acquires the lock
*/
void test_dual_thread_lock_unlock(void)
{
Mutex mutex;
osStatus stat;
Thread thread(osPriorityNormal, TEST_STACK_SIZE);

stat = mutex.lock();
TEST_ASSERT_EQUAL(stat, osOK);
TEST_ASSERT_EQUAL(osOK, stat);

thread.start(callback(test_dual_thread_lock_unlock_thread, &mutex));

stat = mutex.unlock();
TEST_ASSERT_EQUAL(stat, osOK);
TEST_ASSERT_EQUAL(osOK, stat);

wait_us(TEST_HALF_SEC_MS);
wait_ms(TEST_DELAY);
}

void test_dual_thread_lock_trylock_thread(Mutex *mutex)
{
bool stat = mutex->trylock();
TEST_ASSERT_EQUAL(stat, false);
TEST_ASSERT_EQUAL(false, stat);
}

void test_dual_thread_lock_lock_thread(Mutex *mutex)
{
uint32_t start = us_ticker_read();

osStatus stat = mutex->lock(TEST_HALF_SEC_MS);
TEST_ASSERT_EQUAL(stat, osErrorTimeout);
TEST_ASSERT_UINT32_WITHIN(TEST_ONE_MS_US, TEST_HALF_SEC_US, us_ticker_read() - start);
osStatus stat = mutex->lock(TEST_DELAY);
TEST_ASSERT_EQUAL(osErrorTimeout, stat);
TEST_ASSERT_UINT32_WITHIN(5000, TEST_DELAY*1000, us_ticker_read() - start);
}

/** Test dual thread lock

Test dual thread lock locked
Given a mutex and two threads A & B
When thread A calls @a lock and starts thread B
and thread B calls @a lock with 500ms timeout
Then thread B waits 500ms and timeouts

Test dual thread trylock locked
Given a mutex and two threads A & B
When thread A calls @a lock and starts thread B
Then thread B calls @a trylock
and thread B fails to acquire the lock
*/
template <void (*F)(Mutex *)>
void test_dual_thread_lock(void)
{
Expand All @@ -154,59 +205,78 @@ void test_dual_thread_lock(void)
Thread thread(osPriorityNormal, TEST_STACK_SIZE);

stat = mutex.lock();
TEST_ASSERT_EQUAL(stat, osOK);
TEST_ASSERT_EQUAL(osOK, stat);

thread.start(callback(F, &mutex));

wait_us(TEST_ONE_SEC_MS);
wait_ms(TEST_LONG_DELAY);

stat = mutex.unlock();
TEST_ASSERT_EQUAL(stat, osOK);
TEST_ASSERT_EQUAL(osOK, stat);
}

/** Test single thread lock recursive

Given a mutex and a single running thread
When thread calls @a lock twice and @a unlock twice on the mutex
Then the returned statuses are osOK
*/
void test_single_thread_lock_recursive(void)
{
Mutex mutex;
osStatus stat;

stat = mutex.lock();
TEST_ASSERT_EQUAL(stat, osOK);
TEST_ASSERT_EQUAL(osOK, stat);

stat = mutex.lock();
TEST_ASSERT_EQUAL(stat, osOK);
TEST_ASSERT_EQUAL(osOK, stat);

stat = mutex.unlock();
TEST_ASSERT_EQUAL(stat, osOK);
TEST_ASSERT_EQUAL(osOK, stat);

stat = mutex.unlock();
TEST_ASSERT_EQUAL(stat, osOK);
TEST_ASSERT_EQUAL(osOK, stat);
}

/** Test single thread trylock

Given a mutex and a single running thread
When thread calls @a trylock and @a unlock on the mutex
Then the returned statuses are osOK
*/
void test_single_thread_trylock(void)
{
Mutex mutex;

bool stat_b = mutex.trylock();
TEST_ASSERT_EQUAL(stat_b, true);
TEST_ASSERT_EQUAL(true, stat_b);

osStatus stat = mutex.unlock();
TEST_ASSERT_EQUAL(stat, osOK);
TEST_ASSERT_EQUAL(osOK, stat);
}

/** Test single thread lock

Given a mutex and a single running thread
When thread calls @a lock and @a unlock on the mutex
Then the returned statuses are osOK
*/
void test_single_thread_lock(void)
{
Mutex mutex;
osStatus stat;

stat = mutex.lock();
TEST_ASSERT_EQUAL(stat, osOK);
TEST_ASSERT_EQUAL(osOK, stat);

stat = mutex.unlock();
TEST_ASSERT_EQUAL(stat, osOK);
TEST_ASSERT_EQUAL(osOK, stat);
}

utest::v1::status_t test_setup(const size_t number_of_cases) {
GREENTEA_SETUP(15, "default_auto");
utest::v1::status_t test_setup(const size_t number_of_cases)
{
GREENTEA_SETUP(10, "default_auto");
return verbose_test_setup_handler(number_of_cases);
}

Expand All @@ -224,6 +294,7 @@ Case cases[] = {

Specification specification(test_setup, cases);

int main() {
int main()
{
return !Harness::run(specification);
}
Loading