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.

When auto loading a JS script it does not work



Hi, I'm auto-loading a JS script by putting it into <CCSv6 INSALL DIR>\ccsv6\ccs_base\common\IDE\scripts.

The script does auto load but does not respond when pressed... 

The script does work when I load it manually using the scripting console.

I'm using CCS6.

Would appreciate help! 

Thank you (:

  • Hello,

    I tried this out with my CCS 6.2 installation. It worked as expected. It correctly createsthe hotmenu and when I click on it, it executes the contents of the function.

    The script is does auto load but does not respond when pressed... 

    I assume it created the hotmenu for you since you confirmed it auto-loaded. What happens when you run the command by typing it in the scripting console.

    The script does work when I load it manually using the scripting console.

    What actions does the command do? How can you confirm that it executed correctly? Is there any output in the console or elsewhere?

    Thanks

    ki

  • Hi, thanks for the comment.

    The command saves a certain memory section periodically. So if it works I would see files saved in a certain folder.

    If I load the JS script using the scripting console it creates the hotmenu and when pressed does what it meant to do.

    When using the auto-loading option the script is loaded correctly ( as I see the hotmenu) but does not preform its action. 

  • I've debugged the script and I see that when auto-loaded the JS gets stuck when trying the write into the memory.

    i.e. memFill(address, page, length, value) -- doesn't work when auto-loaded and stop proceeding with the script.

    The strange thing is that when loaded manually it does work.

  • I suspect that after you have launched CCS, you did not open the Scripting Console view. The Scripting Console view needs to be opened to initialize the scripting environment, otherwise any console commands or DSS APIs will fail. You can even close the Scripting Console view after opening it. 

    Try opening the Scripting Console and then see if your autoloaded script works.

  • Hi Ki, the Scripting Console was open and I tried closing and opening it and it still doesn't work...

    I've added printings between every line in the script and it prints until reaching the memFill command. 

    The memFill is designed to turn on a flag in the program.

    For some reason the memFill command makes the script crush whereas when manually loaded it does not.

  • Please see my attached video (zipped)

    scripting_console_script.zip

    In the video, I have an example script that hasa hotmenu function that calls memFill to fill 4 words of data (0xACDC) to address 0x8000 of the data page. 

    It have it in the autoload folder of my CCSv6.2 installation.

    Next, I launch a debug session for a F28x target. When I connect to the CPU, and call the "Scripts -> Test" menu item to fill memory, nothing happens.

    Then I open the Scripting Console and try again. This time it succeeds.

    This is the expected behavior. I assume in your case this fails for some odd reason. If you are doing something similar and the script keeps failing, please attach your script to this thread. You will need to rename the file extention to *.txt since the forum will not accept a *.js file extension.

    Thanks

    ki