打印

新手求助关于编程

[复制链接]
1384|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 | 只看该作者
有关于这方面的文档吗?

使用特权

评论回复
5
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};

使用特权

评论回复
6
moron1984|  楼主 | 2011-1-28 16:05 | 只看该作者
感谢楼上的兄弟,学习了~~

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

0

主题

13

帖子

0

粉丝