s3c2440 ads程序移植到keil中(一) 初步完成
1 与其他工程一直一样 直接加入工程进行编译
2440init.s(8): error: A1023E: File "option.inc" could not be opened:
等错误
直接把option.inc Memcfg.inc 2440addr.inc 直接放在2440init.s的目录中
然后编译 当前记过错误消失
出现 .\led.axf: Error: L6238E: 2440init.o(Init) 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 Main.
错误信息:Error: L6238E: 2440init.o(Init) contains invalid call form ‘~PRES8(后面的省略)
原因分析:uVision4的每个汇编指令是以8字节对齐的,所以每个汇编文件的首个段要表面是用8字节对齐的。
解决方法,在2440init.s文件的Init段前面添加PRESERVE 8
然后编译 出现新的错误
这个错误引起的原因是
具体修改如下:
把 2440init.s ;Init 改成 Reset 即可
编译无错误
如下所示