Skip to content

Instantly share code, notes, and snippets.

View yunqu's full-sized avatar
🏠
Working from home

Yun Rock Qu yunqu

🏠
Working from home
View GitHub Profile
@yunqu
yunqu / check_os_package.py
Created April 22, 2019 20:42
Code to check OS package in Python
import re
import shutil
import subprocess
rootfs_packages = {
'jupyter': '4.4',
'python3-opencv': '3.2.0',
'lm-sensors': '1'
}
@yunqu
yunqu / CMakeLists.txt
Created May 1, 2019 17:12
CMake for PYNQ package
PROJECT(PYNQ)
CMAKE_MINIMUM_REQUIRED(VERSION 3.0.0)
SET(PROJECT_DESCRIPTION "https://github.com/Xilinx/PYNQ")
SET(CMAKE_CXX_STANDARD 14)
SET(CMAKE_CXX_STANDARD_REQUIRED ON)
MESSAGE("-- Target system processor: ${CMAKE_SYSTEM_PROCESSOR}")
SET(PYNQ_VERSION_MAJOR 2)
SET(PYNQ_VERSION_MINOR 5)
SET(PYNQ_VERSION_STRING ${PYNQ_VERSION_MAJOR}.${PYNQ_VERSION_MINOR})
MESSAGE("-- PYNQ version: ${PYNQ_VERSION_STRING}")
@yunqu
yunqu / pynq-on-debian.md
Last active April 11, 2020 23:21
Installation steps for PYNQ on Debian Stretch

Install PYNQ on Debian Stretch

We will detail the steps for PYNQ installation on Debian Stretch. We will use the Debian Stretch released along with DNNDK, on ZCU104 board. For other Debian-based OS, the flow will be similar.

Step 1. Set up the image

This step is to configure the image, which is specific to ZCU104 Debian Stretch released. It is not

@yunqu
yunqu / dtbo_led_demo.ipynb
Last active May 10, 2019 22:07
LED demo using device tree overlay
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

1. download bitstream

echo 0 > /sys/class/fpga_manager/fpga0/flags
cp ultra_wrapper.bit /lib/firmware/
echo ultra_wrapper.bit > /sys/class/fpga_manager/fpga0/firmware

2. apply device tree blob

mkdir -p /sys/kernel/config/device-tree/overlays/pl
@yunqu
yunqu / pynq-boot.md
Last active May 11, 2023 14:32
Steps to modify boot device tree in PYNQ image

Quick Steps to Modify Device Tree

This document covers the simple steps to modify an existing device tree in a Petalinux-generated boot partition. For detailed information, you can refer to the steps on Xilinx Wiki page.

Note starting from image v2.3, the customized boot steps are no longer supported by the PYNQ SD build flow. Instead, Petalinux will be used to generate the boot partition. Petalinux has certain requirements on the boot files; the resulting

@yunqu
yunqu / apt-list-installed
Last active October 5, 2019 07:06
source list from pynq_vm
Listing...
a11y-profile-manager-indicator/xenial,now 0.1.10-0ubuntu3 amd64 [installed,automatic]
account-plugin-facebook/xenial,xenial,now 0.12+16.04.20160126-0ubuntu1 all [installed,automatic]
account-plugin-flickr/xenial,xenial,now 0.12+16.04.20160126-0ubuntu1 all [installed,automatic]
account-plugin-google/xenial,xenial,now 0.12+16.04.20160126-0ubuntu1 all [installed,automatic]
accountsservice/xenial-updates,now 0.6.40-2ubuntu11.3 amd64 [installed]
acl/xenial,now 2.2.52-3 amd64 [installed]
acpi-support/xenial,now 0.142 amd64 [installed,automatic]
acpid/xenial,now 1:2.0.26-1ubuntu2 amd64 [installed]
activity-log-manager/xenial-updates,now 0.9.7-0ubuntu23.16.04.1 amd64 [installed,automatic]
@yunqu
yunqu / dropbox.md
Created January 7, 2020 21:01
Download a File from Dropbox in Linux

Download a File from Dropbox in Linux

To download a file from dropbox, the following steps have to be followed:

  1. In your dropbox folder, click the file you want to share, and then click share; and then click create link.
  2. Once the link has been created, you can copy the link by copy link. This will copy the link into your clipboard.
  3. You can paste it somewhere. It has a format similar to: https://www.dropbox.com/s/m5ay6j4to7ryr4p/resizer.bit?dl=0
@yunqu
yunqu / helloworld.c
Last active February 6, 2020 23:26
Helloworld program to debug mm core
/******************************************************************************
*
* Copyright (C) 2009 - 2014 Xilinx, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
@yunqu
yunqu / qemu_on_off.sh
Last active February 23, 2020 19:03
Script to turn on or off the QEMU environment for PYNQ
#!/bin/bash
# adjust the following 3 variables if needed
board="ZCU104"
pynq_path="/opt/builds/PYNQ_20180529"
image="${pynq_path}/sdbuild/output/ZCU104-2.5.img"
if [[ $(sudo losetup -a | head -c1 | wc -c) -ne 0 ]]; then
echo "Image is mounted. Unmounting it..."
mounted=1