cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
asmi84
Observer
Observer
448 Views
Registered: ‎09-02-2017

Petalinux 2020.2 build failure - Microblaze without Ethernet

I've built a system according to minimal specs outlined in UG1144, but without ethernet MAC, and the build fails with a super long log output, but I think the relevant part is this:

microblazeel-xilinx-linux-ld.bfd -Bstatic --no-dynamic-linker -Ttext 0x80100000 -o u-boot -T u-boot.lds arch/microblaze/cpu/start.o --start-group arch/microblaze/cpu/built-in.o arch/microblaze/lib/built-in.o board/xilinx/microblaze-generic/built-in.o cmd/built-in.o common/built-in.o disk/built-in.o drivers/built-in.o drivers/dma/built-in.o drivers/gpio/built-in.o drivers/i2c/built-in.o drivers/net/built-in.o drivers/net/phy/built-in.o drivers/power/built-in.o drivers/power/battery/built-in.o drivers/power/domain/built-in.o drivers/power/fuel_gauge/built-in.o drivers/power/mfd/built-in.o drivers/power/pmic/built-in.o drivers/power/regulator/built-in.o drivers/serial/built-in.o drivers/spi/built-in.o drivers/usb/cdns3/built-in.o drivers/usb/common/built-in.o drivers/usb/dwc3/built-in.o drivers/usb/emul/built-in.o drivers/usb/eth/built-in.o drivers/usb/host/built-in.o drivers/usb/musb-new/built-in.o drivers/usb/musb/built-in.o drivers/usb/phy/built-in.o drivers/usb/ulpi/built-in.o dts/built-in.o env/built-in.o fs/built-in.o lib/built-in.o net/built-in.o --end-group -L /home/asmi/projects/v2020.2/sp50/build/tmp/work/microblazeel_v11.0_bs_cmp_mh_div_generic-xilinx-linux/u-boot-xlnx/v2020.01-xilinx-v2020.2+gitAUTOINC+bb4660c33a-r0/recipe-sysroot/usr/lib/microblazeel-xilinx-linux/9.2.0 -lgcc -Map u-boot.map; true
microblazeel-xilinx-linux-ld.bfd: cmd/built-in.o: in function `format_mac_pxe':
/home/asmi/projects/v2020.2/sp50/build/tmp/work/microblazeel_v11.0_bs_cmp_mh_div_generic-xilinx-linux/u-boot-xlnx/v2020.01-xilinx-v2020.2+gitAUTOINC+bb4660c33a-r0/git/cmd/pxe_utils.c:49: undefined reference to `eth_get_dev_index'
microblazeel-xilinx-linux-ld.bfd: /home/asmi/projects/v2020.2/sp50/build/tmp/work/microblazeel_v11.0_bs_cmp_mh_div_generic-xilinx-linux/u-boot-xlnx/v2020.01-xilinx-v2020.2+gitAUTOINC+bb4660c33a-r0/git/cmd/pxe_utils.c:49: undefined reference to `eth_env_get_enetaddr_by_index'
make[1]: *** [/home/asmi/projects/v2020.2/sp50/build/tmp/work/microblazeel_v11.0_bs_cmp_mh_div_generic-xilinx-linux/u-boot-xlnx/v2020.01-xilinx-v2020.2+gitAUTOINC+bb4660c33a-r0/git/Makefile:1671: u-boot] Error 1
make[1]: Leaving directory '/home/asmi/projects/v2020.2/sp50/build/tmp/work/microblazeel_v11.0_bs_cmp_mh_div_generic-xilinx-linux/u-boot-xlnx/v2020.01-xilinx-v2020.2+gitAUTOINC+bb4660c33a-r0/build'
make: *** [Makefile:167: sub-make] Error 2
make: Leaving directory '/home/asmi/projects/v2020.2/sp50/build/tmp/work/microblazeel_v11.0_bs_cmp_mh_div_generic-xilinx-linux/u-boot-xlnx/v2020.01-xilinx-v2020.2+gitAUTOINC+bb4660c33a-r0/git'
WARNING: /home/asmi/projects/v2020.2/sp50/build/tmp/work/microblazeel_v11.0_bs_cmp_mh_div_generic-xilinx-linux/u-boot-xlnx/v2020.01-xilinx-v2020.2+gitAUTOINC+bb4660c33a-r0/temp/run.do_compile.11932:1 exit 1 from 'exit 1'

 

The very same xsa and bitstream builds just fine in 2020.1, despite the fact that it was created in Vivado 2020.2. I tried disabling kernel networking support via petalinux-config -c kernel, but it didn't work, also tried going through options in -c u-boot (as it seems it complains about something inside u-boot), but couldn't find any options related to networking. I've attached the full build.log in case it helps with investigation.

I tried creating a project with exact same configuration, but with fake Ethernet MAC (as I don't really have PHY on a board), and the build succeeded. So the problem seems to only manifest when there are no Ethernet MACs in a system.

0 Kudos
Reply
5 Replies
stephenm
Moderator
Moderator
419 Views
Registered: ‎09-12-2007

You dont need ethernet for the microblaze. However, it does seem that the uboot defconfig is referencing this:

Can you remove the ethernet and phy references from the defconfig and try again:

https://github.com/Xilinx/u-boot-xlnx/blob/master/configs/microblaze-generic_defconfig

 

Also, as you mentioned. This is taking a long time to build in petalinux just for it to fail. You can isolate the 

uboot from petalinux and build from git sources. Once this builds, just create a patch with your changes to the xilinx-v2020.1 branch

(assuming you are using petalinux 2020.1), and add this to the uboot bbappednd in the petalinux project.

 

 

 

0 Kudos
Reply
asmi84
Observer
Observer
401 Views
Registered: ‎09-02-2017

Thanks, I figured that much. But I'm still very new to the petalinux toolchain, so can you please provide more detailed instructions as to where these files are in a project tree, and also are there any additional steps required before doing petalinux-build again once I do these manual modifications. 

As for the speed, once the build failed for the first time, subsequent attempts to build fail very quickly. I'm trying to get v2020.2 to work at the moment, the v2020.1 builds OK with the same xsa so the issue was introduced some time between 2020.1 and 2020.2.

0 Kudos
Reply
stephenm
Moderator
Moderator
393 Views
Registered: ‎09-12-2007

You cant change this directly in the defconfig:

https://github.com/Xilinx/u-boot-xlnx/blob/master/configs/microblaze-generic_defconfig

However, you can do this in the petalinux project

project-spec\meta-user\recipes-bsp\u-boot\files\bsp.cfg

0 Kudos
Reply
asmi84
Observer
Observer
353 Views
Registered: ‎09-02-2017

Thanks again for response. Unfortunately that didn't work either, and as it became clear later, it wasn't where the problem was anyway.

After extensive study of source code and config files I've traced this out to CMD_PXE (or CONFIG_CMD_PXE) config parameter of u-boot, which is dependent in the actual C source code on NET (CONFIG_NET), but it's not set up as such in cmd/Kconfig. Consequently CMD_PXE stays enabled even when NET is not, this leads to linking in pxe_utils.o, and the error message shown in the OP appearing because those symbols are defined in eth_common.o, which is gated by NET/CONFIG_NET configuration parameter. So the problem is the presence of the former combined with the lack of latter, which is why I think the config file is not set properly. And it's not possible to deselect CMD_PXE in menuconfig because it's inside "Network Commands" submenu which is hidden when NET is unselected.

I think the proper permanent fix for this issue would be a change in cmd/Kconfig which would declare CMD_PXE as dependent on NET (which it is looking at the actual source code). In the meantime the best workaround I found which involves no manual source code or config editing is enabling NET in u-boot via petalinux-config -c u-boot even when it's disabled in the kernel. This is not a very good workaround, as any change in config of anything will force NET disabled in u-boot and so you will have to run -c u-boot again, but it's the one I found to actually work.

jeffrey.johnson
Voyager
Voyager
167 Views
Registered: ‎02-07-2008

Hi @asmi84 

I just wanted to say that I've also had to deal with this issue because I too have some designs in 2020.2 that don't use Ethernet. I needed a fix that didn't go away when a customer decides to change something in the config. So I ended up patching U-Boot so that it doesn't pull in PXE.

Here is the patch (remove-pxe.patch):

diff --git a/cmd/Makefile b/cmd/Makefile
index 3feb7741c8..d0d9bc295d 100644
--- a/cmd/Makefile
+++ b/cmd/Makefile
@@ -110,7 +110,6 @@ ifdef CONFIG_PCI
 obj-$(CONFIG_CMD_PCI) += pci.o
 endif
 obj-$(CONFIG_CMD_PINMUX) += pinmux.o
-obj-$(CONFIG_CMD_PXE) += pxe.o pxe_utils.o
 obj-$(CONFIG_CMD_WOL) += wol.o
 obj-$(CONFIG_CMD_QFW) += qfw.o
 obj-$(CONFIG_CMD_READ) += read.o
@@ -129,7 +128,6 @@ obj-$(CONFIG_CMD_SETEXPR) += setexpr.o
 obj-$(CONFIG_CMD_SPI) += spi.o
 obj-$(CONFIG_CMD_STRINGS) += strings.o
 obj-$(CONFIG_CMD_SMC) += smccc.o
-obj-$(CONFIG_CMD_SYSBOOT) += sysboot.o pxe_utils.o
 obj-$(CONFIG_CMD_TERMINAL) += terminal.o
 obj-$(CONFIG_CMD_TIME) += time.o
 obj-$(CONFIG_CMD_TRACE) += trace.o

The patch must be placed in project-spec/meta-user/recipes-bsp/u-boot/files.

Then you need to add the following line to project-spec/meta-user/recipes-bsp/u-boot/u-boot-xlnx_%.bbappend

SRC_URI += "file://remove-pxe.patch"

This is by no means a "proper permanent fix" but it allows us to get past the build issue and it doesn't get overwritten when we change other configs.

Jeff

0 Kudos
Reply