cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
nctuser
Participant
Participant
575 Views
Registered: ‎10-27-2019

XSDB write variable by name

Jump to solution

Hello,

I am developing application on Zynq7000 with Xilinx SDK and I would like to
use the XSDB to realize some extra debug steps after I connect the XSDK to
a running target. The debug configuration settings has a Attach to running
target debug type and an option to execute a debug script and my intention
is to put these extra steps into this external executable script.

My first question is it possible to use the the XSDB's mwr command to use
write a variable by name? In XSCT I can use the bpadd -addr &MyFuntion
command but can I use the mwr in similar way to specify the memory to write
by variable name instead of numeric memory address?

Is any other method to write a global variable via XSDB script which has no
fixed address in memory?

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
ibaie
Xilinx Employee
Xilinx Employee
368 Views
Registered: ‎10-06-2016

Hi @nctuser 

You can use either locals or print commands to interact with variables.

Regards


Ibai
Don’t forget to reply, kudo, and accept as solution.

View solution in original post

5 Replies
stephenm
Xilinx Employee
Xilinx Employee
536 Views
Registered: ‎09-12-2007

You would need to add the symbol file if you want to do this.

targets -set -filter {name =~ "Cortex-A53 #0"}
memmap -file <your elf file here>

However, if you are connecting to a running system, you might need to stop the processor to do a mwr

nctuser
Participant
Participant
478 Views
Registered: ‎10-27-2019

Thank you for bothering our problem. After your help the elf file
loading works but I have still problem how to specify the address
with variable name.

 

xsct% mwr &trapVariable 1234
xsct% expected integer but got "&trapVariable" instead

 

 
I have tried with and without ampersand, brace etc. but nothing
worked and I did not find the syntax for it in ug1208. Could you
help what syntax should I use?

0 Kudos
ibaie
Xilinx Employee
Xilinx Employee
369 Views
Registered: ‎10-06-2016

Hi @nctuser 

You can use either locals or print commands to interact with variables.

Regards


Ibai
Don’t forget to reply, kudo, and accept as solution.

View solution in original post

nctuser
Participant
Participant
335 Views
Registered: ‎10-27-2019

Hello ibaie,

that is exactly what we needed! I have one more problem, the xsct
working directory is c:\Users\XYZ\AppData\Roaming\Xilinx\Vivado\
so the elf file should be here.

Could I set this working directory realtive to the project or workspace
path?

I found the getws command which prints the current workspace path
but I could not to set it as working directory.

Thank you for your help.

0 Kudos
nctuser
Participant
Participant
234 Views
Registered: ‎10-27-2019

Hello,

I  noticed here in the forum there is struggling with making project path
dependent the TCL's work directory so I share my solution which worked
for me. I use XSDK 2019.2. I hope somebody will find it useful.

 

# Select target!
targets -set -filter { name =~ "ARM Cortex-A9 MPCore #0" }
#
# Put workpace path into a variable.
set wsPath [getws]
#
# Navigate to elf file containing direcory!
cd $wsPath
cd ProjectDirecotry_ZYNQ
cd Debug
#
# Load symbols!
memmap -file Application_ZYNQ.elf
#
# Stop target!
stop

 


I have other questions about XSCT/XSDB debug script but these questions
are out of the scope of this topic and I will start a new topic.

 

 

 

 

0 Kudos