6099|10

63

帖子

0

TA的资源

一粒金砂(初级)

楼主
 

STM的堆可以更改嘛,最大可以更改为多少? [复制链接]

如题!(在malloc的时候出现了问题)
谢谢!
此帖出自stm32/stm8论坛

最新回复

                                 帮助文件应该说的很详细  详情 回复 发表于 2010-1-28 09:43
点赞 关注
 

回复
举报

74

帖子

0

TA的资源

一粒金砂(初级)

沙发
 
                                 这是开发工具的问题,要看你用的是什么工具。
此帖出自stm32/stm8论坛
 
 

回复

63

帖子

0

TA的资源

一粒金砂(初级)

板凳
 
我用的是IAR。编译没有问题啊!只是在运作的时候,分配太大就会返回NULL。
搜索看到有的贴子说是512字节。不知道可不可以改。
此帖出自stm32/stm8论坛
 
 

回复

65

帖子

0

TA的资源

一粒金砂(初级)

4
 
                                 你可以看看IAR的帮助文件,如何设置堆的大小。
此帖出自stm32/stm8论坛
 
 
 

回复

74

帖子

0

TA的资源

一粒金砂(初级)

5
 
                                 好的,谢谢!我马上去看!
此帖出自stm32/stm8论坛
 
 
 

回复

64

帖子

0

TA的资源

宇宙尘埃

6
 
请看黑体部分,你可以在链接脚本里分配HEAP的大小,但不建议你用这种方法,你可以考虑一下使用POOL方式,
uc/OS-II里有一个简单的POOL管理实现方法.
//
// Define a memory region that covers the entire 4 GB addressible space of the
// processor.
//
define memory mem with size = 4G;

//
// Define a region for the on-chip flash.
//
define region FLASH = mem:[from 0x8000000 to 0x807FFFF];

//
// Define a region for the on-chip SRAM.
//
define region SRAM = mem:[from 0x20000000 to 0x2000BFFF];

//
// Define a block for the heap.  The size should be set to something other
// than zero if things in the C library that require the heap are used.
//
define block HEAP with alignment = 8, size = 0x00001000 { };
define block CSTACK with alignment = 8, size = 0x00000400 { };

//
// Indicate that the read/write values should be initialized by copying from
// flash.
//
initialize by copy { readwrite };

//
// Initicate that the noinit values should be left alone.  This includes the
// stack, which if initialized will destroy the return address from the
// initialization code, causing the processor to branch to zero and fault.
//
do not initialize { section .noinit };

//
// Place the interrupt vectors at the start of flash.
//
place at start of FLASH { readonly section .intvec };

//
// Place the remainder of the read-only items into flash.
//
place in FLASH { readonly };

//
// Place all read/write items into SRAM.
//
place in SRAM { readwrite, block HEAP, block CSTACK};
此帖出自stm32/stm8论坛
 
 
 

回复

75

帖子

0

TA的资源

一粒金砂(初级)

7
 
                                 iar有个icf文件,里面可以修改堆,栈大小
此帖出自stm32/stm8论坛
 
 
 

回复

86

帖子

0

TA的资源

一粒金砂(初级)

8
 
非常感谢!我也找到了icf文件,并且更改测试确定更改后是有变化的。
但是,就是担心更改了会不会对其他的地方有影响呢。
所以,我也不倾向与更改。
不知道香版的意见呢!
此帖出自stm32/stm8论坛
 
 
 

回复

72

帖子

0

TA的资源

一粒金砂(初级)

9
 
                                 只要改了之后内存分配不产生冲突,就不会对其他的地方有影响。
此帖出自stm32/stm8论坛
 
 
 

回复

81

帖子

0

TA的资源

一粒金砂(初级)

10
 
                                 改堆的大小不会影响其它的地方,只是空闲的RAM空间变小了。
此帖出自stm32/stm8论坛
 
 
 

回复

72

帖子

0

TA的资源

一粒金砂(初级)

11
 
                                 帮助文件应该说的很详细
此帖出自stm32/stm8论坛
 
 
 

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

随便看看
查找数据手册?

EEWorld Datasheet 技术支持

相关文章 更多>>
关闭
站长推荐上一条 1/10 下一条
有奖直播:当AI遇见仿真,会有什么样的电子行业革新之路?
首场直播:Simcenter AI 赋能电子行业研发创新
直播时间:04月15日14:00-14:50

查看 »

 
EEWorld订阅号

 
EEWorld服务号

 
汽车开发圈

 
机器人开发圈

About Us 关于我们 客户服务 联系方式 器件索引 网站地图 最新更新 手机版

站点相关: 国产芯 安防电子 汽车电子 手机便携 工业控制 家用电子 医疗电子 测试测量 网络通信 物联网 5

北京市海淀区中关村大街18号B座15层1530室 电话:(010)82350740 邮编:100190

电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号 Copyright © 2005-2025 EEWORLD.com.cn, Inc. All rights reserved
快速回复 返回顶部 返回列表