Programmer Troubleshooting

1 DCU Programmer Troubleshooting

The latest troubleshooting guide can be found at https://www.rollingstocksoftware.com/stk500/. However, a snapshot of the instructions has been included in this document for reference.

1.1 NOTE: Windows 10 Compatibility

The AVRISPmkII is not supported in Windows 10. Upon initial install it will work correctly, but after some time it may stop working (cannot connect to device). You can attempt to uninstall all drivers and re-install them to fix it, but it is not guaranteed to work.

1.1.1 Before you start

It is recommended that sound is enabled on your computer, so that you can hear the USB plug-in and plug-out sound. Below are a list of common errors. Find the section(s) most applicable and follow the instructions to fix the error.

1.2 Could not enter programming mode / WARNING! One or more operations failed!

This error occurs when the drivers and support libraries are installed correctly, but the programmer has problems connecting to the DCU.

>stk500 -cUSB -dATmega16 -ms -ifmotor_plug/release/exe/motor_plug.a90 
-e -pf -vf -fffd0 -I1mHz
STK500 command line programmer, v 2.2 Atmel Corp (C) 2004-2005.

Connected to STK500 V2 on port USB:089787233455
Setting ISP frequency to 1.000 MHz (0x03)
Device parameters loaded
Could not enter programming mode
Programming mode left
Connection to STK500 V2 closed

WARNING! One or more operations failed! Please examine the output log above!


>pause
Press any key to continue . . .

1.2.1 Reasons for this error:

  1. The programmer box is not connected to the DCU, or the connection between the programmer box and the DCU is faulty (loose connector, broken cable etc.)
  2. The DCU is off. The DCU must be powered on to be programmed.
  3. The programmer is not on the correct setting
  4. The programmer box itself is faulty. If possible, test with another programming box to verify this.
  5. The microcontroller requires a recovery programming before it can be programmed normally. See below. Only consider this reason if you can program some DCUs but not others.

In certain cases (if DCUs have be programmed with the wrong programming setting), it is possible that the microcontrollers cannot be re-programmed. To fix this, we provide a recovery tool which resets the microcontrollers to their factory settings, after which the DCUs can be reprogrammed. Since the tool and usage vary between projects, please contact us if you think you have this problem.

1.3 Could not create Stk500Common layer…

This error occurs when the STK500 support files are not installed. When attempting to program the DCU (whether or not a DCU is connected), you get these errors:

>stk500 -cUSB -dATmega16 -ms -ifmotor_plug/release/exe/motor_plug.a90 
-e -pf -vf -fffd0 -I1mHz
STK500 command line programmer, v 2.2 Atmel Corp (C) 2004-2005.

Error: Could not create Stk500Common layer
Error: Could not create hex file reader
Error: Could not create source buffer
Error: Could not create destination buffer
Fatal: Make sure 'AvrCommon.dll' and 'Stk500Common.dll' are properly installed

>pause
Press any key to continue . . .

If you get this error (repeated could not create…), your STK500 support files are not correctly installed. You can download and install the drivers from here: http://rollingstocksoftware.com/downloads/AVRCommandLineTools.exe . Please do NOT install the (old) Jungo USB drivers when asked – see Section 1.4.3 for instructions on installing the correct Jungo USB drivers.

1.4 Could not connect to STK500 V2 on USB

When programming, the program is unable to connect to the programming box:

>stk500 -cUSB -dATmega1284p -ms -ifcomm/release/exe/safety.a90 
-e -pf -vf -Eff -f59e0 -I2mHz
STK500 command line programmer, v 2.2 Atmel Corp (C) 2004-2005.

Could not connect to STK500 V2 on USB

>pause
Press any key to continue . . .

Possible reasons for this error:

1.4.1 The Programmer is not connected to the computer

Please check the programmer is connected to the computer when running the programming batch files. This includes checking the USB cable is fully pushed in on both the Computer and Programmer box side, and that the USB cable is not damaged.

1.4.2 The programmer/USB cable/USB port is faulty

To check if the programmer or other physical parts are faulty, please do the following:

  1. Remove the programmer
  2. Open device manager
  3. Plug the programmer into the computer.

If the programmer is working correctly, you should see the device manager list refresh (collapse and then fill with the devices). In addition, windows should not display any A USB device has malfunctioned warnings. If you have sound and windows sounds enabled, the computer should also make a plug in and plug out sound when you plug in and plug out the programmer into the computer.

1.4.3 The AVRISPMkII driver is not installed

You can verify this error by checking device manager:

If the device appears with a yellow triangle exclamation mark symbol, the Jungo driver is not installed. You can download and install the Jungo driver from here: http://rollingstocksoftware.com/downloads/driver-atmel-bundle-7.0.888.exe Correctly installed drivers appear as follows:

1.4.4 The wrong AVRISPMkII driver is installed

If a driver appears to be installed (as per the previous step), but you still get this error, it is possible you have an old or incorrect driver for the AVRISPMkII. The first method to fix this is to simply re-install the driver as shown in the section “The AVRISPMkII driver is not installed“. If this does not work, you should remove all existing drivers, then follow the instructions in “The AVRISPMkII driver is not installed” to re-install the correct driver. The drivers can be uninstalled as follows:

  1. Remove the programmer
  2. Open device manager
  3. Plug the programmer into the computer.
  4. A new device will appear (likely under the Jungo section or the LibUSB section)
  5. Right click the device, then select Uninstall
  6. In the dialog box that pops up, tick the checkbox labeled “Delete the driver software for this device.”
  7. Click Uninstall
  8. Repeat from step 1. until the device shows up with a yellow triangle exclamation mark symbol (as shown in the section “The AVRISPMkII driver is not installed” above)

After this is complete, you can re-install the AVRISPMkII drivers.