Thank you very much. I have interspersed more notes below.
[quote user="Ki-Soo Lee"]
Hi raja,
I will do my best to answer the questions that I have answer for:
[quote user="Raja Subramanian"]1. After the program loads, if I try to run it (using F8), it just hits exit without actually giving me the prompt to specify the u-boot file to flash. But, if I single step it, the program works properly. Any ideas?[/quote]
That is odd. I don't have an answer for that.
[quote user="Raja Subramanian"]2. If I use the CCS GUI to connect to the target and load code, the loader stops at main.c. But, if I use the scripting method above, the loader stops at boot.asm. Why the difference? From CCS GUI, I can hit F8 after loading and it works properly every time.[/quote]
Normally, when loading a program, it will set the PC at the entry point of the program. However, if you are using the "Debug As" (bug) button to launch the debugger, the default is to load the program and auto-run to main. There is also a debugger option that you can set to auto-run to main every time. It is likely that the environment when scripting does not auto-run to main while via GUI, it is.
I am not using "Debug As". I do Ctrl+Alt+L to load the program. That is what gets the program to main(). Maybe, that is equivalent to "Debug As"?
[quote user="Raja Subramanian"]I need to run the SPI1 Pinmux script for flash programming. How can I run that from Debug Server Scripting?[/quote]
Is this script a DSS javascript? Or a GEL file?
This is in the GEL file. It shows up in the Scripts drop down in CCS GUI. Maybe, I just have to add this to the connect function in the GEL file?
[quote user="Raja Subramanian"]Eventually I want to modify the flashing program so that it can take command line arguments and I can use loadti to be able to run from command line without user interaction. When I tried loadti, it seems like the program was trying to load the .out to C6748 and it failed complaining that the image format is wrong. How can I specify in loadti that the code needs to be loaded to the ARM9 core? Do I have to modify main.js?[/quote]
loadti does not handle multi-core environments by default. It will simply try to connect and load to the first core on the JTAG scan chain (which I think is the C674x on a L138). As you mentioned, you'll have to modify the loadti script to correctly handle multi-core environments
So, I tried modifying main.js to open a session with the proper core. It seemed to be happy to load the code just one time. Even that time, the whole process failed as loadti complained about not being able to set breakpoint . Output below
Loading C:/ti/DaVinci-PSP-SDK-03.22.00.02/host-tools/OMAP-L138_FlashAndBootUtils_2_40/OMAP-L138/CCS/SPIWriter/ARM/SPIWriter_OMAP-L137.out
WARNING: ARM9_0: Breakpoint Manager: Retrying with a AET breakpoint
SEVERE: ARM9_0: Trouble Setting Breakpoint with the Action "Process CIO" at 0x80007054: Error 0x00000008/-1066 Error during: Break Point, Cannot set/verify breakpoint at 0x80007054
WARNING: ARM9_0: Breakpoint Manager: Retrying with a AET breakpoint
SEVERE: ARM9_0: Trouble Setting Breakpoint with the Action "Finish Auto Run" at 0x800032cc: Error 0x00000008/-1066 Error during: Break Point, Cannot set/verify breakpoint at 0x800032CC
SEVERE: ARM9_0: Trouble Setting Breakpoint with the Action "Terminate Program Execution" at 0x80007250: Error 0x00000008/-1066 Error during: Break Point, Cannot set/verify breakpoint at 0x80007250
After this attempt, I could not get past initializing the emulator at all. Gets a Java exception. Here is the output. I have tried everything from power cycling the board and power cycling the emulator, power cycling both, but every time I get the following exception.
***** DSS Generic Loader *****
START: 13:54:14 GMT-0700 (PDT)
Configuring Debug Server for specified target...
Done
SEVERE: ICEPICK_C: Error initializing emulator
SEVERE: Could not start server: DebugServer.1: ICEPICK_C: Error initializing emulator
org.mozilla.javascript.WrappedException: Wrapped com.ti.ccstudio.scripting.environment.ScriptingException: Could not start server: DebugServer.1: ICEPICK_C: Error initializing emulator
(C:\ti\ccsv5.3\ccsv5\ccs_base\scripting\examples\loadti\main.js#165)
at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1705)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:157)
at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:201)
at org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:64)
at org.mozilla.javascript.gen.c1._c4(C:\ti\ccsv5.3\ccsv5\ccs_base\scripting\examples\loadti\main.js:165)
at org.mozilla.javascript.gen.c1.call(C:\ti\ccsv5.3\ccsv5\ccs_base\scripting\examples\loadti\main.js)
at org.mozilla.javascript.optimizer.OptRuntime.callName0(OptRuntime.java:106)
at org.mozilla.javascript.gen.c1._c0(C:\ti\ccsv5.3\ccsv5\ccs_base\scripting\examples\loadti\main.js:9)
at org.mozilla.javascript.gen.c1.call(C:\ti\ccsv5.3\ccsv5\ccs_base\scripting\examples\loadti\main.js)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:337)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2755)
at org.mozilla.javascript.gen.c1.call(C:\ti\ccsv5.3\ccsv5\ccs_base\scripting\examples\loadti\main.js)
at org.mozilla.javascript.gen.c1.exec(C:\ti\ccsv5.3\ccsv5\ccs_base\scripting\examples\loadti\main.js)
at org.mozilla.javascript.tools.shell.Main.evaluateScript(Main.java:500)
at org.mozilla.javascript.tools.shell.Main.processFileSecure(Main.java:422)
at org.mozilla.javascript.tools.shell.Main.processFile(Main.java:388)
at org.mozilla.javascript.tools.shell.Main.processSource(Main.java:379)
at org.mozilla.javascript.tools.shell.Main.processFiles(Main.java:176)
at org.mozilla.javascript.tools.shell.Main$IProxy.run(Main.java:97)
at org.mozilla.javascript.Context.call(Context.java:540)
at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:447)
at org.mozilla.javascript.tools.shell.Main.exec(Main.java:159)
at org.mozilla.javascript.tools.shell.Main.main(Main.java:137)
Caused by: com.ti.ccstudio.scripting.environment.ScriptingException: Could not start server: DebugServer.1: ICEPICK_C: Error initializing emulator
at com.ti.debug.engine.scripting.DebugServer$SessionFactory.<init>(DebugServer.java:161)
at com.ti.debug.engine.scripting.DebugServer.openSession(DebugServer.java:1128)
at com.ti.debug.engine.scripting.DebugServer.openSession(DebugServer.java:65)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:142)
... 21 more
Any ideas?
[quote user="Raja Subramanian"]Can I use the XDS100v2 emulator with OMAPL138 and run the above scripts (using loadti)? I have only tried with SD XDS 510 till now, but would like to use XDS100v2.[/quote]
Sure. loadti supports any emulator that CCS does. loadti interfaces to the same debug engine as CCS.
[quote user="Raja Subramanian"] Do you have any data on how long it would take to program an SPI flash (about 256 KB of code - 4 sectors) using loadti and XDS100v2?[/quote]
It will take the same time as doing it in CCS. As for how long in CCS, I do not know.
Oh ok, I was hoping it would be at least a bit faster. But, there is still gain of doing it from command line in a production environment. But, I need to get the loadti variant working reliably.
Thanks
ki
[/quote]