Welcome! Log In Create A New Profile

Advanced

Error burning bootloader atmega1280 & 644P

Posted by fteo88 
Re: Error burning bootloader atmega1280 & 644P
September 20, 2011 03:38PM
marnargulus Wrote:
-------------------------------------------------------
> What command are you using? something like thismoody smiley
> 'C:/avrdude/avrdude' -C 'C:/avrdude/avrdude.conf'
> -c dapa -p atmega644p -P lpt1 -U
> flash:wconfused smileyanguino/bootloaders/atmega644p/ATmegaBOOT
> _644P.hex
>
I am using arduino-022. Is avrdude a diff program?
Re: Error burning bootloader atmega1280 & 644P
September 20, 2011 03:42PM
The arduino IDE is really just a shell program that combines a compiler and a flashy GUI for AVRDUDE. avrdude does the heavy lifting, and if you are having problems with loading you can eliminate a level of troubleshooting by going straight to AVRDUDE's command line. You should have a folder called avrdude in the arduino folder.
Re: Error burning bootloader atmega1280 & 644P
September 20, 2011 03:54PM
This brings back old memories DOS command prompt parsing cmpile link and build.
Will give it a shot & update.
Re: Error burning bootloader atmega1280 & 644P
September 20, 2011 04:15PM
When you plug the Parallel port in you should get a very faint light in the power LED, and when you plug the USB in it should go full brightness. Let me know if that DOESN'T happen, because then it is a board problem.
Re: Error burning bootloader atmega1280 & 644P
September 20, 2011 04:19PM
marnargulus Wrote:
-------------------------------------------------------
> Try setting the fuses first:
>
> avrdude -B 8 -p atmega644P -C (path to avrdude
> config) -c dapa -P lpt1 -U lfuse:w:0xFF:m -U
> hfuse:w:0xDC:m -U efuse:w:0xFD:m

oops didn't plugin usb: get the results below

this is a long one - better than all previous results:
C:\Program Files\Reprap\arduino-0022\hardware\tools\avr\bin>avrdude -B 8 -p atme
ga644P -C c:avrdude.conf -c dapa -P lpt1 -U lfuse:w:0xFF:m -U hfuse:w:0xDC:m -U
efuse:w:0xFD:m

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e960a
avrdude: reading input file "0xFF"
avrdude: writing lfuse (1 bytes):

Writing | ################################################## | 100% 0.00s

avrdude: 1 bytes of lfuse written
avrdude: verifying lfuse memory against 0xFF:
avrdude: load data lfuse data from input file 0xFF:
avrdude: input file 0xFF contains 1 bytes
avrdude: reading on-chip lfuse data:

Reading | ################################################## | 100% 0.00s

avrdude: verifying ...
avrdude: 1 bytes of lfuse verified
avrdude: reading input file "0xDC"
avrdude: writing hfuse (1 bytes):

Writing | | 0% 0.00s ***faile
d;
Writing | ################################################## | 100% 0.06s

avrdude: 1 bytes of hfuse written
avrdude: verifying hfuse memory against 0xDC:
avrdude: load data hfuse data from input file 0xDC:
avrdude: input file 0xDC contains 1 bytes
avrdude: reading on-chip hfuse data:

Reading | ################################################## | 100% 0.00s

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0000
0xdc != 0xff
avrdude: verification error; content mismatch

avrdude: safemode: hfuse changed! Was dc, and is now ff
Would you like this fuse to be changed back? [y/n] y


Edited 1 time(s). Last edit at 09/20/2011 04:21PM by fteo88.
Re: Error burning bootloader atmega1280 & 644P
September 20, 2011 04:26PM
with usb plugged in
1 bytes of efuse verified
safe mode fuses OK
avrdude done OK. Thank you


What next the initial command in a batch file?
avrdude -C C:avrdude.conf -c dapa -p atmega644p -P lpt1 -U flash:w:c:\Program Files\Reprap\arduino-0022\hardware\Sanguino\bootloaders\atmega644p\ATmegaBOOT_644P.hex

