STM32学习笔记- 在MDK下更换启动文件

在移植STM32的时候 虽然统一系列几乎可以通用,但是有时为了得到某款芯片具体功能,需要更换启动配置文件,这里以自己STM32F103ZET6换STM32F103VGT6为例,在做项目时发现内存不够用时:
报了如等等下错误:

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

在网上找到解决办法可以参照这个
链接:https://blog.csdn.net/gengyiping18/article/details/52640806
后来核对项目芯片发现VGT6这款芯片内存够用,只不过用的是ZET6
代码移植的,需要改配置文件。

可以说共四步:
1)核查自己使用芯片对于的启动文件,找到芯片对于的启动文件,
关于型号与启动文件对映选择关系可以参照这个。

链接:https://blog.csdn.net/u012166958/article/details/80495901
2)找到启动文件,替换在工程下core(以MDK为例)文件夹下的启动文件(个人将startup_stm32f10x_hd.s更换startup_stm32f10x_xl.s),再Options of Target下(也就是俗称的魔法棒),选择和相同的芯片型号。
在这里插入图片描述
3)在Options for Target >C/C++>Define将STM32F10X_HD,USE_STDPERIPH_DRIVER改成STM32F10X_XL,USE_STDPERIPH_DRIVER 这里要和core下的启动文件一致
在这里插入图片描述
4)最后在Options for Target >Utilitiles>Settings下添加相匹配的FLASH
在这里插入图片描述
在这里插入图片描述
完成以上4步在编译就可以了 这样就完成了换启动文件。

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

好奇龙猫

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值