stm32f103c8t6移植ucos-Ⅲ内存溢出bug

项目场景:

移植UCOS到stm32f103c8t6时BUG日志


问题描述:

c8t6移植ucos中报错内存溢出
报错代码如下:

.\Objects\ISO-STM32.axf: Error: L6406E: No space in execution regions with .ANY selector matching lib_mem.o(.bss).
.\Objects\ISO-STM32.axf: Error: L6406E: No space in execution regions with .ANY selector matching os_cfg_app.o(.bss).
.\Objects\ISO-STM32.axf: Error: L6406E: No space in execution regions with .ANY selector matching os_var.o(.bss).
.\Objects\ISO-STM32.axf: Error: L6406E: No space in execution regions with .ANY selector matching startup_stm32f10x_md.o(STACK).
.\Objects\ISO-STM32.axf: Error: L6406E: No space in execution regions with .ANY selector matching app.o(.bss).
.\Objects\ISO-STM32.axf: Error: L6406E: No space in execution regions with .ANY selector matching startup_stm32f10x_md.o(HEAP).
.\Objects\ISO-STM32.axf: Error: L6406E: No space in execution regions with .ANY selector matching os_var.o(.data).
.\Objects\ISO-STM32.axf: Error: L6406E: No space in execution regions with .ANY selector matching usart.o(.bss).
.\Objects\ISO-STM32.axf: Error: L6406E: No space in execution regions with .ANY selector matching libspace.o(.bss).
.\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 usart.o(.data).
.\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: L6407E: Sections of aggregate size 0x8960 bytes could not fit into .ANY selector(s).

原因分析:

此处报错:无空间在执行lib_mem之后的程序,说明内存不够,之前的程序有使用到大量内存,占据了之后程序的空间,根据源码的配置,在lib_cfg.h里面配置了内存池的大小,此处占用内存较大,源码移植默认配置了27k,而c8t6的sram只有20k,故严重超出内存
在这里插入图片描述


解决方案:

直接修改内存池大小,我这里配置为5K,即把27改为5就可以
改变后编译效果如下:

在这里插入图片描述

改变之后无报错,移植成功!

猜你喜欢

转载自blog.csdn.net/qq_45396672/article/details/110222577