Edited 3 time(s). Last edit at 09/20/2011 04:39PM by fteo88.
Re: Error burning bootloader atmega1280 & 644P
September 20, 2011 04:41PM
Try this:
avrdude -p m644P -C c:\avrdude.conf -c dapa -P lpt1 -U flash:wanguino/bootloaders/atmega644p/ATmegaBOOT_644P.hex
which is the bootloader. Tell me what that gives you.

If that doesn't work then try this:
(think you might be missing a \ after C: for the .conf file)
avrdude -p m644P -C c:\avrdude.conf -c dapa -P lpt1 -U lfuse:w:0xFF:m -U hfuse:w:0xDC:m -U efuse:w:0xFD:m
save changes
avrdude -p m644P -C c:\avrdude.conf -c dapa -P lpt1 -U flash:wanguino/bootloaders/atmega644p/ATmegaBOOT_644P.hex

(It looks like it failed on hfuse, but tried again and succeeded, but you cancelled the changes when you hit Y)

The format for writing follows:
-U memtypeyawning smileyp:filename[:format]
The -U makes it so that avrdude doesn't reset all your changes (which is default), memtype is memory type (flash which is for ROM), op is operator (Read/Write/Verify), and filename, which is what we are writing. The :m means that we are writing the literal bits from the command line instead of referencing a file.

-B is actually the clock rate, not the baudrate (which is -b), try without this option.


Real glad you at least got Avrdude to read/write your chip, we are miles from where we started.

avrdude -B 8 -p atmega644P -C c:avrdude.conf -c dapa -P lpt1 -U lfuse:w:0xFF:m -U hfuse:w:0xDC:m -U efuse:w:0xFD:m
Re: Error burning bootloader atmega1280 & 644P
September 20, 2011 04:42PM
We are getting there!
Re: Error burning bootloader atmega1280 & 644P
September 20, 2011 04:59PM
marnargulus Wrote:
-------------------------------------------------------
> Try this:
> avrdude -p m644P -C c:\avrdude.conf -c dapa -P
> lpt1 -U
> flash:wanguino/bootloaders/atmega644p/ATmegaBOOT_6
> 44P.hex
> which is the bootloader. Tell me what that gives
> you.
C:\Program Files\Reprap\arduino-0022\hardware\tools\avr\bin>avrdude -p m644P C:a
vrdude.conf -c dapa -p atmega644p -P lpt1 -U flash:w:ATmegaBOOT_644P.hex

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x000102
avrdude: Expected signature for ATMEGA644P is 1E 96 0A
Double check chip, or use -F to override this check.

avrdude done. Thank you.


it is getting there. swap the hex file for the 644, correct?

Edited 2 time(s). Last edit at 09/20/2011 05:13PM by fteo88.
Re: Error burning bootloader atmega1280 & 644P
September 20, 2011 05:18PM
redo above
C:\Program Files\Reprap\arduino-0022\hardware\tools\avr\bin>avrdude -p m644P C:a
vrdude.conf -c dapa -P lpt1 -U flash:w:ATmegaBOOT_644P.hex

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e960a
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed

To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "ATmegaBOOT_644P.hex"
avrdude: input file ATmegaBOOT_644P.hex auto detected as Intel Hex
avrdude: writing flash (65382 bytes):

Writing | ################################################## | 100% 19.31s

avrdude: 65382 bytes of flash written
avrdude: verifying flash memory against ATmegaBOOT_644P.hex:
avrdude: load data flash data from input file ATmegaBOOT_644P.hex:
avrdude: input file ATmegaBOOT_644P.hex auto detected as Intel Hex
avrdude: input file ATmegaBOOT_644P.hex contains 65382 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 18.06s

avrdude: verifying ...
avrdude: 65382 bytes of flash verified

avrdude: safemode: Fuses OK

avrdude done. Thank you.
Re: Error burning bootloader atmega1280 & 644P
September 20, 2011 07:19PM
We should wiki this parallel port method
Re: Error burning bootloader atmega1280 & 644P
September 20, 2011 10:20PM
Awesome, so it works! Did you have to set the fuses first?
Re: Error burning bootloader atmega1280 & 644P
September 21, 2011 12:56AM
Thanks - really appreciate your help.
Re: Error burning bootloader atmega1280 & 644P
September 21, 2011 11:58AM
Fteo, can you give me a list of steps you took with the laptop?

