原创 ADS:Semihosting Test

2008-7-8 10:33 3399 4 4 分类: MCU/ 嵌入式

In order to test a program, I use semihosting instead of downloading the hex file to the ARM Demo board. and I can input the data to the program by my computer and display the result in the AXD's console, like console in VC.
Environment:
ADS
the third-party editor “programmer's notepad”  AXD.


Let's look at the result first(You can look clearly by click it)
点击看大图


The firm of console is what I want.


Following is the "main.c"
int main(void)
{
 unsigned char i;
  printf("This is Bus Data Test!\n");
 printf("Please input the encoded message Format: ""(22,1,23,53,1)""\n");
 scanf("%s",buff);
 printf("The message you input is:%s\n",buff);
 StrToInt((char *)buff,(uint16 *)BusMsg);
 printf("The decoded message is:\n");
 for(i=0;i<MESSAGE_MAX;i++)
 printf("BusMsg[%d]=%d\n",i,BusMsg);
 return 0;
}


There a problem I can't explain:
char buff[30]={"(22,44,33,11)"};
uint16 BusMsg[MESSAGE_MAX]={1};

when they are define in the main.c the result is right, but when I define them in another file "data.c"  the result is wrong except BusMsg[0].


I need some time to read the datasheet, may be someone can explain that. if you know that, tell me please,thanks! 


ps: this file just to practice english writing

PARTNER CONTENT

文章评论0条评论)

登录后参与讨论
我要评论
0
4
关闭 站长推荐上一条 /3 下一条