Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux 程式設計 >> Linux 程式設計

Ubuntu 12.04 下 ZedBoard USB-JTAG 驅動安裝與雙核調試全流程

本文的環境是 Ubuntu 12.04 LTS,物件是 Xilinx 基於 Zynq-7000 AP SoC 平台的 ZedBoard 開發板,目標是把 USB-JTAG 驅動裝通,並接上第二個 CPU 核調試。

前置動作:把 dash 換成 bash

% sudo dpkg-reconfigure -plow dash
  Install as /bin/sh? No

這一步是為了能順利安裝 Mentor 提供的 Xilinx GNU toolchain,否則 ARM 工具鏈裝不上去。

安裝 ISE 與 Digilent 插件

1. 執行 ISE 安裝工具時運行 ./xsetup,過程中會提示 USB Cable 驅動安裝失敗——先不用理會,後面補裝即可。

2. 下載 Digilent Plugin 與 Adept Runtime:

https://www.digilentinc.com/Products/Detail.cfm?NavPath=2,66,768&Prod=DIGILENT-PLUGIN

https://www.digilentinc.com/Products/Detail.cfm?NavPath=2,66,828&Prod=ADEPT2

下載後解壓安裝,目錄裡通常都有 install.sh,用 sudo 執行。

關鍵一點:必須安裝 Digilent Plug-in for Xilinx 14.x,否則 impact 認不出 Digilent USB 驅動。插件需放到 $HOME 下的 .cse 文件夾,完整路徑為 ~/.cse/lin/14.2/plugins/Digilent/libCseDigilent/,該目錄下要能看到 libCseDigilent.so 與 libCseDigilent.xml。缺了它,impact 無法識別 ZedBoard。

export to sdk 報錯的真正原因

執行導出到 SDK 時遇到:

ERROR:EDK -
  Error while running "gmake -f system.make exporttosdk".
ERROR: [Common 17-49] Internal Data Exception: xps application failed!

起初以為是路徑配錯,折騰半天才發現是系統裡根本沒有 gmake 這個命令。做個指向 make 的軟鏈接即可:

sudo ln -s /usr/bin/make /usr/bin/gmake

連接第二個核

在 XMD 命令行下執行:

XMD% connect arm hw -debugdevice cpunr 2

CortexA9 Processor Configuration
-------------------------------------
Version.............................0x00000003
User ID.............................0x00000000
No of PC Breakpoints................6
No of Addr/Data Watchpoints.........1

Connected to "arm" target. id = 65
Starting GDB server for "arm" target (id = 65) at TCP port no 1235
XMD% User Interrupt, Processor Stopped at 0x001000a8

用 remote debug 接上去

先用常規方式下載程序並啟動 Debug,連上之後不要運行。接著改用 remote debug,IP Address 填 localhost,Port 填 1235。此時執行 targets 可以看到主板上的 CPU 與 FPGA 調試 TAP:

targets
------------------------------------------------
System(0) - Hardware System on FPGA(Device 1) Targets:
------------------------------------------------
Target(64) - Cortex-A9(1) Hardware Debug Target
Target(65) - Cortex-A9(2) Hardware Debug Target*
Target(352) - Cortex-A9 CoreSight Debug Target

帶星號的 Target(65) 就是當前選中的第二個核,至此雙核調試環境搭建完成。

Copyright © Linux教程網 All Rights Reserved