Did you install arduino/sanguino 22 or 18?
Did you have to set the fuses manually before the BL?
Did you need to change anything other than boards.txt
Did you need the drivers?

I'm trying to build an batch file that does all this stuff on a windows machine, as this seems to be one of the major stumbling blocks when it comes to increases RepRap's user base.
Re: Error burning bootloader atmega1280 & 644P
September 21, 2011 12:57PM
marnargulus Wrote:
-------------------------------------------------------
> Fteo, can you give me a list of steps you took
> with the laptop?
Old Dell Latitude C610 with Win2000 - parallel port (MUST/required).

> Did you install arduino/sanguino 22 or 18?
Arduino 022 and the latest Sanguino installed per instruction on Sprinter - copied from my previous setup on Win7 for Sprinter setup for SL

> Did you have to set the fuses manually before the
> BL?
I am not sure - I ran 2 batch commands that you gave me on this thread.

> Did you need to change anything other than
> boards.txt
This was previously setup for Sprinter with SL. Copied all dir under arduino to the old laptop. Moved all the needed file to the same dir because I forgot how to code a proper path in the batch file.

> Did you need the drivers?
Must run install giveio.bat in the Arduino dir to activate LPT1 (parallel port). So that Arduino can use it to run both batch file.

> I'm trying to build an batch file that does all this stuff on a windows machine, as this seems to
> be one of the major stumbling blocks when it comes to increases RepRap's user base.
The batch file execute is on this thread as well. We should wiki this process while it is fresh on my mind. I can take pictures of my setup so that other can follow. Increasing Windows - not so sure because all new machines are mostly laptop without parallel port.

IMHO to increase Win users, a simple USB method is needed for those that has SL completed correctly w/o bootloaded 644p.
Re: Error burning bootloader atmega1280 & 644P
September 21, 2011 01:20PM
Personally, I think that we should be able to booload from a completed (soldered) SL. Afterall, the SL has a built in FTDI usb connection and fully wired with power and routed MOSI, MISO et. al. The 16Mhz crystal that we took advantage using Parallel port method is installed with the rest of the capacitors and resistors.

Instead with DAPA method - I needed an old laptop (almost forgot the password to unlock) w. Parallel port. Create DAPA. Recopy the entire setup from a working laptop. Use SL connect to USB for power and LPT1 to program. Hunt for a bunch file and trying to recall how to write .BAT file.
Re: Error burning bootloader atmega1280 & 644P
September 21, 2011 01:46PM
If we had pre-bootloaded chips available we could load Sprinter with USB. The bootloader allows interaction between the 644P and computer via FTDI SMD chip. Once the bootloader is loaded you should be able to do everything via USB, except the arduino IDE is screwy with 644P.

I'll look into building a windows batch file to do the install and command line inputs.
Re: Error burning bootloader atmega1280 & 644P
September 21, 2011 01:48PM
You loaded your sprinter sketch with no problem after the bootloader wrote, correct?
Re: Error burning bootloader atmega1280 & 644P
September 21, 2011 01:49PM
And are you having any trouble with the board/machine now?
Re: Error burning bootloader atmega1280 & 644P
September 21, 2011 01:57PM
I think DAPA should be considered "standard" for RepRap, as a dedicated computer with a parallel port can be had for 75 dollars shipped. This means a "dedicated" machine for your reprap

