Re: [Openocd-development] script command

2011-07-29 Thread Jie Zhang
On Fri, Jul 29, 2011 at 12:10 AM, Steve Bennett ste...@workware.net.au wrote: On 29/07/2011, at 2:06 PM, Steve Bennett wrote: On 29/07/2011, at 1:40 PM, Jie Zhang wrote: Hi, Where is the script command defined? I greped in jimtcl and openocd source code, but could not find it. Thank you!

Re: [Openocd-development] [PATCH 4/4] flash: add support for deprecated stm32 flash cmds

2011-07-29 Thread Spencer Oliver
On 29 July 2011 02:01, Steve Bennett ste...@workware.net.au wrote: I don't know what parameters may be passed to these procs, but if they could contain spaces, quotes or braces this could cause unexpected behaviour. You might consider using the more correct form: proc stm32f2xxx args {    

[Openocd-development] script vs source

2011-07-29 Thread Jie Zhang
Hi, OpenOCD uses script command to execute config file passed through -f option. script command is defined as a function proc script {filename} { source [find $filename] } Thus when executing the config file, global variables defined in that config file is not global any more. If I

Re: [Openocd-development] script vs source

2011-07-29 Thread Spencer Oliver
On 29 July 2011 11:45, Jie Zhang jzhang...@gmail.com wrote: Hi, OpenOCD uses script command to execute config file passed through -f option. script command is defined as a function proc script {filename} {        source [find $filename] } Thus when executing the config file, global

Re: [Openocd-development] script vs source

2011-07-29 Thread Jie Zhang
Let's me explain more on what I'm trying to do. In Blackfin gdbproxy, I hardcoded memory maps in C source code. When moving to OpenOCD, I'm trying to put them in the config files, which is something in my TODO list for a long time. At that time I thought about using an XML file for this purpose.

Re: [Openocd-development] script vs source

