Solved! Go to Solution.
OK, the "file not found" error means exactly that: your Tcl file is not being found. After some experimentation with the IDE and with a simple Tcl script similar to yours, I got it to work. Here's what you need to do:
1) Make sure that if the file pathname has blanks, that you enclose everything in quotes. I assume you were doing this at least for the cmdIDE argument. To be more precise, here's my command line:
"C:\Program Files\Freescale\CodeWarrior PA V8.8\bin\cmdIDE.exe" /d D:\multicore\core0\tcl_script.tcl
Note that the path name to the tcl file did not have any blanks, so the quotes were not required for that argument, whiile they were for specifying where cmdIDE was. Note also that the tcl file is in the directory with the project, particularly for the core0.mcp file. We're getting to that file next.
2) The command line debugger likes interpreting the reverse slashes for some reason, which trashes the path name to your project file. So, in your tcl file you need to have:
debug D:/multicore/core0/core0.mcp
bp main
bp main off
puts "I was here"
go
As the path name specifies, the .mcp project file is in the same directory with the .tcl file.
With the above command line and tcl file, when I issued the command line, the CodeWarrior IDE launched, opened the project, and executed the tcl commands.
HTH.
---Tom
OK, the "file not found" error means exactly that: your Tcl file is not being found. After some experimentation with the IDE and with a simple Tcl script similar to yours, I got it to work. Here's what you need to do:
1) Make sure that if the file pathname has blanks, that you enclose everything in quotes. I assume you were doing this at least for the cmdIDE argument. To be more precise, here's my command line:
"C:\Program Files\Freescale\CodeWarrior PA V8.8\bin\cmdIDE.exe" /d D:\multicore\core0\tcl_script.tcl
Note that the path name to the tcl file did not have any blanks, so the quotes were not required for that argument, whiile they were for specifying where cmdIDE was. Note also that the tcl file is in the directory with the project, particularly for the core0.mcp file. We're getting to that file next.
2) The command line debugger likes interpreting the reverse slashes for some reason, which trashes the path name to your project file. So, in your tcl file you need to have:
debug D:/multicore/core0/core0.mcp
bp main
bp main off
puts "I was here"
go
As the path name specifies, the .mcp project file is in the same directory with the .tcl file.
With the above command line and tcl file, when I issued the command line, the CodeWarrior IDE launched, opened the project, and executed the tcl commands.
HTH.
---Tom
I can tell you what I remember, I did use tcl scripts in the past but not recently. Also I don't know the CW debugger for the DSC56800, I did use CF, EPPC and X86 in the past only.
> 3.cmdIDE.exe /d scriptname.tcl executed. The IDE hangs.
Not sure what you mean with "hangs". The ide wont close unless you tell it to do so, there is a scripting command for this.
> 4.Executed by setting a Script point. The .tcl file is opened but no command executed.
Script points execute the script when the underlying breakpoint is hit. Was it hit? Try a simple command like
puts "I was here"
>5.Tried executing the script file through the 'source scriptname.tcl'command in
>the command window. There was an error message output.
Then fix the errors before you try anything else....
Which errors did you get?
>Clarifications:
>1.How should we have the commands in the .tcl file executed?
Not sure what you are asking. Executing them via source, command line argument or via script point should work.
>2.As mentioned in the reference pdf, there was no 'tcld.tcl' file which needs to
>get executed at start up? It is mentioned to be available at %SystemRoot% directory.
Cannot help, never heared of this file. Don't think it is needed.
> 3. Is there any additional software that needs to be installed for the script execution?
No. The needed tcl libraries are provided.
> 4.Is it possible to provide 'values to variables' to be passed to the functions in
> the software through the script?
Not sure that 'values in variables' means. TCL is a progamming language which supports variables, reading/writing files and much more. So if this refers to read setup information into the script via configuration files, then this can be done via standard TCL.
> 5.Can the script consist only of the Metrowerks commands?
TCL commands work too. There are also many TCL libraries.
Daniel
Try taking a look Application Note 3118. Although it covers Flash programming, it has a short example that uses a Tcl script. This might be enough information to help you get started. To save you the trouble of looking for the App Note, I'll attach it here.
According to my understanding of the documentation, the tcld.tcl file is where you place your Tcl commands. When you open a command line window in CodeWarrior, the IDE searches for this file and if it is present, the command line window executes the commands in the file. HTH.