[Keil]ads工程移植到Keil MDK 编译出现的警告和错误解决
2015-07-11 00:22
441 查看
问题描述:从ADS将C代码移植到Keil后,还存在几个警告,于是查阅了下,有篇博文介绍的很详细的,现转载如下,转载地址:http://blog.sina.com.cn/s/blog_67ed0acc0101c825.html
warning: A1876W:Use
of '|' as a synonym for the :OR: operator isdeprecated.
部分源代码:
MSR CPSR_c, #(NoInt|IRQ32Mode) ;进入IRQ模式。
解决方法:把"|"修改为 ":OR:", 如下
MSR CPSR_c, #NoInt:OR:IRQ32Mode ;进入IRQ模式。
warning: A1608W: MOV pc, instructionused, but BX is preferred
解决方法:把MOV pc, 替换为 BX
Error: L6238E: os_cpu_a.o(subr)contains invalid call from '~PRES8 (The user did not require codeto preserve 8-byte aligment of 8-byte data objects)' function
to'REQ8 (Code was permitted to depend on the 8-byte aligment of8-byte data items)' function OSIntExit.
解决方法:在汇编程序前面加上 PRESERVE8
PRESERVE8
AREA |subr|, CODE, READONLY
IMPORT OSIntNesting
IMPORT OSTCBCur
IMPORT IsrIRQ
…………
warning: A1085W: Forced user-modeLDM/STM must not be followed by use of banked R8-R14
部分源代码:
STMFD SP,{R3,SP,LR}^ ;系统模式SP→|R0 |
SUB SP,SP,#12 ;系统模式SP→|SPSR|
解决方法:在两行语句中间加nop,即可解决warning
STMFD SP,{R3,SP,LR}^ ;系统模式SP→|R0 |
nop
SUB SP,SP,#12 ;系统模式SP→|SPSR|
error: L6236E:No section matches selector - no section to be
FIRST/LAST.
部分源代码:
RuninFlash.sct
LR_ROM1 0x00000000
{ ; load region
ER_ROM1 0x00000000 0x0200000
{ ; load address = execution address
*.o (RESET, +First) ;报错的地方
*(InRoot$$Sections)
.ANY (+RO)
}
RW_RAM1 0x0C000000 0x800000
{ ; RW data
.ANY (+RW +ZI)
}
}
解决方法:
在启动文件,我的是44binit.s 中找到
AREA Init,CODE,READONLY
改为
AREA RESET,CODE,READONLY
warning: A1876W:Use
of '|' as a synonym for the :OR: operator isdeprecated.
部分源代码:
MSR CPSR_c, #(NoInt|IRQ32Mode) ;进入IRQ模式。
解决方法:把"|"修改为 ":OR:", 如下
MSR CPSR_c, #NoInt:OR:IRQ32Mode ;进入IRQ模式。
warning: A1608W: MOV pc, instructionused, but BX is preferred
解决方法:把MOV pc, 替换为 BX
Error: L6238E: os_cpu_a.o(subr)contains invalid call from '~PRES8 (The user did not require codeto preserve 8-byte aligment of 8-byte data objects)' function
to'REQ8 (Code was permitted to depend on the 8-byte aligment of8-byte data items)' function OSIntExit.
解决方法:在汇编程序前面加上 PRESERVE8
PRESERVE8
AREA |subr|, CODE, READONLY
IMPORT OSIntNesting
IMPORT OSTCBCur
IMPORT IsrIRQ
…………
warning: A1085W: Forced user-modeLDM/STM must not be followed by use of banked R8-R14
部分源代码:
STMFD SP,{R3,SP,LR}^ ;系统模式SP→|R0 |
SUB SP,SP,#12 ;系统模式SP→|SPSR|
解决方法:在两行语句中间加nop,即可解决warning
STMFD SP,{R3,SP,LR}^ ;系统模式SP→|R0 |
nop
SUB SP,SP,#12 ;系统模式SP→|SPSR|
error: L6236E:No section matches selector - no section to be
FIRST/LAST.
部分源代码:
RuninFlash.sct
LR_ROM1 0x00000000
{ ; load region
ER_ROM1 0x00000000 0x0200000
{ ; load address = execution address
*.o (RESET, +First) ;报错的地方
*(InRoot$$Sections)
.ANY (+RO)
}
RW_RAM1 0x0C000000 0x800000
{ ; RW data
.ANY (+RW +ZI)
}
}
解决方法:
在启动文件,我的是44binit.s 中找到
AREA Init,CODE,READONLY
改为
AREA RESET,CODE,READONLY
相关文章推荐
- [Android--Tool]使用activity-lifecycle源码建立工程无R.java的问题
- [Android--Tool]Android如何将他人的代码放入新建的工程中
- [Android--Tool]不在Android设备运行而打开AVD问题解决
- [Android--Tool]Android的SDK文档的下载
- [Android--Tool]更新SDK后ADT版本低不支持问题的解决
- [Android--Tool]javadoc的生成
- [Android--Tool]SDK中截取连接的被调试手机的画面
- [Android--UI]EditText的使用问题
- [Android--UI]ScrollView使用学习
- 58沈剑:秒杀系统架构优化思路
- 01."中大在线App"总分析
- [Com]Java中的串口编程
- [Android--Tool]提示adb is down问题与解决
- [JDK]什么是JDK
- [Android--Tool]Android开发环境安装与配置
- [Android--UI]颜色对照表
- [Keyword]Java语言中的关键字及其说明
- 三步制作自定义图标的微博第三方登录
- 每个程序猿都有个黑客小宇宙,自敲代码的时候就爆发了一发不可收拾
- java初级笔记_反射