2011-07-29 Thread Jie Zhang
On Fri, Jul 29, 2011 at 7:34 AM, Spencer Oliver s...@spen-soft.co.uk wrote: On 29 July 2011 11:45, Jie Zhang jzhang...@gmail.com wrote: Hi, OpenOCD uses script command to execute config file passed through -f option. script command is defined as a function proc script {filename} {        

Re: [Openocd-development] script vs source

2011-07-29 Thread Jie Zhang
On Fri, Jul 29, 2011 at 7:12 AM, Øyvind Harboe oyvindhar...@gmail.com wrote: Its historical. Perhaps it should be this way? Perhaps ot is better to pass args as args to procs rathr than global variables? Perhaps we should retire script? It's really historical. It was in the first commit in the

Re: [Openocd-development] script vs source

2011-07-29 Thread Steve Bennett
On 29/07/2011, at 8:45 PM, Jie Zhang jzhang...@gmail.com wrote: Hi, OpenOCD uses script command to execute config file passed through -f option. script command is defined as a function proc script {filename} { source [find $filename] } Thus when executing the config file,

Re: [Openocd-development] [PATCH 3/4] cfg: update scripts to use new stm32 driver names

2011-07-29 Thread Andreas Fritiofson
On Thu, Jul 28, 2011 at 1:52 PM, Spencer Oliver s...@spen-soft.co.ukwrote: delete mode 100644 tcl/target/stm32.cfg delete mode 100644 tcl/target/stm32f2xxx.cfg For compatibility with existing user scripts, it would be best to keep these files during the 0.5.x period. Just make them print a

Re: [Openocd-development] [PATCH 3/4] cfg: update scripts to use new stm32 driver names

2011-07-29 Thread Spencer Oliver
On 29 July 2011 14:54, Andreas Fritiofson andreas.fritiof...@gmail.com wrote: On Thu, Jul 28, 2011 at 1:52 PM, Spencer Oliver s...@spen-soft.co.uk wrote:  delete mode 100644 tcl/target/stm32.cfg  delete mode 100644 tcl/target/stm32f2xxx.cfg see patch 4 Spen

[Openocd-development] [PATCH] Better fixes for set but not used warnings

2011-07-29 Thread Jie Zhang
I happened to find that two previous fixes for set-but-not-used warnings are not correct or not good. This patch should be an improvement. Please review and merge if good. Regards, Jie diff --git a/src/target/etb.c b/src/target/etb.c index 3cb2254..974ab2b 100644 --- a/src/target/etb.c +++

Re: [Openocd-development] [PATCH 3/4] cfg: update scripts to use new stm32 driver names

2011-07-29 Thread Andreas Fritiofson
On Fri, Jul 29, 2011 at 4:09 PM, Spencer Oliver s...@spen-soft.co.ukwrote: On 29 July 2011 14:54, Andreas Fritiofson andreas.fritiof...@gmail.com wrote: On Thu, Jul 28, 2011 at 1:52 PM, Spencer Oliver s...@spen-soft.co.uk wrote: delete mode 100644 tcl/target/stm32.cfg delete mode

Re: [Openocd-development] script vs source

2011-07-29 Thread Jie Zhang
On Fri, Jul 29, 2011 at 8:16 AM, Steve Bennett ste...@workware.net.au wrote: Makes sense to me to change it to: proc script {filename} {        uplevel #0 source [find $filename] } The attached patch removes script command completely. Jie From f00a57d009fb713091b096521e82600a2e2401c2 Mon

Re: [Openocd-development] script vs source

2011-07-29 Thread Jie Zhang
On Fri, Jul 29, 2011 at 11:24 AM, Jie Zhang jzhang...@gmail.com wrote: On Fri, Jul 29, 2011 at 8:16 AM, Steve Bennett ste...@workware.net.au wrote: Makes sense to me to change it to: proc script {filename} {        uplevel #0 source [find $filename] } The attached patch removes script

Re: [Openocd-development] [PATCH 3/4] cfg: update scripts to use new stm32 driver names

2011-07-29 Thread Spencer Oliver
On 29 July 2011 15:43, Andreas Fritiofson andreas.fritiof...@gmail.com wrote: That one won't help for all scripts out there that are currently sourcing target/stm32.cfg. /Andreas Good point - how about http://repo.or.cz/w/openocd/ntfreak.git/commit/e4908b71bcac1e3ae01a4f54cffe475b0be6e336

Re: [Openocd-development] [PATCH] Better fixes for set but not used warnings

2011-07-29 Thread Jie Zhang
On Fri, Jul 29, 2011 at 11:41 AM, Spencer Oliver s...@spen-soft.co.uk wrote: On 29 July 2011 15:32, Jie Zhang jzhang...@gmail.com wrote: I happened to find that two previous fixes for set-but-not-used warnings are not correct or not good. This patch should be an improvement. Please review and

Re: [Openocd-development] [PATCH 3/4] cfg: update scripts to use new stm32 driver names

2011-07-29 Thread Andreas Fritiofson
On Fri, Jul 29, 2011 at 5:38 PM, Spencer Oliver s...@spen-soft.co.ukwrote: On 29 July 2011 15:43, Andreas Fritiofson andreas.fritiof...@gmail.com wrote: That one won't help for all scripts out there that are currently sourcing target/stm32.cfg. /Andreas Good point - how about

Re: [Openocd-development] [PATCH 3/4] cfg: update scripts to use new stm32 driver names

2011-07-29 Thread Spencer Oliver
On 29 July 2011 16:56, Andreas Fritiofson andreas.fritiof...@gmail.com wrote: On Fri, Jul 29, 2011 at 5:38 PM, Spencer Oliver s...@spen-soft.co.uk wrote: On 29 July 2011 15:43, Andreas Fritiofson andreas.fritiof...@gmail.com wrote: That one won't help for all scripts out there that are

Re: [Openocd-development] [PATCH 3/3] ft2232: Add casts to avoid warnings

2011-07-29 Thread Jie Zhang
On Fri, Jun 24, 2011 at 3:14 PM, Jie Zhang jzhang...@gmail.com wrote: On Mon, Jun 20, 2011 at 6:50 AM, Steve Bennett ste...@workware.net.au wrote: The default is -Werror, so warnings become errors and stop the build. Might be better to simply #define FT_STATUS instead. -              

Re: [Openocd-development] [OpenOCD][PULL Request][MIPS32] Fixed single byte memory write

2011-07-29 Thread Mahr, Stefan
Hi Drasko. Drasko DRASKOVIC (1): mips32 : Fixed memory byte access Your patch fixes the broken byte access, but not the big endian host issue. Since both problems are tied together, I would prefer a more common solution. Attached patch hopefully fixes both issues. It should also fix