我新装的ADS1.2,
操作步骤如下:File->New->roject->Arm Executable Image 然后添上工程名字,确定,
右键->Add Files 添加 Init.s,Main.c
Init.s :
IMPORT Main AREA init,CODE,READONLY ENTRY LDR R0, =0x3FF0000; LDR R1, =0xE7FFFF80;//配置SYSCFG,片内4K Cache,4K SRAM STR R1 [R0] LDR SP,0x3FE1000; // SP指向4K SRAM的尾地址,堆栈向下生成 BL Main B . END
Main.c :
#define IOPMOD (*(volatile unsigned *)0x03FF5000) //register #define IOPDATA (*(volatile unsigned *)0x03FF5008) //register
void Delay(unsigned int); int Main() { unsigned long LED; IOPMOD = 0xFFFFFFFF; IOPDATA = 0x01; for(;;) { LED = IOPDATA; LED = (LED << 1); IOPDATA = LED; Delay(10); if(!(IOPDATA & 0x0F)) IOPDATA = 0x01; } return(0); }
void Delay(unsigned int x) { unsigned int i,j,k; for(i = 0; i <= x; i++) for(j = 0; j < 0xff; j++) for(k = 0; k < 0xff ;k++); }
编译并MAKE后,却显示 IMPORT Main 为 Unknown opcode AREA init,CODE,READONLY 为 Unknown opcode ENTRY 为 A Label was found which was in no AREA
请了解的朋友帮助一下!谢谢!
|