版本:RT-Thread-rt-thread-v2.1.0
BSP:51822 适配芯片51822aa 16Kram
使用芯片板子:51822AC 32Kram
问题:可以输出串口,但创建线程后,无法调用,一点反应都没有
S文件:
Stack_Size EQU 0x00000400
AREA STACK, NOINIT, READWRITE, ALIGN=3
Stack_Mem SPACE Stack_Size
__initial_sp
Heap_Size EQU 0x00000000
AREA HEAP, NOINIT, READWRITE, ALIGN=3
__heap_base
Heap_Mem SPACE Heap_Size
__heap_limit
应用:
#define THREAD_PRIORITY 5
#define THREAD_STACK_SIZE 512
#define THREAD_TIMESLICE 5
static rt_thread_t tid1 = RT_NULL;
static rt_thread_t tid2 = RT_NULL;
static void thread_entry(void* parameter)
{
rt_uint32_t count = 0;
rt_uint32_t no = (rt_uint32_t) parameter;
while (1)
{
rt_kprintf("thread%d count: %d
", no, count ++);
rt_thread_delay(10);
}
}
int rt_application_init()
{
tid1 = rt_thread_create("t1",
thread_entry,
(void*)1,
THREAD_STACK_SIZE,
THREAD_PRIORITY,
THREAD_TIMESLICE);
if (tid1 != RT_NULL)
rt_thread_startup(tid1);
else
return -1;
tid2 = rt_thread_create("t2",
thread_entry,
(void*)2,
THREAD_STACK_SIZE,
THREAD_PRIORITY,
THREAD_TIMESLICE);
if (tid2 != RT_NULL)
rt_thread_startup(tid2);
else
return -1;
return 0;
}
结果:
| /
- RT - Thread Operating System
/ | 2.1.0 build Apr 28 2017
2006 - 2016 Copyright by rt-thread team
之后就没有一点反应和输出