This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

write through a javascript with DSS in the CCS scripting console



Hello,

I am trying to define an automatic flashing procedure with dss. For it I defined a javascript and I run it with "dss.sh javascript.js"

Everything works fine till I need to load in the memory.

After debugSession.target.run(); I do 

debugSession_Cortex_M4_IPU1_C0.memory.loadRaw(0,0x8250040c,"/tmp/app", 32, false); debugSession_Cortex_M4_IPU1_C0.memory.loadRaw(0,0x8450040c,"/tmp/sbl", 32, false);

to load my files in the memory but apparently it is not working well. 

When I flash manually with CCS, after loading my program I have to write in the scripting console (not in the normal console) the two previous commands (loadraw...) and when I do it, it works fine.

I think, the problem is that when I run my js-script with dss I am not openning the "scripting console" of CSS but the normal "console" and when I do "loadraw()" this will be executed in the normal console instead of the scripting console and no program will be loaded.

I there anyway to write on the scripting console of CSS using a js-script and dss?

Thanks in advance

Javier

  • Just one more comment, I run the javascript from the console of my ubuntu, without oppening CCS: $PATH_DSS/./dss.sh $PATH_JS/TDA3_Flash_0909.js
  • hello,

    Javier Garcia24 said:
    After debugSession.target.run(); I do 

    Since that API is a synchronous run call, where is the target halted when the API returns and the subsequent loadRaw APIs are called?

    Thanks

    ki

  • Hello Ki,

    I am not quite sure that I halt the target before executing "target.run()". 

    I have tried something and now it apparently works. After I have started the connection with the cores, I load the binary, then I do a System Reset , then "loadRaw()" before calling "target.run()" and then when the target runs, it works propperly. My binary takes my program from the flash memory and loads it in the DDR of my SoC. I think, the issue is solved

    Could you please explain me a bit more about halting the target before running? How can I implement it in a javascript?

    Thanks for your help

    Javier

  • target.run is a synchronous API. So when you call target.run, the call will not return until either:

    A) the target reaches some halt point on its own (like reaching a breakpoint)
    B) if the calls times out (if you set a script timeout) - which would cause an exception to be thrown

    If neither occurs, then the script will simply be stuck there. This may explain why the loadRaw never occurred - because it was never reached. And also explains why calling loadRaw before target.run works.

    Thanks
    ki