项目场景:
移植UCOS到stm32f103c8t6时BUG日志app
问题描述:
c8t6移植ucos中报错内存溢出
报错代码以下:
spa
.\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,故严重超出内存
3d
解决方案:
直接修改内存池大小,我这里配置为5K,即把27改成5就能够
改变后编译效果以下:
日志
改变以后无报错,移植成功!code