[STM32F1] 在MDK下更换启动文件

[复制链接]
 楼主| 慢动作 发表于 2023-7-28 00:31 | 显示全部楼层 |阅读模式
在移植STM32的时候 虽然统一系列几乎可以通用,但是有时为了得到某款芯片具体功能,需要更换启动配置文件,这里以自己STM32F103ZET6换STM32F103VGT6为例,在做项目时发现内存不够用时:
报了如等等下错误:

  1. .......
  2.     ..\OBJ\MALLOC.axf: Error: L6406E: No space in execution regions with .ANY selector matching gui_charline.o(i._Log2VisBuffered).
  3.     ..\OBJ\MALLOC.axf: Error: L6406E: No space in execution regions with .ANY selector matching guicc_888_index2color.o(i.LCD_Index2Color_888).
  4.     ..\OBJ\MALLOC.axf: Error: L6406E: No space in execution regions with .ANY selector matching guicc_8888.o(i._Color2Index_8888).
  5.     ..\OBJ\MALLOC.axf: Error: L6406E: No space in execution regions with .ANY selector matching guicc_8888_index2color.o(i.LCD_Index2Color_8888).
  6.     ..\OBJ\MALLOC.axf: Error: L6406E: No space in execution regions with .ANY selector matching iusefp.o(.text).
  7.     ..\OBJ\MALLOC.axf: Error: L6407E: Sections of aggregate size 0x1977c bytes could not fit into .ANY selector(s).
  8.     Not enough information to list image symbols.
  9.     Not enough information to list the image map.
  10.     Finished: 2 information, 0 warning and 706 error messages.
  11.     "..\OBJ\MALLOC.axf" - 706 Error(s), 0 Warning(s).
  12.     Target not created.


 楼主| 慢动作 发表于 2023-7-28 00:32 | 显示全部楼层
在网上找到解决办法可以参照这个
链接:https://blog.csdn.net/gengyiping18/article/details/52640806
后来核对项目芯片发现VGT6这款芯片内存够用,只不过用的是ZET6
代码移植的,需要改配置文件。
 楼主| 慢动作 发表于 2023-7-28 00:32 | 显示全部楼层
可以说共四步:
1)核查自己使用芯片对于的启动文件,找到芯片对于的启动文件,
关于型号与启动文件对映选择关系可以参照这个。
链接:https://blog.csdn.net/u012166958/article/details/80495901
 楼主| 慢动作 发表于 2023-7-28 00:32 | 显示全部楼层
2)找到启动文件,替换在工程下core(以MDK为例)文件夹下的启动文件(个人将startup_stm32f10x_hd.s更换startup_stm32f10x_xl.s),再Options of Target下(也就是俗称的魔法棒),选择和相同的芯片型号。
9177564c29c1376866.png
 楼主| 慢动作 发表于 2023-7-28 00:32 | 显示全部楼层
3)在Options for Target >C/C++>Define将STM32F10X_HD,USE_STDPERIPH_DRIVER改成STM32F10X_XL,USE_STDPERIPH_DRIVER 这里要和core下的启动文件一致 9648564c29c1f5afce.png
 楼主| 慢动作 发表于 2023-7-28 00:32 | 显示全部楼层
4)最后在Options for Target >Utilitiles>Settings下添加相匹配的FLASH
9261064c29c2b5948e.png
 楼主| 慢动作 发表于 2023-7-28 00:32 | 显示全部楼层
4962464c29c322a69b.png
完成以上4步在编译就可以了 这样就完成了换启动文件。
tdh03z 发表于 2023-7-28 07:35 来自手机 | 显示全部楼层
做个记录,这个碰到过
您需要登录后才可以回帖 登录 | 注册

本版积分规则

81

主题

913

帖子

0

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