07-17-2017 05:56 AM
I am currently working with the Embedded Design Tutorial (UG1209) and tried to generate firmware for the PMU (p.43 f.) of the ZYNQ UltraScale+ ZCU102 board. So far, everything worked as expected and I was also able to create linux images using PetaLinux (the next example project) so, in principle, I think that my system is set up correctly.
When creating the firmware and building it after a "Clean Project" everything seems to work until it stops during the linking process with an error message:
[...] Building target: pmu_fw.elf Invoking: MicroBlaze gcc linker mb-gcc -nostartfiles -Wl,-T -Wl,../src/lscript.ld -L../../pmu_bsp/psu_pmu_0/lib -mlittle-endian -mxl-barrel-shift -mxl-pattern-compare -mcpu=v9.2 -mxl-soft-mul -o "pmu_fw.elf" ./src/idle_hooks.o ./src/pm_api.o ./src/pm_binding.o ./src/pm_callbacks.o ./src/pm_clock.o ./src/pm_common.o ./src/pm_config.o ./src/pm_core.o ./src/pm_ddr.o ./src/pm_extern.o ./src/pm_gic_proxy.o ./src/pm_gpp.o ./src/pm_master.o ./src/pm_mmio_access.o ./src/pm_node.o ./src/pm_node_reset.o ./src/pm_notifier.o ./src/pm_periph.o ./src/pm_pll.o ./src/pm_power.o ./src/pm_proc.o ./src/pm_requirement.o ./src/pm_reset.o ./src/pm_slave.o ./src/pm_sram.o ./src/pm_system.o ./src/pm_usb.o ./src/xpfw_aib.o ./src/xpfw_core.o ./src/xpfw_crc.o ./src/xpfw_error_manager.o ./src/xpfw_events.o ./src/xpfw_interrupts.o ./src/xpfw_ipi_manager.o ./src/xpfw_main.o ./src/xpfw_mod_dap.o ./src/xpfw_mod_em.o ./src/xpfw_mod_legacy.o ./src/xpfw_mod_pm.o ./src/xpfw_mod_rtc.o ./src/xpfw_mod_sched.o ./src/xpfw_mod_stl.o ./src/xpfw_mod_wdt.o ./src/xpfw_module.o ./src/xpfw_platform.o ./src/xpfw_resets.o ./src/xpfw_restart.o ./src/xpfw_rom_interface.o ./src/xpfw_scheduler.o ./src/xpfw_start.o ./src/xpfw_user_startup.o ./src/xpfw_util.o ./src/xpfw_xpu.o -Wl,--start-group,-lxil,-lgcc,-lc,--end-group -Wl,--start-group,-lxilfpga,-lxil,-lgcc,-lc,--end-group -Wl,--start-group,-lxilsecure,-lxil,-lgcc,-lc,--end-group ../../pmu_bsp/psu_pmu_0/lib/libxilsecure.a(xsecure_rsa.o): In function `XSecure_RsaSignVerification': (.text.XSecure_RsaSignVerification+0x2c): undefined reference to `XGetPSVersion_Info' collect2: error: ld returned 1 exit status make: *** [pmu_fw.elf] Fehler 1 14:32:42 Build Finished (took 6s.919ms)
It seems like the library behind "xplatform_info.h" is somehow missing but I could not figure out how to resolve this problem.
Any hints are highly appreciated.
My system configuration:
- CentOS Linux 7
- Xilinx Vivado HL System Edition, SDK and Petalinux Tools; all version 2017.1
- ZYNQ UltraScale+ ZCU102 production version board
- Downloaded ZCU102 BSP (prod-silicon) from Xilinx
07-17-2017 06:30 AM
I have already seen the same type of error but only on windows. It seems that the make clean file remove the RSA library.
The only way I have found is to re-create the BSP. If this is the issue, it should be fixed in 2017.3.
07-17-2017 02:26 PM
I have the same error message when trying to build using PetaLinux 2017.2.
../../pmu-firmware_bsp/psu_pmu_0/lib/libxilsecure.a(xsecure_rsa.o): In function `XSecure_RsaSignVerification':
(.text.XSecure_RsaSignVerification+0x2c): undefined reference to `XGetPSVersion_Info'
collect2: error: ld returned 1 exit status
07-18-2017 12:28 AM
thanks for your help. Unfortunately, the error remains.
Steps I took:
- Disabled "Build Automatically"
- Regenerate BSP Sources
- Build Project
So, as you suggested, I did not clean the firmware project before building.
Another warning I found that might be related (appears while generating the BSP):
[...] Running Make libs in psu_pmu_0/libsrc/xilsecure_v2_0/src make -C psu_pmu_0/libsrc/xilsecure_v2_0/src -s libs "SHELL=/bin/sh" "COMPILER=mb-gcc" "ARCHIVER=mb-ar" "COMPILER_FLAGS= -O2 -c -mcpu=v9.2 -mlittle-endian -mxl-barrel-shift -mxl-pattern-compare -mxl-soft-mul" "EXTRA_COMPILER_FLAGS=-ffunction-sections -fdata-sections -Wall -Wextra" Compiling XilSecure Library xsecure_rsa.c: In function 'XSecure_RsaSignVerification': xsecure_rsa.c:419:6: warning: implicit declaration of function 'XGetPSVersion_Info' [-Wimplicit-function-declaration] if (XGetPSVersion_Info() != XPS_VERSION_1) ^~~~~~~~~~~~~~~~~~ Finished building libraries 09:21:44 Build Finished (took 4s.516ms)
I checked and theoretically "xplatform_info.h" is referenced in the header file but somehow it seems like it is not parsed correctly?
07-25-2017 01:02 AM
Nobody any advice or suggestions how to fix this problem? It's a bit frustrating to get stuck while still working through the tutorial not having achieved any single line of production code...
Is there anything I can do to give further insights in the system configuration etc.?
@florentw Judging from the error message, I cannot agree that the RSA lib got removed as it parses it and tries to link it but cannot find the XGetPSVersion_Info() function from another file.
In xplatform_info.h lines 82 - 84:
#if defined (ARMR5) || (__aarch64__) || (ARMA53_32) u32 XGetPSVersion_Info(); #endif
Is the pmu covered by this #if condition? I tried to manually adjust it by commenting the #if out but on running build it gets restored to its original state...
07-25-2017 05:27 AM
Yes the PMU should use it because you are using a ZCU102 which is a aarch64.
If you want to comment the line, you need to use it in a local repo (copy the library and ad it to the local repo)
07-25-2017 05:58 AM
07-25-2017 07:13 AM
Yes you are right the PMU FW runs on an MB... I replied too quickly...
On my project, the use of XGetPSVersion_Info is also marked as implicit declaration of function (I also have a warning) but I have no issue building the PMU FW.