RealView MDK在链接时提示空间不够的解决方案总结
来源:互联网 发布:金融行业数据服务企业 编辑:程序博客网 时间:2024/05/19 22:57
在默认设置下,将例程USARTPDC_test选择在片上SRAM中调试时,编译通过、在链接时会提示以下错误信息提示空间不够:
compiling init.c...
compiling interrupt_Usart.c...
compiling main.c...
linking...
.\Int_RAM\USARTPDC_test.axf: Error: L6406W: No space in execution regions with .ANY selector matching Section .text(_scanf_int.o).
.\Int_RAM\USARTPDC_test.axf: Error: L6406W: No space in execution regions with .ANY selector matching Section .text(_scanf_longlong.o).
.\Int_RAM\USARTPDC_test.axf: Error: L6406W: No space in execution regions with .ANY selector matching Section .text(aeabi_sdiv.o).
.\Int_RAM\USARTPDC_test.axf: Error: L6406W: No space in execution regions with .ANY selector matching Section .text(init.o).
.\Int_RAM\USARTPDC_test.axf: Error: L6406W: No space in execution regions with .ANY selector matching Section CL$$btod_mult_common(btod.o).
.\Int_RAM\USARTPDC_test.axf: Error: L6406W: No space in execution regions with .ANY selector matching Section .text(__printf.o).
.\Int_RAM\USARTPDC_test.axf: Error: L6406W: No space in execution regions with .ANY selector matching Section CL$$btod_div_common(btod.o).
.\Int_RAM\USARTPDC_test.axf: Error: L6406W: No space in execution regions with .ANY selector matching Section .text(main.o).
.\Int_RAM\USARTPDC_test.axf: Error: L6406W: No space in execution regions with .ANY selector matching Section .text(_scanf.o).
.\Int_RAM\USARTPDC_test.axf: Error: L6406W: No space in execution regions with .ANY selector matching Section .text(interrupt_usart.o).
.\Int_RAM\USARTPDC_test.axf: Error: L6406W: No space in execution regions with .ANY selector matching Section .text(scanf_fp.o).
.\Int_RAM\USARTPDC_test.axf: Error: L6406W: No space in execution regions with .ANY selector matching Section .text(scanf_hexfp.o).
.\Int_RAM\USARTPDC_test.axf: Error: L6407W: Sections of aggregate size 0x23f8 bytes could not fit into .ANY selector(s).
Target not created
一、使用微库
使用微库时,将以更精简短小的C库替代标准C库,减小代码大小,使用微库的方法如下:
打开Project->Options->Target,将Use MicroLIB前面的复选框勾上。如下图:
图一 使用微库
点击确定之后,重新编译、链接。发现还是会提示空间不够的错误信息,但错误信息明显比以前少了:
Build target 'USARTPDC_test Int RAM'
assembling RM9200.s...
compiling init.c...
compiling interrupt_Usart.c...
compiling main.c...
linking...
.\Int_RAM\USARTPDC_test.axf: Error: L6406W: No space in execution regions with .ANY selector matching Section .text(interrupt_usart.o).
.\Int_RAM\USARTPDC_test.axf: Error: L6406W: No space in execution regions with .ANY selector matching Section i._printf_core(printf8.o).
.\Int_RAM\USARTPDC_test.axf: Error: L6407W: Sections of aggregate size 0x86c bytes could not fit into .ANY selector(s).
Target not created
二、修改链接脚本
修改链接脚本的方法有两种一种是直接修改分散加载文件,另一种是使用默认分散加载文件,这时仅需修改Project->Options->Target中的存储空间起始和大小。为了简单直观,本例中使用后者。在使用后者时,需要在Project->Options->Linker中将Use Memory Layout from Target Dialog前面的复选框勾上。如下图:
图二 使用默认的分散加载文件
然后在Project->Options->Target中修改存储空间中只读部分和可读写部分的起始和大小,一般来说加大只读部分大小(该部分存放程序中的指令),而减小可读写部分的大小(该部分存放堆栈、局部变量等)。
根据错误提示可知,只读部分空间最少需要加大0x86c bytes,总空间固定16KB,相应地需要减小可读写部分大小。修改之前如图一,修改后如下图:
图三 增大只读部分大小,减小可读写部分大小
点击确定之后,重新编译、链接:
Build target 'USARTPDC_test Int RAM'
assembling RM9200.s...
compiling init.c...
compiling interrupt_Usart.c...
compiling main.c...
linking...
Program Size: Code=9388 RO-data=380 RW-data=4 ZI-data=1244
".\Int_RAM\USARTPDC_test.axf" - 0 Error(s), 0 Warning(s).
编译链接成功!
三、修改优化级别,着重对空间进行优化
在编译时着重对空间进行优化,让编译器自动减小代码大小。可使用编译选项-Ospace
进行编译以达到目的,另外可以选更高的选优化级别―-03如下图:
图四 选较高优化级别针对空间进行优级化以减小代码大小
- RealView MDK在链接时提示空间不够的解决方案总结
- RealView MDK在链接时提示空间不够的解决方案总结
- Keil RealView MDK在链接时提示空间不够的解决方案总结 keil: Error: L6406E: No space in execution regions with
- 转载_RealView MDK在链接时提示空间不够的解决方案总结
- MDK在链接时提示空间不够(No space in execution regions with .ANY selector... )的解决方案总结
- MDK在链接时提示空间不够(No space in execution regions with .ANY selector... )的解决方案总结
- MDK在链接时提示空间不够(No space in execution regions with .ANY selector... )的解决方案总结
- MDK在链接时提示空间不够(No space in execution regions with .ANY selector... )解决方案
- 在Realview MDK 中如何生成*.bin 格式的文件
- 在Realview MDK中添加自己的FLASH编程算法
- RealView MDK的指定位置
- uVision, MDK, realview的关系
- Realview MDK中链接脚本详细解析
- Realview MDK中链接脚本详细解析
- Realview MDK中链接脚本详细解析
- Realview MDK中链接脚本详细解析
- Realview MDK中链接脚本详细解析
- RealView MDK和RVDS的区别
- miniui(nui)进度条
- keil MDK编译器警告和错误详解
- S3c2440ALCD控制器配置实例
- python学习(17)--Matplotlib
- 不同的LCD之间程序移植时配置参考
- RealView MDK在链接时提示空间不够的解决方案总结
- mini2440裸机之PWM
- s3c2440的pwm输出
- EMC磁珠到底是什么特性?
- 对增益大于等于10时保持稳定的放大器进行补偿以在较低增益下工作
- 电子技术的老生常谈——接地
- msp430f149单片机控制步进电机C语言程序
- 关于typedef的用法总结(转)
- Altium Designer生成Gerber文件和钻孔文件的一般步骤