打印
[STM8]

stm8l 怎么设置程序从RAM中执行

[复制链接]
2431|1
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
xiaox314|  楼主 | 2014-1-22 09:35 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
STM8, RAM, TI, se, IO
stm8L,想块读写或擦除操作,但需要把这些程序移到RAM中执行,下面是flash。c的注释!请哪位会的教一些
具体怎么做?

1- Define a segment FLASH_CODE by the mean of " #pragma section (FLASH_CODE)".
    This segment is defined in the stm8l15x_flash.c file.
  2- Uncomment the "#define RAM_EXECUTION  (1)" line in the stm8l15x.h file,
    or define it in Cosmic compiler preprocessor to enable the FLASH_CODE segment
   definition.
  3- In STVD Select Project\Settings\Linker\Category "input" and in the RAM section
    add the FLASH_CODE segment with "-ic" options.
  4- In main.c file call the _fctcpy() function with first segment character as
    parameter "_fctcpy('F');" to load the declared moveable code segment
    (FLASH_CODE) in RAM before execution.
  5- By default the _fctcpy function is packaged in the Cosmic machine library,
    so the function prototype "int _fctcopy(char name);" must be added in main.c
    file.
沙发
airwill| | 2014-1-22 12:36 | 只看该作者
5步设置讲得蛮详细的, 照着试试看呢?
内存统一编址, 总线支持, 从 SRAM 执行是可行的.

使用特权

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

本版积分规则

16

主题

733

帖子

7

粉丝