Skip to content

Commit 485bdee

Browse files
author
Cruz Monrreal
authored
Merge pull request #7631 from ARMmbed/release-candidate
Release candidate for mbed-os-5.9.4
2 parents 50bd61a + 6974f23 commit 485bdee

File tree

414 files changed

+416073
-502
lines changed

Some content is hidden

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

414 files changed

+416073
-502
lines changed

LICENSE-BSD-3-Clause

Lines changed: 0 additions & 25 deletions
This file was deleted.

TESTS/mbed_hal/common_tickers/main.cpp

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@
2929
#define TICKER_INT_VAL 500
3030
#define TICKER_DELTA 10
3131

32-
#define LP_TICKER_OVERFLOW_DELTA 0 // this will allow to detect that ticker counter rollovers to 0
33-
#define US_TICKER_OVERFLOW_DELTA 50
32+
#define LP_TICKER_OVERFLOW_DELTA1 0 // this will allow to detect that ticker counter rollovers to 0
33+
#define LP_TICKER_OVERFLOW_DELTA2 0
34+
#define US_TICKER_OVERFLOW_DELTA1 50
35+
#define US_TICKER_OVERFLOW_DELTA2 60
3436

3537
#define TICKER_100_TICKS 100
3638

@@ -48,7 +50,18 @@ using namespace utest::v1;
4850
volatile int intFlag = 0;
4951
const ticker_interface_t* intf;
5052
ticker_irq_handler_type prev_irq_handler;
51-
unsigned int ticker_overflow_delta;
53+
/* Some targets might fail overflow test uncertainly due to getting trapped in busy
54+
* intf->read() loop. In the loop, some ticker values wouldn't get caught in time
55+
* because of:
56+
* 1. Lower CPU clock
57+
* 2. Compiled code with worse performance
58+
* 3. Interrupt at that time
59+
*
60+
* We fix it by checking small ticker value range rather than one exact ticker point
61+
* in near overflow check.
62+
*/
63+
unsigned int ticker_overflow_delta1;
64+
unsigned int ticker_overflow_delta2;
5265

5366
/* Auxiliary function to count ticker ticks elapsed during execution of N cycles of empty while loop.
5467
* Parameter <step> is used to disable compiler optimisation. */
@@ -293,12 +306,13 @@ void ticker_overflow_test(void)
293306
intFlag = 0;
294307

