【分享】如何使用coresight作为MPSoC的标准输入输出?

standalone/freerto应用程序使用coresight作为MPSoC的标准输入输出

对于standalone/freerto应用程序, 在BSP工程的Board Support Package Setting里,可以配置STDOUT/STDIN的物理设备。在standalone或者freertos标签窗口的STDOUT/STDIN的选项下,有none, uart0, uart1, psu_coresight_0等选项。选中psu_coresight_0,重新编译工程。
然后运行工程,打开Xilinx xsct,连接单板,选择“Cortex-A53 #0”,执行jtagterminal,就会启动一个窗口,显示通过psu_coresight_0打印的字符串。

XSCT下的记录:

****** Xilinx Software Commandline Tool (XSCT) v2016.4
  **** Build date : Dec 14 2016-22:58:10
    ** Copyright 1986-2016 Xilinx, Inc. All Rights Reserved.

xsct% help
Available Help Categories

connections   - Target Connection Management
registers     - Target Registers
running       - Program Execution
memory        - Target Memory
download      - Target Download FPGA/BINARY
reset         - Target Reset
breakpoints   - Target Breakpoints/Watchpoints
streams       - Jtag UART
miscellaneous - Miscellaneous
jtag          - JTAG Access
tfile         - Target File System
sdk           - SDK Projects
petalinux     - Petalinux commands
hsi           - HSI commands

Type "help" followed by above "category" for more details or
help" followed by the keyword "commands" to list all the commands

xsct% help streams
Category commands

jtagterminal - Start/Stop Jtag based hyper-terminal
readjtaguart - Start/Stop reading from Jtag Uart

Type "help" followed by above "command", or the above "command" followed by
"-help" for more details

xsct% jtagterminal
Invalid target. Use "connect" command to connect to hw_server/TCF agent
xsct% connect
tcfchan#0
xsct% target
  1  PS TAP
     2  PMU
     3  PL
  4  PSU
     5  RPU (Reset)
        6  Cortex-R5 #0 (RPU Reset)
        7  Cortex-R5 #1 (RPU Reset)
     8  APU
        9  Cortex-A53 #0 (Running)
       10  Cortex-A53 #1 (Power On Reset)
       11  Cortex-A53 #2 (Power On Reset)
       12  Cortex-A53 #3 (Power On Reset)
xsct% target 9
xsct% jtagterminal
57118
xsct% Info: Cortex-A53 #0 (target 9) Stopped at 0xffff0000 (Reset Catch)
xsdb% Info: Cortex-A53 #0 (target 9) Running
xsdb% Info: Cortex-A53 #0 (target 9) Stopped at 0x998 (Breakpoint)
main() at ../src/helloworld.c: 56
56:     init_platform();
xsdb% Info: Cortex-A53 #0 (target 9) Running

JTAG-based Hyperterminal下的记录:

JTAG-based Hyperterminal.
Connected to JTAG-based Hyperterminal over TCP port : 49984
(using socket : sock396)
Help :
Terminal requirements :
  (i) Processor's STDOUT is redirected to the ARM DCC/MDM UART
  (ii) Processor's STDIN is redirected to the ARM DCC/MDM UART.
       Then, text input from this console will be sent to DCC/MDM's UART port.
  NOTE: This is a line-buffered console and you have to press "Enter"
        to send a string of characters to DCC/MDM.

Hello World @ 206!

U-Boot/Linux下,要选择和使能对应的驱动,使用的比较少使用coresight作为zynq的标准输入输出

U-Boot/Linux下,要选择和使能对应的驱动,也可以使用,但是使用的比较少。

参考文档

Using JTAG UART

原文地址:https://www.cnblogs.com/hankfu/p/14441851.html