移植野火ucos例程stm32F103ZET6到C8T6上时,遇到内存溢出的问题,以及解决方法

1、更改完单片机型号后,编译工程后,出现内存溢出错误,

.\Objects\ISO-STM32.axf: Error: L6406E: No space in execution regions with .ANY selector matching cpu_core.o(.data).
.\Objects\ISO-STM32.axf: Error: L6406E: No space in execution regions with .ANY selector matching stm32f10x_rcc.o(.data).
.\Objects\ISO-STM32.axf: Error: L6406E: No space in execution regions with .ANY selector matching cpu_core.o(.bss).
.\Objects\ISO-STM32.axf: Error: L6406E: No space in execution regions with .ANY selector matching lib_mem.o(.data).
.\Objects\ISO-STM32.axf: Error: L6406E: No space in execution regions with .ANY selector matching os_prio.o(.data).
.\Objects\ISO-STM32.axf: Error: L6406E: No space in execution regions with .ANY selector matching os_cpu_c.o(.data).
.\Objects\ISO-STM32.axf: Error: L6406E: No space in execution regions with .ANY selector matching stdout.o(.data).
.\Objects\ISO-STM32.axf: Error: L6406E: No space in execution regions with .ANY selector matching bsp_usart.o(.data).
.\Objects\ISO-STM32.axf: Error: L6407E: Sections of aggregate size 0x54 bytes could not fit into .ANY selector(s).

首先是参考网上对内存溢出现象的解决方法,参考博文https://blog.csdn.net/gengyiping18/article/details/52640806

增大了RAM 值,初步是解决了内存溢出问题,编译通过。

2、编译通过后,编写应用程序,编译通过后,程序无法进入主函数,死在了HardFault_Handler中断处,出现硬件错误

无法进入主函数,分析原因为堆栈内存溢出,修改了启动文件中:

Stack_Size      EQU     0x0000400

Heap_Size       EQU     0x00000200

以上为修改后的

然而并没有解决以上问题。

怀疑是任务堆栈太大,造成内存溢出,于是修改了app_cfg.h中的任务堆栈大小值,

发现启动任务堆栈大小最大只能为114,大于114会出现内存溢出,子任务堆栈大小不能大于70,这和C8T6本身内存有关系,

所以此处在使用C8T6时,子任务堆栈大小,应大小适中,不能太大,防止造成内存溢出

更改到如图所示的堆栈大小后,无法进入主函数,死在HardFault_Handler硬件错误中断的问题解决。

 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值