cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
betontalpfa
Explorer
Explorer
580 Views
Registered: ‎10-12-2018

How to select given target device from multiple device

Jump to solution

I have two same (custom) FPGA board connected to my PC via a USB blaster. I want to setup these boards with TCL commands using an xsct console. How can I switch these boards? (using the targets command)

Here is the message:

xsct% targ -set -filter {name =~ "ARM*#1"}
more than one targets found with "name =~ "ARM*#1"":
     6  ARM Cortex-A9 MPCore #1 (Running)
    12  ARM Cortex-A9 MPCore #1 (Running)

I have tried targ -set -filter {name =~ "ARM*#1"} -index <with several values> with no success.

How can I switch between these two targets?

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
betontalpfa
Explorer
Explorer
560 Views
Registered: ‎10-12-2018

The following TCL process can handle this issue

proc switch_arm { {index 0} } {
    set arm [lindex [targ -filter {name =~ "ARM*#1"} -target-properties] $index ]
    set idx_of_target_id [lsearch $arm target_id]
    incr idx_of_target_id
    set target_id [lindex $arm $idx_of_target_id]
    targ -set $target_id
}

View solution in original post

1 Reply
betontalpfa
Explorer
Explorer
561 Views
Registered: ‎10-12-2018

The following TCL process can handle this issue

proc switch_arm { {index 0} } {
    set arm [lindex [targ -filter {name =~ "ARM*#1"} -target-properties] $index ]
    set idx_of_target_id [lsearch $arm target_id]
    incr idx_of_target_id
    set target_id [lindex $arm $idx_of_target_id]
    targ -set $target_id
}

View solution in original post