295308
/* Wait for max count. */
296-
while (intf->read() != (max_count - ticker_overflow_delta)) {
309+
while (intf->read() >= (max_count - ticker_overflow_delta2) &&
310+
intf->read() <= (max_count - ticker_overflow_delta1)) {
297311
/* Just wait. */
298312
}
299313

300314
/* Now we are near/at the overflow point. Detect rollover. */
301-
while (intf->read() > ticker_overflow_delta);
315+
while (intf->read() > ticker_overflow_delta1);
302316

303317
const uint32_t after_overflow = intf->read();
304318

@@ -310,7 +324,7 @@ void ticker_overflow_test(void)
310324
const uint32_t next_after_overflow = intf->read();
311325

312326
/* Check that after the overflow ticker continue count. */
313-
TEST_ASSERT(after_overflow <= ticker_overflow_delta);
327+
TEST_ASSERT(after_overflow <= ticker_overflow_delta1);
314328
TEST_ASSERT(next_after_overflow >= TICKER_100_TICKS);
315329
TEST_ASSERT_EQUAL(0, intFlag);
316330

@@ -465,7 +479,8 @@ utest::v1::status_t us_ticker_setup(const Case *const source, const size_t index
465479

466480
prev_irq_handler = set_us_ticker_irq_handler(ticker_event_handler_stub);
467481

468-
ticker_overflow_delta = US_TICKER_OVERFLOW_DELTA;
482+
ticker_overflow_delta1 = US_TICKER_OVERFLOW_DELTA1;
483+
ticker_overflow_delta2 = US_TICKER_OVERFLOW_DELTA2;
469484

470485
return greentea_case_setup_handler(source, index_of_case);
471486
}
@@ -493,7 +508,8 @@ utest::v1::status_t lp_ticker_setup(const Case *const source, const size_t index
493508

494509
prev_irq_handler = set_lp_ticker_irq_handler(ticker_event_handler_stub);
495510

496-
ticker_overflow_delta = LP_TICKER_OVERFLOW_DELTA;
511+
ticker_overflow_delta1 = LP_TICKER_OVERFLOW_DELTA1;
512+
ticker_overflow_delta2 = LP_TICKER_OVERFLOW_DELTA2;
497513

498514
return greentea_case_setup_handler(source, index_of_case);
499515
}

TESTS/mbedmicro-rtos-mbed/basic/main.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@
2929

3030
using utest::v1::Case;
3131

32+
#if defined(__CORTEX_M23) || defined(__CORTEX_M33)
33+
#define TEST_STACK_SIZE 512
34+
#else
3235
#define TEST_STACK_SIZE 256
36+
#endif
3337
#define ONE_MILLI_SEC 1000
3438

3539
volatile uint32_t elapsed_time_ms = 0;

TESTS/mbedmicro-rtos-mbed/event_flags/main.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ using utest::v1::Case;
3030
#error [NOT_SUPPORTED] test not supported
3131
#endif
3232

33+
#if defined(__CORTEX_M23) || defined(__CORTEX_M33)
34+
#define THREAD_STACK_SIZE 512
35+
#else
3336
#define THREAD_STACK_SIZE 320 /* 512B stack on GCC_ARM compiler cause out of memory on some 16kB RAM boards e.g. NUCLEO_F070RB */
37+
#endif
3438

3539
#define MAX_FLAG_POS 30
3640
#define PROHIBITED_FLAG_POS 31

TESTS/mbedmicro-rtos-mbed/mail/main.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@
2929

3030
using namespace utest::v1;
3131

32+
#if defined(__CORTEX_M23) || defined(__CORTEX_M33)
33+
#define THREAD_STACK_SIZE 512
34+
#else
3235
#define THREAD_STACK_SIZE 320 /* larger stack cause out of heap memory on some 16kB RAM boards in multi thread test*/
36+
#endif
3337
#define QUEUE_SIZE 16
3438
#define THREAD_1_ID 1
3539
#define THREAD_2_ID 2

TESTS/mbedmicro-rtos-mbed/malloc/main.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ volatile bool thread_should_continue = true;
3737

3838
#if defined(__CORTEX_A9)
3939
#define THREAD_STACK_SIZE 512
40+
#elif defined(__CORTEX_M23) || defined(__CORTEX_M33)
41+
#define THREAD_STACK_SIZE 512
4042
#else
4143
#define THREAD_STACK_SIZE 256
4244
#endif

TESTS/mbedmicro-rtos-mbed/mutex/main.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@
2929

3030
using namespace utest::v1;
3131

32+
#if defined(__CORTEX_M23) || defined(__CORTEX_M33)
33+
#define TEST_STACK_SIZE 768
34+
#else
3235
#define TEST_STACK_SIZE 512
36+
#endif
3337

3438
#define TEST_LONG_DELAY 20
3539
#define TEST_DELAY 10

TESTS/mbedmicro-rtos-mbed/systimer/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
#if !MBED_TICKLESS
16+
#ifndef MBED_TICKLESS
1717
#error [NOT_SUPPORTED] Tickless mode not supported for this target.
1818
#endif
1919

TESTS/mbedmicro-rtos-mbed/threads/main.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
#define THREAD_STACK_SIZE 512
3333
#if defined(__CORTEX_A9)
3434
#define PARALLEL_THREAD_STACK_SIZE 512
35+
#elif defined(__CORTEX_M23) || defined(__CORTEX_M33)
36+
#define PARALLEL_THREAD_STACK_SIZE 512
3537
#else
3638
#define PARALLEL_THREAD_STACK_SIZE 384
3739
#endif

TESTS/netsocket/tcp/main.cpp

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ using namespace utest::v1;
3232
namespace
3333
{
3434
NetworkInterface* net;
35+
Timer tc_bucket; // Timer to limit a test cases run time
3536
}
3637

3738
char tcp_global::rx_buffer[RX_BUFF_SIZE];
@@ -66,24 +67,32 @@ static void _ifdown() {
6667
printf("MBED: ifdown\n");
6768
}
6869

69-
void tcpsocket_connect_to_echo_srv(TCPSocket& sock) {
70+
nsapi_error_t tcpsocket_connect_to_echo_srv(TCPSocket& sock) {
7071
SocketAddress tcp_addr;
7172

7273
get_interface()->gethostbyname(MBED_CONF_APP_ECHO_SERVER_ADDR, &tcp_addr);
7374
tcp_addr.set_port(MBED_CONF_APP_ECHO_SERVER_PORT);
7475

75-
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock.open(get_interface()));
76-
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock.connect(tcp_addr));
76+
nsapi_error_t err = sock.open(get_interface());
77+
if (err != NSAPI_ERROR_OK) {
78+
return err;
79+
}
80+
81+
return sock.connect(tcp_addr);
7782
}
7883

79-
void tcpsocket_connect_to_discard_srv(TCPSocket& sock) {
84+
nsapi_error_t tcpsocket_connect_to_discard_srv(TCPSocket& sock) {
8085
SocketAddress tcp_addr;
8186

8287
get_interface()->gethostbyname(MBED_CONF_APP_ECHO_SERVER_ADDR, &tcp_addr);
8388
tcp_addr.set_port(9);
8489

85-
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock.open(get_interface()));
86-
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock.connect(tcp_addr));
90+
nsapi_error_t err = sock.open(get_interface());
91+
if (err != NSAPI_ERROR_OK) {
92+
return err;
93+
}
94+
95+
return sock.connect(tcp_addr);
8796
}
8897

8998
void fill_tx_buffer_ascii(char *buff, size_t len)
@@ -93,16 +102,23 @@ void fill_tx_buffer_ascii(char *buff, size_t len)
93102
}
94103
}
95104

105+
int split2half_rmng_tcp_test_time()
106+
{
107+
return (tcp_global::TESTS_TIMEOUT-tc_bucket.read())/2;
108+
}
109+
96110
// Test setup
97111
utest::v1::status_t greentea_setup(const size_t number_of_cases)
98112
{
99-
GREENTEA_SETUP(480, "default_auto");
113+
GREENTEA_SETUP(tcp_global::TESTS_TIMEOUT, "default_auto");
100114
_ifup();
115+
tc_bucket.start();
101116
return greentea_test_setup_handler(number_of_cases);
102117
}
103118

104119
void greentea_teardown(const size_t passed, const size_t failed, const failure_t failure)
105120
{
121+
tc_bucket.stop();
106122
_ifdown();
107123
return greentea_test_teardown_handler(passed, failed, failure);
108124
}

0 commit comments

Comments
 (0)