Issue writing/reading from mmap device after load device tree overlay

Hi all,
I’ve been experimenting with the excellent PYNQ-PRIO design and I think I might found an issue. I’ve been searching for a while on internet with no luck and I hope maybe someone can tell me what could be going on.
My design is the same as the PYNQ-PRIO for the ZCU104 and the only modification that I did is to add an axi gpio into the static region of the PL as you can see in the next diagram.

After load successfully the iic partial configuration of the partial region 0 I’ve tried to write some value into the axi_gpio to turn on/off some leds and then the entire linux hangs.
I’ve tried several configuration and what it seems to make the difference is not load the partial region, but the dtbo. Apparently when a dtbo is provided along with the partial region bitstream the access to /dev/mem crashes the entire system.
To probe that I ran the next code:

After that I’ve tried to read and write the axi gpio register to turn on/off leds with good results.
Then I loaded manually the dtbo by using the next commands
sudo su
mkdir -p /sys/kernel/config/device-tree/overlays/pr_0_iic
cat pr_0_iic.dtbo > /sys/kernel/config/device-tree/overlays/pr_0_iic/dtbo

After that I verified than the devicetree overlay was properly loaded by checking the i2cdetect output

Finally I tried to modify again the axi gpio led outputs by using devmem2 command getting as result the system hanging.

I was wondering if anybody with more experience could explain me what could be going on. It looks like when the dtbo is inserted something happens with the way than Linux manages the access to /dev/mem device producing this system crashes.


  • ZCU104 board running Pynq 3.0.1
  • PYNQ-PRIO design compiled in Vivado 2020.2

Thanks, Toni

Hi @anrusal,

Welcome to the PYNQ community.

I am not familiar with the PYNQ-PRIO project, but I see that it has not been updated in a while. I have worked in DFX, in particular with the Composable Overlay. PYNQ Composable Overlays Introduction — PYNQ Composable Overlays 1.0.2 documentation, perhaps this is something you can look at.

Regarding the issue, if the dtbo has the same basename as the partial bitstream (and it is in the same directory) it will be downloaded automatically. You can check if the dtbo is applied properly looking at the dmesg, or if you plug in the JTAG, the output should show up there as well.

Are you enabling the pr decouplers before downloading the partial bitstream and disabling them after programming the partial region?

You can also check the changes that the dbto made, by looking at the current device tree. linux - How to list the kernel Device Tree - Unix & Linux Stack Exchange