急:ADS入门问题,各位帮帮忙吧
前段时间使用SDT2.51开发环境,现在想改用ADS1.2.可是,我将SDT下全都编译通过的文件,放到ADS1.2下,却发现没有一个文件能够顺利编译,全都有问题。
实在不明白,这些问题都莫名其妙。
请各位帮帮忙,谢谢 举个例子,或者把源码贴上来,这样才好分析啊 好的。
那些文件我在sdt2.51下都顺利编译通过了,但是放在ads1.2下就出现很多了问题.
例如在编译44binit.s文件时,由于文件开始有两句包含语句:GET ..\inc\option.a和GET ..\inc\memcfg.a ,一开始怎么都编译不过,出现很多错误,后来我将这两个文件的后缀名改为.s就可以了,敢情是ads下不识.a文件
另外,ADS中是不是不支持#elif这种条件编译指令啊?我随便编译一个.c文件,老是提示出错,信息如下:
Error : (Serious) C2275E: illegal character (hex code 0xa1) in source
option.h line 62
Error : (Serious) C2275E: illegal character (hex code 0xa1) in source
option.h line 37
Error : (Serious) C2275E: illegal character (hex code 0xa1) in source
option.h line 37
Error : (Serious) C2275E: illegal character (hex code 0xa1) in source
option.h line 37
Error : (Serious) C2275E: illegal character (hex code 0xa1) in source
option.h line 37
Error : (Serious) C2275E: illegal character (hex code 0xa1) in source
option.h line 37
Error : (Serious) C2275E: illegal character (hex code 0xa1) in source
option.h line 37
Error : (Serious) C2275E: illegal character (hex code 0xa1) in source
option.h line 37
Error : (Serious) C2275E: illegal character (hex code 0xa1) in source
option.h line 37
Error : (Serious) C2275E: illegal character (hex code 0xa1) in source
option.h line 37
Error : (Serious) C2275E: illegal character (hex code 0xa1) in source
option.h line 37
Error : (Serious) C2275E: illegal character (hex code 0xa1) in source
option.h line 37
Error : (Serious) C2275E: illegal character (hex code 0xa1) in source
option.h line 37
Error : (Serious) C2275E: illegal character (hex code 0xa1) in source
option.h line 37
Error : (Serious) C2275E: illegal character (hex code 0xa1) in source
option.h line 37
Error : (Serious) C2275E: illegal character (hex code 0xa1) in source
option.h line 37
Error : (Serious) C2275E: illegal character (hex code 0xa1) in source
option.h line 37
Error : (Serious) C2275E: illegal character (hex code 0xa1) in source
option.h line 37
Error : (Serious) C2275E: illegal character (hex code 0xa1) in source
option.h line 37
Error : (Serious) C2275E: illegal character (hex code 0xa1) in source
option.h line 37
Error : (Serious) C2275E: illegal character (hex code 0xa1) in source
option.h line 37
Error : (Serious) C2275E: illegal character (hex code 0xa1) in source
option.h line 37
Error : (Serious) C2275E: illegal character (hex code 0xa1) in source
option.h line 37
Error : (Serious) C2275E: illegal character (hex code 0xa1) in source
option.h line 37
Error : (Serious) C2275E: illegal character (hex code 0xa1) in source
option.h line 37
Error : (Serious) C2275E: illegal character (hex code 0xa1) in source
option.h line 37
Error : (Serious) C2275E: illegal character (hex code 0xa1) in source
option.h line 37
Error : (Serious) C2275E: illegal character (hex code 0xa1) in source
option.h line 37
Error : (Serious) C2275E: illegal character (hex code 0xa1) in source
option.h line 37
Error : (Serious) C2275E: illegal character (hex code 0xa1) in source
option.h line 37
Error : (Fatal) C3047U: Too many errors
option.h line 37
所提示错误处都是option.h文件中#elif处.
option.h文件:
#define MCLK (20000000) /* 修改系统主频20Mhz */
#define PLLON 1 /* 使能PLL,注意,使能后必须使用S/W命令设置PLLCON,否则Fout = Fin而不是Fpllo */
#if (MCLK==66000000)
#define PLL_M (0x3a) /* 主分频值,PLLCON */
#define PLL_P (0x3) /* 预分频值, PLLCON */
#define PLL_S (0x1) /* 后分频值,PLLCON */
#elif (MCLK==60000000)
#define PLL_M (0x34)
#define PLL_P (0x3)
#define PLL_S (0x1)
#elif (MCLK==40000000)
#define PLL_M (0x48)
#define PLL_P (0x3)
#define PLL_S (0x2)
#elif (MCLK==20000000)
#define PLL_M (0x48)
#define PLL_P (0x3)
#define PLL_S (0x3)
#endif
#define WRBUFOPT (0x8) /* 允许写缓冲 */
#define SYSCFG_8KBn (0x6)/* 不允许写缓冲,8KB空间全部作为Cache,不允许停止选项 */
#define SYSCFG_0KB (0x0|WRBUFOPT)/* 允许写缓冲,不使用Cache即8KB内部SRAM,不允许停止选项 */
#define SYSCFG_4KB (0x2|WRBUFOPT)/* 允许写缓冲,4KBflash,4KB内部SRAM,不允许停止选项 */
#define SYSCFG_8KB (0x6|WRBUFOPT)/* 允许写缓冲,8KB空间全部作为Cache,不允许停止选项 */
#define DRAM 1 /* 表示RAM类型为DRAM */
#define SDRAM 2 /* 表示RAM类型为SDRAM(这两个常数作用是什么???) */
#define BDRAMTYPE SDRAM /* 在power.c,44blib.c使用 */
#define BUSWIDTH (16) /* 数据总线宽度 */
#define CACHECFG SYSCFG_8KB/* 缓冲器配置 */
#define _RAM_STARTADDRESS 0xc000000 /* 定义RAM空间起始地址 */
#define _ISR_STARTADDRESS 0xc7fff00 /* 中断向量起始地址,注意这里把它们映射至RAM空间(GCS6:64Mbit(8MB) DRAM/SDRAM) */
/* 这个常量在option.a文件中也有定义,但那里是提供给44binit.s使用 */
/* 这里供44b.h使用,用于定义中断向量表 */
#endif /*__OPTION_H__*/
实在搞不明白 问题解决了一部分了。
ads下可能真不识.a文件,应该改为.s。不过我觉得有点不合理,因为memcfg.a和option.a都只是定义一些常量和宏,相当于汇编语言的头文件,如果改为.s的话,变为源文件了,编译器会对它们进行编译。而在编译memcfg.s时,出现错误提示:
Error : A1150E: Bad symbol
Memcfg.s line 82
82 00000000[ BDRAMTYPE = "DRAM" ;MT=01(FP DRAM) or 10(EDO DRAM)
Error : A1150E: Bad symbol
Memcfg.s line 95
95 00000000[ BDRAMTYPE = "DRAM" ;MT=01(FP DRAM) or 10(EDO DRAM)
2 Errors, 0 Warnings
也就是说找不到BDRAMTYPE定义,而BDRAMTYPE定义是在option.s文件中进行的。是不是要加一句类似include的语句?不过在sdt下,memcfg.a和option.a是可以顺利编译通过的。
还有上面#elif问题,主要注释有问题,在sdt下没问题,但在ads下好像就不允许了。搞不懂 编译链接问题解决了,只要将memcfg.s和option.s从工程中删除即可,因为它们是不需要被编译的文件,它们相当于汇编语言头文件。
不过又来新问题了,原来由sdt生成的bin文件运行很正常,但是用sdt编译链接生成的bin,下载到sram空间后,凡是涉及到中断的地方都不能正常工作了,奇怪
感谢热心网友richard给我发的工程例程,我是看了他的例程才想到的,谢谢!
顺便也感谢所有帮助我的网友。 好像这个中断的问题我也碰到过,你的中断向量表的代码是怎么写的? ENTRY
b ResetHandler;for debug
b HandlerUndef;handlerUndef
b HandlerSWI ;SWI interrupt handler
b HandlerPabort ;handlerPAbort
b HandlerDabort ;handlerDAbort
b . ;handlerReserved
b HandlerIRQ
b HandlerFIQ
;***IMPORTANT NOTE***
;If the H/W vectored interrutp mode is enabled, The above two instructions should
;be changed like below, to work-around with H/W bug of S3C44B0X interrupt controller.
; b HandlerIRQ->subs pc,lr,#4
; b HandlerIRQ->subs pc,lr,#4
VECTOR_BRANCH
ldr pc,=HandlerEINT0 ;mGA H/W interrupt vector table
ldr pc,=HandlerEINT1 ;
ldr pc,=HandlerEINT2 ;
ldr pc,=HandlerEINT3 ;
ldr pc,=HandlerEINT4567 ;
ldr pc,=HandlerTICK ;mGA
b .
b .
ldr pc,=HandlerZDMA0 ;mGB
ldr pc,=HandlerZDMA1 ;
ldr pc,=HandlerBDMA0 ;
ldr pc,=HandlerBDMA1 ;
ldr pc,=HandlerWDT ;
ldr pc,=HandlerUERR01 ;mGB
b .
b .
ldr pc,=HandlerTIMER0 ;mGC
ldr pc,=HandlerTIMER1 ;
ldr pc,=HandlerTIMER2 ;
ldr pc,=HandlerTIMER3 ;
ldr pc,=HandlerTIMER4 ;
ldr pc,=HandlerTIMER5 ;mGC
b .
b .
ldr pc,=HandlerURXD0 ;mGD
ldr pc,=HandlerURXD1 ;
ldr pc,=HandlerIIC ;
ldr pc,=HandlerSIO ;
ldr pc,=HandlerUTXD0 ;
ldr pc,=HandlerUTXD1 ;mGD
b .
b .
ldr pc,=HandlerRTC ;mGKA
b . ;
b . ;
b . ;
b . ;
b . ;mGKA
b .
b .
ldr pc,=HandlerADC ;mGKB
b . ;
b . ;
b . ;
b . ;
b . ;mGKB
b .
b .
;0xe0=EnterPWDN
。。。。。。
^ _ISR_STARTADDRESS
HandleReset # 4
HandleUndef # 4
HandleSWI # 4
HandlePabort # 4
HandleDabort # 4
HandleReserved # 4
HandleIRQ # 4
HandleFIQ # 4
;Don't use the label 'IntVectorTable',
;because armasm.exe cann't recognize this label correctly.
;the value is different with an address you think it may be.
;IntVectorTable
HandleADC # 4
HandleRTC # 4
HandleUTXD1 # 4
HandleUTXD0 # 4
HandleSIO # 4
HandleIIC # 4
HandleURXD1 # 4
HandleURXD0 # 4
HandleTIMER5 # 4
HandleTIMER4 # 4
HandleTIMER3 # 4
HandleTIMER2 # 4
HandleTIMER1 # 4
HandleTIMER0 # 4
HandleUERR01 # 4
HandleWDT # 4
HandleBDMA1 # 4
HandleBDMA0 # 4
HandleZDMA1 # 4
HandleZDMA0 # 4
HandleTICK # 4
HandleEINT4567 # 4
HandleEINT3 # 4
HandleEINT2 # 4
HandleEINT1 # 4
HandleEINT0 # 4 ;0xc1(c7)fff84
就是44b0测试代码自带的44binit.s文件啊,这些中断使用sdt编译后,生成的bin都能很好响应,为什么使用ads编译后生成的bin却不能正常响应呢?
奇怪啊 不知道各位的问题解决了没有?我也遇到了这个问题,我在ADS帮助文件里找到了这段话,但能读懂英文但没搞懂意思,各位群策群力把这个问题解决掉哟!
想把此文件共享出来,但不知道怎么贴。
A1150E: Bad symbol
This typically occurs in two cases:
1) when the current file requires another file to be INCLUDEed to define some symbols, for example:
"init.s", line 2: Error: A1150E: Bad symbol
2 00000000 DCD EBI_CSR_0
typically requires a definitions file to be included, e.g:
INCLUDE targets/eb40.inc
2) when the current file requires some symbols to be IMPORTed, for example:
"init.s", line 4: Error: A1150E: Bad symbol
4 00000000 LDR r0, =||Image$$RAM$$ZI$$Limit||
typically requires the symbol to be imported, e.g:
IMPORT ||Image$$RAM$$ZI$$Limit|| 将44blib_A.s添加到工程中并将源文件中的GET....和文件夹中的文件扩展名从.a改为.s就可以了
页:
[1]