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.

After reset Expressions set to zero in IDDK Development kit

Other Parts Discussed in Thread: CONTROLSUITE

I am going through the IDDK Development kit user guide procedure and everything works great the first time but after that the expression variables in figure 10 of the user guide are set to zero except the enable flag which continues to be set to 1.

I followed step 18. to Reset the target on program load or restart.  Then step 19 says to disable the silicon real-time mode button before resetting the CPU.  This I have done. 

I stop the program according to the instructions in the user guide.  The second time I go through the steps when I click debug the program automatically starts running without ever hitting the run button.  The variables in the expression window still remain from the previous debug however their values are now all set to zero! 

How can I prevent the values in the expression window (and thus the .c file) from being set to zero when I reload the program a second time? 

Thanks,

Adam

  • Hi Stevens,

    What is the option you set for the following-
    Run->Debug Configurations, In the Auto Run and Launch options -- Auto Run Options?
    Do you have "On a Program Load or Restart" box checked?
    Do you have the "Run Symbol" set to main?
    If so, i would expect the program to come to main and halt there when you hit the debug button.
    Instead of hitting the debug  icon, you can also try Run-> Load -> Load program and select the load file then do a reset and restart after the load is complete.
    Either case - the program should halt at main. This is irrespective of the values of flags/variables in expression window.

    -Bharathi.

  • Bharathi,

    Thank you for the response.  I had previously gone into Tools-> Debugger Options -> Program/ Memory Load Options and checked Reset the target on a program load or restart. and then clicked Remember My Settings.

    Per your instructions above I checked  Run ->Debug Configurations "On a Program Load or Restart". 

    With this box checked the program still begins to run without me clicking the play button.  I could not find the "Run Symbol" setting.  Where exactly is this?

    This was only a peculiarity right now and not my main problem.  The main problem is that the variables of the expressions window are set to zero on a restarting of the program.  I have to delete the file from my working directory and then re-import it in order to get the variables set back to what they are supposed to be.  This is the main problem.  Perhaps it is related to the above problem?  I am not sure.

    Thanks for your help.

    -Adam

  • Adam,

    Is the program execution from Flash or RAM?
    Are you getting any warnings like "Unable to set requested breakpoint" or "breakpoint address is in valid memory" etc when you load the program.
    One reason why debugger is unable to halt at main is if it fails to keep the break point for some reason.
    In such case you would get a warning in the similar lines described above.

    Regarding the other problem - are these variables initialized in code or via expression window?


    -Bharathi.

  • Bharathi,

    The program is running in Ram.  The only warning I sometimes get is: 

    IcePick_C_0: Trouble Reading Memory Block at 0x0 on Page 0 of Length 0x320

    The variables are initialized in the code but when the expression window is in continuous refresh I believe the values in the code are changed to the values in the expression window.  And I think from the previous run they get set to zero so when the program starts up they get set to zero.  This is just a theory.

    I think my original file from the controlsuite directory has been corrupted in this way because now even when I reimport the project again the program does not produce the pwm graphs it was producing.  The graphs are just flat lined at zero. 

    I have attached the user manual so you know exactly the steps I have been following.

    TI Development Kit IDDK User's Guide.pdf

  • Adam,

    This still doesn't explain why the program doesn't stop at main.
    What boot mode are you using? can you check the boot pin status?
    Also, since you mentioned file corruption, you can download the controlSuite project again.
    You are referring to the right document.

    -Bharathi.

  • Bharathi,

    I am using EMU_BOOT_SARAM.  I do not know how to check the boot pin status.

    I re installed control suite and imported a fresh copy of the program.  I rebuilt the program and started the debug.  The program stopped at main as it should.  Then I selected Program/Memory Load Options ->Reset the target on Program Load and set the boot mode to EMU_BOOT_SARAM.  I clicked the Enable-silicon realtime mode and ran the program.  I imported the Variables_IDDK_Level1.txt file into the Expressions window and set the enable flag to 1.  I also set up the graphs according to the user manual.  The graph results were as good and the LED3 on the board was blinking at a rapid pace.

    I then disabled the silicon realtime mode and hit the reset cpu button and terminated the program. 

    I then clicked the debug button again and the program jumped right into running.  I did not have the opportunity to set the boot mode to SARAM.  The LED3 was blinking this time but at a slower pace.  I halted the program.  The LED3 stopped blinking.  I unplugged the board from the usb and power supply.  When I plugged them back in LED3 started blinking again at the slower pace.

    Some time ago I ran an example from the C2000 multiday workshop where I believe we ran a program from flash to blink an LED.  I wonder if this is still on the flash and causing a conflict.  Just a guess. 

    I then switched to another computer and successfully ran the program several times.  This was very promising until I switched to using full halt with reset instead of individually clicking the disable silicon realtime button and then the reset CPU button.  Then the problem happened all over again and even re importing the project is not fixing the problem.  Somehow using the full halt with reset button also caused the unchecking of the "reset target on program load or restart button" and then running the program without this button checked corrupting the program.  Even now that the box is checked and I have reimported a fresh copy of the project when I click the run button it appears in CCS the program is running but there is no LED flashing and no output on the graphs.

    I just reimported the file one more time made sure the "reset target on program load or restart button" was checked and began the debug again.  This time the program immediately started running.  This time it was the program with the slow flashing of the LED.  I did not have the opportunity to go to scripts -> EMU_BOOT_SARAM since the program automatically started running after clicking debug.  I then realize that another program from the workspace was running on the device even though it was not active.  I reset and halted the device and closed all the other projects in my workspace.

    I then reimported the project again.  The "reset target on program load or restart button" was again unchecked so I rechecked it.  Then I started the Debug again.  At this point CCS froze up and I had to restart the program.  When I run the debug the program is jumping right in and running and the LED3 is blinking slowly.

    I then reimported the project and the "reset target on program load or restart button" was again unchecked so I rechecked it.  When I hit Debug the program stopped at main.  I clicked EMU_BOOT_SARAM and enabled the realtime mode then clicked run and set the EnableFlag to 1.  The program ran like it should and produced the correct output!

    I then unchecked the run in realtime mode, reset the cpu, and then halted the program.

    Then I made sure the "reset target on program load or restart button" was still checked, which it was, and ran the debug again.  This time the program did not stop at main but jumped right in to slowly flashing the LED.

    I then clicked reset cpu and saw an error:

    C28xx_CPU: Trouble Removing Breakpoint with the Action "Finish Auto Run" at 0x80db: (Error -1066 @ 0x80BD) Unable to set/clear requested breakpoint.  Verify that the breakpoint address is in valid memory.  (Emulation package 5.1.64.0)

    This "Finish Auto Run" seems suspicious as I do not want an auto run.

    This is all I can handle for today. 

    Do you know what the problem is?

    Thank you so much for your help.

    -Adam

  • I think the main issue is that a program is running automatically from the flash causing a conflict. How do I reset the flash memory back to the original settings?
  • Adam,

    From the error you mentioned above - it seems like the debugger is, for some reason, failing to place a break point at main, which in turn is leading to execution of the code without halting at main.
    This is the probable cause we discussed earlier as well and I was asking if you have seen any warnings in this regard.
    Can you refer to the post below and try to get rid of the error?
    http://e2e.ti.com/support/development_tools/code_composer_studio/f/81/p/179727/647569#647569 
    Y
    ou can also refer to similar posts on this topic on the forum.

    -Bharathi.

  • Bharathi,

    Yes, I think this is the issue.  There is another program running from the Flash that I need to figure out how to get rid of that must be taking up the breakpoints.

    I did the C2000 multiday workshop labs for this board and Lab 10 had us load a program to run from flash.  There were no instructions on how to remove this program.  So even now when I power up the board this program generates a 2 kHz PWM at pin 49. 

    How do I clear this program from the flash?  I think this will solve the breakpoint issue.

    Thanks,

    Adam