1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

JTAGではなくSDカードのBoot.binから実行したプログラムに対してブレークポイントを張る (Zynq UltraScale+)

Last updated at Posted at 2020-10-04

概要

JTAGではなく、QSPI, SDカードから実行した場合もXSCTを使ってデバッグが可能
https://japan.xilinx.com/html_docs/xilinx2019_1/SDK_Doc/xsct/use_cases/xsdb_debug_program_running_on-target.html
と公式にあるので、実際に確認してみました。

環境

  • Ultra96 V2
  • Boot.binは生成して、SDカードに既に書き込まれている前提

確認

Ultra96 V2がSDカードに入ったBoot.binから起動した状態で、XSCT開きます
image.png

connectでターゲットと接続します。
targetsでターゲットの状態を確認します。
今は、CortexR5の#0だけ動かしている状態です。

XSCT
xsct% connect
attempting to launch hw_server
****** Xilinx hw_server v2019.1
  **** Build date : May 24 2019 at 15:13:31
    ** Copyright 1986-2019 Xilinx, Inc. All Rights Reserved.

INFO: hw_server application started
INFO: Use Ctrl-C to exit hw_server application
****** Xilinx hw_server v2019.1
  **** Build date : May 24 2019 at 15:13:31
    ** Copyright 1986-2019 Xilinx, Inc. All Rights Reserved.

INFO: hw_server application started
INFO: Use Ctrl-C to exit hw_server application
INFO: To connect to this hw_server instance use url: TCP:127.0.0.1:3121

tcfchan#1
xsct% targets
  1  PS TAP
     2  PMU
     3  PL
  4  PSU
     5  RPU
        6  Cortex-R5 #0 (Running)
        7  Cortex-R5 #1 (Reset)
     8  APU (L2 Cache Reset)
        9  Cortex-A53 #0 (APU Reset)
       10  Cortex-A53 #1 (APU Reset)
       11  Cortex-A53 #2 (APU Reset)
       12  Cortex-A53 #3 (APU Reset)

xsct% targets 6
xsct% memmap -file ./ultra96_only_app_cmake/build/main/app.elf

Boot.binに、FreeRTOS CLIを入れているので
ターミナルに task-stats と入力すると、起動する関数にブレークを設定します。

ブレーク設定する関数
static BaseType_t prvTaskStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{
    const char *const pcHeader = "     State   Priority  Stack    #\r\n************************************************\r\n";
    BaseType_t xSpacePadding;
...

ブレークは bpadd で設定します。
ドキュメント : https://www.xilinx.com/html_docs/xilinx2018_1/SDK_Doc/xsct/breakpoints/reference_breakpoints_bpadd.html

XSCT
xsct% bpadd -target-id 6 &prvTaskStatsCommand
3
xsct% Info: Breakpoint 3 status:
   target 6: {Address: 0x1006c0 Type: Hardware}

ターミナルから task-stats と入力すると
以下が表示されてブレークされたことがわかります。

xsct% Info: Cortex-R5 #0 (target 6) Stopped at 0x1006c0 (Breakpoint)
195: {

ステップ実行するには nxt と入れます
ドキュメント : https://www.xilinx.com/html_docs/xilinx2018_1/SDK_Doc/xsct/running/reference_xsct_running.html

xsct% nxt
xsct% Info: Cortex-R5 #0 (target 6) Running
xsct% Info: Cortex-R5 #0 (target 6) Stopped at 0x1006d8 (Step)
196: const char *const pcHeader = "     State   Priority  Stack    #\r\n************************************************\r\n";
xsct% nxt
xsct% Info: Cortex-R5 #0 (target 6) Running
xsct% Info: Cortex-R5 #0 (target 6) Stopped at 0x1006e4 (Step)
204: 	configASSERT( pcWriteBuffer );
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?