2020年6月14日日曜日

ultra96+petalinux2019.2+ros2 dashingでpwm_controlをしてみた


subscriberを改造し、uio経由でPWM制御します。uioはここを参考にしています。
ultra96v2_oobでは以下の通りの準備が必要です。
ros_controlの作法とかc++の作法は知らないのであしからず。

1.configでCONFIG_SUBSYSTEM_REMOVE_PL_DTBのオプションを無効にし、BOOTARGSでuioを有効にするオプションを追加する。
diff --git a/project-spec/configs/config b/project-spec/configs/config
index 8663a10..806558c 100644
--- a/project-spec/configs/config
+++ b/project-spec/configs/config
@@ -154,7 +154,7 @@ CONFIG_SUBSYSTEM_BOOTARGS_EARLYPRINTK=y

 CONFIG_SUBSYSTEM_DEVICETREE_FLAGS=""
 # CONFIG_SUBSYSTEM_DTB_OVERLAY is not set
-CONFIG_SUBSYSTEM_REMOVE_PL_DTB=y
+# CONFIG_SUBSYSTEM_REMOVE_PL_DTB is not set

 #
 # ARM Trusted Firmware Compilation Configuration
@@ -241,4 +241,4 @@ CONFIG_YOCTO_ENABLE_DEBUG_TWEAKS=y
 # User Layers
 #
 CONFIG_USER_LAYER_0=""
-CONFIG_SUBSYSTEM_BOOTARGS_GENERATED="earlycon console=ttyPS0,115200 clk_ignore_unused root=/dev/mmcblk0p2 rw rootwait"
+CONFIG_SUBSYSTEM_BOOTARGS_GENERATED="earlycon console=ttyPS0,115200 clk_ignore_unused root=/dev/mmcblk0p2 rw rootwait uio_pdrv_genirq.of_id=generic-uio"
diff --git a/project-spec/meta-plnx-generated/recipes-bsp/device-tree/device-tree.bbappend b/project-spec/meta-plnx-generated/recipes-bsp/device-tree/device-tree.bbappend
index 2bce90c..b5f8609 100644
--- a/project-spec/meta-plnx-generated/recipes-bsp/device-tree/device-tree.bbappend
+++ b/project-spec/meta-plnx-generated/recipes-bsp/device-tree/device-tree.bbappend
@@ -3,7 +3,6 @@ YAML_MAIN_MEMORY_CONFIG_forcevariable = "PSU_DDR_0"
XSCTH_WS = "${TOPDIR}/../components/plnx_workspace/device-tree"
FILESEXTRAPATHS_append := ":${sysconf}"
YAML_CONSOLE_DEVICE_CONFIG_forcevariable = "psu_uart_1"
-YAML_REMOVE_PL_DT = "1"
export PETALINUX
SRC_URI_append ="\
file://config\
device-treeに自動生成されたPL設定を反映するためにCONFIG_SUBSYSTEM_REMOVE_PL_DTBを無効にし、uio使用するためのパラメータを追加しました。