With the SD breakout board costing ~15 dollars shipped this can be a decent investment (you can get a used PS for 15-20 dollars too). We need to start recognizing that RepRap is more than just the plastic and nuts and bolts, which we have TONS of support for. I would say we only have marginal support for RAMPS, and even less for Sanguiniololu. (And I'm not saying full support, but the fact that every instruction set is over 5 major versions behind is sad).
Re: Error burning bootloader atmega1280 & 644P
September 21, 2011 07:11PM
Running SL 1.2 with the newly bootloaded 644P.
Re: Error burning bootloader atmega1280 & 644P
September 21, 2011 07:36PM
marnargulus Wrote:
-------------------------------------------------------
> I think DAPA should be considered "standard" for
> RepRap, as a dedicated computer with a parallel
> port can be had for 75 dollars shipped. This
> means a "dedicated" machine for your reprap
>
Since I have the SL complete and the 644P blank, there should be a way to upload the bootloader to the blank 644P with SL connected to the USB. I have no knowledge of how SL works, I am not EE, just a Civil Engineer with strong CAD and computing background. I figure if I can program via DAPA using SL - there should be a shortcut to just USB bootload it via SL with blank 644P. Then Sprinter it and run Pronterface.

Bootloader allow communication between FTDI and 644P. Isn't there a way to use the FTDI to get to MOSI, MISO et. al. and bootload it?

Then we don't have to spend extras on another computer with parallel port or arduino card or breadboard or extra crystal. Been there, done all that. I salvaged a very old DB25 from my dino box of wires to create DAPA.

Having said that I am going to need help setting up reprap/wiki for DAPA with win2k.

Edited 1 time(s). Last edit at 09/21/2011 07:42PM by fteo88.
Re: Error burning bootloader atmega1280 & 644P
September 22, 2011 09:51AM
The bootloader is what is used to interface between the FTDI chip and the 644P. The bootloading process is really the biggest stumbling block in this process, as people who have done it often just say "Oh, just pull out your AVR Programmer and use that", which is unrealistic for getting RepRap into the community as a whole. People don't buy normal printers without the ROM installed, I don't see why we are assuming the RepRap community would be any different. I'm thinking I might just build a daisy chain ROM programmer and start selling the chips at cost (just pay shipping). I've found some places that sell a preloaded chip, but they cost $10+shipping or more; I ordered my full set from mouser for 25 dollars (with shipping).

So here is what I see for RepRap Sanguinololu:
1. Consistent board/chipset
2. Preloaded chips available
3. effecient batch file to install all drivers and software

At the point we can start shipping sets that you can literally just solder together and you can start printing.
Re: Error burning bootloader atmega1280 & 644P
September 22, 2011 12:52PM
The FTDI can provide 5V power to SL even if the 644P is blank. We can communicate with SL 644P (blank) via the MOSI et. al. pins with DAPA. However, direct communication between FTDI & 644P isn't possible without bootloader. Once bootloaded that FTDI-644p route is open.
So DAPA method uses the back door communication to 644P on SL to bootload.

I don't know much about FTDI except it is a USB-rs232(serial) chip.
Re: Error burning bootloader atmega1280 & 644P
September 22, 2011 02:35PM
I'm building a step by step for bit banging on my user wiki right now, I'm not sure if you can edit that? If you can, feel free to update as you see fit. Eventually when I get photos and everything cleaned up I'll put it on an independent wiki page and link it from the Sanguinololu page.

[reprap.org]
Re: Error burning bootloader atmega1280 & 644P
September 22, 2011 02:51PM
Nice start. I can add to it once it is public.

I didnt use any resistors at all per your suggestion - direct wire.
Re: Error burning bootloader atmega1280 & 644P
September 22, 2011 03:20PM
Yeah, resistors are only for protecting the parallel port from excessive power spikes (which with the USB should never be an issue). They are not actually necessary for the data transmission at all.
Re: Error burning bootloader atmega1280 & 644P
September 22, 2011 04:12PM
Re: Error burning bootloader atmega1280 & 644P
September 22, 2011 04:22PM
Hello everyone,

I have only skimmed the first page and it sounds like the same issue I had on a my first Sanguinololu. The issue was/is with the install of the OS. I have reinstalled every file relating to the USB and arduino on my laptop and never ever have I been able to communicate with a 644 chip (three boards and chips tested) But when I did a fresh Install of my OS on a different computer it worked the first time and every time since on that computer. But no matter what I re-install on the first computer it never works.


P.S. It does not work from the first computer even when trying with a USBasp. I have also tried copying everything from the working computer to the first one and it still does not work.

Edited 1 time(s). Last edit at 09/22/2011 04:26PM by Sublime.


FFF Settings Calculator Gcode post processors Geometric Object Deposition Tool Blog
Tantillus.org Mini Printable Lathe How NOT to install a Pololu driver
Re: Error burning bootloader atmega1280 & 644P
September 22, 2011 04:39PM
Can you explain what you mean a little more? I'm trying to keep all these Sanguinololu problems/solutions sets documented.
Sorry, only registered users may post in this forum.

Click here to login