Author Topic: "multiple definition" errors building fsbl for SI5338 on TE0803 SoM in Vitis  (Read 373 times)

RichardH

  • Active Member
  • *
  • Posts: 6
Hi

I am using a TE0803 SoM which has a ZU4 SoC, in conjunction with a TEBF0808 baseboard.

I want to enable the SI5338 clock generator on the SoM to a specific frequency. To do this, I am trying to modify the register header file in the FSBL as described here:
https://wiki.trenz-electronic.de/display/PD/Si5338

and here: https://wiki.trenz-electronic.de/display/PD/TE0803+StarterKit#TE0803StarterKit-zynqmp_fsbl.1

I have created Platform project in Vitis and a Standalone Application project on top of that using the fsbl template. I have then replaced the fsbl files with the (TE Mod) modified versions from StarterKit/sw_lib/sw_apps/zynqmp_fsbl/src. I also added all files begining with te_ from StarterKit/sw_lib/sw_apps/zynqmp_fsbl/src.

Then I have used ClockBuilder Pro to export the required register file for the settings I want and replaced te_Si5338-Registers.h with this.

Unfortunately when I try to build this I get a large number of errors regarding multiple definitions, for example:

c:/xilinx/vitis/2021.2/gnu/aarch64/nt/aarch64-none/x86_64-oesdk-mingw32/usr/bin/aarch64-xilinx-elf/../../libexec/aarch64-xilinx-elf/gcc/aarch64-xilinx-elf/10.2.0/real-ld.exe: ./src/te_si5338.o (symbol from plugin): in function `si5338_version':
(.text+0x0): multiple definition of `Uart_Ps'; ./src/te_iic_platform.o (symbol from plugin):(.text+0x0): first defined here
c:/xilinx/vitis/2021.2/gnu/aarch64/nt/aarch64-none/x86_64-oesdk-mingw32/usr/bin/aarch64-xilinx-elf/../../libexec/aarch64-xilinx-elf/gcc/aarch64-xilinx-elf/10.2.0/real-ld.exe: ./src/te_si5338.o (symbol from plugin): in function `si5338_version':
(.text+0x0): multiple definition of `I2cInstancePtr'; ./src/te_iic_platform.o (symbol from plugin):(.text+0x0): first defined here


Is my approach correct? Have I missed any required steps or am I taking the wrong approach?

RichardH

  • Active Member
  • *
  • Posts: 6
Reverting to Vitis 2020 seems to have removed the issue.

JH

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1924
Hi,
it's a problem with 21.2 compiler and declaration
check "te_iic_platform.c/h" and "te_uart.h/c".
XIicPs, XGpio,XUartLite,XUartNs550 and XUartPs objects must be declared as extern now.
change this on the header files and add this instances also to the c file.


We will change this on our 2021.2 update.
br
John