Debugging RPU Firmware - 2023.2 English

Libmetal and OpenAMP User Guide (UG1186)

Document ID
UG1186
Release Date
2023-11-07
Version
2023.2 English

The Cortex-R5 firmware build with Vitis/Vivado saves its runtime messages into a remoteproc trace buffer. The firmware’s resource table communicates the buffer address and size to Linux kernel. The remoteproc exports this buffer via debugFS and it can be viewed by reading /sys/kernel/debug/remoteproc/remoteproc0/trace0, for example: cat /sys/kernel/debug/remoteproc/remoteproc0/trace0.

Below is an example to debug the echo test example running on RPU 0 with AMD System Debugger (XSDB). In this example, the function platform_init is found in platform_info.c at line 295 and is compiled to be at the address 0x3ed011c8. The below example shows how to set and run up to a breakpoint and print the value of local variables in the scope stopped at the breakpoint.

xsdb% bpadd -addr 0x3ed011c8

0

xsdb% Info: Breakpoint 0 status:

target 7: {Address: 0x3ed011c8 Type: Hardware}

xsdb% dow ~/test.elf

Downloading Program -- ~/test.elf

section, .vectors: 0x00000000 - 0x0000051f

section, .text: 0x3ed00000 - 0x3ed0d73f

section, .init: 0x3ed0d740 - 0x3ed0d74b

section, .fini: 0x3ed0d74c - 0x3ed0d757

section, .rodata: 0x3ed0d758 - 0x3ed0ee8f

section, .data: 0x00000520 - 0x00001623

section, .resource_table: 0x00001700 - 0x000017ff

section, .eh_frame: 0x3ed0ee90 - 0x3ed0ee93

section, .ARM.exidx: 0x3ed0ee94 - 0x3ed0ee9b

section, .init_array: 0x3ed0ee9c - 0x3ed0eea3

section, .fini_array: 0x3ed0eea4 - 0x3ed0eea7

section, .bss: 0x3ed0eea8 - 0x3ed0f157

section, .heap: 0x00001800 - 0x000057ff

section, .stack: 0x00005800 - 0x00008fff

100%    0MB   0.3MB/s  00:00

Setting PC to Program Start Address 0x00000000

Successfully downloaded ~/test.elf

xsdb% con

xsdb% Info: Cortex-R5 #0 (target 7) Stopped at 0x3ed011c8 (Breakpoint)

platform_init() at ../src/platform_info.c: 295

295: {

xsdb% locals

argc      : 0

argv      : 0

platform  : 0

proc_id   : 0

rsc_id    : 1053874736

rproc     : 1053824852

xsdb% con

Info: Cortex-R5 #0 (target 7) Running

xsdb%