Skip to content

Commit 39a459f

Browse files
committed
Port RTOS tests to nrf51.
Provide fixed stack stize for nrf51 targets. Disable memory allocation for stdout otherwise tests fail on mkit target.
1 parent c0a6c7c commit 39a459f

File tree

8 files changed

+38
-8
lines changed

8 files changed

+38
-8
lines changed

libraries/tests/rtos/mbed/basic/main.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
#define STACK_SIZE DEFAULT_STACK_SIZE/2
1414
#elif (defined(TARGET_STM32F030R8)) && defined(TOOLCHAIN_IAR)
1515
#define STACK_SIZE DEFAULT_STACK_SIZE/2
16+
#elif defined(TARGET_MCU_NRF51822)
17+
#define STACK_SIZE 512
1618
#else
1719
#define STACK_SIZE DEFAULT_STACK_SIZE
1820
#endif
@@ -34,6 +36,8 @@ void led2_thread(void const *argument) {
3436
}
3537

3638
int main() {
39+
setbuf(stdout, NULL);
40+
3741
MBED_HOSTTEST_TIMEOUT(15);
3842
MBED_HOSTTEST_SELECT(wait_us_auto);
3943
MBED_HOSTTEST_DESCRIPTION(Basic thread);

libraries/tests/rtos/mbed/isr/main.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
#define STACK_SIZE DEFAULT_STACK_SIZE/4
1717
#elif (defined(TARGET_STM32F030R8)) && defined(TOOLCHAIN_IAR)
1818
#define STACK_SIZE DEFAULT_STACK_SIZE/2
19+
#elif defined(TARGET_MCU_NRF51822)
20+
#define STACK_SIZE 512
1921
#else
2022
#define STACK_SIZE DEFAULT_STACK_SIZE
2123
#endif
@@ -38,6 +40,8 @@ void queue_thread(void const *argument) {
3840
}
3941

4042
int main (void) {
43+
setbuf(stdout, NULL);
44+
4145
MBED_HOSTTEST_TIMEOUT(20);
4246
MBED_HOSTTEST_SELECT(default_auto);
4347
MBED_HOSTTEST_DESCRIPTION(ISR (Queue));

libraries/tests/rtos/mbed/mail/main.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ typedef struct {
2424
#define STACK_SIZE DEFAULT_STACK_SIZE/2
2525
#elif (defined(TARGET_STM32F030R8)) && defined(TOOLCHAIN_IAR)
2626
#define STACK_SIZE DEFAULT_STACK_SIZE/2
27+
#elif defined(TARGET_MCU_NRF51822)
28+
#define STACK_SIZE 512
2729
#else
2830
#define STACK_SIZE DEFAULT_STACK_SIZE
2931
#endif
@@ -44,6 +46,8 @@ void send_thread (void const *argument) {
4446
}
4547

4648
int main (void) {
49+
setbuf(stdout, NULL);
50+
4751
MBED_HOSTTEST_TIMEOUT(20);
4852
MBED_HOSTTEST_SELECT(default_auto);
4953
MBED_HOSTTEST_DESCRIPTION(Mail messaging);

libraries/tests/rtos/mbed/mutex/main.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,17 @@
1717
#elif defined(TARGET_STM32F334R8) && defined(TOOLCHAIN_IAR)
1818
#define STACK_SIZE DEFAULT_STACK_SIZE/4
1919
#elif defined(TARGET_STM32F030R8) && defined(TOOLCHAIN_IAR)
20-
#define STACK_SIZE DEFAULT_STACK_SIZE/4
20+
#define STACK_SIZE DEFAULT_STACK_SIZE/4
2121
#elif defined(TARGET_STM32F070RB) && defined(TOOLCHAIN_IAR)
22-
#define STACK_SIZE DEFAULT_STACK_SIZE/2
22+
#define STACK_SIZE DEFAULT_STACK_SIZE/2
2323
#elif defined(TARGET_STM32F072RB) && defined(TOOLCHAIN_IAR)
24-
#define STACK_SIZE DEFAULT_STACK_SIZE/2
24+
#define STACK_SIZE DEFAULT_STACK_SIZE/2
2525
#elif defined(TARGET_STM32F302R8) && defined(TOOLCHAIN_IAR)
26-
#define STACK_SIZE DEFAULT_STACK_SIZE/2
26+
#define STACK_SIZE DEFAULT_STACK_SIZE/2
2727
#elif defined(TARGET_STM32F303K8) && defined(TOOLCHAIN_IAR)
2828
#define STACK_SIZE DEFAULT_STACK_SIZE/2
29+
#elif defined(TARGET_MCU_NRF51822)
30+
#define STACK_SIZE 512
2931
#else
3032
#define STACK_SIZE DEFAULT_STACK_SIZE
3133
#endif
@@ -73,6 +75,8 @@ void test_thread(void const *args) {
7375
}
7476

7577
int main() {
78+
setbuf(stdout, NULL);
79+
7680
MBED_HOSTTEST_TIMEOUT(20);
7781
MBED_HOSTTEST_SELECT(default);
7882
MBED_HOSTTEST_DESCRIPTION(Mutex resource lock);

libraries/tests/rtos/mbed/queue/main.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ typedef struct {
2424
#define STACK_SIZE DEFAULT_STACK_SIZE/4
2525
#elif (defined(TARGET_STM32F030R8)) && defined(TOOLCHAIN_IAR)
2626
#define STACK_SIZE DEFAULT_STACK_SIZE/2
27+
#elif defined(TARGET_MCU_NRF51822)
28+
#define STACK_SIZE 512
2729
#else
2830
#define STACK_SIZE DEFAULT_STACK_SIZE
2931
#endif
@@ -46,6 +48,8 @@ void send_thread (void const *argument) {
4648
}
4749

4850
int main (void) {
51+
setbuf(stdout, NULL);
52+
4953
MBED_HOSTTEST_TIMEOUT(20);
5054
MBED_HOSTTEST_SELECT(default_auto);
5155
MBED_HOSTTEST_DESCRIPTION(Queue messaging);

libraries/tests/rtos/mbed/semaphore/main.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,17 @@
2020
#elif defined(TARGET_STM32F103RB) && defined(TOOLCHAIN_IAR)
2121
#define STACK_SIZE DEFAULT_STACK_SIZE/4
2222
#elif defined(TARGET_STM32F030R8) && defined(TOOLCHAIN_IAR)
23-
#define STACK_SIZE DEFAULT_STACK_SIZE/4
23+
#define STACK_SIZE DEFAULT_STACK_SIZE/4
2424
#elif defined(TARGET_STM32F070RB) && defined(TOOLCHAIN_IAR)
25-
#define STACK_SIZE DEFAULT_STACK_SIZE/2
25+
#define STACK_SIZE DEFAULT_STACK_SIZE/2
2626
#elif defined(TARGET_STM32F072RB) && defined(TOOLCHAIN_IAR)
27-
#define STACK_SIZE DEFAULT_STACK_SIZE/2
27+
#define STACK_SIZE DEFAULT_STACK_SIZE/2
2828
#elif defined(TARGET_STM32F302R8) && defined(TOOLCHAIN_IAR)
29-
#define STACK_SIZE DEFAULT_STACK_SIZE/2
29+
#define STACK_SIZE DEFAULT_STACK_SIZE/2
3030
#elif defined(TARGET_STM32F303K8) && defined(TOOLCHAIN_IAR)
3131
#define STACK_SIZE DEFAULT_STACK_SIZE/4
32+
#elif defined(TARGET_MCU_NRF51822)
33+
#define STACK_SIZE 512
3234
#else
3335
#define STACK_SIZE DEFAULT_STACK_SIZE
3436
#endif
@@ -64,6 +66,8 @@ void test_thread(void const *delay) {
6466
}
6567

6668
int main (void) {
69+
setbuf(stdout, NULL);
70+
6771
MBED_HOSTTEST_TIMEOUT(20);
6872
MBED_HOSTTEST_SELECT(default_auto);
6973
MBED_HOSTTEST_DESCRIPTION(Semaphore resource lock);

libraries/tests/rtos/mbed/signals/main.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
#define STACK_SIZE DEFAULT_STACK_SIZE/4
1616
#elif (defined(TARGET_STM32F030R8)) && defined(TOOLCHAIN_IAR)
1717
#define STACK_SIZE DEFAULT_STACK_SIZE/2
18+
#elif defined(TARGET_MCU_NRF51822)
19+
#define STACK_SIZE 512
1820
#else
1921
#define STACK_SIZE DEFAULT_STACK_SIZE
2022
#endif
@@ -32,6 +34,8 @@ void led_thread(void const *argument) {
3234
}
3335

3436
int main (void) {
37+
setbuf(stdout, NULL);
38+
3539
MBED_HOSTTEST_TIMEOUT(20);
3640
MBED_HOSTTEST_SELECT(default_auto);
3741
MBED_HOSTTEST_DESCRIPTION(Signals messaging);

libraries/tests/rtos/mbed/timer/main.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ void blink(void const *n) {
2323
}
2424

2525
int main(void) {
26+
setbuf(stdout, NULL);
27+
2628
MBED_HOSTTEST_TIMEOUT(15);
2729
MBED_HOSTTEST_SELECT(wait_us_auto);
2830
MBED_HOSTTEST_DESCRIPTION(Timer);

0 commit comments

Comments
 (0)