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.

430F1101A, FET430UIF, IAR Kickstart -- Debugging

I was working all day saturday and the USB debugger and IAR were playing fine.  I made several changes to the code, downloaded and debugged several times without issue.

Today I made one or two changes to software and debugged my change one time.  I had the error "Cannot write register" when I hit 'downlaod and debug"  it allowed me to run once.  After that when I hit reset I got the error "Stack pointer out of range"  The stack pointer had something like 0xDFE after I hit reset. 

I powered down and exited the debugger.  Powered the target, plugged in the USBFET, and then tried to do download and debug and IAR crashed.  Something about the IAR__PM.exe had a problem (not sure of hte actual name).

I tried 3 different target boards -- shut down my PC, powered back up - powered up the USBFet, powered up the Target board.  Compiled my code, downloaded.  Everything was fine.  I stopped the debugger.  Compiled my code again and when I went to "Download and debug" I now get "Could not find device"  So the first time I debug it is ok but it wont connect after that.  If it does then I get other issues.

Any suggestions?

  • I don't understand exactly what you're saying in the second sentence of your second paragraph, and that might be important.  Did you get the error when you tried to download and debug?  Did your code get downloaded OK, run once and then give you the error?

    Did you try reverting your code to a known working version?   I've had strange problems with IAR when my code tried to do things like initialize the RESET ISR to the wrong address.  Also:  are you including a device header in your code, and if so -- is it the correct one?

  • I guess I was rambling a bit.

    The error occured in the debug window during the download and debug - The code looked like it was running but when I stopped execution and hit reset the SP was wrong -- it is now 5D44. 

    I got a new target board and it downloaded but had this error:

    Would you believe that I created a new module in CVS and thought that all the files were added and they were not. I will have to make my best guess at what it looked like.

    I think I may have damaged my FET tool -- I have a switch on the target board and when I was playing around I toggled the switch.  The switch pull down the TCLK and TMS to ground.  This switch is intended to be used in normal operation (after I finished debugging the other functions).  Would this damage the FET tool or does it have internal protection?

     

  • Since you get the message that your code was downloaded and verified successfully (line 7 in your screen shot), I'd say that your debug tool is working fine.  Just to be sure though, why don't you make a really simple program (or use one of the simple examples provided for your device) and see if you can download and debug that?  That will at least set your mind to rest that your tools are working OK ( been there!! ).

    Based on my limited experience though, I think you've got a software problem.  Can you single step your code at all?  The fact that you can -see- your stack as something other than "ffff" is another promising indicator that your hardware is OK.

  • Thanks for the advice Curt.  Back to basics -->  I opened an example project and modified for my board and it worked.

    So I went back to my project and looked at the FET tool setup.  When I had the switch in the wrong position and everything was not working I decided to change some FET tool settings. Iselected "Connect to active project" and "Verify Download"  Then I realized the the switch was in the wrong position but never changed back the FET tool settings.

    I deselected "Connect to active project" and "Verify Download" and I have my switch in the correct position and it now works. 

  • That's great Joe! 

    I've had exactly the same sort of experience :-)

**Attention** This is a public forum