diff --git a/components/finsh/shell.h b/components/finsh/shell.h index d3551f0..a74f4da 100644 --- a/components/finsh/shell.h +++ b/components/finsh/shell.h @@ -17,10 +17,7 @@ #ifndef FINSH_THREAD_PRIORITY #define FINSH_THREAD_PRIORITY 20 #endif -#ifdef __ISA_NATIVE__ -#undef FINSH_THREAD_STACK_SIZE -#define FINSH_THREAD_STACK_SIZE (4096 * 3) -#elif !defined(FINSH_THREAD_STACK_SIZE) +#ifndef FINSH_THREAD_STACK_SIZE #define FINSH_THREAD_STACK_SIZE 2048 #endif #ifndef FINSH_CMD_SIZE diff --git a/src/components.c b/src/components.c index 5ffa5a9..731fbd7 100644 --- a/src/components.c +++ b/src/components.c @@ -21,10 +21,7 @@ #include #ifdef RT_USING_USER_MAIN -#ifdef __ISA_NATIVE__ -#undef RT_MAIN_THREAD_STACK_SIZE -#define RT_MAIN_THREAD_STACK_SIZE (4096 * 3) -#elif !defined(RT_MAIN_THREAD_STACK_SIZE) +#ifndef RT_MAIN_THREAD_STACK_SIZE #define RT_MAIN_THREAD_STACK_SIZE 2048 #endif /* RT_MAIN_THREAD_STACK_SIZE */ #ifndef RT_MAIN_THREAD_PRIORITY diff --git a/src/thread.c b/src/thread.c index 162e271..3141764 100644 --- a/src/thread.c +++ b/src/thread.c @@ -492,6 +492,11 @@ rt_thread_t rt_thread_create(const char *name, if (thread == RT_NULL) return RT_NULL; +#ifdef __ISA_NATIVE__ + const rt_uint32_t stack_size_min = 0x4000; + if (stack_size < stack_size_min) stack_size = stack_size_min; +#endif + stack_start = (void *)RT_KERNEL_MALLOC(stack_size); if (stack_start == RT_NULL) {