[STM8] RAM运行代码出错

[复制链接]
609|8
 楼主| supernan 发表于 2020-4-12 13:40 | 显示全部楼层 |阅读模式
目前在在IAP功能,FLASH编程使用BLOCK编程代码,这样就需要RAM中执行CODE,按照固件库说明 允许RAM中执行
kangzj 发表于 2020-4-12 13:46 | 显示全部楼层
楼主详细说说怎么回事啊,这么说太笼统了
 楼主| supernan 发表于 2020-4-12 13:49 | 显示全部楼层

#if !defined (RAM_EXECUTION)
#define RAM_EXECUTION  (1)
#endif /* RAM_EXECUTION */

但是执行到FLASH_ProgramBlock(u32BlockAddr, FLASH_MEMTYPE_PROG, FLASH_PROGRAMMODE_STANDARD, pBuf);

就会重启死机
 楼主| supernan 发表于 2020-4-12 13:51 | 显示全部楼层
编译的时候出现如下警告:

Warning[Ta005]: Library call (?mul32_l0_l0_l1) from within a __ramfunc function E:\工程项目\ZBS-II\软件工程\STM8\BL\Lib\STM8S_StdPeriph_Driver\src\stm8s_flash.c 659
Warning[Ta005]: Library call (?add32_l0_l0_l1) from within a __ramfunc function E:\工程项目\ZBS-II\软件工程\STM8\BL\Lib\STM8S_StdPeriph_Driver\src\stm8s_flash.c 659
Warning[Ta005]: Library call (?epilogue_l2) from within a __ramfunc function E:\工程项目\ZBS-II\软件工程\STM8\BL\Lib\STM8S_StdPeriph_Driver\src\stm8s_flash.c 685
Warning[Ta005]: Library call (?mul32_l0_l0_l1) from within a __ramfunc function E:\工程项目\ZBS-II\软件工程\STM8\BL\Lib\STM8S_StdPeriph_Driver\src\stm8s_flash.c 607
Warning[Ta005]: Library call (?add32_l0_l0_l1) from within a __ramfunc function E:\工程项目\ZBS-II\软件工程\STM8\BL\Lib\STM8S_StdPeriph_Driver\src\stm8s_flash.c 607
Warning[Ta005]: Library call (?epilogue_l2) from within a __ramfunc function E:\工程项目\ZBS-II\软件工程\STM8\BL\Lib\STM8S_StdPeriph_Driver\src\stm8s_flash.c 627
Warning[Ta005]: Library call (?dec32_l1_l1) from within a __ramfunc function E:\工程项目\ZBS-II\软件工程\STM8\BL\Lib\STM8S_StdPeriph_Driver\src\stm8s_flash.c 545
liuzaiy 发表于 2020-4-12 13:54 | 显示全部楼层
问题比较明显:IAR的库函数 mul32,add32等等位于FLASH里,从RAM里面的函数调用的IAR的库函数,所以出问题了。
 楼主| supernan 发表于 2020-4-12 13:57 | 显示全部楼层

mul32_l0_l0_l1 警告提示是下面这段代码
   
/* Point to the first block address */
    startaddress = startaddress + ((uint32_t)BlockNum * FLASH_BLOCK_SIZE);

怎么改呢
pangb 发表于 2020-4-12 14:00 | 显示全部楼层
目前在在IAP功能,FLASH编程使用BLOCK编程代码,这样就需要RAM中执行CODE,按照固件库说明 允许RAM中执行,具体如下:

#if !defined (RAM_EXECUTION)
#define RAM_EXECUTION  (1)
#endif /* RAM_EXECUTION */

在哪里有这个说明啊,能不能给个链接或贴出来
chenjunt 发表于 2020-4-12 14:10 | 显示全部楼层
我eeprom编程也出现了许多警告,请问怎么解决Warning[Ta005]: Library call (?mul32_l0_l0_l1) from within a __ramfunc function F:\registor\linshi\线切割\xqg-gaopin-code\TCIAR V1.1\FWlib\src\stm8s_flash.c 655
 楼主| supernan 发表于 2020-4-12 14:16 | 显示全部楼层

搞定了,呵呵,犯了低级错误…
您需要登录后才可以回帖 登录 | 注册

本版积分规则

730

主题

10412

帖子

6

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