新手求助关于编程

[复制链接]
2777|5
 楼主| moron1984 发表于 2011-1-27 15:49 | 显示全部楼层 |阅读模式
本帖最后由 moron1984 于 2011-1-27 15:53 编辑

我刚刚接触STM32的cpu,现在用的编译器是IAR的,我想知道就是对于这款编译器,怎么对flash和ram进行分段,定义段名,就是有没有类似链接脚本的东西
还有就是在这个启动代码会不会有一段启动的汇编代码,刚刚新建了一个工程没发现启动文件,因为有可能会修改这段启动代码,但是不知道在哪,请求高手指点~~谢谢了
STM32W108 发表于 2011-1-27 16:51 | 显示全部楼层
怎么对flash和ram进行分段,定义段名,就是有没有类似链接脚本的东西
-------------------------------------------------------
连接脚本有。
*.icf文件
 楼主| moron1984 发表于 2011-1-27 17:00 | 显示全部楼层
刚刚我找到了这个文件了,但是可以对falsh或者ram进行分段吗?定义段名,可以在申请变量的时候放在指定段,或者程序也可以放在指定段
 楼主| moron1984 发表于 2011-1-28 11:09 | 显示全部楼层
有关于这方面的文档吗?
STM32W108 发表于 2011-1-28 11:22 | 显示全部楼层
EWARM_DevelopmentGuide上面有。

Declare and place your own sections
To declare new sections!ain addition to theones used by the IAR build tools!at
specific parts of your code or data, use mechanisms in the compiler and assemble
example:
/* Places a variable in your own section MyOwnSection. */
const int MyVariable @ "MyOwnSection" = 5;
            name    createSection
            /* Create a section */
            section myOwnSection:CONST
            /* And fill it with constant bytes */
            dcb     5, 6, 7, 8
            end

To place your new section, the original place in ROM {readonly}; directive is
sufficient.
However, to place the section MyOwnSection explicitly, update the linker configuration
file with a
place in directive, for example:
/* Place MyOwnSection in the ROM region */
place in ROM {readonly section MyOwnSection};
 楼主| moron1984 发表于 2011-1-28 16:05 | 显示全部楼层
感谢楼上的兄弟,学习了~~
您需要登录后才可以回帖 登录 | 注册

本版积分规则

0

主题

13

帖子

0

粉丝
快速回复 在线客服 返回列表 返回顶部