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 / install-gcc.md
Last active April 5, 2024 01:27
Install a different version of GCC on Ubuntu

First, add the ubuntu-toolchain-r/test PPA to your system with:

sudo apt install software-properties-common
sudo add-apt-repository ppa:ubuntu-toolchain-r/test

Install the desired GCC and G++ versions by typing:

sudo apt install gcc-7 g++-7 gcc-8 g++-8 gcc-9 g++-9
@yunqu
yunqu / qt-fix.md
Created October 21, 2020 18:14
QT error message when running petalinux-config

For petalinux-config command, sometimes I see the following error:

QCoreApplication::arguments: Please instantiate the QApplication object first
QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave.

And the petalinux-config command refuses to give me terminal window to configure the project.

To resolve this issue:

@yunqu
yunqu / UrlConnect.java
Created March 30, 2020 05:56
URL test for java class
// Test for URL in java
//
// Usage:
// $ javac UrlConnect.java
// $ java UrlConnect
//
// If failed, need to check the cacerts store to make sure
// by default this is /etc/ssl/certs/java/cacerts
// Can change the URL in the file to test other sites
@yunqu
yunqu / azure_iot.md
Last active March 26, 2020 04:50
PYNQ interacting with Azure IoT

PYNQ and Azure IoT

This article records the steps required to make Azure IoT work with PYNQ image v2.5. I am using Ultra96v2 as an example in this article.

Setup

Follow the instructions for Raspberry Pi to set up the device.

When you create the IoT hub, remember to choose 'Central US' as the region.

@yunqu
yunqu / build-bazel-qemu.md
Last active August 6, 2020 14:09
Steps to build Bazel in QEMU environment for PYNQ images

Building Bazel on QEMU

Here you'll learn how to build Bazel targetting PYNQ image (ZCU104 or Pynq-Z1) with QEMU environment.

I am using ZCU104 as an example; Pynq-Z1 is very similar (change ZCU104 to Pynq-Z1 where it is needed in my steps). Other Zynq and Zynq Ultrascale images should also work.

Requirement

@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
@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 / 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 / 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 / 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