cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
dannier
Visitor
Visitor
527 Views
Registered: ‎05-11-2020

Change image.ub from xilinx-zcu102-v2019.1-final.BSP but import overlay fail, do i lose steps? device tree?

Jump to solution

Originally, i can run following python code in jupyter on board zcu102 successfully by step1 ~ step3. but i replace kernel by step4 ~ step8 to run python code again, then it fail.

step 1: create download BSP and rootfs as below command

-- bash ~/PYNQ/sdbuild/scripts/image_from_prebuilt.sh zcu102 ~/PYNQ/boards/zcu102/xilinx-zcu102-v2019.1-final.bsp aarch64 ~/PYNQ/bionic.aarch64.2.5.img

step 2: write image to sd card.

 -- sudo dd if=./zcu102-2.5.img of=/dev/sdh bs=4M status=progress

step 3: write python code (as below) to test my bitstream.

==========python code in jupyter===================

from __future__ import print_function
import sys
sys.path.append('/home/xilinx')
from pynq import Overlay
from pynq import Bitstream
from pynq import allocate
import numpy as np
from pynq.lib.dma import *
from pynq import MMIO
from cffi import FFI
ffi = FFI()
Ol = Overlay("/home/xilinx/bit-DPR-addsubprd/DPR_add_sub_prd.bit")

======================================================

step 4: create project from my BSP

~/xilinx-zc102-2019.1$ petalinux-create -t project -s <path-to-bsp>

step 5: change rootfs from ramdisk to sd card 

~/xilinx-zc102-2019.1$petalinux-config ==> Image Packaging Configuration

step 6: build

~/xilinx-zc102-2019.1$petalinux-build

step 7: replace image.ub in 1st partition of my sd card by new image.ub in project-path/images/linux/image.ub

step 8: boot from sd card with new kernel and run python code again but fail as below

-----------------------------------jupyter error stack on zcu102----------------------------------------
RuntimeError Traceback (most recent call last)
<ipython-input-1-4d920c81e03f> in <module>()
4 import socket
5 sys.path.append('/home/xilinx')
----> 6 from pynq import Overlay
7 from pynq import Bitstream
8 from pynq import allocate

/usr/local/lib/python3.6/dist-packages/pynq/__init__.py in <module>()
31 from .uio import UioController
32 from .xlnk import Xlnk
---> 33 from .pl import PL
34 from .ps import Register
35 from .ps import Clocks

/usr/local/lib/python3.6/dist-packages/pynq/pl.py in <module>()
37 from multiprocessing.connection import Client
38 from .mmio import MMIO
---> 39 from .ps import CPU_ARCH_IS_SUPPORTED, CPU_ARCH, ZYNQ_ARCH, ZU_ARCH
40 from .devicetree import DeviceTreeSegment
41 from .devicetree import get_dtbo_path

/usr/local/lib/python3.6/dist-packages/pynq/ps.py in <module>()
320
321
--> 322 class _ClocksUltrascale(_ClocksMeta):
323 """Implementation class for all Zynq Ultrascale PS and PL clocks
324 not exposed to users.

/usr/local/lib/python3.6/dist-packages/pynq/ps.py in _ClocksUltrascale()
380
381 if CPU_ARCH_IS_SUPPORTED:
--> 382 IOPLL_CTRL = Register(CRL_APB_ADDRESS + IOPLL_CTRL_OFFSET)
383 RPLL_CTRL = Register(CRL_APB_ADDRESS + RPLL_CTRL_OFFSET)
384

/usr/local/lib/python3.6/dist-packages/pynq/registers.py in __init__(self, address, width, debug, buffer)
113 if buffer is None:
114 from .mmio import MMIO
--> 115 array = MMIO(address, np.dtype(register_type).itemsize).array
116 elif hasattr(buffer, 'view'):
117 array = buffer

/usr/local/lib/python3.6/dist-packages/pynq/mmio.py in __init__(self, base_addr, length, debug, device)
81 if device is None:
82 from .pl_server.device import Device
---> 83 device = Device.active_device
84 self.device = device
85 print("mmio base_addr " + hex(base_addr))

/usr/local/lib/python3.6/dist-packages/pynq/pl_server/device.py in active_device(cls)
89 if not hasattr(cls, '_active_device'):
90 if len(cls.devices) == 0:
---> 91 raise RuntimeError("No Devices Found")
92 cls._active_device = cls.devices[0]
93 return cls._active_device

RuntimeError: No Devices Found

---------------------------------------------------------------------

what steps do i lose? thanks for help!

0 Kudos
1 Solution

Accepted Solutions
dannier
Visitor
Visitor
464 Views
Registered: ‎05-11-2020

xlnk driver default is not enabled, that help with memory management, accelerator control, and data movement among other things. to enable driver and device tree as below.

> petalinux-config -c kernel
  (1) Device Drivers → Staging drivers → Xilinx APF Accelerator driver (ON)
  (2) Device Drivers → Staging drivers → Xilinx APF Accelerator driver → Xilinx APF DMA engines support (ON)
 - Add device tree fragment for APF driver
  (1) add path: <>/project-spec/metauser/recipes-bsp/device-tree/files/system-user.dtsi
  (2) add content:
       /{
            xlnk {
           compatible = "xlnx,xlnk-1.0";
           };
        };

View solution in original post

0 Kudos
1 Reply
dannier
Visitor
Visitor
465 Views
Registered: ‎05-11-2020

xlnk driver default is not enabled, that help with memory management, accelerator control, and data movement among other things. to enable driver and device tree as below.

> petalinux-config -c kernel
  (1) Device Drivers → Staging drivers → Xilinx APF Accelerator driver (ON)
  (2) Device Drivers → Staging drivers → Xilinx APF Accelerator driver → Xilinx APF DMA engines support (ON)
 - Add device tree fragment for APF driver
  (1) add path: <>/project-spec/metauser/recipes-bsp/device-tree/files/system-user.dtsi
  (2) add content:
       /{
            xlnk {
           compatible = "xlnx,xlnk-1.0";
           };
        };

View solution in original post

0 Kudos