Re: [Openocd-development] read/modify/write registers from TCL

2009-05-10 Thread David Brownell
On Sunday 10 May 2009, Øyvind Harboe wrote: > > Well, neither of these solutions seems excessively elegant ... ;) > > > > Thanks for the suggestions.  It doesn't look quite straightforward > > to add new "mrw" commands that return a value ... the interpreter > > is hidden at the point you've got to

Re: [Openocd-development] read/modify/write registers from TCL

2009-05-10 Thread Øyvind Harboe
On Sun, May 10, 2009 at 8:37 AM, David Brownell wrote: > On Saturday 09 May 2009, Magnus Lundin wrote: >> The other to trick is to prefix openocd commands with ocd_  to tell the >> tcl interpretr to grab openocd output as tcl input. >> >>  > set v "[ocd_mdw 0]" >> 0x: e59ff04c >> 0x000

Re: [Openocd-development] read/modify/write registers from TCL

2009-05-09 Thread David Brownell
On Saturday 09 May 2009, Magnus Lundin wrote: > The other to trick is to prefix openocd commands with ocd_  to tell the > tcl interpretr to grab openocd output as tcl input. > >  > set v "[ocd_mdw 0]" > 0x: e59ff04c > 0x: e59ff04c > >  > puts "$v"         > 0x: e59ff04c

Re: [Openocd-development] read/modify/write registers from TCL

2009-05-09 Thread Magnus Lundin
David Brownell wrote: > So there I am, trying to do basic PLL init code using TCL. > > All I have to do is read a register, modify the result, and > write it back ... write a register ... read a register and > do something based on a bitfield ... etc. Not what I'd call > pretty TCL code (is there

[Openocd-development] read/modify/write registers from TCL

2009-05-09 Thread David Brownell
So there I am, trying to do basic PLL init code using TCL. All I have to do is read a register, modify the result, and write it back ... write a register ... read a register and do something based on a bitfield ... etc. Not what I'd call pretty TCL code (is there such a thing?), but workable. Ex