Go Down

Topic: IDE & AVRISP MKII (Read 1 time) previous topic - next topic

MitchSF

I know there is a lot of discussion on this, and I've searched. I am able to program bootloaders with no issues using Windows 7, IDE 1.0.5 (AVRDude 5.11), and Olimex AVRISP MKII.

I want to start using MightyCore, which requires 1.6.5+. I've tried several later releases with the version of AVRDude included with that release, and also with 5.11, without success. AVRDude 5.11 gives a syntax error, and later versions give "avrdude : stk500v2_recv_mk2 : error in USB receive", errors.

If you know of some combination of the IDE equal to or greater than 1.6.5, and an AVRDude version that will work with it, please let me know. Thanks in advance.


chucktodd

I know there is a lot of discussion on this, and I've searched. I am able to program bootloaders with no issues using Windows 7, IDE 1.0.5 (AVRDude 5.11), and Olimex AVRISP MKII.

I want to start using MightyCore, which requires 1.6.5+. I've tried several later releases with the version of AVRDude included with that release, and also with 5.11, without success. AVRDude 5.11 gives a syntax error, and later versions give "avrdude : stk500v2_recv_mk2 : error in USB receive", errors.

If you know of some combination of the IDE equal to or greater than 1.6.5, and an AVRDude version that will work with it, please let me know. Thanks in advance.


With version 1.6.5

I had to modify the platform.txt and add the Windows resource kit for (sleep.exe).  
My windows 7 executed the script too fast, the AVRisp MKII timed out.

Here is what I changed.
in C:\Program Files\Arduino\hardware\arduino\avr\platform.txt
I modified the tools.avrdude.cmd.path
********************
# AVR Uploader/Programmers tools
# ------------------------------

tools.avrdude.path={runtime.tools.avrdude.path}
#modifed chuck 2015 to add delay, under win7, too fast, AVRISP can't Respond, causes timeout
tools.avrdude.cmd.path={path}/bin/x.cmd
tools.avrdude.config.path={path}/etc/avrdude.conf
********************

and Created this cmd file
C:\Program Files\Arduino\hardware\tools\avr\bin\x.cmd

********************
"c:\Program Files\Windows Resource Kits\Tools\sleep.exe" 1
set a=%0
%a:~0,-6%avrdude.exe" %*
********************

The %a crap is to generate the correct path for avrdude.exe

Chuck.

p.s. the asterisks '************' mark the start and end of the file contents, don't include them in your files. :) 
Currently built mega http server, Now converting it to ESP32.

ron_sutherland

The Olimex AVRISP MKII is trying to look like an MKII using LUFA. Looks like a patch is waiting to be accepted into avrdude.

https://savannah.nongnu.org/bugs/index.php?40831

The bug report tells what is wrong, so it must have been introduced between avrdude 5.11 and 6.0. At any rate, it does not look like a fix will happen soon.

@Chuck is that an Atmel MKII or an Olimex MKII, looking at the bug it sounds like the Atmel one may work (although I could imagine it having timing issues).

I have a Dragon ISP, but don't use it because the USB connector is so flimsy. I have been using the Arduino ISP sketch which is an example in the new IDE (1.6.7+).
my projects: https://github.com/epccs

chucktodd

The Olimex AVRISP MKII is trying to look like an MKII using LUFA. Looks like a patch is waiting to be accepted into avrdude.

https://savannah.nongnu.org/bugs/index.php?40831

The bug report tells what is wrong, so it must have been introduced between avrdude 5.11 and 6.0. At any rate, it does not look like a fix will happen soon.

@Chuck is that an Atmel MKII or an Olimex MKII, looking at the bug it sounds like the Atmel one may work (although I could imagine it having timing issues).

I have a Dragon ISP, but don't use it because the USB connector is so flimsy. I have been using the Arduino ISP sketch which is an example in the new IDE (1.6.7+).
Authentic Atmel AVRISP mkII, PN:A09-0002/06 SN:02001301751 Date 2012.07.24

Chuck.
Currently built mega http server, Now converting it to ESP32.

MitchSF

Thank you. I'll try the modification with the latest IDE. If that doesn't work, I"ll use an Uno as an ISP, as I have several sitting around.


MitchSF

#5
May 31, 2016, 01:51 pm Last Edit: May 31, 2016, 01:57 pm by MitchSF
I ended up breadboarding a shield for the 1284P, with room for a ZIF socket. It worked out so well that I ordered a few boards. For anyone interested, here are the design and Gerber files.

https://drive.google.com/folderview?id=0B3kvk05blsPJb2RnamE0dXhUYk0&usp=sharing

What I would really like to have now, is a version of the Arduino as ISP sketch that sets the fuses, then uploads any HEX file. I took a look at the code, and it's not something I can do.

ron_sutherland

That can be set up in the Arduino IDE but it is a two step process of doing the fuse and unlocking the bootloader area, then loading the bootloader and locking the bootloader area. I was trying to do that sort of thing, but each IDE update felt like a spin loop to keep things working with the Arduino build system. To get out of the spin loop I invested some time to learn how makefiles do their magic, it was well spent.

http://hackaday.com/2016/03/15/embed-with-elliot-microcontroller-makefiles/

I have tested my very simple mega328 Makefile that loads the optiboot bootloader. I just type 'make fuse' and 'make isp', which could be moreover automated with a shell script if at some point I need to do a few hundred boards.

https://github.com/epccs/RPUno/tree/master/Bootloader

I have not tested my mega1284 Makefile, so it may have errors lurking in it.

https://github.com/epccs/irrigate7/tree/master/Bootloader

Again all that can be added to the Arduino IDE but I for one found it painful, and a Makefile to be so much less painful.
my projects: https://github.com/epccs

MitchSF

#7
Jun 01, 2016, 02:01 am Last Edit: Jun 01, 2016, 02:33 am by MitchSF
Thanks. I'll work through the Hackaday info.

Go Up