Skip to content

Commit e9e1ff9

Browse files
author
Cruz Monrreal
authored
Merge pull request #7302 from OpenNuvoton/nuvoton_m2351_v1.1
Support Nuvoton's NUMAKER_PFM_M2351 target
2 parents b30ac55 + a242799 commit e9e1ff9

File tree

172 files changed

+84710
-23
lines changed

Some content is hidden

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

172 files changed

+84710
-23
lines changed

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

features/nvstore/TESTS/nvstore/functionality/main.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,13 @@ static const int thr_test_num_secs = 5;
4343
static const int thr_test_max_data_size = 32;
4444
static const int thr_test_num_threads = 3;
4545

46+
#if defined(__CORTEX_M23) || defined(__CORTEX_M33)
47+
static const int thr_test_min_stack_size = 1280;
48+
static const int thr_test_max_stack_size = 1280;
49+
#else
4650
static const int thr_test_min_stack_size = 768;
4751
static const int thr_test_max_stack_size = 1024;
48-
52+
#endif
4953

5054
typedef struct {
5155
uint8_t *buffs[max_test_keys][thr_test_num_buffs];

rtos/TARGET_CORTEX/mbed_boot.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,12 @@ void mbed_start_main(void)
321321
_main_thread_attr.cb_mem = &_main_obj;
322322
_main_thread_attr.priority = osPriorityNormal;
323323
_main_thread_attr.name = "main_thread";
324+
325+
/* Allow non-secure main thread to call secure functions */
326+
#if defined(DOMAIN_NS) && (DOMAIN_NS == 1U)
327+
_main_thread_attr.tz_module = 1U;
328+
#endif
329+
324330
osThreadId_t result = osThreadNew((osThreadFunc_t)pre_main, NULL, &_main_thread_attr);
325331
if ((void *)result == NULL) {
326332
MBED_ERROR1(MBED_MAKE_ERROR(MBED_MODULE_PLATFORM, MBED_ERROR_CODE_INITIALIZATION_FAILED), "Pre main thread not created", &_main_thread_attr);

0 commit comments

Comments
 (0)