ispEnterProgMode: Error after succesful use for a long time

Started by ylun, November 07, 2018, 05:12:20 PM

Previous topic - Next topic

ylun

Hello guys.

After a long time of succesfully using 3 different AVR-ISP-MK2 programmers (jumpers set to OFF, 5V), Atmel Studio and different target devices, I have run into an annoying problem that stops me from updating firmware of my target devices.

The issue at hand is the following error message in Atmel when trying to read the target device:

   Failed to enter programming mode. ispEnterProgMode: Error status
   received: Got 0xc0, expected 0x00 (Command has failed to execute on
   the tool)
   
   Unable to enter programming mode. Verify device selection, interface
   settings, target power, security bit, and connections to the target device.
   
   ^Details
   Timestamp:      2018-11-07 13:41:44.142
   Severity:      ERROR
   ComponentId:   20100
   StatusCode:      1
   ModuleName:      TCF (TCF command: Device:startSession failed.)

   Failed to enter programming mode. ispEnterProgMode: Error status received: Got
   0xc0, expected 0x00 (Command has failed to execute on the tool)

As I said, for a couple of years I have had no issues at all like this. The programmers worked fine however since a couple of weeks hiccups showed up. I have used 2 work laptops to update the firmware for multiple target devices. These laptops have Windows 10 installed on them. I have also succesfully updated target devices' firmware before with my own laptop, however I can't do that anymore. The same error shows up on my own laptop now as well. Mind you, my personal laptop has a brand new reinstall of Windows 10.

I have used the manual (AVR-ISP-MK2.pdf) for the AVR-ISP-MK2 programmer. Thus I have also tried to reinstall the programmer firmware through Atmel Flip.

For further information, I logged the steps I did today on my personal laptop in the code format below.

Using the manual AVR-ISP-MK2.pdf. References for section numbers are for the manual. In each step that I tried to read the target device, I tried all clock speeds.

i. TARGET jumpers on ARV-ISP-MKII for 5V, OFF.
ii. Repaired Atmel Studio 7.0 so that all Atmel drivers are installed.

1. Log every step in detail. Note that many steps have been tried before.
2. Followed the 2.3 Quick setup steps 1 to 4.
2.1 Downloaded and extracted the drivers for AVR-ISP-MK2. These can be downloaded from
the following location: https://www.olimex.com/Products/AVR/Programmers/AVR-ISP-MK2/resources/DRIVER-MK2-AS-6-7-W10.zip
2.2 Plug AVR-ISP-MK2 to my laptop via a suitable USB cable (printer USB cable).
2.3 Open Device Manager. In my case in Device Manager I see
"Atmel -> AVRISP mkII, double clicking AVRISP mkII and going to Driver I see
Driver Provider: Atmel Norway AS
Driver Date: 2017-03-31
Driver Version: 42.0.2.0
Digital Signer: Atmel Norway
2.4 See 2.3, already under Atmel -> AVRISP mkII.
3. Try to read the programmer with Atmel.
4. Fails, same error message as before:
Failed to enter programming mode. ispEnterProgMode: Error status
received: Got 0xc0, expected 0x00 (Command has failed to execute on
the tool)

Unable to enter programming mode. Verify device selection, interface
settings, target power, security bit, and connections to the target device.

^Details
Timestamp: 2018-11-07 13:41:44.142
Severity: ERROR
ComponentId: 20100
StatusCode: 1
ModuleName: TCF (TCF command: Device:startSession failed.)

Failed to enter programming mode. ispEnterProgMode: Error status received: Got
0xc0, expected 0x00 (Command has failed to execute on the tool)
5. Reboot laptopt. Programmer still connected to laptop.
6. Try to read the programmer with Atmel.
7. Fails again, same error message as before (4.). Decouple programmer cable from target device.
8. Try the manual driver installation mentioned in Section 2.3, Step 4. I double
click the AVRISP mkII -> Driver -> Update Driver -> Browse my computer for driver software
-> Let me pick from a list ... -> AVRISP mkII (top choice of two, bottom choice follows next).
9. Try to read the programmer with Atmel.
10. Fails again, same error message as before (4.). Decouple programmer cable from target device.
11. Now select the second (bottom) choice of 8. After this the driver now shows up under
libusb-win32 devices -> AVRISP mkII in Device Manager. Double clicking AVRISP mkII and going
to the tab Driver I see
Driver Provider: libusb-win32
Driver Date: 2016-01-27
Driver Version: 1.2.6.0
Digital Signer: Hannes Jochriem Elektronische Bausaetze
12. Try to read the programmer with Atmel.
13. Fails again, same error message as before (4.). Decouple programmer cable from target device.
14. Updated driver with the choice in step 8.
15. Continue to build up frustration.
16. Go to Section 5.2 Upgrade firmware button.
17. 5.2.1. After pressing the Upgrade pin on the programmer, the programmer shows up in Device Manager as
libusb-win32 devices -> AT90USB162. Go to Properties -> Driver shows:
Driver Provider: Atmel Corporation
Driver Date: 2013-01-05
Driver Version: 1.2.3.0
Digital Signer: Atmel Norway

DO NOT DECOUPLE THE USB CABLE!!!!
5.2.2. Atmel already installed previously.
5.2.3. Right click on AT90USB162 -> Update driver -> Browse my computer ... -> ...\Flip 3.4.7\usb -> Include subfolders -> Next
Windows already installed best driver in my case. Other laptops could be different (having another driver loaded).
Device still recognized under -> as: libusb-win32 devices -> AT90USB162.
5.2.4. Start Atmel FLIP, click "Select a target device" -> choose AT90USB162.
5.2.5. "Select a communication medium" -> "USB".
5.2.6. From "File" -> "Load hex file" and choose "AVR456-studio-AVRISP-MKII.hex". In the "Operations flow" section click "Run" button.
5.2.7. Disconnect de programmer from the cable and reconnect.
In Device Manager -> Driver tab shows as:
Driver Provider: Atmel Norway AS
Driver Date: 2017-03-31
Driver Version: 42.0.2.0
Digital Signer: Atmel Norway
18. Go to Atmel, connect programmer to target device and try to read target device.
19. Same error as before.
20. Try not to lose it.

LubOlimex

It doesn't seem to be an issue related to the drivers or the connection between the computer and AVR-ISP-MK2 since such problems usually result in different error indicating that AVR-ISP-MK2 is NOT accessible by the Atmel Studio. It is probably something between the AVR-ISP-MK2 and the target.

1. When did this issue appear? What exactly changed in your setup (maybe Atmel Studio upgrade, maybe new laptop, maybe new target, maybe new ribbon cable etc)?

2. Did you try to erase the device before reading it? Maybe it is just locked.

Unfortunately this is a very general error message that doesn't indicate much, and there are a lot of things that might have went wrong. Quite honestly I'd start by checking multiple times the wire connections and the power supply. It is less likely to be a driver issue. So few ideas:

3. Ensure that hardware connection is flawless. People often try to use PDI or TPI for ISP connection. Remember that AVR-ISP-MK2 has ONLY 10-pin ISP. There is no 6-pin ISP. Missing MISO or MOSI or misconnecting them would lead to this error for sure. Ribbon cables can break. USB cables can break.

4. Ensure that the board is powered, but make sure that you are not powering it from multiple sources. Maybe try powering it via the AVR-ISP-MK2.

5. Check if you have enabled debugWire by mistake and disable it (go to Debug -> Disable debugWire and Close)

6. Check the ISP clock frequency - sometimes it is too high. Set it lower value. There is a slider in Atmel Studio 7.

7. Make sure that the target is not locked (security bits enabled). Try to first erase it before programming it.

8. Test with entirely different target if possible.

9. Search for similar reports with the original AVRispmkii - it might be some bug in Atmel Studio 7.

10. Refer again to the quick start section of the user's manual. If drivers and everything else at your side seems like in the pictures in the manual, then the problem is somewhere else and no need to re-install drivers.

Technical support and documentation manager at Olimex

ylun

Hi LubOlimex,

thanks for your reply. I have tried everything before, but nothing seemed to work. A couple days ago we asked our supplier for new cables because I thought the pins on the ISP connector on the target end (thus not the programmer end) might be eroded/worn. We didn't get the proper cable from them (they got mixed up in the communication) and since time was of the essence, we went to them today and tested there. The result was that our ICSP10 cables on the target end were indeed eroded/worn so now we have new cables which work again. This actually explains why our old cables worked sometimes. It is weird though that all our ICSP10 cables (about 3 or 4 of them) stopped working nearly the same time. I haven't got an explanation for that though.

Would you be so kind to close this topic since it has been resolved?

LubOlimex

Thank you for the update. Glad it is resolved. I've had a lot of issues with cables myself.

We don't close the threads here it is fine as it is.

Best regards,
Lub/OLIMEX
Technical support and documentation manager at Olimex