2.設定が衝突するdevice-treeの記述の修正とPWM_w_Int_0をuioで使用する設定を行う
diff --git a/project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi b/project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi
index d7be975..cb4ce5e 100755
--- a/project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi
+++ b/project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi
@@ -194,18 +194,22 @@
reg = <0>;
};
};
-&amba {
- axi_intc_0: axi-interrupt-ctrl {
- #interrupt-cells = <2>;
- compatible = "xlnx,xps-intc-1.00.a";
- interrupt-controller;
- reg = <0x0 0x80020000 0x0 0x1000>;
- xlnx,kind-of-intr = <0x0>;
- xlnx,num-intr-inputs = <0x20>;
- interrupt-parent = <&gic>;
- interrupts = <0 89 4>;
- };

+&axi_intc_0 {
+ #interrupt-cells = <2>;
+ compatible = "xlnx,xps-intc-1.00.a";
+ interrupt-controller;
+ reg = <0x0 0x80020000 0x0 0x1000>;
+ xlnx,kind-of-intr = <0x0>;
+ xlnx,num-intr-inputs = <0x20>;
+ interrupt-parent = <&gic>;
+ interrupts = <0 89 4>;
+};
+&PWM_w_Int_0 {
+ compatible = "generic-uio";
+};
+
+&amba {
zyxclmm_drm {
compatible = "xlnx,zocl";
status = "okay";
axi_intc_0の設定が衝突するので、system-user.dtsiのaxi_intc_0を参照して設定を上書きするように変更ました。(もしかしたらaxi_intc_0の設定は消すだけでもいいかもしれないけど調べていない)
ultra96v2_oobではPWM用のIPがPWM_w_Int_0として用意してあり、0x80070000にアサインされています。
この信号の出力はLow Speed Expansion Connectorの29ピンに接続されているので、テスターで設定に従って動作しているか調べることが可能です。

3.ros2 dashingからアクセスできるようにpwm_controlノードを準備する。
rclcppとstd_msgsに依存したament_cmakeでbuildするpwm_controlパッケージを作成します。pwm_controlのソースは以下の通りとしました。ホストのcolconでbuild可能なことを確認し、git commit=>hashを指定しての.bbファイルを作成して、petalinux-user-image.bbのインストール対象にpwm_controlを含めました。
//pwm_control.cpp
#include <cstdio>
#include <memory>
#include <fcntl.h>
#include <unistd.h>
#include <string>
#include <sys/mman.h>
#include <rclcpp/rclcpp.hpp>
#include <std_msgs/msg/int32.hpp>

class PwmControl : public rclcpp::Node
{
public:
explicit PwmControl(const std::string & topic_name)
: Node("pwm_control")
{
/* メモリアクセス用デバイスファイルを開く */
int fd;
const char* file_name = "/dev/uio4";
const int size = 0x1000;
if ((fd = open(file_name, O_RDWR | O_SYNC)) < 0) {
throw std::runtime_error("Failed to init Pwm_W_Int");
}

/* ARM(CPU)から見た物理アドレス → 仮想アドレスへのマッピング */
uio_ptr = static_cast<int*>(mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0));
if (uio_ptr == MAP_FAILED) {
close(fd);
throw std::runtime_error("Failed to init Pwm_W_Int mmap");
}

// pwm_valueトピックのコールバック関数
auto callback =
[this](const std_msgs::msg::Int32::UniquePtr msg) -> void
{
*(volatile unsigned int*)(uio_ptr) = msg->data;
RCLCPP_INFO(this->get_logger(), "pwm_value:%d", msg->data);
};

// pwm_valueトピックの受信設定
rclcpp::QoS qos(rclcpp::KeepLast(10));
sub_ = create_subscription<std_msgs::msg::Int32>(
topic_name, qos, callback);
}

~PwmControl(){
delete(uio_ptr);
}

private:
rclcpp::Subscription<std_msgs::msg::Int32>::SharedPtr sub_;
int* uio_ptr;
};

int main(int argc, char * argv[])
{
setvbuf(stdout, NULL, _IONBF, BUFSIZ);
rclcpp::init(argc, argv);

auto node = std::make_shared<PwmControl>("pwm_value");
rclcpp::spin(node);
rclcpp::shutdown();
return 0;
}

4.bitbakeからの動作確認。
sdに書き込みultra96を起動後以下のコマンドを実行。
AvnetのPWM_w_Intは先頭レジスタでDuty比を指定する仕組みのようなので、topicでDuty比が指定できることを確認しました。
ちなみにDuty比の上限は99%(990000)となっているようです。

#source ros2_setup.sh
#ros2 run pwm_control pwm_control &
#ros2 topic pub /pwm_value std_msgs/Int32 "{data: 800000}"

テスターでLow Speed Expansion Connectorの29ピンをチェックし、指定した値に応じた電圧値が出ていることを確認しました。

ros2からは普通にuio経由でアクセスすればPL部の機能にアクセス可能ということがわかりました。
次はデバイスファイルとトピック名をパラメーター指定するのと、Lチカさせてみるのが目標かな。

参考ページ
https://qiita.com/iwatake2222/items/da91ce4dc2a8a8df3c0a


2020年6月6日土曜日

ultra96+petalinux2019.2+ros2 dashingでhello worldサンプルの実行


これの続きを使ってpublisher,subscriberサンプルをultra96上で動作させます。
手順は以下の通り。

1.Superfloreを利用してレシピのお手本を生成する。
2.サンプルの取得
対象は書籍でサンプルとして公開されているhttps://github.com/youtalk/get-started-ros2とします。
ros2の使い方は書かないので本や記事等を参考にどうぞ。
 $ cd <path-to-work-dir>
 $ git clone https://github.com/youtalk/get-started-ros2
3.動作確認
以下に従い動作を確認します。
 $ cd get-started-ros2/ros2
 $ source <path-to-ros2-distro>/setup.sh
$ colcon build
$ source install/setup.sh
$ ros2 run hello_world listener &
$ ros2 run hello_world talker
[INFO] [talker]: Hello world!
[INFO] [talker]: Hello world!
[INFO] [listener]: Hello world!
[INFO] [talker]: Hello world!
[INFO] [listener]: Hello world!
[INFO] [talker]: Hello world!
[INFO] [listener]: Hello world!
[INFO] [talker]: Hello world!
[INFO] [listener]: Hello world!
4.パッケージ単位でgitリポジトリ化する
パッケージ単位でyoctoのレシピ作成するので、パッケージ単位でリポジトリ化しただけです。yoctoで使用可能なfile等によって保存箇所を指定する等の方法を用いても問題ないはずです。
navigation2のパッケージを確認するとbranchでパッケージ毎のリリース管理を行っているようですね。(bloom使うとこうなるのかどうかは調べていない。今度調べる。)
 $ cd <path-to-work-dir>
 $ mkdir my_hello_world
$ cd my_hello_world
$ cp -rf ../get-started-ros2/ros2/hello_world .
$ cp -rf ../get-started-ros2/ros2/hello_world_msgs .
$ cd hello_world
$ git init
$ git add .
$ git commit -m "test"
$ git log #<hash1>をメモ
$ cd ../hello_world_msgs
$ git init
$ git add .
$ git commit -m "test"
$ git log #<hash2>をメモ

5.レシピを作成
 $ cd <path-to-petalinux-project-dir>/project-spec/meta-user/recipes-apps
 $ mkdir ros2_helloworld
$ cd ros2_helloworld
$ cp <path-to-meta-ros>/meta-ros2-dashing/generated-recipes/navigation2/nav2-msgs_0.2.6-1.bb ./hello-world.bb
$ cp hello-world.bb hello-world-msgs.bb

それぞれのファイルは以下の通り編集する。BUILD_DEPENDS等はpackage.xmlと揃えておけば問題ないと思われます。また、ROS_BUILDTOOL_DEPENDSは末尾に"-native"を付与しておかないとうまく動作しませんでした。
# hello_world.bb
inherit ros_distro_dashing
inherit ros_superflore_generated

DESCRIPTION = "ROS2 helloworld"
AUTHOR = "Akira Nishiyama <mr081677@gmaix.com>"
HOMEPAGE = "http://mtwestsun.blogspot.com"
SECTION = "devel"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"

ROS_CN = "hello_world"
ROS_BPN = "hello_world"

ROS_BUILD_DEPENDS = "rclcpp rclcpp-components hello-world-msgs"

ROS_BUILDTOOL_DEPENDS = " \
    ament-cmake-native \
"

ROS_EXPORT_DEPENDS = ""

ROS_BUILDTOOL_EXPORT_DEPENDS = ""

ROS_EXEC_DEPENDS = "rclcpp rclcpp-components hello-world-msgs launch-ros"

# Currently informational only -- see http://www.ros.org/reps/rep-0149.html#dependency-tags.
ROS_TEST_DEPENDS = " \
    ament-cmake-gtest \
    ament-cmake-pytest \
    ament-lint-auto \
    ament-lint-common \
    launch \
    launch-testing \
"

DEPENDS = "${ROS_BUILD_DEPENDS} ${ROS_BUILDTOOL_DEPENDS}"
# Bitbake doesn't support the "export" concept, so build them as if we needed them to build this package (even though we actually
# don't) so that they're guaranteed to have been staged should this package appear in another's DEPENDS.
DEPENDS += "${ROS_EXPORT_DEPENDS} ${ROS_BUILDTOOL_EXPORT_DEPENDS}"

RDEPENDS_${PN} += "${ROS_EXEC_DEPENDS}"

# matches with: https://github.com/SteveMacenski/navigation2-release/archive/release/dashing/navigation2/0.2.6-1.tar.gz
#ROS_BRANCH ?= "branch=release/dashing/navigation2"
#SRC_URI = "git://github.com/SteveMacenski/navigation2-release;${ROS_BRANCH};protocol=https"
SRC_URI = "git://<path-to-work-dir>/my_hello_world/hello_world"
SRCREV = "<hash1>"
S = "${WORKDIR}/git"

ROS_BUILD_TYPE = "ament_cmake"

inherit ros_${ROS_BUILD_TYPE}

# hello-world-msg.bb

inherit ros_distro_dashing
inherit ros_superflore_generated

DESCRIPTION = "ROS2 helloworld" AUTHOR = "Akira Nishiyama <mr081677@gmaix.com>" HOMEPAGE = "http://mtwestsun.blogspot.com" SECTION = "devel" LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
ROS_CN = "hello_world"
ROS_BPN = "hello_world_msgs"

ROS_BUILD_DEPENDS = " \
action-msgs \
std-msgs \
"

ROS_BUILDTOOL_DEPENDS = " \
ament-cmake-native \
rosidl-default-generators-native \
"

ROS_EXPORT_DEPENDS = ""

ROS_BUILDTOOL_EXPORT_DEPENDS = ""

ROS_EXEC_DEPENDS = " \
action-msgs \
rosidl-default-runtime \
std-msgs \
"

# Currently informational only -- see http://www.ros.org/reps/rep-0149.html#dependency-tags.
ROS_TEST_DEPENDS = ""

DEPENDS = "${ROS_BUILD_DEPENDS} ${ROS_BUILDTOOL_DEPENDS}"
# Bitbake doesn't support the "export" concept, so build them as if we needed them to build this package (even though we actually
# don't) so that they're guaranteed to have been staged should this package appear in another's DEPENDS.
DEPENDS += "${ROS_EXPORT_DEPENDS} ${ROS_BUILDTOOL_EXPORT_DEPENDS}"

RDEPENDS_${PN} += "${ROS_EXEC_DEPENDS}"

#ROS_BRANCH ?= "branch=release/dashing/navigation2"
#SRC_URI = "git://github.com/SteveMacenski/navigation2-release;${ROS_BRANCH};protocol=https"
SRC_URI = "git://<path-to-work-dir>/my_hello_world/hello_world_msgs"
SRCREV = "<hash2>"
S = "${WORKDIR}/git"

ROS_BUILD_TYPE = "ament_cmake"

inherit ros_${ROS_BUILD_TYPE}

5.bitbake
本当はmeta-userのLAYERDEPENDS設定等しないといけないような気もするけど動作したので放置。
petalinux-user-image.bbのIMAGE_INSTALLにhello-worldを追加し、bitbakeしてください。

 $ cd <path-to-petalinux-project>
$ source prepare_bitbake.sh #ug1144のbitbakeアクセスの通り
 $ bitbake petalinux-user-image
6.動作確認
出来上がったイメージのQEMUで実行した際のログは以下の通り。
めでたしめでたし。
次はsubscriberからuio経由で外部回路を制御させてみる。

$ make qemuboot 
petalinux-boot --qemu --root --u-boot --qemu-args "-net nic -net nic -net nic -net nic,netdev=my_tap0 -netdev tap,ifname=tap0,id=my_tap0 -drive file=myfile/myramdisk/sd.img,if=sd,id=sd0,index=0,format=raw -drive file=myfile/myramdisk/sd.img,if=sd,id=sd1,index=1,format=raw"
INFO: sourcing build tools
INFO: No DTB has been specified, use the default one "/home/akira/work/ultra96v2_oob/ultra96v2_oob/petalinux/images/linux/system.dtb".
INFO: No DTB has been specified, use the default one "/home/akira/work/ultra96v2_oob/ultra96v2_oob/petalinux/images/linux/system.dtb".
INFO: Starting microblaze QEMU
INFO: Starting the above QEMU command in the background
INFO:  qemu-system-microblazeel -M microblaze-fdt   -serial mon:stdio -serial /dev/null -display none -kernel /home/akira/work/ultra96v2_oob/ultra96v2_oob/petalinux/pre-built/linux/images/pmu_rom_qemu_sha3.elf -device loader,file=/home/akira/work/ultra96v2_oob/ultra96v2_oob/petalinux/images/linux/pmufw.elf      -hw-dtb /home/akira/work/ultra96v2_oob/ultra96v2_oob/petalinux/images/linux/zynqmp-qemu-multiarch-pmu.dtb -machine-path /tmp/tmp.hRZ7VQMSxE -device loader,addr=0xfd1a0074,data=0x1011003,data-len=4 -device loader,addr=0xfd1a007C,data=0x1010f03,data-len=4 
qemu-system-microblazeel: Failed to connect socket /tmp/tmp.hRZ7VQMSxE/qemu-rport-_pmu@0: No such file or directory
qemu-system-microblazeel: info: QEMU waiting for connection on: disconnected:unix:/tmp/tmp.hRZ7VQMSxE/qemu-rport-_pmu@0,server
INFO: Set QEMU tftp to /home/akira/work/ultra96v2_oob/ultra96v2_oob/petalinux/images/linux 
INFO: TCP PORT is free 
INFO: Starting aarch64 QEMU
INFO:  qemu-system-aarch64 -M arm-generic-fdt   -serial /dev/null -serial mon:stdio -serial /dev/null -serial /dev/null -display none -device loader,file=/home/akira/work/ultra96v2_oob/ultra96v2_oob/petalinux/images/linux/bl31.elf,cpu-num=0 -device loader,file=/home/akira/work/ultra96v2_oob/ultra96v2_oob/petalinux/images/linux/u-boot.elf -gdb tcp::9000 -dtb /home/akira/work/ultra96v2_oob/ultra96v2_oob/petalinux/images/linux/system.dtb    -hw-dtb /home/akira/work/ultra96v2_oob/ultra96v2_oob/petalinux/images/linux/zynqmp-qemu-multiarch-arm.dtb -machine-path /tmp/tmp.hRZ7VQMSxE -global xlnx,zynqmp-boot.cpu-num=0 -global xlnx,zynqmp-boot.use-pmufw=true -net nic -net nic -net nic -net nic,netdev=my_tap0 -netdev tap,ifname=tap0,id=my_tap0 -drive file=myfile/myramdisk/sd.img,if=sd,id=sd0,index=0,format=raw -drive file=myfile/myramdisk/sd.img,if=sd,id=sd1,index=1,format=raw   -m 4G
Executing /etc/qemu-ifup
Bringing up tap0 for bridged mode...
Adding tap0 to br0...
QEMU 2.11.1 monitor - type 'help' for more information
(qemu) audio: Could not init `oss' audio driver
qemu-system-aarch64: warning: vlan 0 is not connected to host network
PMU Firmware 2019.2	Mar 25 2020   13:32:02
PMU_ROM Version: xpbr-v8.1.0-0
NOTICE:  ATF running on XCZUUNKN/QEMU v4/RTL0.0 at 0xfffea000
NOTICE:  BL31: Secure code at 0x60000000
NOTICE:  BL31: Non secure code at 0x10080000
NOTICE:  BL31: v2.0(release):xilinx-v2019.1-12-g713dace9
NOTICE:  BL31: Built : 01:40:08, Jun  2 2020
PMUFW:	v1.1


U-Boot 2019.01 (Jun 05 2020 - 10:08:23 +0000)

Model: Avnet Ultra96 Rev1
Board: Xilinx ZynqMP
DRAM:  2 GiB
EL Level:	EL2
Chip ID:	unknown
MMC:   mmc@ff160000: 0, mmc@ff170000: 1
Loading Environment from FAT... *** Warning - bad CRC, using default environment

In:    serial@ff010000
Out:   serial@ff010000
Err:   serial@ff010000
Model: Avnet Ultra96 Rev1
Board: Xilinx ZynqMP
Bootmode: JTAG_MODE
Reset reason:	
Net:   ZYNQ GEM: ff0e0000, phyaddr ffffffff, interface gmii
eth0: ethernet@ff0e0000
U-BOOT for ultra96v2-oob-2019_2

Hit any key to stop autoboot:  0 
Device: mmc@ff160000
Manufacturer ID: aa
OEM: 5859
Name: QEMU! 
Bus Speed: 17361111
Mode : SD Legacy
Rd Block Len: 512
SD version 2.0
High Capacity: Yes
Capacity: 19.5 GiB
Bus Width: 4-bit
Erase Group Size: 512 Bytes
17931120 bytes read in 2714 ms (6.3 MiB/s)
## Loading kernel from FIT Image at 10000000 ...
   Using 'conf@system-top.dtb' configuration
   Trying 'kernel@1' kernel subimage
     Description:  Linux kernel
     Type:         Kernel Image
     Compression:  uncompressed
     Data Start:   0x100000f8
     Data Size:    17875456 Bytes = 17 MiB
     Architecture: AArch64
     OS:           Linux
     Load Address: 0x00080000
     Entry Point:  0x00080000
     Hash algo:    sha1
     Hash value:   23573d0df39a3f0530c9e7f9d1ab2ef551cebf23
   Verifying Hash Integrity ... sha1+ OK
## Loading fdt from FIT Image at 10000000 ...
   Using 'conf@system-top.dtb' configuration
   Trying 'fdt@system-top.dtb' fdt subimage
     Description:  Flattened Device Tree blob
     Type:         Flat Device Tree
     Compression:  uncompressed
     Data Start:   0x1110c3fc
     Data Size:    53757 Bytes = 52.5 KiB
     Architecture: AArch64
     Hash algo:    sha1
     Hash value:   a66528d068a418f56a14c41dcc8807fd6e11747b
   Verifying Hash Integrity ... sha1+ OK
   Booting using the fdt blob at 0x1110c3fc
   Loading Kernel Image ... OK
   Loading Device Tree to 0000000007fef000, end 0000000007fff1fc ... OK

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[    0.000000] Linux version 4.19.0 (oe-user@oe-host) (gcc version 8.2.0 (GCC)) #1 SMP Mon Jun 1 13:51:25 UTC 2020
[    0.000000] Machine model: Avnet Ultra96 Rev1
[    0.000000] earlycon: cdns0 at MMIO 0x00000000ff010000 (options '115200n8')
[    0.000000] bootconsole [cdns0] enabled
[    0.000000] efi: Getting EFI parameters from FDT:
[    0.000000] efi: UEFI not found.
[    0.000000] cma: Reserved 256 MiB at 0x000000006fc00000
[    0.000000] psci: probing for conduit method from DT.
[    0.000000] psci: PSCIv1.1 detected in firmware.
[    0.000000] psci: Using standard PSCI v0.2 function IDs
[    0.000000] psci: MIGRATE_INFO_TYPE not supported.
[    0.000000] psci: SMC Calling Convention v1.1
[    0.000000] random: get_random_bytes called from start_kernel+0x94/0x3f8 with crng_init=0
[    0.000000] percpu: Embedded 22 pages/cpu @(____ptrval____) s52504 r8192 d29416 u90112
[    0.000000] Detected VIPT I-cache on CPU0
[    0.000000] CPU features: enabling workaround for ARM erratum 843419
[    0.000000] CPU features: enabling workaround for ARM erratum 845719
[    0.000000] Speculative Store Bypass Disable mitigation not required
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 512771
[    0.000000] Kernel command line: earlycon console=ttyPS0,115200 clk_ignore_unused root=/dev/mmcblk0p2 rw rootwait uio_pdrv_genirq.of_id=generic-uio
[    0.000000] Dentry cache hash table entries: 262144 (order: 9, 2097152 bytes)
[    0.000000] Inode-cache hash table entries: 131072 (order: 8, 1048576 bytes)
[    0.000000] Memory: 1767388K/2079744K available (10620K kernel code, 624K rwdata, 5364K rodata, 832K init, 308K bss, 50212K reserved, 262144K cma-reserved)
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] rcu: 	RCU event tracing is enabled.
[    0.000000] rcu: 	RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=4.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[    0.000000] GIC: Adjusting CPU interface base to 0x00000000f902f000
[    0.000000] GIC: Using split EOI/Deactivate mode
[    0.000000] irq-xilinx: /amba_pl@0/interrupt-controller@80020000: num_irq=32, edge=0x0
[    0.000000] arch_timer: cp15 timer(s) running at 65.00MHz (phys).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0xefdb196da, max_idle_ns: 440795204367 ns
[    0.000226] sched_clock: 56 bits at 65MHz, resolution 15ns, wraps every 2199023255550ns
[    0.011436] Console: colour dummy device 80x25
[    0.013663] Calibrating delay loop (skipped), value calculated using timer frequency.. 130.00 BogoMIPS (lpj=260000)
[    0.014478] pid_max: default: 32768 minimum: 301
[    0.020409] Mount-cache hash table entries: 4096 (order: 3, 32768 bytes)
[    0.021065] Mountpoint-cache hash table entries: 4096 (order: 3, 32768 bytes)
[    0.059922] ASID allocator initialised with 32768 entries
[    0.061070] rcu: Hierarchical SRCU implementation.
[    0.065615] EFI services will not be available.
[    0.068262] smp: Bringing up secondary CPUs ...
[    0.091681] Detected VIPT I-cache on CPU1
[    0.093118] CPU1: Booted secondary processor 0x0000000001 [0x410fd034]
[    0.122680] Detected VIPT I-cache on CPU2
[    0.123096] CPU2: Booted secondary processor 0x0000000002 [0x410fd034]
[    0.140402] Detected VIPT I-cache on CPU3
[    0.141098] CPU3: Booted secondary processor 0x0000000003 [0x410fd034]
[    0.142057] smp: Brought up 1 node, 4 CPUs
[    0.144672] SMP: Total of 4 processors activated.
[    0.145209] CPU features: detected: 32-bit EL0 Support
[    0.147421] CPU: All CPU(s) started at EL2
[    0.148309] alternatives: patching kernel code
[    0.186633] devtmpfs: initialized
[    0.252060] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.252913] futex hash table entries: 1024 (order: 4, 65536 bytes)
[    0.300666] xor: measuring software checksum speed
[    0.339513]    8regs     :   985.000 MB/sec
[    0.383845]    8regs_prefetch:   980.000 MB/sec
[    0.427350]    32regs    :   958.000 MB/sec
[    0.469294]    32regs_prefetch:  1093.000 MB/sec
[    0.469684] xor: using function: 32regs_prefetch (1093.000 MB/sec)
[    0.470502] pinctrl core: initialized pinctrl subsystem
[    0.506571] NET: Registered protocol family 16
[    0.516979] audit: initializing netlink subsys (disabled)
[    0.525963] audit: type=2000 audit(0.444:1): state=initialized audit_enabled=0 res=1
[    0.539224] cpuidle: using governor menu
[    0.547528] vdso: 2 pages (1 code @ (____ptrval____), 1 data @ (____ptrval____))
[    0.548535] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
[    0.569312] DMA: preallocated 256 KiB pool for atomic allocations
[    0.793643] HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages
[    0.877428] raid6: int64x1  gen()   471 MB/s
[    0.949047] raid6: int64x1  xor()    69 MB/s
[    1.020235] raid6: int64x2  gen()   635 MB/s
[    1.091523] raid6: int64x2  xor()   383 MB/s
[    1.162688] raid6: int64x4  gen()   238 MB/s
[    1.235989] raid6: int64x4  xor()   457 MB/s
[    1.307786] raid6: int64x8  gen()   544 MB/s
[    1.380568] raid6: int64x8  xor()   270 MB/s
[    1.457095] raid6: neonx1   gen()   441 MB/s
[    1.531921] raid6: neonx1   xor()   225 MB/s
[    1.603078] raid6: neonx2   gen()   370 MB/s
[    1.674293] raid6: neonx2   xor()   203 MB/s
[    1.745048] raid6: neonx4   gen()   407 MB/s
[    1.816022] raid6: neonx4   xor()   158 MB/s
[    1.888932] raid6: neonx8   gen()   414 MB/s
[    1.959675] raid6: neonx8   xor()   203 MB/s
[    1.960054] raid6: using algorithm int64x2 gen() 635 MB/s
[    1.960427] raid6: .... xor() 383 MB/s, rmw enabled
[    1.960909] raid6: using neon recovery algorithm
[    1.981309] GPIO IRQ not connected
[    1.981710] XGpio: gpio@80040000: registered, base is 510
[    1.983514] GPIO IRQ not connected
[    1.990309] XGpio: gpio@80040000: dual channel registered, base is 508
[    1.995324] GPIO IRQ not connected
[    1.995762] XGpio: gpio@80050000: registered, base is 507
[    2.002467] GPIO IRQ not connected
[    2.002987] XGpio: gpio@80060000: registered, base is 506
[    2.003671] GPIO IRQ not connected
[    2.006821] XGpio: gpio@80060000: dual channel registered, base is 505
[    2.027318] SCSI subsystem initialized
[    2.034689] usbcore: registered new interface driver usbfs
[    2.036063] usbcore: registered new interface driver hub
[    2.037595] usbcore: registered new device driver usb
[    2.039487] media: Linux media interface: v0.10
[    2.040519] videodev: Linux video capture interface: v2.00
[    2.041666] pps_core: LinuxPPS API ver. 1 registered
[    2.042107] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti 
[    2.043157] PTP clock support registered
[    2.044108] EDAC MC: Ver: 3.0.0
[    2.057178] zynqmp-ipi-mbox mailbox@ff990400: Probed ZynqMP IPI Mailbox driver.
[    2.061892] zynqmp-ipi-mbox mailbox@ff90000: Probed ZynqMP IPI Mailbox driver.
[    2.065780] FPGA manager framework
[    2.070161] Advanced Linux Sound Architecture Driver Initialized.
[    2.088054] Bluetooth: Core ver 2.22
[    2.090111] NET: Registered protocol family 31
[    2.090521] Bluetooth: HCI device and connection manager initialized
[    2.091210] Bluetooth: HCI socket layer initialized
[    2.091698] Bluetooth: L2CAP socket layer initialized
[    2.092472] Bluetooth: SCO socket layer initialized
[    2.102999] clocksource: Switched to clocksource arch_sys_counter
[    2.105095] VFS: Disk quotas dquot_6.6.0
[    2.105802] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[    2.196553] NET: Registered protocol family 2
[    2.213096] tcp_listen_portaddr_hash hash table entries: 1024 (order: 2, 16384 bytes)
[    2.214115] TCP established hash table entries: 16384 (order: 5, 131072 bytes)
[    2.215876] TCP bind hash table entries: 16384 (order: 6, 262144 bytes)
[    2.218820] TCP: Hash tables configured (established 16384 bind 16384)
[    2.223751] UDP hash table entries: 1024 (order: 3, 32768 bytes)
[    2.224807] UDP-Lite hash table entries: 1024 (order: 3, 32768 bytes)
[    2.228275] NET: Registered protocol family 1
[    2.237523] RPC: Registered named UNIX socket transport module.
[    2.239246] RPC: Registered udp transport module.
[    2.239727] RPC: Registered tcp transport module.
[    2.240206] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    2.261390] hw perfevents: no interrupt-affinity property for /pmu, guessing.
[    2.268272] hw perfevents: enabled with armv8_pmuv3 PMU driver, 1 counters available
[    2.281960] Initialise system trusted keyrings
[    2.286488] workingset: timestamp_bits=62 max_order=19 bucket_order=0
[    2.305316] NFS: Registering the id_resolver key type
[    2.306085] Key type id_resolver registered
[    2.306433] Key type id_legacy registered
[    2.307790] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    2.309026] jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
[    6.555438] NET: Registered protocol family 38
[    6.797060] Key type asymmetric registered
[    6.798752] Asymmetric key parser 'x509' registered
[    6.800016] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 247)
[    6.801611] io scheduler noop registered
[    6.801914] io scheduler deadline registered
[    6.802322] io scheduler cfq registered (default)
[    6.802623] io scheduler mq-deadline registered
[    6.803400] io scheduler kyber registered
[    7.321410] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[    7.368310] 80010000.serial: ttyS3 at MMIO 0x80011000 (irq = 84, base_baud = 4687500) is a 16550A
[    7.376797] 80030000.serial: ttyS1 at MMIO 0x80031000 (irq = 85, base_baud = 4687500) is a 16550A
[    7.537369] brd: module loaded
[    7.600943] loop: module loaded
[    7.617165] mtdoops: mtd device (mtddev=name/number) must be supplied
[    7.644140] libphy: Fixed MDIO Bus: probed
[    7.672608] tun: Universal TUN/TAP device driver, 1.6
[    7.695610] CAN device driver interface
[    7.708410] usbcore: registered new interface driver asix
[    7.710362] usbcore: registered new interface driver ax88179_178a
[    7.711718] usbcore: registered new interface driver cdc_ether
[    7.712642] usbcore: registered new interface driver net1080
[    7.713504] usbcore: registered new interface driver cdc_subset
[    7.714321] usbcore: registered new interface driver zaurus
[    7.715863] usbcore: registered new interface driver cdc_ncm
[    7.734389] usbcore: registered new interface driver uas
[    7.738599] usbcore: registered new interface driver usb-storage
[    7.756797] rtc_zynqmp ffa60000.rtc: rtc core: registered ffa60000.rtc as rtc0
[    7.760086] i2c /dev entries driver
[    7.794560] usbcore: registered new interface driver uvcvideo
[    7.795552] USB Video Class driver (1.1.1)
[    7.809335] Bluetooth: HCI UART driver ver 2.3
[    7.810010] Bluetooth: HCI UART protocol H4 registered
[    7.810372] Bluetooth: HCI UART protocol BCSP registered
[    7.811357] Bluetooth: HCI UART protocol LL registered
[    7.811753] Bluetooth: HCI UART protocol ATH3K registered
[    7.813363] Bluetooth: HCI UART protocol Three-wire (H5) registered
[    7.815413] Bluetooth: HCI UART protocol Intel registered
[    7.817260] Bluetooth: HCI UART protocol QCA registered
[    7.818296] usbcore: registered new interface driver bcm203x
[    7.820252] usbcore: registered new interface driver bpa10x
[    7.821937] usbcore: registered new interface driver bfusb
[    7.823364] usbcore: registered new interface driver btusb
[    7.823991] Bluetooth: Generic Bluetooth SDIO driver ver 0.1
[    7.825196] usbcore: registered new interface driver ath3k
[    7.827725] EDAC MC: ECC not enabled
[    7.830022] EDAC ZynqMP-OCM: ECC not enabled - Disabling EDAC driver
[    7.852833] sdhci: Secure Digital Host Controller Interface driver
[    7.853469] sdhci: Copyright(c) Pierre Ossman
[    7.853890] sdhci-pltfm: SDHCI platform and OF driver helper
[    7.863340] ledtrig-cpu: registered to indicate activity on CPUs
[    7.865152] zynqmp_firmware_probe Platform Management API v1.1
[    7.865839] zynqmp_firmware_probe Trustzone version v1.0
[    7.957818] zynqmp-pinctrl firmware:zynqmp-firmware:pinctrl: zynqmp pinctrl initialized
[    8.556274] zynqmp_clk_mux_get_parent() getparent failed for clock: lpd_wdt, ret = -22
[    8.565087] alg: No test for xilinx-zynqmp-aes (zynqmp-aes)
[    8.565803] zynqmp_aes zynqmp_aes: AES Successfully Registered
[    8.565803] 
[    8.573422] alg: No test for xilinx-keccak-384 (zynqmp-keccak-384)
[    8.579486] alg: No test for xilinx-zynqmp-rsa (zynqmp-rsa)
[    8.593351] usbcore: registered new interface driver usbhid
[    8.595353] usbhid: USB HID core driver
[    8.660273] fpga_manager fpga0: Xilinx ZynqMP FPGA Manager registered
[    8.669562] usbcore: registered new interface driver snd-usb-audio
[    8.693210] pktgen: Packet Generator for packet performance testing. Version: 2.75
[    8.711485] Initializing XFRM netlink socket
[    8.712945] NET: Registered protocol family 10
[    8.729926] Segment Routing with IPv6
[    8.734334] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[    8.745230] NET: Registered protocol family 17
[    8.746273] NET: Registered protocol family 15
[    8.748613] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[    8.755549] can: controller area network core (rev 20170425 abi 9)
[    8.757113] NET: Registered protocol family 29
[    8.757581] can: raw protocol (rev 20170425)
[    8.757973] can: broadcast manager protocol (rev 20170425 t)
[    8.758825] can: netlink gateway (rev 20170425) max_hops=1
[    8.762473] Bluetooth: RFCOMM TTY layer initialized
[    8.763743] Bluetooth: RFCOMM socket layer initialized
[    8.765009] Bluetooth: RFCOMM ver 1.11
[    8.767666] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[    8.768171] Bluetooth: BNEP filters: protocol multicast
[    8.768732] Bluetooth: BNEP socket layer initialized
[    8.769283] Bluetooth: HIDP (Human Interface Emulation) ver 1.2
[    8.771430] Bluetooth: HIDP socket layer initialized
[    8.775838] 9pnet: Installing 9P2000 support
[    8.776708] Key type dns_resolver registered
[    8.784690] registered taskstats version 1
[    8.785170] Loading compiled-in X.509 certificates
[    8.792487] Btrfs loaded, crc32c=crc32c-generic
[    8.870027] ff000000.serial: ttyPS2 at MMIO 0xff000000 (irq = 42, base_baud = 10416666) is a xuartps
[    8.883325] ff010000.serial: ttyPS0 at MMIO 0xff010000 (irq = 43, base_baud = 2480158) is a xuartps
[    8.886617] console [ttyPS0] enabled
[    8.886617] console [ttyPS0] enabled
[    8.891606] bootconsole [cdns0] disabled
[    8.891606] bootconsole [cdns0] disabled
[    8.908709] of-fpga-region fpga-full: FPGA Region probed
[    8.931214] xilinx-dpdma fd4c0000.dma: Xilinx DPDMA engine is probed
[    8.945376] xilinx-zynqmp-dma fd500000.dma: ZynqMP DMA driver Probe success
[    8.948978] xilinx-zynqmp-dma fd510000.dma: ZynqMP DMA driver Probe success
[    8.953258] xilinx-zynqmp-dma fd520000.dma: ZynqMP DMA driver Probe success
[    8.956239] xilinx-zynqmp-dma fd530000.dma: ZynqMP DMA driver Probe success
[    8.959454] xilinx-zynqmp-dma fd540000.dma: ZynqMP DMA driver Probe success
[    8.962284] xilinx-zynqmp-dma fd550000.dma: ZynqMP DMA driver Probe success
[    8.965982] xilinx-zynqmp-dma fd560000.dma: ZynqMP DMA driver Probe success
[    8.971481] xilinx-zynqmp-dma fd570000.dma: ZynqMP DMA driver Probe success
[    8.979101] xilinx-zynqmp-dma ffa80000.dma: ZynqMP DMA driver Probe success
[    8.981683] xilinx-zynqmp-dma ffa90000.dma: ZynqMP DMA driver Probe success
[    8.989595] xilinx-zynqmp-dma ffaa0000.dma: ZynqMP DMA driver Probe success
[    8.994271] xilinx-zynqmp-dma ffab0000.dma: ZynqMP DMA driver Probe success
[    8.999678] xilinx-zynqmp-dma ffac0000.dma: ZynqMP DMA driver Probe success
[    9.001607] xilinx-zynqmp-dma ffad0000.dma: ZynqMP DMA driver Probe success
[    9.005630] xilinx-zynqmp-dma ffae0000.dma: ZynqMP DMA driver Probe success
[    9.009015] xilinx-zynqmp-dma ffaf0000.dma: ZynqMP DMA driver Probe success
[    9.029169] xilinx-psgtr fd400000.zynqmp_phy: Lane:1 type:8 protocol:4 pll_locked:yes
[    9.095359] zynqmp_clk_divider_set_rate() set divider failed for ams_ref_div1, ret = -13
[    9.195585] xilinx-dp-snd-codec fd4a0000.zynqmp-display:zynqmp_dp_snd_codec0: Failed to get required clock freq
[    9.199111] xilinx-dp-snd-codec: probe of fd4a0000.zynqmp-display:zynqmp_dp_snd_codec0 failed with error -22
[    9.203738] xilinx-dp-snd-pcm zynqmp_dp_snd_pcm0: Xilinx DisplayPort Sound PCM probed
[    9.209304] xilinx-dp-snd-pcm zynqmp_dp_snd_pcm1: Xilinx DisplayPort Sound PCM probed
[    9.218557] xilinx-dp-snd-card fd4a0000.zynqmp-display:zynqmp_dp_snd_card: ASoC: CPU DAI (null) not registered
[    9.223384] OF: graph: no port node found in /amba/zynqmp-display@fd4a0000
[    9.235684] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[    9.236384] [drm] No driver support for vblank timestamp query.
[    9.246272] xlnx-drm xlnx-drm.0: bound fd4a0000.zynqmp-display (ops 0xffffff8008b9d6b8)
[    9.474269] Console: switching to colour frame buffer device 128x48
[    9.511212] zynqmp-display fd4a0000.zynqmp-display: fb0:  frame buffer device
[    9.517699] [drm] Initialized xlnx 1.0.0 20130509 for fd4a0000.zynqmp-display on minor 0
[    9.520228] zynqmp-display fd4a0000.zynqmp-display: ZynqMP DisplayPort Subsystem driver probed
[    9.524593] zynqmp_gpd_attach_dev() domain6 request failed for node 35: -13
[    9.525570] cdns-spi ff040000.spi: failed to add to PM domain domain6: -13
[    9.526435] cdns-spi: probe of ff040000.spi failed with error -13
[    9.529822] zynqmp_gpd_attach_dev() domain7 request failed for node 36: -13
[    9.531127] cdns-spi ff050000.spi: failed to add to PM domain domain7: -13
[    9.532102] cdns-spi: probe of ff050000.spi failed with error -13
[    9.552583] macb ff0e0000.ethernet: Not enabling partial store and forward
[    9.553463] macb: GEM doesn't support hardware ptp.
[    9.565631] libphy: MACB_mii_bus: probed
[    9.720080] Marvell 88E1111 ff0e0000.ethernet-ffffffff:00: attached PHY driver [Marvell 88E1111] (mii_bus:phy_addr=ff0e0000.ethernet-ffffffff:00, irq=POLL)
[    9.721785] macb ff0e0000.ethernet eth0: Cadence GEM rev 0x40070106 at 0xff0e0000 irq 30 (00:0a:35:00:22:01)
[    9.728139] xilinx-axipmon ffa00000.perf-monitor: Probed Xilinx APM
[    9.733118] xilinx-axipmon fd0b0000.perf-monitor: Probed Xilinx APM
[    9.739557] xilinx-axipmon fd490000.perf-monitor: Probed Xilinx APM
[    9.745349] xilinx-axipmon ffa10000.perf-monitor: Probed Xilinx APM
[    9.785014] dwc3 fe200000.dwc3: Failed to get clk 'ref': -2
[    9.790499] WARNING: CPU: 1 PID: 38 at include/linux/dma-mapping.h:516 dwc3_alloc_event_buffers+0x138/0x1b8
[    9.791986] Modules linked in:
[    9.792624] CPU: 1 PID: 38 Comm: kworker/1:1 Not tainted 4.19.0 #1
[    9.793094] Hardware name: Avnet Ultra96 Rev1 (DT)
[    9.794431] Workqueue: events deferred_probe_work_func
[    9.795313] pstate: 60000005 (nZCv daif -PAN -UAO)
[    9.795725] pc : dwc3_alloc_event_buffers+0x138/0x1b8
[    9.796139] lr : dwc3_alloc_event_buffers+0x6c/0x1b8
[    9.796535] sp : ffffff80092fb6e0
[    9.796791] x29: ffffff80092fb6e0 x28: 0000000000000000 
[    9.797285] x27: 0000000000000000 x26: 0000000000000000 
[    9.797689] x25: ffffffc06d14c438 x24: 0000000000001000 
[    9.798097] x23: ffffffc06cec1c10 x22: ffffff8008ae7000 
[    9.798776] x21: ffffffc06ce2d018 x20: ffffff80090f8648 
[    9.799274] x19: ffffffc06d14c418 x18: 0000000000000010 
[    9.799678] x17: 0000000000000000 x16: 0000000000000000 
[    9.800145] x15: ffffffffffffffff x14: ffffff80090f8648 
[    9.801111] x13: ffffff80891945cf x12: ffffff80091945d7 
[    9.801494] x11: 0000000000000001 x10: ffffff80091726c0 
[    9.801943] x9 : 0000000000000000 x8 : ffffffc06cef8000 
[    9.802348] x7 : 0000000000000000 x6 : 000000000000003f 
[    9.802941] x5 : 0000000000000040 x4 : ffffffc06cec1e98 
[    9.803488] x3 : 0000000000000000 x2 : 0000000000000001 
[    9.803883] x1 : ffffffc06d14c400 x0 : 0000000000000000 
[    9.804522] Call trace:
[    9.804857]  dwc3_alloc_event_buffers+0x138/0x1b8
[    9.805333]  dwc3_probe+0x7b4/0xbb0
[    9.805746]  platform_drv_probe+0x50/0xa0
[    9.806048]  really_probe+0x1c8/0x280
[    9.806339]  driver_probe_device+0x54/0xe8
[    9.807460]  __device_attach_driver+0xb8/0xe8
[    9.807867]  bus_for_each_drv+0x78/0xc8
[    9.808179]  __device_attach+0xd4/0x130
[    9.808502]  device_initial_probe+0x10/0x18
[    9.808915]  bus_probe_device+0x90/0x98
[    9.810340]  device_add+0x334/0x608
[    9.811038]  of_device_add+0x58/0x68
[    9.811460]  of_platform_device_create_pdata+0xac/0x108
[    9.812042]  of_platform_bus_create+0x294/0x390
[    9.813191]  of_platform_populate+0x74/0xd8
[    9.813731]  dwc3_of_simple_probe+0x3fc/0x528
[    9.817692]  platform_drv_probe+0x50/0xa0
[    9.818696]  really_probe+0x1c8/0x280
[    9.819245]  driver_probe_device+0x54/0xe8
[    9.820069]  __device_attach_driver+0xb8/0xe8
[    9.820424]  bus_for_each_drv+0x78/0xc8
[    9.820720]  __device_attach+0xd4/0x130
[    9.821285]  device_initial_probe+0x10/0x18
[    9.821746]  bus_probe_device+0x90/0x98
[    9.822090]  deferred_probe_work_func+0x6c/0xa0
[    9.822368]  process_one_work+0x1e4/0x340
[    9.822607]  worker_thread+0x248/0x488
[    9.823547]  kthread+0x124/0x128
[    9.823927]  ret_from_fork+0x10/0x18
[    9.824500] ---[ end trace c9727e12cc5fc9ec ]---
[    9.833639] dwc3 fe200000.dwc3: swiotlb: coherent allocation failed, size=4096
[    9.834533] CPU: 1 PID: 38 Comm: kworker/1:1 Tainted: G        W         4.19.0 #1
[    9.835352] Hardware name: Avnet Ultra96 Rev1 (DT)
[    9.835815] Workqueue: events deferred_probe_work_func
[    9.836225] Call trace:
[    9.836415]  dump_backtrace+0x0/0x148
[    9.836688]  show_stack+0x14/0x20
[    9.836839]  dump_stack+0x90/0xb4
[    9.836986]  swiotlb_alloc+0x160/0x168
[    9.837166]  __dma_alloc+0xa8/0x1e0
[    9.837327]  dwc3_alloc_event_buffers+0xd0/0x1b8
[    9.837525]  dwc3_probe+0x7b4/0xbb0
[    9.837683]  platform_drv_probe+0x50/0xa0
[    9.837858]  really_probe+0x1c8/0x280
[    9.838053]  driver_probe_device+0x54/0xe8
[    9.838298]  __device_attach_driver+0xb8/0xe8
[    9.838553]  bus_for_each_drv+0x78/0xc8
[    9.838844]  __device_attach+0xd4/0x130
[    9.839107]  device_initial_probe+0x10/0x18
[    9.839511]  bus_probe_device+0x90/0x98
[    9.839953]  device_add+0x334/0x608
[    9.840559]  of_device_add+0x58/0x68
[    9.840957]  of_platform_device_create_pdata+0xac/0x108
[    9.841839]  of_platform_bus_create+0x294/0x390
[    9.842329]  of_platform_populate+0x74/0xd8
[    9.843005]  dwc3_of_simple_probe+0x3fc/0x528
[    9.843512]  platform_drv_probe+0x50/0xa0
[    9.845004]  really_probe+0x1c8/0x280
[    9.846598]  driver_probe_device+0x54/0xe8
[    9.847556]  __device_attach_driver+0xb8/0xe8
[    9.848601]  bus_for_each_drv+0x78/0xc8
[    9.848969]  __device_attach+0xd4/0x130
[    9.849335]  device_initial_probe+0x10/0x18
[    9.849686]  bus_probe_device+0x90/0x98
[    9.849924]  deferred_probe_work_func+0x6c/0xa0
[    9.850170]  process_one_work+0x1e4/0x340
[    9.850388]  worker_thread+0x248/0x488
[    9.850610]  kthread+0x124/0x128
[    9.850935]  ret_from_fork+0x10/0x18
[    9.851436] dwc3 fe200000.dwc3: can't allocate event buffer
[    9.851827] dwc3 fe200000.dwc3: failed to allocate event buffers
[    9.853628] dwc3: probe of fe200000.dwc3 failed with error -12
[    9.858080] zynqmp_gpd_attach_dev() domain10 request failed for node 23: -13
[    9.858492] dwc3-of-simple ff9e0000.usb1: failed to add to PM domain domain10: -13
[    9.858926] dwc3-of-simple: probe of ff9e0000.usb1 failed with error -13
[    9.899651] pca954x 0-0075: probe failed
[    9.900828] i2c i2c-0: Failed to register i2c client pca9548 at 0x75 (-16)
[    9.901402] i2c i2c-0: of_i2c: Failure registering /amba/i2c@ff030000/i2cswitch@75
[    9.902004] i2c i2c-0: Failed to create I2C device for /amba/i2c@ff030000/i2cswitch@75
[    9.903138] cdns-i2c ff030000.i2c: 100 kHz mmio ff030000 irq 32
[    9.913300] cdns-wdt fd4d0000.watchdog: Xilinx Watchdog Timer with timeout 60s
[    9.919137] cdns-wdt ff150000.watchdog: Xilinx Watchdog Timer with timeout 10s
[    9.932895] cpufreq: cpufreq_online: CPU0: Running at unlisted freq: 277777 KHz
[    9.938565] cpufreq: cpufreq_online: CPU0: Unlisted initial frequency changed to: 299999 KHz
[    9.955866] zynqmp_gpd_attach_dev() domain12 request failed for node 39: -13
[    9.956521] sdhci-arasan ff160000.mmc: failed to add to PM domain domain12: -13
[    9.957115] sdhci-arasan: probe of ff160000.mmc failed with error -13
[    9.972905] sdhci-arasan ff170000.mmc: allocated mmc-pwrseq
[    9.976338] sdhci-arasan ff170000.mmc: Linked as a consumer to regulator.1
[   10.023395] mmc0: SDHCI controller on ff170000.mmc [ff170000.mmc] using ADMA 64-bit
[   10.048154] xilinx-dp-snd-card fd4a0000.zynqmp-display:zynqmp_dp_snd_card: ASoC: CPU DAI (null) not registered
[   10.057574] xilinx-dp-snd-card fd4a0000.zynqmp-display:zynqmp_dp_snd_card: ASoC: CPU DAI (null) not registered
[   10.088127] input: gpio-keys as /devices/platform/gpio-keys/input/input0
[   10.101076] rtc_zynqmp ffa60000.rtc: setting system clock to 2020-06-05 13:34:32 UTC (1591364072)
[   10.102236] of_cfs_init
[   10.105405] of_cfs_init: OK
[   10.106427] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[   10.115220] xilinx-dp-snd-card fd4a0000.zynqmp-display:zynqmp_dp_snd_card: ASoC: CPU DAI (null) not registered
[   10.134157] mmc0: Problem switching card into high-speed mode!
[   10.136072] mmc0: new SDHC card at address 4567
[   10.144558] mmcblk0: mmc0:4567 QEMU! 19.5 GiB 
[   10.171103]  mmcblk0: p1 p2
[   10.183822] xilinx-dp-snd-card fd4a0000.zynqmp-display:zynqmp_dp_snd_card: ASoC: CPU DAI (null) not registered
[   10.656803] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[   10.657643] clk: Not disabling unused clocks
[   10.658223] ALSA device list:
[   10.658526]   No soundcards found.
[   10.668827] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[   10.672876] cfg80211: failed to load regulatory.db
[   10.768587] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[   10.769697] VFS: Mounted root (ext4 filesystem) on device 179:2.
[   10.791751] devtmpfs: mounted
[   10.888023] Freeing unused kernel memory: 832K
[   10.920274] Run /sbin/init as init process
INIT: version 2.88 booting
[   12.733379] random: fast init done
Starting udev
[   14.629052] udevd[1807]: starting version 3.2.5
[   14.692496] random: udevd: uninitialized urandom read (16 bytes read)
[   14.700365] random: udevd: uninitialized urandom read (16 bytes read)
[   14.708102] random: udevd: uninitialized urandom read (16 bytes read)
[   15.156178] udevd[1808]: starting eudev-3.2.5
[   15.740370] urandom_read: 2 callbacks suppressed
[   15.740611] random: udevd: uninitialized urandom read (16 bytes read)
[   15.741860] random: udevd: uninitialized urandom read (16 bytes read)
[   15.746518] random: udevd: uninitialized urandom read (16 bytes read)
[   16.192436] zocl: loading out-of-tree module taints kernel.
[   16.225028] [drm] Probing for xlnx,zocl
[   16.228841] [drm] FPGA programming device pcap founded.
[   16.229570] [drm] PR Isolation addr 0x0
[   16.266810] [drm] Initialized zocl 2018.2.1 20180313 for amba:zyxclmm_drm on minor 1
[   16.295312] xilinx-dp-snd-card fd4a0000.zynqmp-display:zynqmp_dp_snd_card: ASoC: CPU DAI (null) not registered
[   16.980242] zynqmp_r5_remoteproc ff9a0100.zynqmp_r5_rproc: RPU core_conf: split0
[   16.981021] zynqmp_r5_remoteproc ff9a0100.zynqmp_r5_rproc: Invalid core_conf mode provided - split0 , 0
[   16.981760] zynqmp_r5_remoteproc: probe of ff9a0100.zynqmp_r5_rproc failed with error -22
[   17.589093] mali-utgard: probe of fd4b0000.gpu failed with error -14
[   31.112602] FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[   31.759425] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
Starting Ultra96 AP setup daemon.
INIT: Entering runlevel: 5
Configuring network interfaces... Successfully initialized wpa_supplicant
rfkill: Cannot get wiphy information
Could not read interface wlan0 flags: No such device
WEXT: Could not set interface 'wlan0' UP
wlan0: Failed to initialize driver interface
Cannot find device "wlan0"
[   45.235972] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
udhcpc: started, v1.29.2
[   46.328996] macb ff0e0000.ethernet eth0: link up (100/Full)
[   46.333245] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending select for 10.0.2.49
udhcpc: lease of 10.0.2.49 obtained, lease time 3600
/etc/udhcpc.d/50default: Adding DNS 10.0.2.2
Starting system message bus: dbus.
Starting haveged: haveged: listening socket at 3
haveged: haveged starting up


Starting Xserver
mount: /mnt: /dev/mmcblk0p1 already mounted on /run/media/mmcblk0p1.
mount: /mnt: /dev/mmcblk0 already mounted or mount point busy.
Starting Dropbear SSH server: mount: /mnt: /dev/mmcblk0p1 already mounted on /run/media/mmcblk0p1.
dropbear.
mount: /mnt: /dev/mmcblk0 already mounted or mount point busy.
Starting rpcbind daemon...
done.

X.Org X Server 1.20.1
X Protocol Version 11, Revision 0
Build Operating System: Linux 5.3.0-42-generic x86_64 
Current Operating System: Linux ultra96v2-oob-2019_2 4.19.0 #1 SMP Mon Jun 1 13:51:25 UTC 2020 aarch64
Kernel command line: earlycon console=ttyPS0,115200 clk_ignore_unused root=/dev/mmcblk0p2 rw rootwait uio_pdrv_genirq.of_id=generic-uio
Build Date: 24 March 2020  07:53:07PM
 
Current version of pixman: 0.34.0
	Before reporting problems, check http://wiki.x.org
	to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
	(++) from command line, (!!) notice, (II) informational,
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Fri Jun  5 13:35:19 2020
(==) Using config file: "/etc/X11/xorg.conf"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
haveged: haveged: ver: 1.9.4; arch: generic; vend: ; build: (gcc 8.2.0 CTV); collect: 128K

haveged: haveged: cpu: (VC); data: 16K (D V); inst: 16K (D V); idx: 11/40; sz: 15528/64688

haveged: haveged: tot tests(BA8): A:1/1 B:1/1 continuous tests(B):  last entropy estimate 8.00165

haveged: haveged: fills: 0, generated: 0 

[   57.159599] [drm] Pid 2250 opened device
[   57.168697] [drm] Pid 2250 closed device
[   57.264686] random: crng init done
[   57.269028] random: 2 urandom warning(s) missed due to ratelimiting
starting statd: done
Starting bluetooth: The XKEYBOARD keymap compiler (xkbcomp) reports:
> Warning:          Unsupported high keycode 372 for name  ignored
>                   X11 cannot support keycodes above 255.
>                   This warning only shows for the first high keycode.
bluetoothd.
Starting Distributed Compiler Daemon: distccErrors from xkbcomp are not fatal to the X server
/etc/rc5.d/S20distcc: start failed with error code 110
Starting internet superserver: inetd.
exportfs: can't open /etc/exports for reading
NFS daemon support not enabled in kernel
Starting ntpd: done
Starting syslogd/klogd: D-BUS per-session daemon address is: unix:abstract=/tmp/dbus-jhGaeRlEzu,guid=2055157ca40b03733a2ec37a5eda4a1f
done
mount: /mnt: /dev/mmcblk0p1 already mounted on /run/media/mmcblk0p1.
Starting internet superserver: xinetd.
mount: /mnt: /dev/mmcblk0 already mounted or mount point busy.
 * Starting Avahi mDNS/DNS-SD Daemon: avahi-daemon
Starting Telephony daemon
Starting watchdog daemon...GLib-GIO-Message: 13:35:32.531: Using the 'memory' GSettings backend.  Your settings will not be saved or shared with other applications.
done
Failed to launch bus: Failed to execute child process ?/usr/bin? (Permission denied)Starting Linux NFC daemon
matchbox: Cant find a keycode for keysym 269025056
matchbox: ignoring key shortcut XF86Calendar=!$contacts

matchbox: Cant find a keycode for keysym 2809
matchbox: ignoring key shortcut telephone=!$dates

matchbox: Cant find a keycode for keysym 269025050
matchbox: ignoring key shortcut XF86Start=!matchbox-remote -desktop

[settings daemon] Forking. run with -n to prevent fork
Starting tcf-agent: OK


(matchbox-panel:2411): dbind-WARNING **: 13:35:41.674: Error retrieving accessibility bus address: org.a11y.Bus.Error: Failed to execute child process ?/usr/bin? (Permission denied)

(matchbox-desktop:2409): dbind-WARNING **: 13:35:41.662: Error retrieving accessibility bus address: org.a11y.Bus.Error: Failed to execute child process ?/usr/bin? (Permission denied)
Last login: Fri Jun  5 13:35:41 UTC 2020 on tty1
mount: /mnt: /dev/mmcblk0p1 already mounted on /run/media/mmcblk0p1.
mount: /mnt: /dev/mmcblk0 already mounted or mount point busy.
root@ultra96v2-oob-2019_2:~# 
root@ultra96v2-oob-2019_2:~# 
root@ultra96v2-oob-2019_2:~# source ros_setup.sh
root@ultra96v2-oob-2019_2:~# ros2 pkg list
action_msgs
actionlib_msgs
ament_cmake
ament_index_cpp
ament_index_python
angles
behaviortree_cpp
builtin_interfaces
cartographer_ros
cartographer_ros_msgs
class_loader
common_interfaces
composition_interfaces
compressed_image_transport
console_bridge_vendor
costmap_queue
cv_bridge
depthimage_to_laserscan
diagnostic_msgs
dwb_controller
dwb_core
dwb_critics
dwb_msgs
dwb_plugins
dynamixel_sdk
geometry_msgs
hello_world
hello_world_msgs
hls_lfcd_lds_driver
image_geometry
image_transport
joy
kdl_parser
laser_geometry
launch
launch_ros
launch_testing
libyaml_vendor
lifecycle_msgs
map_msgs
message_filters
nav2_amcl
nav2_behavior_tree
nav2_bringup
nav2_bt_navigator
nav2_common
nav2_costmap_2d
nav2_dwb_controller
nav2_lifecycle_manager
nav2_map_server
nav2_msgs
nav2_navfn_planner
nav2_recoveries
nav2_util
nav2_voxel_grid
nav2_world_model
nav_2d_msgs
nav_2d_utils
nav_msgs
navigation2
osrf_pycommon
pluginlib
rcl
rcl_action
rcl_interfaces
rcl_lifecycle
rcl_logging_noop
rcl_yaml_param_parser
rclcpp
rclcpp_action
rclcpp_components
rclcpp_lifecycle
rclpy
rcutils
rmw
rmw_fastrtps_cpp
rmw_fastrtps_shared_cpp
rmw_implementation
rmw_implementation_cmake
robot_state_publisher
ros2action
ros2cli
ros2component
ros2launch
ros2lifecycle
ros2msg
ros2multicast
ros2node
ros2param
ros2pkg
ros2run
ros2service
ros2srv
ros2topic
ros_base
ros_core
ros_environment
ros_workspace
rosgraph_msgs
rosidl_default_generators
rosidl_default_runtime
rosidl_generator_c
rosidl_generator_py
rosidl_parser
rosidl_runtime_py
rosidl_typesupport_cpp
rosidl_typesupport_fastrtps_c
rosidl_typesupport_fastrtps_cpp
rosidl_typesupport_interface
rosidl_typesupport_introspection_c
rosidl_typesupport_introspection_cpp
sensor_msgs
shape_msgs
sros2
sros2_cmake
std_msgs
std_srvs
stereo_msgs
teleop_twist_joy
teleop_twist_keyboard
test_msgs
tf2
tf2_eigen
tf2_geometry_msgs
tf2_kdl
tf2_msgs
tf2_ros
tf2_sensor_msgs
trajectory_msgs
turtlebot3
turtlebot3_bringup
turtlebot3_cartographer
turtlebot3_description
turtlebot3_msgs
turtlebot3_navigation2
turtlebot3_node
turtlebot3_teleop
unique_identifier_msgs
urdf
visualization_msgs
yaml_cpp_vendor
root@ultra96v2-oob-2019_2:~# (sleep 5; ros2 run hello_world talker) &
[1] 4172
root@ultra96v2-oob-2019_2:~# ros2 run hello_world listener
[INFO] [talker]: Hello world!
[INFO] [talker]: Hello world!
[INFO] [talker]: Hello world!
[INFO] [talker]: Hello world!
[INFO] [talker]: Hello world!
[INFO] [talker]: Hello world!
[INFO] [talker]: Hello world!
[INFO] [talker]: Hello world!
[INFO] [talker]: Hello world!
[INFO] [talker]: Hello world!
[INFO] [talker]: Hello world!
[INFO] [talker]: Hello world!
[INFO] [talker]: Hello world!
[INFO] [talker]: Hello world!
[INFO] [talker]: Hello world!
[INFO] [talker]: Hello world!
[INFO] [listener]: Hello world!
[INFO] [talker]: Hello world!
[INFO] [listener]: Hello world!
[INFO] [talker]: Hello world!
[INFO] [listener]: Hello world!
[INFO] [talker]: Hello world!
[INFO] [listener]: Hello world!
[INFO] [talker]: Hello world!
[INFO] [listener]: Hello world!
[INFO] [talker]: Hello world!
[INFO] [listener]: Hello world!
[INFO] [talker]: Hello world!
[INFO] [listener]: Hello world!
[INFO] [talker]: Hello world!
[INFO] [listener]: Hello world!
[INFO] [talker]: Hello world!
[INFO] [listener]: Hello world!
[INFO] [talker]: Hello world!
[INFO] [listener]: Hello world!








2020年3月20日金曜日

petalinux 2019.2とultra96v2にpytorchをインストールしたときのメモ

AIエッジコンテスト(実装コンテスト)のチュートリアル【3: Ultra96ボードのCPUで推論実行】を行うために、raspberry pi向けのビルド方法を参考にしながらpetalinuxのyocto環境にpytorchを追加していきます。
petalinuxのpythonは3.5なのでPYNQ向けにビルドされたイメージはそのままでは使えません。ros2が動く環境をベースにチュートリアル実行できるように整えていきます。

yoctoのSRC_URIで指定するgit fetcherにはいくつか暗黙の条件があることを知った。
公式ページを見るのが良い。SRCREVで指定可能なのはmasterブランチだけであった。

SRC_URI="git://;branch=<branch_name>"


色々試したけどクロスコンパイル難しすぎて断念。
設定をsetup.pyから実行されるcmakeにまかせてはいけないのか、
mobile設定を活かせばいいのかは調べきれず。
そのうち調べることにしてとりあえずはtarget環境でビルドし、
wheel化したものを使用していくことに。
petalinux環境ではpython3-wheelのレシピが無いので、最新のopenembeddedから拝借してmeta-userに配置して使用します。

ビルドしたものは以下に置いておきます。
torch-1.4.0a0+7f73f1d-cp35-cp35m-linux_aarch64.whl
torchvision-0.5.0a0+85b8fbf-cp35-cp35m-linux_aarch64.whl


target環境のビルド方法は以下の通りです。
QEMUからのネットワーク接続には以下のコマンドをホストで追加する必要があります。
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADEホストのリソースが潤沢にある場合は別途搭載メモリが多い環境を作成して並列ビルドするとビルド時間短縮につながると思います。(devicetreeの変更だけで認識してくれるかと思ったけどそううまく行かなかったことは記録しておく)


実機の場合はwifiの設定が必要です。


ネットワークつながるようになったら以下の通りビルドを勧めていきます。
 ・ソースの取得
# git clone --recursive https://github.com/pytorch/pytorch
# cd pytorch
# git submodule sync
# git submodule update --init --recursive

環境変数の設定
# export NO_CUDA=1
# export NO_DISTRIBUTED=1
# export NO_MKLDNN=1 
# export BUILD_TEST=0
# export MAX_JOBS=2

・ビルドの実行
# python3 setup.py bdist_wheel

・インストールの実行
# pip3 install torch*.whl
# pip3 install torchvision*.whl

yoctoで予め含ませたいところだけどやり方が不明で断念。
C拡張部分をうまく扱わないといけなさそう。
wheelの仕様あまり理解していないから後でよく見ようとおもうけど、直接ファイル展開すれば良さそう
target環境でpipによるインストールを行うようにしている。

jupyterがemulator経由だとハングしてしまったので、以下の通り実行した。(参考)
# jupyter nbconvert --to notebook --execute demo.ipynb \
    --output mynotebook_out.ipynb --ExecutePreprocessor.timeout=2678400 \
     --allow-errors --debug

scipyが無いと言われたのでyoctoで追加する方法を調査中。

参考ページ
https://qiita.com/HirokiNakahara/items/20742dc7d2a5be209b23https://github.com/pytorch/pytorch
https://qiita.com/yyojiro/items/d91b02149aa6480ded80
https://stackoverflow.com/questions/48660051/yocto-recipe-python-whl-package/57694762#57694762
https://qiita.com/ikeyasu/items/f6216565bcfee5af96c9


2020年2月17日月曜日

ultra96+petalinux+ros2 dashingでturtlebotをgazeboで動かすまでのメモ


以下のSuperfloreを利用してレシピを生成する。
https://github.com/ros/meta-ros/wiki/Superflore-OE-Recipe-Generation-Scheme

navigation2のチュートリアル

https://ros-planning.github.io/navigation2/getting_started/index.html#running-the-example


ros2レシピ生成した後の解析でエラーはくやつを探して消す。buildでcatkin指定しているものはとりあえず消しておく。
grep 'ROS_BUILD_TYPE = "catkin"' -rl ./meta-ros2-dashing/

ROS_UNRESOLVED_PLATFORM_PKGを解決する。=>いらなかった模様。レシピインストール時に問題となったら考える。

clang-format

boost_python3が足りないと言われた。
local.confに以下を追加とのこと。(https://www.yoctoproject.org/pipermail/yocto/2015-April/024351.html)
PACKAGECONFIG_pn-boost = "python"
 
libboost_python3が見つからなかったので、以下のパッチを適用。do_install_appendとして適用 
https://patchwork.openembedded.org/patch/155696/ 

glibcのtaskhashもmismatchしたのでlocked-sig.incから消去。
glibc-localeも同様。

以下のパッチのバージョン指定に誤りがあったためビルドが通らず。
誤:meta-ros2-dashing/recipes-bbappends/vision-opencv/cv-bridge_2.1.3-1.bbappend
正:meta-ros2-dashing/recipes-bbappends/vision-opencv/cv-bridge_2.1.4-1.bbappend
エラーが取れたらパッケージを導入する。
project_spec/meta-plnx-generated/recipes-core/images/petalinux-user-image.bbでIMAGE_INSTALLに次を追加
・packagegroup-ros-turtlebot3-core
・packagegroup-ros-turtlebot3-extended
=================================================================

ros2のネットワークが落ちているとうまくトピック認識できない件について
 
以下のようにbr0とtap0を作る 
sudo brctl addbr br0
sudo ip addr add 10.0.2.2/16 dev br0
sudo ip link set br0 up
sudo ip tuntap add user akira mode tap
sudo dnsmasq --interface=br0 --bind-interfaces --dhcp-range=10.0.2.3,10.0.2.254


-net nic -net nic -net nic -net nic,netdev=my_tap0 -netdev tap,ifname=tap0,id=my_tap0
をQEMU動作の引数として渡す。 =>guestからhostへros2 topic流れてくるようになったが、host側でros2 topic echo /chatterすると、 Could not determine the type for the passed topicというメッセージが出る。
パケットキャプチャの結果、IPフラグメント通信の問題と思われる。cadence_gem.cが怪しいと思うので調査。qemu-xilinxのデバッグフラグを有効にする。locked-sig.incからqemu-xilinxを削除。


SRC_URI_append ="\
    file://0001-enable-cadence_gem-debug-flag.patch \
"
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"


EXTRA_OECONF_append = " \
                --enable-debug \
                "



From 1652e2bd5b1eb896774045f0ac06ea1887abb87d Mon Sep 17 00:00:00 2001
From: Akira Nishiyama <xxxxxxxx@gmail.com>
Date: Mon, 17 Feb 2020 00:29:30 +0900
Subject: [PATCH] enable cadence_gem debug flag

---
 hw/net/cadence_gem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c
index 26d8d5e693..74e5118be5 100644
--- a/hw/net/cadence_gem.c
+++ b/hw/net/cadence_gem.c
@@ -31,7 +31,7 @@
 #include "net/checksum.h"
 #include "exec/address-spaces.h"

-#define CADENCE_GEM_ERR_DEBUG 0
+#define CADENCE_GEM_ERR_DEBUG 1
 #define DB_PRINT(...) do {\
     if (CADENCE_GEM_ERR_DEBUG) {   \
         qemu_log(": %s: ", __func__); \
-- 
2.17.1

qemu実行後にtx側のチェックサムオフロードやめるだけで問題は解決するので特に修正はしない。


pingとros2 multicastのテスト結果を記載する。

HOSTのみでの起動確認
$/opt/ros/dashing/lib/robot_state_publisher/robot_state_publisher /opt/ros/dashing/share/turtlebot3_description/urdf/turtlebot3_waffle.urdf

$ros2 run rviz2 rviz2 -d /opt/ros/dashing/share/nav2_bringup/launch/nav2_default_view.rviz

$ /opt/ros/dashing/lib/nav2_lifecycle_manager/lifecycle_manager

$gazebo -s libgazebo_ros_init.so /opt/ros/dashing/share/turtlebot3_gazebo/worlds/turtlebot3_worlds/waffle.model



================================================
QEMU側

ethtool -K eth0 tx off
export ROS_MASTER_URI=http://10.0.2.49:11311
export ROS_IP=10.0.2.49
export ROS_HOSTNAME=10.0.2.49
export ROS_DOMAIN_ID=1
source ros_setup.sh


2020年2月5日水曜日

ultra96v2_oobにros2-dashingを導入する方法その2〜

前回の続きです。見ればわかるとおりとりあえず動かした感がものすごく強いのでご使用の際は自己責任でお願いします。

まずは環境変数の設定をします。ug1144でプロジェクトのBitbakeへのアクセスを参考にbitbakeを使用できるようにします。なお、単純なuser-layerとしての追加は試しましたがtaskhash mismatchの問題出たのでソースから生成するようにしてます。(実はlocal.confをいじるだけでいけたかもしれないけど)
 
$cd <petalinux_prj_root>
$source <petalinux_install_path>/settings.sh
$source <petalinux_install_path>/components/yocto/source/aarch64/environment-setup-aarch64-xilinx-linux
$source <petalinux_install_path>/components/yocto/source/aarch64/layers/core/oe-init-build-env
$export PATH=<petalinux_install_path>/tools/xsct/bin:$PATH
$export BB_ENV_EXTRAWHITE="$BB_ENV_EXTRAWHITE PETALINUX"

bitbake straceが動けば環境設定は成功です。
次はソースからビルドするようにpetalinuxで使用しているプロジェクト一式をgithubから持ってきます。必要なレイヤーは<petalinux_prj_root>/build/conf/bblayer.confに記載があるので、これを参考に集めてきます。


BBLAYERS := " \
  ${SDKBASEMETAPATH}/poky/meta \
  ${SDKBASEMETAPATH}/poky/meta-poky \
  ${SDKBASEMETAPATH}/meta-openembedded/meta-perl \
  ${SDKBASEMETAPATH}/meta-openembedded/meta-python \
  ${SDKBASEMETAPATH}/meta-openembedded/meta-filesystems \
  ${SDKBASEMETAPATH}/meta-openembedded/meta-gnome \
  ${SDKBASEMETAPATH}/meta-openembedded/meta-multimedia \
  ${SDKBASEMETAPATH}/meta-openembedded/meta-networking \
  ${SDKBASEMETAPATH}/meta-openembedded/meta-webserver \
  ${SDKBASEMETAPATH}/meta-openembedded/meta-xfce \
  ${SDKBASEMETAPATH}/meta-openembedded/meta-initramfs \
  ${SDKBASEMETAPATH}/meta-openembedded/meta-oe \
  ${SDKBASEMETAPATH}/meta-browser \
  ${SDKBASEMETAPATH}/meta-qt5 \
  ${SDKBASEMETAPATH}/meta-xilinx/meta-xilinx-bsp \
  ${SDKBASEMETAPATH}/meta-xilinx/meta-xilinx-pynq \
  ${SDKBASEMETAPATH}/meta-xilinx/meta-xilinx-contrib \
  ${SDKBASEMETAPATH}/meta-xilinx-tools \
  ${SDKBASEMETAPATH}/meta-petalinux \
  ${SDKBASEMETAPATH}/meta-virtualization \
  ${SDKBASEMETAPATH}/meta-openamp \
  ${SDKBASEMETAPATH}/meta-jupyter \
  ・・・ 

よって次のコマンドを実行します。最後におまけでmeta-rosもクローンしておきます。
$cd ../project-spec
$git clone https://github.com/Xilinx/poky -b rel-v2019.2
$git clone https://github.com/Xilinx/meta-openembedded -b rel-v2019.2
$git clone https://github.com/Xilinx/meta-browser -b rel-v2019.2
$git clone https://github.com/Xilinx/meta-qt5 -b rel-vc2019.2
$git clone https://github.com/Xilinx/meta-xilinx -b rel-v2019.2
$git clone https://github.com/Xilinx/meta-xilinx-tools -b rel-v2019.2
$git clone https://github.com/Xilinx/meta-petalinux -b rel-v2019.2
$git clone https://github.com/Xilinx/meta-virtualization -b rel-v2019.2
$git clone https://github.com/Xilinx/meta-openamp -b rel-v2019.2
$git clone https://github.com/Xilinx/meta-jupyter -b rel-v2019.2
$git clone https://github.com/ros/meta-ros -b origin/thud-draft

続いてbblayer.confを編集します。SDKBASEMETAPATHはgit cloneしたレイヤーを指定しておきます。
また、meta-rosの公式ビルドガイドに従うとraspberry-pi用のyocto環境を作成できるので、これを参考に以下のように追記しています。
なお、今回はどうせやるならros2のdashingだろうということでこれを選んでいます。
DISTROを変更すればros1-melodicやros2-crystal,ros2-eloquent(本当?)でも対応できると思います。
中身をよく調べもせずコピーしているので多分不要なものが含まれています。(MCF設定とか)
ROS_DISTRO_BASELINE_PLATFORM ?= "ubuntu-bionic"も参考元ではどこかで指定されるものと思われますが、petalinuxプロジェクトでは指定されないので定義して置く必要があります。


# Generated by mcf -- DO NOT EDIT
MCF_PROGRAM_VERSION = "7.2.0"

# LAYER_CONF_VERSION is increased each time build/conf/bblayers.conf
# changes incompatibly
LCONF_VERSION = "7"

SDKBASEMETAPATH = "<path_to_project-spec>"

META_ROS2_DASHING_LAYER ?= "${SDKBASEMETAPATH}/meta-ros/meta-ros2-dashing"
META_ROS2_LAYER ?= "${SDKBASEMETAPATH}/meta-ros/meta-ros2"
META_ROS_COMMON_LAYER ?= "${SDKBASEMETAPATH}/meta-ros/meta-ros-common"
META_ROS_BACKPORTS_WARRIOR_LAYER ?= "${SDKBASEMETAPATH}/meta-ros/meta-ros-backports-warrior"

BBLAYERS ?= " \
    ${SDKBASEMETAPATH}/poky/meta \
    ${SDKBASEMETAPATH}/poky/meta-poky \
    ${SDKBASEMETAPATH}/meta-openembedded/meta-perl \
    ${SDKBASEMETAPATH}/meta-openembedded/meta-python \
    ${SDKBASEMETAPATH}/meta-openembedded/meta-filesystems \
    ${SDKBASEMETAPATH}/meta-openembedded/meta-gnome \
    ${SDKBASEMETAPATH}/meta-openembedded/meta-multimedia \
    ${SDKBASEMETAPATH}/meta-openembedded/meta-networking \
    ${SDKBASEMETAPATH}/meta-openembedded/meta-webserver \
    ${SDKBASEMETAPATH}/meta-openembedded/meta-xfce \
    ${SDKBASEMETAPATH}/meta-openembedded/meta-initramfs \
    ${SDKBASEMETAPATH}/meta-openembedded/meta-oe \
    ${SDKBASEMETAPATH}/meta-browser \
    ${SDKBASEMETAPATH}/meta-qt5 \
    ${SDKBASEMETAPATH}/meta-xilinx/meta-xilinx-bsp \
    ${SDKBASEMETAPATH}/meta-xilinx/meta-xilinx-pynq \
    ${SDKBASEMETAPATH}/meta-xilinx/meta-xilinx-contrib \
    ${SDKBASEMETAPATH}/meta-xilinx-tools \
    ${SDKBASEMETAPATH}/meta-petalinux \
    ${SDKBASEMETAPATH}/meta-virtualization \
    ${SDKBASEMETAPATH}/meta-openamp \
    ${SDKBASEMETAPATH}/meta-jupyter \
    ${META_RASPBERRYPI_LAYER} \
    ${META_ROS2_DASHING_LAYER} \
    ${META_ROS2_LAYER} \
    ${META_ROS_COMMON_LAYER} \
    ${META_ROS_BACKPORTS_WARRIOR_LAYER} \
    ${META_PYTHON_LAYER} \
    ${META_OE_LAYER} \
    ${META_LAYER} \
"
BBFILE_PRIORITY_ros2-dashing-layer_forcevariable = "39"
BBFILE_PRIORITY_ros2-layer_forcevariable = "38"
BBFILE_PRIORITY_ros-common-layer_forcevariable = "35"
BBFILE_PRIORITY_ros-backports-warrior-layer_forcevariable = "34"
BBFILE_PRIORITY_meta-python_forcevariable = "13"
BBFILE_PRIORITY_openembedded-layer_forcevariable = "10"
BBFILE_PRIORITY_core_forcevariable = "5"

ROS_DISTRO_BASELINE_PLATFORM ?= "ubuntu-bionic"

# Lines from the BblayersConfExtraLines setting:
MCF_DISTRO ?= "ros2"
ROS_DISTRO ?= "dashing"
MCF_SUPPORTED_MACHINES ?= "qemux86 raspberrypi3"
MCF_OPENEMBEDDED_VERSION ?= "2.6-464.1-thud"


まだ終わりません。つぎは<petalinux_prj_root>/build/conf/local.confです。UNINATIVE_CHECKSUMの行をコメントアウトします。meta-rosが何かやるせいだと思っています。WARNINGを書いてくれていますが無視します。
また<petalinux_prj_root>/build/conf/locked_sigs.incからlibgcc-initial及びglibc-initialの行をごっそりと削除します。meta-rosの仕業だと思っています。

<petalinux_prj_root>/project-spec/meta-plnx-generated/recipes-core/images/petalinux-user-image.bbを編集します。
IMAGE_INSTALLの最後に"ros-core \"を追加します。

また、pythonのバージョンに起因する問題と思われるエラー確認したのでpython3はpython3だろということでとりあえずmeta-rosのbackportsのpythonレシピを消してpetalinuxが使用しているpythonが使われるようにしました。

rm -rf <petalinux_prj_root>/project-spec/meta-ros/meta-ros-backports-warrior/recipes-devtools/python/python3
rm -rf <petalinux_prj_root>/project-spec/meta-ros/meta-ros-backports-warrior/recipes-devtools/python/python3_3.7.2.bb

ここまで来てようやくbuildができます。
次のように実行します。

$cd <path_to_prj_root>/build
$bitbake petalinux-user-image
buildには12時間かかりました。また途中chromeのbuild時に27Gのメモリが必要でしたのでswapを追加してbuildしました。 bblayer.conf,locked_sigs.inc,local.conf,petalinux-user-image.bbはpetalinux configで上書きされてしまうので、
バージョン管理するかバックアップ取っておくかしておくのが良いです。

あとは<path_to_prj_root>/Makefileにpetalinux同様のdeployイメージ収集処理を追加しておくと便利と思います。私は以下を追加しています。

import_deploy:
        cp -f $(DEPLOY_DIR)/fitImage images/linux/image.ub
        cp -f $(DEPLOY_DIR)/arm-trusted-firmware.elf images/linux/bl31.elf
        cp -f $(DEPLOY_DIR)/pmu-ultra96-zynqmp.elf images/linux/pmufw.elf
        cp -f $(DEPLOY_DIR)/u-boot.elf images/linux/u-boot.elf
        cp -f $(DEPLOY_DIR)/fsbl-ultra96-zynqmp.elf images/linux/zynqmp_fsbl.elf
        cp -f $(DEPLOY_DIR)/system.dtb images/linux/system.dtb
        cp -f $(DEPLOY_DIR)/System.map.linux images/linux/System.map.linux
        cp -f $(DEPLOY_DIR)/uEnv.txt images/linux/uEnv.txt
        cp -f $(DEPLOY_DIR)/petalinux-user-image-dashing-ultra96-zynqmp.tar.gz images/linux/rootfs.tar.gz
        cp -f $(DEPLOY_DIR)/qemu-hw-devicetrees/multiarch/zynqmp-pmu.dtb images/linux/zynqmp-qemu-multiarch-pmu.dtb
        cp -f $(DEPLOY_DIR)/qemu-hw-devicetrees/multiarch/zcu100-arm.dtb images/linux/zynqmp-qemu-multiarch-arm.dtb
        cp -f project-spec/hw-description/ultra96v2_oob.bit images/linux/system.bit

qemu動作させてみます。sd.imgはどうにかして用意してください。実機で動作させても同じです。
bootしたあとはROS2 Sanity Testを実行して動作確認します。
qemu動作時とSanity Test実行時のメッセージをおいておきます。
よいrosライフを!

$ make qemuboot 
petalinux-boot --qemu --u-boot --qemu-args "-drive file=myfile/sd.img,if=sd,id=sd0,index=0,format=raw -drive file=myfile/sd.img,if=sd,id=sd1,index=1,format=raw"
INFO: sourcing build tools
INFO: No DTB has been specified, use the default one "/home/akira/work/ultra96v2_oob/ultra96v2_oob/petalinux/images/linux/system.dtb".
INFO: No DTB has been specified, use the default one "/home/akira/work/ultra96v2_oob/ultra96v2_oob/petalinux/images/linux/system.dtb".
INFO: Starting microblaze QEMU
INFO: Starting the above QEMU command in the background
INFO:  qemu-system-microblazeel -M microblaze-fdt   -serial mon:stdio -serial /dev/null -display none -kernel /home/akira/work/ultra96v2_oob/ultra96v2_oob/petalinux/pre-built/linux/images/pmu_rom_qemu_sha3.elf -device loader,file=/home/akira/work/ultra96v2_oob/ultra96v2_oob/petalinux/images/linux/pmufw.elf      -hw-dtb /home/akira/work/ultra96v2_oob/ultra96v2_oob/petalinux/images/linux/zynqmp-qemu-multiarch-pmu.dtb -machine-path /tmp/tmp.V5UJRYwebI -device loader,addr=0xfd1a0074,data=0x1011003,data-len=4 -device loader,addr=0xfd1a007C,data=0x1010f03,data-len=4 
INFO: Set QEMU tftp to /home/akira/work/ultra96v2_oob/ultra96v2_oob/petalinux/images/linux 
INFO: TCP PORT is free 
INFO: Starting aarch64 QEMU
INFO:  qemu-system-aarch64 -M arm-generic-fdt   -serial /dev/null -serial mon:stdio -display none -device loader,file=/home/akira/work/ultra96v2_oob/ultra96v2_oob/petalinux/images/linux/bl31.elf,cpu-num=0 -device loader,file=/home/akira/work/ultra96v2_oob/ultra96v2_oob/petalinux/images/linux/u-boot.elf -gdb tcp::9000 -dtb /home/akira/work/ultra96v2_oob/ultra96v2_oob/petalinux/images/linux/system.dtb  -net nic -net nic -net nic -net nic,netdev=eth0 -netdev user,id=eth0,tftp=/home/akira/work/ultra96v2_oob/ultra96v2_oob/petalinux/images/linux   -hw-dtb /home/akira/work/ultra96v2_oob/ultra96v2_oob/petalinux/images/linux/zynqmp-qemu-multiarch-arm.dtb -machine-path /tmp/tmp.V5UJRYwebI -global xlnx,zynqmp-boot.cpu-num=0 -global xlnx,zynqmp-boot.use-pmufw=true -drive file=myfile/sd.img,if=sd,id=sd0,index=0,format=raw -drive file=myfile/sd.img,if=sd,id=sd1,index=1,format=raw   -m 4G
qemu-system-microblazeel: Failed to connect socket /tmp/tmp.V5UJRYwebI/qemu-rport-_pmu@0: No such file or directory
qemu-system-microblazeel: info: QEMU waiting for connection on: disconnected:unix:/tmp/tmp.V5UJRYwebI/qemu-rport-_pmu@0,server
QEMU 2.11.1 monitor - type 'help' for more information
(qemu) audio: Could not init `oss' audio driver
qemu-system-aarch64: warning: vlan 0 is not connected to host network
PMU Firmware 2019.2 Feb  3 2020   10:48:12
PMU_ROM Version: xpbr-v8.1.0-0
NOTICE:  ATF running on XCZUUNKN/QEMU v4/RTL0.0 at 0xfffea000
NOTICE:  BL31: Secure code at 0x60000000
NOTICE:  BL31: Non secure code at 0x10080000
NOTICE:  BL31: v2.0(release):xilinx-v2019.1-12-g713dace9
NOTICE:  BL31: Built : 10:50:42, Feb  3 2020
PMUFW: v1.1


U-Boot 2019.01 (Feb 03 2020 - 10:03:12 +0000)

Model: Avnet Ultra96 Rev1
Board: Xilinx ZynqMP
DRAM:  2 GiB
EL Level: EL2
Chip ID: unknown
MMC:   mmc@ff160000: 0, mmc@ff170000: 1
Loading Environment from FAT... *** Warning - bad CRC, using default environment

In:    serial@ff010000
Out:   serial@ff010000
Err:   serial@ff010000
Model: Avnet Ultra96 Rev1
Board: Xilinx ZynqMP
Bootmode: JTAG_MODE
Reset reason: 
Net:   ZYNQ GEM: ff0e0000, phyaddr ffffffff, interface gmii
eth0: ethernet@ff0e0000
U-BOOT for ultra96v2-oob-2019_2

Hit any key to stop autoboot:  0 
Device: mmc@ff160000
Manufacturer ID: aa
OEM: 5859
Name: QEMU! 
Bus Speed: 17361111
Mode : SD Legacy
Rd Block Len: 512
SD version 2.0
High Capacity: Yes
Capacity: 19.5 GiB
Bus Width: 4-bit
Erase Group Size: 512 Bytes
18462860 bytes read in 4812 ms (3.7 MiB/s)
## Loading kernel from FIT Image at 10000000 ...
   Using 'conf@system-top.dtb' configuration
   Trying 'kernel@1' kernel subimage
     Description:  Linux kernel
     Type:         Kernel Image
     Compression:  uncompressed
     Data Start:   0x10000108
     Data Size:    18424320 Bytes = 17.6 MiB
     Architecture: AArch64
     OS:           Linux
     Load Address: 0x00080000
     Entry Point:  0x00080000
     Hash algo:    sha1
     Hash value:   5b2a4cdeafb06d0c1704ce266cab9d682020e4be
   Verifying Hash Integrity ... sha1+ OK
## Loading fdt from FIT Image at 10000000 ...
   Using 'conf@system-top.dtb' configuration
   Trying 'fdt@system-top.dtb' fdt subimage
     Description:  Flattened Device Tree blob
     Type:         Flat Device Tree
     Compression:  uncompressed
     Data Start:   0x1119240c
     Data Size:    36617 Bytes = 35.8 KiB
     Architecture: AArch64
     Hash algo:    sha1
     Hash value:   180c885fca6c51a5faf912f89c16d35ab258afd1
   Verifying Hash Integrity ... sha1+ OK
   Booting using the fdt blob at 0x1119240c
   Loading Kernel Image ... OK
   Loading Device Tree to 0000000007ff4000, end 0000000007ffff08 ... OK

Starting kernel ...

INIT: version 2.88 booting
Starting udev
Starting Ultra96 AP setup daemon.
Turning Ultra96 WiFi & Bluetooth LEDs ON...done.
 
Starting Flask server deamon to serve Ultra96 startup page.
INIT: Entering runlevel: 5
Configuring network interfaces... Successfully initialized wpa_supplicant
rfkill: Cannot get wiphy information
Could not read interface wlan0 flags: No such device
WEXT: Could not set interface 'wlan0' UP
wlan0: Failed to initialize driver interface
Cannot find device "wlan0"
Starting system message bus: dbus.
Starting Connection Manager
Starting haveged: haveged: listening socket at 3
haveged: haveged starting up


Starting Xserver
mount: /mnt: /dev/mmcblk0p1 already mounted on /run/media/mmcblk0p1.
mount: /mnt: /dev/mmcblk0 already mounted or mount point busy.
Starting Dropbear SSH server: haveged: haveged: ver: 1.9.4; arch: generic; vend: ; build: (gcc 8.2.0 CTV); collect: 128K

haveged: haveged: cpu: (VC); data: 16K (D V); inst: 16K (D V); idx: 11/40; sz: 15528/64688

haveged: haveged: tot tests(BA8): A:1/1 B:1/1 continuous tests(B):  last entropy estimate 8.00355

haveged: haveged: fills: 0, generated: 0 

mount: /mnt: /dev/mmcblk0p1 already mounted on /run/media/mmcblk0p1.
dropbear.
mount: /mnt: /dev/mmcblk0 already mounted or mount point busy.
Starting rpcbind daemon...

X.Org X Server 1.20.1
X Protocol Version 11, Revision 0
Build Operating System: Linux 5.3.0-28-generic x86_64 
Current Operating System: Linux ultra96v2-oob-2019_2 4.19.0-xilinx-v2019.2 #1 SMP Mon Feb 3 01:47:41 UTC 2020 aarch64
Kernel command line: earlycon console=ttyPS0,115200 clk_ignore_unused root=/dev/mmcblk0p2 rw rootwait
Build Date: 03 February 2020  03:41:05AM
 
Current version of pixman: 0.34.0
 Before reporting problems, check http://wiki.x.org
 to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
 (++) from command line, (!!) notice, (II) informational,
 (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Wed Feb  5 09:38:25 2020
(==) Using config file: "/etc/X11/xorg.conf"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
done.
starting statd: done
The XKEYBOARD keymap compiler (xkbcomp) reports:
> Warning:          Unsupported high keycode 372 for name  ignored
>                   X11 cannot support keycodes above 255.
>                   This warning only shows for the first high keycode.
Starting bluetooth: bluetoothd.
Errors from xkbcomp are not fatal to the X server
Starting Distributed Compiler Daemon: distcc/etc/rc5.d/S20distcc: start failed with error code 110
Starting internet superserver: inetd.
exportfs: can't open /etc/exports for reading
NFS daemon support not enabled in kernel
Starting ntpd: done
Starting syslogd/klogd: D-BUS per-session daemon address is: unix:abstract=/tmp/dbus-CG2YvTEmNM,guid=06462448b754ac2b1c4e7eed5e3a8d1b
done
mount: /mnt: /dev/mmcblk0p1 already mounted on /run/media/mmcblk0p1.
Starting internet superserver: xinetdmount: /mnt: /dev/mmcblk0 already mounted or mount point busy.
.
 * Starting Avahi mDNS/DNS-SD Daemon: avahi-daemon
Opening webpage
Starting Telephony daemon
GLib-GIO-Message: 09:38:41.098: Using the 'memory' GSettings backend.  Your settings will not be saved or shared with other applications.
Starting watchdog daemon...Failed to launch bus: Failed to execute child process ?/usr/bin? (Permission denied)done
Starting Linux NFC daemon
matchbox: Cant find a keycode for keysym 269025056
matchbox: ignoring key shortcut XF86Calendar=!$contacts

matchbox: Cant find a keycode for keysym 2809
matchbox: ignoring key shortcut telephone=!$dates

matchbox: Cant find a keycode for keysym 269025050
matchbox: ignoring key shortcut XF86Start=!matchbox-remote -desktop

[settings daemon] Forking. run with -n to prevent fork
Starting tcf-agent: OK


(matchbox-panel:2420): dbind-WARNING **: 09:38:53.223: Error retrieving accessibility bus address: org.a11y.Bus.Error: Failed to execute child process ?/usr/bin? (Permission denied)

(matchbox-desktop:2419): dbind-WARNING **: 09:38:53.219: Error retrieving accessibility bus address: org.a11y.Bus.Error: Failed to execute child process ?/usr/bin? (Permission denied)
mount: /mnt: /dev/mmcblk0p1 already mounted on /run/media/mmcblk0p1.
mount: /mnt: /dev/mmcblk0 already mounted or mount point busy.
root@ultra96v2-oob-2019_2:~# 
root@ultra96v2-oob-2019_2:~# 
root@ultra96v2-oob-2019_2:~# source [2586:2586:0205/093904:ERROR:gl_factory.cc(48)] Requested GL implementation is not available.
[2586:2586:0205/093904:ERROR:gpu_child_thread.cc(348)] Exiting GPU process due to errors during initialization
  
root@ultra96v2-oob-2019_2:~# 
root@ultra96v2-oob-2019_2:~# 
root@ultra96v2-oob-2019_2:~# source ros_setup.sh
[2377:2573:0205/093916:ERROR:browser_gpu_channel_host_factory.cc(123)] Failed to launch GPU process.
[2377:2573:0205/093917:ERROR:browser_gpu_channel_host_factory.cc(123)] Failed to launch GPU process.

root@ultra96v2-oob-2019_2:~# 
root@ultra96v2-oob-2019_2:~# echo $LD_LIBRARY_PATH
/usr/lib
root@ultra96v2-oob-2019_2:~# ros2 topic list
/parameter_events
/rosout
root@ultra96v2-oob-2019_2:~# ros2 msg list
action_msgs/msg/GoalInfo
action_msgs/msg/GoalStatus
action_msgs/msg/GoalStatusArray
actionlib_msgs/msg/GoalID
actionlib_msgs/msg/GoalStatus
actionlib_msgs/msg/GoalStatusArray
builtin_interfaces/msg/Duration
builtin_interfaces/msg/Time
diagnostic_msgs/msg/DiagnosticArray
diagnostic_msgs/msg/DiagnosticStatus
diagnostic_msgs/msg/KeyValue
geometry_msgs/msg/Accel
geometry_msgs/msg/AccelStamped
geometry_msgs/msg/AccelWithCovariance
geometry_msgs/msg/AccelWithCovarianceStamped
geometry_msgs/msg/Inertia
geometry_msgs/msg/InertiaStamped
geometry_msgs/msg/Point
geometry_msgs/msg/Point32
geometry_msgs/msg/PointStamped
geometry_msgs/msg/Polygon
geometry_msgs/msg/PolygonStamped
geometry_msgs/msg/Pose
geometry_msgs/msg/Pose2D
geometry_msgs/msg/PoseArray
geometry_msgs/msg/PoseStamped
geometry_msgs/msg/PoseWithCovariance
geometry_msgs/msg/PoseWithCovarianceStamped
geometry_msgs/msg/Quaternion
geometry_msgs/msg/QuaternionStamped
geometry_msgs/msg/Transform
geometry_msgs/msg/TransformStamped
geometry_msgs/msg/Twist
geometry_msgs/msg/TwistStamped
geometry_msgs/msg/TwistWithCovariance
geometry_msgs/msg/TwistWithCovarianceStamped
geometry_msgs/msg/Vector3
geometry_msgs/msg/Vector3Stamped
geometry_msgs/msg/Wrench
geometry_msgs/msg/WrenchStamped
lifecycle_msgs/msg/State
lifecycle_msgs/msg/Transition
lifecycle_msgs/msg/TransitionDescription
lifecycle_msgs/msg/TransitionEvent
nav_msgs/msg/GridCells
nav_msgs/msg/MapMetaData
nav_msgs/msg/OccupancyGrid
nav_msgs/msg/Odometry
nav_msgs/msg/Path
rcl_interfaces/msg/FloatingPointRange
rcl_interfaces/msg/IntegerRange
rcl_interfaces/msg/IntraProcessMessage
rcl_interfaces/msg/ListParametersResult
rcl_interfaces/msg/Log
rcl_interfaces/msg/Parameter
rcl_interfaces/msg/ParameterDescriptor
rcl_interfaces/msg/ParameterEvent
rcl_interfaces/msg/ParameterEventDescriptors
rcl_interfaces/msg/ParameterType
rcl_interfaces/msg/ParameterValue
rcl_interfaces/msg/SetParametersResult
rosgraph_msgs/msg/Clock
sensor_msgs/msg/BatteryState
sensor_msgs/msg/CameraInfo
sensor_msgs/msg/ChannelFloat32
sensor_msgs/msg/CompressedImage
sensor_msgs/msg/FluidPressure
sensor_msgs/msg/Illuminance
sensor_msgs/msg/Image
sensor_msgs/msg/Imu
sensor_msgs/msg/JointState
sensor_msgs/msg/Joy
sensor_msgs/msg/JoyFeedback
sensor_msgs/msg/JoyFeedbackArray
sensor_msgs/msg/LaserEcho
sensor_msgs/msg/LaserScan
sensor_msgs/msg/MagneticField
sensor_msgs/msg/MultiDOFJointState
sensor_msgs/msg/MultiEchoLaserScan
sensor_msgs/msg/NavSatFix
sensor_msgs/msg/NavSatStatus
sensor_msgs/msg/PointCloud
sensor_msgs/msg/PointCloud2
sensor_msgs/msg/PointField
sensor_msgs/msg/Range
sensor_msgs/msg/RegionOfInterest
sensor_msgs/msg/RelativeHumidity
sensor_msgs/msg/Temperature
sensor_msgs/msg/TimeReference
shape_msgs/msg/Mesh
shape_msgs/msg/MeshTriangle
shape_msgs/msg/Plane
shape_msgs/msg/SolidPrimitive
std_msgs/msg/Bool
std_msgs/msg/Byte
std_msgs/msg/ByteMultiArray
std_msgs/msg/Char
std_msgs/msg/ColorRGBA
std_msgs/msg/Empty
std_msgs/msg/Float32
std_msgs/msg/Float32MultiArray
std_msgs/msg/Float64
std_msgs/msg/Float64MultiArray
std_msgs/msg/Header
std_msgs/msg/Int16
std_msgs/msg/Int16MultiArray
std_msgs/msg/Int32
std_msgs/msg/Int32MultiArray
std_msgs/msg/Int64
std_msgs/msg/Int64MultiArray
std_msgs/msg/Int8
std_msgs/msg/Int8MultiArray
std_msgs/msg/MultiArrayDimension
std_msgs/msg/MultiArrayLayout
std_msgs/msg/String
std_msgs/msg/UInt16
std_msgs/msg/UInt16MultiArray
std_msgs/msg/UInt32
std_msgs/msg/UInt32MultiArray
std_msgs/msg/UInt64
std_msgs/msg/UInt64MultiArray
std_msgs/msg/UInt8
std_msgs/msg/UInt8MultiArray
stereo_msgs/msg/DisparityImage
trajectory_msgs/msg/JointTrajectory
trajectory_msgs/msg/JointTrajectoryPoint
trajectory_msgs/msg/MultiDOFJointTrajectory
trajectory_msgs/msg/MultiDOFJointTrajectoryPoint
unique_identifier_msgs/msg/UUID
visualization_msgs/msg/ImageMarker
visualization_msgs/msg/InteractiveMarker
visualization_msgs/msg/InteractiveMarkerControl
visualization_msgs/msg/InteractiveMarkerFeedback
visualization_msgs/msg/InteractiveMarkerInit
visualization_msgs/msg/InteractiveMarkerPose
visualization_msgs/msg/InteractiveMarkerUpdate
visualization_msgs/msg/Marker
visualization_msgs/msg/MarkerArray
visualization_msgs/msg/MenuEntry
root@ultra96v2-oob-2019_2:~# (sleep 5; ros2 topic pub /chatter std_msgs/String "data: Hello world") &
[1] 3871
root@ultra96v2-oob-2019_2:~# ros2 topic echo /chatter
publisher: beginning loop
publishing #1: std_msgs.msg.String(data='Hello world')

publishing #2: std_msgs.msg.String(data='Hello world')

data: Hello world
---
publishing #3: std_msgs.msg.String(data='Hello world')

data: Hello world
---
publishing #4: std_msgs.msg.String(data='Hello world')

data: Hello world
---
publishing #5: std_msgs.msg.String(data='Hello world')

data: Hello world
---
publishing #6: std_msgs.msg.String(data='Hello world')

data: Hello world
---
publishing #7: std_msgs.msg.String(data='Hello world')

data: Hello world
---
QEMU: Terminated
qemu-system-microblazeel: /pmu@0: Disconnected clk=454329055928 ns





ultra96v2_oobにros2-dashingを導入する方法その1〜

meta-ros導入のメモu-bootやqemu-devicetreeの設定変更など書き散らしたものを整理していきます。

環境作成するための方法をまとめて後で使用できるようにすることが目的です。
petalinuxとvitisのインストールは省略し、Vivadoプロジェクトを作成した後からの続きの手順を記載します。




petalinuxのプロジェクトを作成します。ただし、sstateはmeta-rosの導入時に問題が出たので設定しません。buildはまだです。

次にu-bootのconfig_sys_text_baseを修正します。
パッチファイル作成し、以下に保存します。

<petalinux_prj>/project-spec/meta-user/recipes-bsp/u-boot/files/config_sys_text_base_amend.patch

<petalinux_prj>/project-spec/meta-user/recipes-bsp/u-boot/u-boot-xlnx_%.bbappendを以下の通りにしてパッチを追加します。


FILESEXTRAPATHS_prepend := "${THISDIR}/files:"

SRC_URI += "file://platform-top.h"
SRC_URI += "file://bsp.cfg"
SRC_URI += "file://config_sys_text_base_amend.patch"


u-bootの次はqemu用のhw-dtbを修正するパッチを当てます。
結局petalinux-buildではrosを導入できなかったのでzcu102のqemu用dtbを使用すればいいような気もするけど、せっかくなので。
ファイルを置く場所は<petalinux_prj>/project-spec/meta-user/recipes-devtools/qemu/files/0001-enable-gems-for-zcu100-arm.dts.patchです。
後述するbitbakeを使用してbitbake -e qemu-devicetrees | grep ^FILEでレベルを合わせてmeta-userに配置することで適用できます。
パッチの内容は以下のようにgemのinvalidをコメントアウトしているだけです。
これでqemu動作させた際にgem3を使用して通信可能にし、rosの模擬動作やgazeboとの接続ができるようになるはずです。

From 4b5e8412beaff0a773ac4c960344e661e460ac65 Mon Sep 17 00:00:00 2001
From: Akira Nishiyama <xxxx@xxx.xxx>
Date: Wed, 29 Jan 2020 08:04:19 +0900
Subject: [PATCH] enable gems for zcu100-arm.dts

---
 zcu100-arm.dts | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/zcu100-arm.dts b/zcu100-arm.dts
index 4eee783..28351dc 100644
--- a/zcu100-arm.dts
+++ b/zcu100-arm.dts
@@ -40,6 +40,7 @@
 };

 /* Invalidate all GEMs as there is no Ethernet */
+/*
 &gem0 {
     compatible = "invalid";
 };
@@ -55,7 +56,7 @@
 &gem3 {
     compatible = "invalid";
 };
-
+*/
 &ps7_qspi_0 {
     qspi-flash@0 {
         compatible = "n25q128a13";
-- 
2.17.1

この後はpetalinuxツールではなくyoctoを使用していくための設定を行うのと、
meta-ros導入時に発生したtaskhash mismatchの問題に対応するためにソースからビルドしていくように設定します。
長くなるので続く



2020年2月4日火曜日

ultra96v2_oobをカスタムする話その4_meta-rosを導入するまでのメモ

とりあえずmeta-rosをビルドできるだけの環境を用意する。
ここを参考に環境を整えていく。

cd project-spec
git clone https://github.com/ros/meta-ros -b thud-draft

そのままuser-layerとして追加しようとしたけどtaskhashの問題出てきたので、
petalinux環境をgithubのXilinx/meta-xxxから作成できるように変更した。
rel-v2019.2を使っておけばインストールしたものと同じ状態になるはずなので試した。

pythonのsetuptoolsが見つからないエラーが出たのでmeta-ros-backports-warriorからpythonレシピを削除。
backportsしている理由がよくわからないから問題出るかもしれないけどとりあえず続行。

ultra96v2_oobをそのままビルドするとchromeのビルドには最大27Gのメモリが必要なので注意。
メモリが必要なのはこいつのみなのでswap増し増しでビルドを通す。

sstate_cacheの問題と見られるエラーが発生。以下のページを参考。
https://github.com/Xilinx/Edge-AI-Platform-Tutorials/issues/3

またlocked_sigからlibgcc-initial,glibc-initialを削除。
taskhashの問題発生のため。

これで本当に同一かはわからないけどとりあえずビルドとQEMUの動作確認はできた。
実機もOK。