您的位置:首页 > 其它

Keil MDK 编译 uc/OS-II 出现的警告和错误解决

2011-07-08 13:40 661 查看
Keil MDK 编译 uc/OS-II 出现的警告和错误解决

由于程序都是从网上下载下来的,很多都是在ADS下编译的,而使用MDK并不能直接编译通过,先把我遇到的一些问题汇总一下,主要是汇编程序编译出现的问题。

warning: A1876W: Use of '|' as a synonym for the :OR: operator is deprecated.
部分源代码:
MSR CPSR_c, #(NoInt|IRQ32Mode) ;进入IRQ模式。

解决方法:把"|"修改为 ":OR:", 如下

MSR CPSR_c, #NoInt:OR:IRQ32Mode ;进入IRQ模式。

warning: A1608W: MOV pc,<rn> instruction used, but BX <rn> is preferred
解决方法:把MOV pc, <rn> 替换为 BX <rn>

Error: L6238E: os_cpu_a.o(subr) contains invalid call from '~PRES8 (The user did not require code to preserve 8-byte aligment of 8-byte data objects)' function to 'REQ8 (Code was permitted to depend on the 8-byte aligment of 8-byte data items)' function OSIntExit.
解决方法:在汇编程序前面加上 PRESERVE8
PRESERVE8
AREA |subr|, CODE, READONLY
IMPORT OSIntNesting
IMPORT OSTCBCur
IMPORT IsrIRQ
…………

warning: A1085W: Forced user-mode LDM/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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: