[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[microblaze-uclinux] Use xgpio.h and xparameters.h
Hi all,
I want to use the Xilinx GPIO-driver (xgpio.h) which is included in the uClinux. Could somebody tell me how I can compile it correctly to use it? I have written a C-Code like this:
------------------------------------------------------------
#include "xparameters.h"
#include "xgpio.h"
int main()
{
XGpio test;
XGpio_Initialize(&test, XPAR_LED_GPIO_DEVICE_ID);
return 0;
}
------------------------------------------------------------
I have the following Makefile:
------------------------------------------------------------
ifndef ROOTDIR
ROOTDIR=../../uClinux-dist-20051110-suzaku8
endif
ROMFSDIR = $(ROOTDIR)/romfs
ROMFSINST = romfs-inst.sh
PATH := $(PATH):$(ROOTDIR)/tools
UCLINUX_BUILD_USER = 1
include $(ROOTDIR)/.config
LIBCDIR = $(CONFIG_LIBCDIR)
include $(ROOTDIR)/config.arch
EXEC = DataTransfer
OBJS = DataTransfer.o
all: $(EXEC)
$(EXEC): $(OBJS)
$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBTHREAD) $(LDLIBS)
clean:
-rm -f $(EXEC) *.elf *.gdb *.o
romfs:
$(ROMFSINST) /bin/$(EXEC)
%.o: %.c
$(CC) -c $(CFLAGS) -o $@ $<
------------------------------------------------------------
I get the follwing errors:
ucfront-gcc mb-gcc -Wl,-elf2flt -o DataTransfer DataTransfer.o
DataTransfer.elf2flt: In function `main':
/home/suzaku/s03_nase/suzaku_proj/SDK_projects/TestApplication/Debug/../DataTransfer.c(.text+0x58): undefined reference to `XGpio_Initialize'
/home/suzaku/s03_nase/suzaku_proj/SDK_projects/TestApplication/Debug/../DataTransfer.c:26: undefined reference to `XGpio_SetDataDirection'
/home/suzaku/s03_nase/suzaku_proj/SDK_projects/TestApplication/Debug/../DataTransfer.c:27: undefined reference to `XGpio_DiscreteWrite'
collect2: ld returned 1 exit status
make: *** [DataTransfer] Error 1
Is there an alternative for the Makefile oder does I have to change the C-Code? Or does I have to use the ibm_ocp_gpio.h?
Greetings
N. Seyberlich
--
Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kanns mit allen: http://www.gmx.net/de/go/multimessenger
___________________________
microblaze-uclinux mailing list
microblaze-uclinux@xxxxxxxxxxxxxx
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/