I am having trouble running the debugger on a STM32F205ZG using µVision4 and the ULINK2. I keep getting the error message "Could not stop Cortex-M device! Please check the JTAG cable." I am using the SW port. Any help with this would be greatly appreciated.
From the manual: http://www.keil.com/support/man/docs/ulink2/ulink2_errors.htm
Could not stop Cortex-M device The debugger tries to stop the target. This attempt can be made after initializing the connection, or while resetting the target, or through a stop/step command while debugging. In some cases, the target's debug block not functioning properly raises this error.
It looks like the debug block of the device is disabled somehow. Can you try with a different device? Have you programmed something into that device? Some devices have a feature to disable debugging (basically this is a device lock function).
CRP enabled...?
It isn't just copy-protection that can break the JTAG interface.
One thing with debugging is that it is good if debugged applications always has an initial delay before actually starting to play with the hardware.
In case a downloaded application configures the clocking incorrectly and hangs the processor it can also kill the JTAG interface. With an initial delay, you get a window after reset where the JTAG interface can get in contact with the processor and block the program from reaching the invalid code.
try unchecking options for target>Uililties>settings>Reset and run. (keep the clock speed low)
That will leave the chip in its 'native state' and ulink will connect unless you have a hardware error. whether this allow you to see the effects of 'step into' (once) should deternine the course of action
Erik
(keep the clock speed low) refer to the JTAG clock, 1MHz should be good
Thanks to everyone that has posted a response. I'm sorry I have been unable to reply to anything for a few days. Here are a few replies for some of the questions people have asked:
"Can you try with a different device? Have you programmed something into that device?"
The device I am using has previously been programmed with code for the application I am developing. This code essentially works, there are a couple of bugs though which is what I am trying to figure out. I have erased the device before trying to debug the code but this makes no difference. I am trying to get my hands on a device that hasn't previously been programmed.
"In case a downloaded application configures the clocking incorrectly.."
As above: the application code has already been programmed to the board and does run, it's just that it wont debug. Someone else that used to work on this application has managed to debug the code before but I am no longer in contact with him which is why I am stuck trying to get this to work.
"try unchecking options for target>Uililties>settings>Reset and run (keep the clock speed low) refer to the JTAG clock, 1MHz should be good"
This has already been tried without success, the 1MHz JTAG clock speed is the default. I have tried slower speeds (with Reset and run checked and unchecked) which made no difference.
"CRP enabled..."
Not as far as I am aware but I am very new to embedded systems development. I am hoping when I get a device that hasn't been previously programmed it will give me a better insight into what is happening.