硬汉嵌入式论坛

 找回密码
 立即注册
查看: 6407|回复: 7
收起左侧

[μCOS-II] x2的堆栈最大为多少?

[复制链接]

3

主题

9

回帖

18

积分

新手上路

积分
18
发表于 2014-6-3 07:48:44 | 显示全部楼层 |阅读模式
用论坛上的ucos例程,仅能建立8个任务【每个任务512字节】,再建立任务就会提示堆栈不够。怎么解决呢?
回复

使用道具 举报

210

主题

1045

回帖

1685

积分

至尊会员

More we do, more we can do.

积分
1685
发表于 2014-6-3 09:28:47 | 显示全部楼层
可事实是它俩没关系。
回复

使用道具 举报

3

主题

9

回帖

18

积分

新手上路

积分
18
 楼主| 发表于 2014-6-3 10:48:17 | 显示全部楼层

回 emwin 的帖子

emwin:可事实是它俩没关系。
(2014-06-03 09:28)
请教跟哪个有关系呢?
我看启动文件的堆栈定义是Stack_Size      EQU     0x0001000
刚好与8个任务相同,再多任务就提示错误,所以猜测是这个关系,不知错在哪里?
回复

使用道具 举报

3

主题

9

回帖

18

积分

新手上路

积分
18
 楼主| 发表于 2014-6-3 10:56:06 | 显示全部楼层
.\\Obj\\output.axf: Error: L6406E: No space in execution regions with .ANY selector matching gui_x_ucos.o(.data).
.\\Obj\\output.axf: Error: L6406E: No space in execution regions with .ANY selector matching lcd_ra8875.o(.data).
.\\Obj\\output.axf: Error: L6406E: No space in execution regions with .ANY selector matching guialloc.o(.data).
.\\Obj\\output.axf: Error: L6406E: No space in execution regions with .ANY selector matching guitask.o(.data).
.\\Obj\\output.axf: Error: L6406E: No space in execution regions with .ANY selector matching usb_bot.o(.data).
.\\Obj\\output.axf: Error: L6406E: No space in execution regions with .ANY selector matching bsp_tft_lcd.o(.data).
.\\Obj\\output.axf: Error: L6406E: No space in execution regions with .ANY selector matching usb_pwr.o(.data).
.\\Obj\\output.axf: Error: L6406E: No space in execution regions with .ANY selector matching os_cpu_c.o(.data).
.\\Obj\\output.axf: Error: L6406E: No space in execution regions with .ANY selector matching lcd_api.o(.data).
.\\Obj\\output.axf: Error: L6406E: No space in execution regions with .ANY selector matching widget.o(.data).
.\\Obj\\output.axf: Error: L6406E: No space in execution regions with .ANY selector matching wm__sendmessage.o(.data).
.\\Obj\\output.axf: Error: L6406E: No space in execution regions with .ANY selector matching usb_core.o(.data).
.\\Obj\\output.axf: Error: L6406E: No space in execution regions with .ANY selector matching usb_int.o(.data).
.\\Obj\\output.axf: Error: L6406E: No space in execution regions with .ANY selector matching stdout.o(.data).
.\\Obj\\output.axf: Error: L6406E: No space in execution regions with .ANY selector matching bsp_nand.o(.data).
.\\Obj\\output.axf: Error: L6406E: No space in execution regions with .ANY selector matching lcd_spfd5420.o(.data).
.\\Obj\\output.axf: Error: L6407E: Sections of aggregate size 0x80 bytes could not fit into .ANY selector(s).
回复

使用道具 举报

3

主题

9

回帖

18

积分

新手上路

积分
18
 楼主| 发表于 2014-6-3 12:27:21 | 显示全部楼层
捕获.JPG 已经找到原因,空间不够导致。
回复

使用道具 举报

3

主题

9

回帖

18

积分

新手上路

积分
18
 楼主| 发表于 2014-6-3 12:28:25 | 显示全部楼层
如上图将IRAM增加了0x5000就可以了。不知道这样会不会影响其他。。。。。。
回复

使用道具 举报

1万

主题

6万

回帖

10万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
106971
QQ
发表于 2014-6-3 13:30:51 | 显示全部楼层
1.  X2用的VET6片子有64KB的RAM
2. 这个Stack_Size      EQU     0x0001000是系统堆栈,单位是4个字节,也就是说 0x0001000表示 0x0001000 * 4这么多的字节
3. 任务堆栈就是文件开头定义的任务数组。每个任务都有一个数组,数组也是以4字节为一个单位的。
回复

使用道具 举报

210

主题

1045

回帖

1685

积分

至尊会员

More we do, more we can do.

积分
1685
发表于 2014-6-3 15:42:57 | 显示全部楼层

回 liuerbin 的帖子

liuerbin:如上图将IRAM增加了0x5000就可以了。不知道这样会不会影响其他。。。。。。 (2014-06-03 12:28) 
别逗了,你觉得SRAM不够,改大数值芯片里就变大了?

我说它俩(启动代码栈和任务)没关系是这样的:

*.s里的栈是MSP,用于中断和OS启动前。之后,OS会切换至PSP,这时用到的栈是创建时分配的空间。所以,它和你的问题没有因果关系。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|Archiver|手机版|硬汉嵌入式论坛

GMT+8, 2024-5-12 09:03 , Processed in 0.180591 second(s), 28 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表