...
Tip | ||
---|---|---|
| ||
This steps can take along time ~ 40 mins to complete Users can expedite this using the commands below: mkdir sysroot tar -xzf rfdc_linux/images/Linux/rootfs.tar.gz -C sysroot ./usr ./lib |
The RFDC driver is delivered as a shared object in Linux. The makefile can be seen here and below:
...
Code Block | ||||
---|---|---|---|---|
| ||||
petalinux-create --type apps --name rfdc-test --enable |
Warning | ||
---|---|---|
| ||
This will create an app with a default rfdc-test.c in the project-spec/meta-user/recipes-apps/rfdc-test/files folder. This should be deleted as it may cause issues during compile |
Open the makefile at project-spec/meta-user/recipes-apps/rfdc-test/files and make the changes below:
Code Block | ||||
---|---|---|---|---|
| ||||
APP = rfdc-test # Add any other object files to this list below APP_OBJS = xrfdc_selftest_example.o APP_OBJS += xrfdc_clk.o LDLIBS += -lmetal LDLIBS += -lrfdc all: $(APP) build: $(APP) $(APP): $(APP_OBJS) $(CC) $(LDFLAGS) -o $@ $(APP_OBJS) $(LDLIBS) clean: -rm -f $(APP) *.elf *.gdb *.o $(APP_OBJS) %.o: %.c $(CC) -c -Wall -O0 -g3 -c -fmessage-length=0 -MT"$@" -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<" |
...
Code Block | ||||
---|---|---|---|---|
| ||||
# # This file is the rfdc-test recipe. # SUMMARY = "Simple rfdc-test application" SECTION = "PETALINUX/apps" LICENSE = "MIT" LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" SRC_URI = "file://xrfdc_selftest_example.c \ file://xrfdc_clk.c \ file://xrfdc_clk.h \ file://Makefile \ " S = "${WORKDIR}" DEPENDS = “libmetal"rfdc" PROVIDES = "rfdc-test" do_compile (){ { make oe_runmakeall BOARD_FLAG=-DXPS_BOARD_ZCU111 OUTS=rfdc-test RFDC_OBJS=xrfdc_selftest_example.o } do_install() { install -d ${D}${bindir} install -m 0755 rfdc-read-writetest ${D}${bindir} } |
Note: Users need to pass the XPS_BOARD_ZCU111 symbol to the compiler in order to set up the clocks correctly. The OUTS here will be the application name, and the RFDC_OBJS is the toplevel file