Jump to content
  • 0

/dev/xdevcfg broken for pre-built ArtyZ7-20 Petalinux images


matt.valerio

Question

Posted

I've got an Arty Z7-20 board. It's powered by an external wall-wart (USB power isn't enough).

I cloned the git repo from here: https://github.com/Digilent/Petalinux-Arty-Z7-20

Then I copied the BOOT.bin and images.ub files from Arty-Z7-20/pre-built/linux/images/ onto a microSD card.

Plugged the microSD card into the Arty slot, powered on the board.

PuTTY is connected on COM10, I see the boot spew and get to a prompt. Login as root/root.

I see that the dropbear SSH server is started, so I scp my .bit file over.

Then I want to reconfigure the PL with my own bit file

cat mydesign.bit > /dev/xdevcfg
cat: write error: Connection timed out

There's mention of this being a known bug in the 2017.3 version of the Petalinux tools on the Xilinx forums here:
https://forums.xilinx.com/t5/Embedded-Linux/Petalinux-2017-3-dev-xdevcfg-cat-write-error-Connection-timed/td-p/812448
It seems like this may have also affected the 2017.2 version that was used to build the pre-build images in the Digilent repo?.

Xilinx confirmed in that forum post that the issue with /dev/xdevcfg is fixed in 2017.4.

Since the pre-built images for the ArtyZ7-20 board don't work, I'm trying to set up the Petalinux tools to build my own, but have been unsuccessful so far.

What are the chances that Digilent will release pre-built images based on Petalinux 2017.4 with the xdevcfg fix?

6 answers to this question

Recommended Posts

Posted

@matt.valerio Hey Matt, sounds like you are doing a great job!

The short answer is: Digilent will probably not release a 2017.4 version of the prebuilt image for Arty Z7-20 for at least 6 months or so.

In the mean-time, I can tell you how to update your kernel for the existing 2017.4 project so that you can take advantage of the updates to xdevcfg.

From your project run "petalinux-build -x distclean" followed by "petalinux-build -x mrproper"

then run "petalinux-config" 

select Linux Components Select --> Remote linux-kernel settings

for Remote linux-kernel git URL, type in "git://github.com/xilinx/linux-xlnx.git;protocol=https"

for Remote linux-kernel git TAG/Commit ID, type in "xilinx-v2017.4"

exit out of the config menu and save your changes. At this point, try and re-build your project and see if xdevcfg now works.

This will have updated your kernel and driver information to the same ones that are present in version 2017.4, so you should be able to take advantage of any new updates to the kernel that were made without having to start over with a brand new project.

I should also mention that I've run into problems with xdevcfg in multiple different ways. The hardware is pretty testy about bitstream format as well, so make sure you are following the correct guidelines for the bitstream format from Xilinx.

Let me know if that works for you.

Mitchell

 

 

Posted

Hi Mitchell,

Ok, after quite a bit of trial and error last night and this morning I was able to get petalinux to build, but the new image doesn't boot.

Here are the steps I followed:

Installed Petalinux 2017.2

chmod +x petalinux-v2017.2-final-installer.run
./petalinux-v2017.2-final-installer.run /opt/Xilinx/petalinux/2017.2
source /opt/Xilinx/petalinux/2017.2/settings.sh

Installed Xilinx SDK 2017.2

Use installer, then
source /opt/Xilinx/SDK/2017.2/settings64.sh

Installed the Digilent board files

Checking out the git repo

mkdir ~/git
cd  git
git clone --recursive https://github.com/Digilent/Petalinux-Arty-Z7-20.git
cd Petalinux-Arty-Z7-20
git checkout tags/v2017.2-2
cd Arty-Z7-20

(Open question: Is that the proper way to adhere to the warning on the Petalinux-Arty-Z7-20 github page that says "Warning: You should only use this repo when it is checked out on a release tag"?)

Now the steps you mention in your post above

petalinux-build -x distclean
petalinux-build -x mrproper
petalinux-config, change remote linux-kernel git URL/TAG, save when exit
petalinux-build

The build took over an hour each time (mainly because git pulls run at 1MB/sec on my network for some reason, so all of the do_fetch operations took forever). It took me a few tries to understand the build errors and figure out that the Xilinx SDK didn't have the Digilent board files installed, a crucial step (see above).

I tried to boot the kernel in QEMU.

petalinux-boot --qemu --image images/linux/zImage

The first time it hung after "Warning: unable to open an initial console", but the second time it worked after a longer delay (generating dropbear SSH keys?). I was able to ssh to localhost and run a few other commands. "Ctrl-A x" to kill the emulator.

Now packaging up the BOOT.BIN file

petalinux-package --boot --format BIN --fpga images/linux/Arty_Z7_20_wrapper.bit

Then I mount the microSD card, copied the BOOT.BIN and image.ub files to a microSD card, sync, and unmount.

Plug in the microSD card to the Arty, JP4 set to SD, plug in the wallwart power adapter, open up COM10 in PuTTY, and......nothing. No serial output.

I tried 3 times, no dice. Tried hitting the SRST button a few times, no dice.

I'm going to try to do these steps again from a completely fresh tree.

 

 

Posted

As another data point just to see if my petalinux build environment is sane, I wanted to re-run the same steps but with no modifications (changing the remote kernel URL/TAG to kernel 2017.4). This would create a set of BOOT.BIN and image.ub files that should theoretically be (nearly) identical to the ones in the pre-built directory.

New terminal
source /opt/Xilinx/petalinux/2017.2/settings.sh
source /opt/Xilinx/SDK/2017.2/settings64.sh
cd ~
mkdir Digilent
cd Digilent
mkdir no_mods
cd no_mods
git clone --recursive https://github.com/Digilent/Petalinux-Arty-Z7-20.git
cd Petalinux-Arty-Z7-20
git checkout tags/v2017.2-2
cd Arty-Z7-20
petalinux-build -x distclean
petalinux-build -x mrproper
petalinux-build
petalinux-boot --qemu --image images/linux/zImage
Booted, Ctrl-A x
petalinux-package --boot --format BIN --fpga images/linux/Arty_Z7_20_wrapper.bit

Copy images/linux/{BOOT.BIN,image.ub} to microSD card, plug into Arty Z7-20, JP4 set to SD, power on board, hook up COM10 in PuTTY and... nothing.

What am I doing wrong? This should be exactly the same as the pre-built images, so clearly there is something wrong with either my petalinux installation or the way I've checked out the Digilent git repo.

Posted

Hi @morsucci, I think I figured it out.

I was using the wrong petalinux-package command. After re-reading the Github page README https://github.com/Digilent/Petalinux-Arty-Z7-20, I see that it should be

petalinux-package --boot --force --fsbl images/linux/zynq_fsbl.elf --fpga images/linux/Arty_Z7_20_wrapper.bit --u-boot

I went back to my Petalinux project and made the changes to the remote kernel URL/TAG to pull in Xilinx kernel 2017.4, and re-ran petalinux-build, which completed without errors.

I copied the BOOT.BIN and image.ub files to the microSD card and was able to boot the Arty Z7-20 from it successfully.

The dropbear SSH server was running, so I could scp my .bit file over

Then 

cat mydesign.bit > /dev/xdevcfg

did not show an error like before, so I'm assuming that it reconfigured the PL.

With that hurdle out of the way, I can start writing my driver/application to verify that the PL was indeed reconfigured.

Thanks for the help!

Posted

@matt.valerio Thank you for the follow up. I'm glad everything is working well for you now!

Quick note on our Petalinux release projects...You can also download a .bsp of the project. This will essentially build the same project for you (already checked out on a release tag) without having to clone the repo from github. Let me know if you have any questions about this process if you are interested.

 

Have a great day.

Mitchell 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...