After reading uncountable threads and articles regarding this topic, I still cannot communicate my ULINK2 with Keil evaluation board MCBSTR9 (v4). So I need some help.
The problem came when suddenly, when trying to download an application (as I've been doing every day), error message Too many JTAGS devices in chain appeared (I don't have multiple devices in chain).
As I could see, no device information was displayed in uVision, under ULINK ARM debugger settings menu. Automatic information about the device did not appear.
Changing JTAG clock didn't work.
Following the instructions in http://www.keil.com/support/docs/3354.htm , I uninstalled Windows USB drivers. Diagnosis changed, but not enough: now the error message is JTAG communication failure.
ULINK2 was and still is correctly displayed as Human Interface Device.
I tried to manual configure device information (IDCODE, Device Name, IR len) with the information provided by ARM but my efforts were unsuccessful. And I don't have much JTAG knowledge.
I was developing and testing one application to put STR9 in Sleep mode, it must be wake up by the RTC clock. Perhaps this information is useful to solve my problem.
What can I do to re-enable JTAG communication?
Thanks in advance.
maybe this can help?
http://www.keil.com/support/docs/3215.htm
Thanks Tamir for your help.
But after trying ten times to do the entire erase sequence I have to admit (with great disappointment) it is not the solution. The message persists: JTAG communication failure
If necessary I could post the code which I was developing when JTAG failed. The code did not work, either.
As additional information, I always power the board with the USB, but when my problems began I was powering the board with 5 volts in VIN.
Thanks.
What if you erase the flash and try to download something like Blinky instead of your software?
Hello Tamir. And thanks again.
Excuse my ignorance on this, but, ¿how can I erase Flash without passing trough uVision erase procedure?. Until now I have always used ULINK to erase and reprogram my applications.
Now I get always the same response: JTAG Communication Failure: when trying to erase and trying to reprogram. Blinky is the project I was trying to download now.
Is there a way to erase Flash without using ULINK? (I don't have another JTAG adapter)
the erase procedure as described in the above link should work. note the timing requirements - you must keep the reset button pressed for at least 0.5 seconds but not longer than 1.5 seconds. I have tried this myself - if you following the exact procedure your flash should be erased.
Yes, I'm following the procedure you link (my english is not natural, so perhaps it was not clear what I was doing). Those are the steps I'm following:
1. I power off the board (unplug USB). 2. I hold RESET button (S1 in my board) 3. Power on the board (plug USB) while holding S1. 4. Go to Flash - Erase option in uVision menubar. Blinky project is open. 5. Click Erase. 6. Count to one (inside my head). 7. Release S1.
I get the error message: JTAG Comunnication Failure
Perhaps the most difficult part is to count between 0.5 and 1.5, but I suppose that at least one of the multiple times I tried was correctly timed.
By the way, I think that the error message appears before one second has passed after I click 'Erase'. Releasing S1 after this message appears doesn't seem to have any effect.
Thanks for your patience.
When I last tried this procedure a couple of months ago (I trashed my flash by loading software that incorrectly configured the system clock) I remember that selecting "erase flash" from uVision caused the tool to wait until I released my reset. I release the flash not more than 0.5-0.8 seconds after selecting "erase flash". Are you sure you really hold the reset down? You must be missing something in the procedure. I had the exact same problem - erasing the flash solved it. What happens if you lower the JTAG clock, or put it back on 1 MHz...?
It works!!
I have added one step to the the procedure. I don't know whether it was the key, but I'm going to post the exact steps which worked.
1. I power off the board (unplug USB). 2. Unplug ULINK2 adapter fron JTAG connector. 3. Plug in ULINK2 adapter. 4. I hold RESET button (S1 in my board) 5. Power on the board (plug USB) while holding S1. 6. Go to Flash - Erase option in uVision menubar. Blinky project is open. 7. Click Erase. 8. Count to one (inside my head). 9. Release S1.
As Tamir said, uVision wait for the release of S1 (before it didn't). Flash was erased and now Blinky is running.
Now I have to deal with RTC and with the fact that I corrupted somehow the clock control registers. My code scares me!
Thanks for your help and insistence, Tamir. I wouldn't have tried so many times without it.
Good work. My board came along with a ULINK-ME, which as far as I remember did not required it be physically disconnected from the board when erasing the flash.