请教在ucos移植后,main中能够malloc,任务中不能malloc的原因?
我在华邦的w90p710上移植了ucos,在main程序中我连续malloc了10个0x1000大小的空间,在跳转到task2中以后,发现0x1000大小的空间就分配不了了,task2我分配了10k的栈,试过100k的栈也无效果,task2只能分配不超过4k的堆,不知道这是什么原因?我把main中的malloc取消了,task2中也只能malloc不超过4k的堆,请教各位走过路过的大侠,看这个问题出在哪里。我的堆栈是重新分配过的,各都超过了4M空间,怎么调整都不行。
#include <rt_misc.h>
//video buffer: 0xe00000 __value_in_regs struct __initial_stackheap __user_initial_stackheap( unsigned R0, unsigned SP, unsigned R2, unsigned SL) { struct __initial_stackheap config;
config.heap_base = 0x400000; //R0 一段模式中R1>R0,R0~R1之间的做为heap
config.stack_base = 0xc00000; //R1
config.heap_limit = 0x800000; //R2
config.stack_limit = 0x800000; //R3
return config;
}
搜索更多相关主题的帖子:
malloc main ucos 任务 移植