TCL Scripting for OpenOCD

Hi All,

I have tried to write a script for OpenOCD. As an example following command can be used to shutdown openocd. like that way we can execute OpenOCD commands in console.

This commnad can be used to shutdown openocd

puts shutdown “>”

i want to run SVF file with a TCL Script.

to run svf file following command can be used.

tap - auto0.tap abc.svf

to run above command in script i have to check for available tap in the device

to view device we can use scan_chain command.

puts scan_chain “>”

from this command there is output in console.

i want to extract the tap name from the output of the console. how to handle that?

Thanks

Hi All,

I have written a tcl script in OpenOCD and its running … i want to add a gui for that script.for that im using tk package. but for openocd tk cannot load package

So how to load a package to OpenOCD?

I’ve not done anything more complex with the “JimTcl” built in to openOCD than changing parameters on scripts that other people wrote, so I don’t know exactly how limited it is. You might be able to get it to open a file or pipe to accomplish your first objective.

To add a GUI interface, you should probably create an external program using your favorite language: Tcl/Tk or C or Python etc., and have it connect to openOCD via either the Telnet port or the tcl port.

Thanks.yes i used tcl for creating a Telnet application . i can run scan_chain command via my tcl application. but when im using it for drscan or irscan command it wont work.i didnt configured a target yet.difficult to configure target because the target im goning to define is not in OpenOCD.my target chip is XC9536XL. :frowning: that is the problem) Help me please.