Hi. Saw your patch. I tried the same thing here but it doesn't work for the embedded artists target, the board I have here for testing openocd.
The ea target includes the lpc2478.cpu file and then starts using _TARGETNAME. As I mentioned in my original email, because init hasn't been called yet the variable isn't valid and the ea script has an error. It's right at the top of the file if you want to see. The question is how target boards are supposed to work. It would be great if a dev could just say that the paradigm is x and we could march to that. Maybe the fix is to have the ea target setup another init like script whereby the one that calls through to the CPU file runs and then the target one runs so variables are setup in the correct order. But who knows? Chris On Feb 1, 2012, at 5:25 PM, Freddie Chopin <[email protected]> wrote: > Hi! > > The change that I've just posted to gerrit should help the issue you have. > > http://openocd.zylin.com/#/c/421/ > > I've tested it by adding additional command to openocd call: > -c "init; echo $_TARGETNAME" > The problem is that you HAVE to have "init" before using the variable - > that's the way with init_targets() and only setting _TARGETNAME > explicitly in config files can work... this is another solution (set > variable, pass variable to init_targets inner functions - the variable > is set before init now). Currently _TARGETNAME is set internally by > init_targets() and that is executed on init, while config scripts are > parsed before that. > > BTW - this scheme (init_targets()) is used only in lpc2xxx files... > Maybe it's not the way? > > 4\/3!! > > ------------------------------------------------------------------------------ > Keep Your Developer Skills Current with LearnDevNow! > The most comprehensive online learning library for Microsoft developers > is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, > Metro Style Apps, more. Free future releases when you subscribe now! > http://p.sf.net/sfu/learndevnow-d2d > _______________________________________________ > OpenOCD-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/openocd-devel ------------------------------------------------------------------------------ Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d _______________________________________________ OpenOCD-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openocd-devel
