71 views
Skip to first unread message

ttchjd

unread,
Apr 14, 2010, 9:16:09 AM4/14/10
to FPGA
��λѧ���ã�
���һ�����⣬��edk11.4����д�˸����򣬵����õ�print��xil_printf��ʱ�򱨴?˭�ܰ���æô��googleû�������sdk����û���⣬������xps����ͳ������ˣ�֮ǰ��test_memory�������ù�print���ǿ��Եġ�
xil_printf.c:50: undefined reference to `outbyte'��
 
�������£�
#include "xparameters.h"
#include <stdio.h>
#include "xgpio.h"
#include "xgpio_l.h"
#include "xutil.h"
//#include "xgpio_i.h"
int main(void)
{
 XGpio dip,led;
 Xuint32 dip_check;
 //print("--start of the program--\r\n");
 XGpio_Initialize(&dip,XPAR_DIP_SWITCHES_8BIT_DEVICE_ID);
 XGpio_SetDataDirection(&dip,1,0xffffffff);
 
 XGpio_Initialize(&led,XPAR_LEDS_8BIT_DEVICE_ID);
 XGpio_SetDataDirection(&led,1,0x00000000);
 
 while(1)
 {
  dip_check=XGpio_DiscreteRead(&dip,1);
  xil_printf("swicth data %x \n",dip_check);
  XGpio_DiscreteWrite(&led,1,dip_check);
  
 }
 
 return 0;
}
 


����+����+���� ��Ҫ���ɳ���,�ֻ�MSN����㶨! �������أ�

ttchjd

unread,
Apr 14, 2010, 9:36:22 AM4/14/10
to FPGA
����������ˣ�����Ϊ����û�б���Ϊstd_in��std_out��֮ǰ�ƺ�û�Ĺ�֪��Ϊʲô�ͱ��ĵ��ˡ��Ĺ����ˣ�����build���������������⣬��������֮�󴮿�û���������һ�����Ӵ��ڵ�ʱ����ʾ�����ϣ���������֮���������ļ���Ȼ����������led��switch�����Ǵ���û�������λ�����������������
 

From: tt_...@msn.com
To: fpga-cl...@googlegroups.com
Subject:
Date: Wed, 14 Apr 2010 21:16:09 +0800
--
You received this message because you are subscribed to the Google
Groups "fpga-club-sjtu" group.
�����Ҫ�������ֱ�ӷ��ʼ���fpga-cl...@googlegroups.com
���ߵ���̳��ҳ�����
http://groups.google.com/group/fpga-club-sjtu?hl=en?hl=en

Zhiqiang Que

unread,
Apr 14, 2010, 8:03:50 PM4/14/10
to fpga-cl...@googlegroups.com
你的串口之前有连上过吗?比如在test memory的时候是否有输出呢?可以先确认串口连接时正确的。

ttchjd wrote:
这 个问题解决了,是因为串口没有被设为std_in和std_out,之前似乎没改过,不知道为什么就被改掉了。改过来了,可以build,不过又有新问 题,就是下载之后串口没有输出,第一次连接串口的时候提示连不上,重新连上之后,再下载文件,然后其他正常,是led和switch,但是串口没输出?哪 位碰到过类似问题过吗?

 

From: tt_...@msn.com
To: fpga-cl...@googlegroups.com
Subject:
Date: Wed, 14 Apr 2010 21:16:09 +0800

各位学长好!
请教一个问题,在edk11.4里面写了个程序,但是用到print和xil_printf的时候报错,谁能帮下忙么?google没解决。在sdk里面 没问题,但是在xps里面就出问题了,之前的test_memory例子里用过print,是可以的。
xil_printf.c:50: undefined reference to `outbyte';
 
代码如下:

#include "xparameters.h"
#include <stdio.h>
#include "xgpio.h"
#include "xgpio_l.h"
#include "xutil.h"
//#include "xgpio_i.h"
int main(void)
{
 XGpio dip,led;
 Xuint32 dip_check;
 //print("--start of the program--\r\n");
 XGpio_Initialize(&dip,XPAR_DIP_SWITCHES_8BIT_DEVICE_ID);
 XGpio_SetDataDirection(&dip,1,0xffffffff);
 
 XGpio_Initialize(&led,XPAR_LEDS_8BIT_DEVICE_ID);
 XGpio_SetDataDirection(&led,1,0x00000000);
 
 while(1)
 {
  dip_check=XGpio_DiscreteRead(&dip,1);
  xil_printf("swicth data %x \n",dip_check);
  XGpio_DiscreteWrite(&led,1,dip_check);
  
 }
 
 return 0;
}
 


聊天+搜索+邮箱 想要轻松出游,手机MSN帮你搞定! 立刻下载!
--
You received this message because you are subscribed to the Google
Groups "fpga-club-sjtu" group.
如果想要发贴,可以直接发邮件到fpga-cl...@googlegroups.com
或者到论坛首页发贴即可
http://groups.google.com/group/fpga-club-sjtu?hl=en?hl=en

聊天+搜索+邮箱 想要轻松出游,手机MSN帮你搞定! 立刻下载! --
You received this message because you are subscribed to the Google
Groups "fpga-club-sjtu" group.
如果想要发贴,可以直接发邮件到fpga-cl...@googlegroups.com
或者到论坛首页发贴即可
http://groups.google.com/group/fpga-club-sjtu?hl=en?hl=en

Zhiqiang Que

unread,
Apr 15, 2010, 12:44:51 AM4/15/10
to fpga-cl...@googlegroups.com
那么说明genesysy上有2个串口。和V5板卡上应该一样的,一个串口只是把管脚引出来,没有具体的RS232的接口。
你应该设定你使用的那个串口即为标准输入,也为标准的输出。


-------------
不是,串口线是我在华联二楼买的,test_memory的例子里面串口线连好了的,可以用,有输出,不过昨天的自己写的有点问题,没有输出。有个问题没 想明白,genesysy上只有一个串口,为什么microblaze系统建立之后例化了两个串口,一个做标准输入,一个做标准输出,这个会有问题吗?
Reply all
Reply to author
Forward
0 new messages