Go Down

Topic: ATmega1284P: End to End using 1.0 IDE (Read 76 times) previous topic - next topic

ringz

#210
Mar 01, 2012, 05:31 pm Last Edit: Mar 04, 2012, 07:33 pm by ringz Reason: 1


[Now Solved]

I have built a mighty-1284 on stripboard. I have installed optiboot loader (from maniacbug's .zip file)  onto my 1284 and it flashes away nicely when I press the reset switch.

However I can't upload a sketch because avrdude doesn't want to communicate with my board. I get this error:

System wide configuration file is "C:\Downloads\Arduino Development Kit\arduino-1.0\hardware/tools/avr/etc/avrdude.conf"
error at C:\Downloads\Arduino Development Kit\arduino-1.0\hardware/tools/avr/etc/avrdude.conf:332 unrecognized character: "w"

I'm assuming, and I don't know if I'm correct, that avrdude doesn't know about optiboot on 1284's and avrdude.conf needs to be amended.

Have I got this correct? If so any help updating my .conf file will be gratefully received :)

Martyn.

maniacbug

Please post the full verbose output text of your upload.

Also, please post the 1284p section of the avrdude.conf file, AND post lines 325-340 of avrdude.conf (in case line 332 is not in the 1284p section).

uno23

#212
Mar 02, 2012, 10:01 pm Last Edit: Mar 02, 2012, 10:10 pm by uno23 Reason: 1
Hi  I have built a mighty-1284 on breadboard. I have installed  in my linux box the folder mighty-1284  from maniacbug's .zip file.
I open arduino 1.0 ide and selected optiboot_atmega1284 after some seconds my avr programmer ( pololu avr usb programmer that i have added to programmer.txt) blinks and copy bootloader to 1284p ..I hope :) arduino ide return with no errors. Well ...next step....so I try to upload a blink sketch....but I have this error: avrdude: stk500_recv(): programmer is not responding :(
how i can investigate? Is a problem to reset pin? I have folllow maniacbug instruction :D.




also i have tried with this command line

avrdude -c avrispv2 -p m1284p -e -P /dev/ttySA0 -U -e Ulock:w:0x3F:m -Uefuse:w:0xfd:m -Uhfuse:w:0xde:m -Ulfuse:w:0xff:m  flash:w:/home/marco/Desktop/arduino-1.0/hardware/mighty-1284p/bootloaders/optiboot/optiboot_atmega1284p.hex -v -v

but i have this result

avrdude: Version 5.10, compiled on Jun 29 2010 at 03:44:14
        Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
        Copyright (c) 2007-2009 Joerg Wunsch

        System wide configuration file is "/etc/avrdude.conf"
        User configuration file is "/home/marco/.avrduderc"

        Using Port                    : /dev/ttySA0
        Using Programmer              : avrispv2
        AVR Part                      : ATMEGA1284P
        Chip Erase delay              : 9000 us
        PAGEL                         : PD7
        BS2                           : PA0
        RESET disposition             : dedicated
        RETRY pulse                   : SCK
        serial program mode           : yes
        parallel program mode         : yes
        Timeout                       : 200
        StabDelay                     : 100
        CmdexeDelay                   : 25
        SyncLoops                     : 32
        ByteDelay                     : 0
        PollIndex                     : 3
        PollValue                     : 0x53
        Memory Detail                 :

                                 Block Poll               Page                       Polled
          Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
          ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
          eeprom        65    10   128    0 no       4096    8      0  9000  9000 0xff 0xff
          flash         65    10   256    0 yes    131072  256    512  4500  4500 0xff 0xff
          lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
          lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
          hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
          efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
          signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
          calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00

        Programmer Type : STK500V2
        Description     : Atmel AVR ISP V2
        Programmer Model: STK500
        Hardware Version: 15
        Firmware Version Master : 2.10
        Topcard         : Unknown
        Vtarget         : 0.0 V
        SCK period      : 0.1 us
        Varef           : 0.0 V
        Oscillator      : 3.686 MHz

avrdude: AVR device initialized and ready to accept instructions

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

avrdude: Device signature = 0x1e9706
avrdude: erasing chip
"Ulock" memory type not defined for part "ATMEGA1284P"

avrdude: safemode: Fuses OK

avrdude done.  Thank you.

i have a 1284-pu and not 1284p-pu but i have change signature in my .avrduderc file

thanks

Marco

Madhu

Hello all,

I uploaded the bootloader according to the instructions; all went fine. However when I try to upload the blink sketch, I get the below error message :

Code: [Select]
Binary sketch size: 1188 bytes (of a 130048 byte maximum)
C:\Madhu\arduino-1.0\hardware/tools/avr/bin/avrdude -CC:\Madhu\arduino-1.0\hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega1284p -carduino -P\\.\COM4 -b115200 -D -Uflash:w:C:\Users\MADHU_~1\AppData\Local\Temp\build7288213302364854003.tmp\Blink.cpp.hex:i

avrdude: Version 5.11, compiled on Sep  2 2011 at 19:38:36
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "C:\Madhu\arduino-1.0\hardware/tools/avr/etc/avrdude.conf"

         Using Port                    : \\.\COM4
         Using Programmer              : arduino
         Overriding Baud Rate          : 115200
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: Recv:
avrdude: stk500_getsync(): not in sync: resp=0x00

avrdude done.  Thank you.



I can upload fine if I use Arduino as as the ISP.

What gives?

I know that the
Code: [Select]
not in sync: resp=0x00 is the most un-helpful error meaage; but I tried the normal troubleshooting :

Swapping the RX and TX line,
Adding a capacitor between DTR and reset

I am at a loss now, Please assist.

thanks,
Madhu.

maniacbug

Actually, it is pretty helpful because we can see this:

Code: [Select]

avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: Recv:


This tells us that the avrdude and the bootloader are having NO communication whatsoever.

Unfortunately, you're not the only one having problems, and no one has identified what the fix is for people who are having problems.

For @uno23, the problem seems more straightforward

Code: [Select]

avrdude: Version 5.10, compiled on Jun 29 2010 at 03:44:14
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch


This is an old version of avrdude.  I've never seen this work with 5.10, only with 5.11.

ringz

I have sorted my problem. It turned out that I hadn't burned the bootloader properly.

I have an AVRISP MkII but I obviously did something wrong when I used AVR Studio 5.1 to manually burn the bootloaders.

Unfortunately the Arduino IDE can't use the AVRISP MkII using the standard USB drivers so I had find some other way of burning the bootloader.

I decided to try to using ArduinoISP and cobble together a patch cable for my ZIF programming board.

Anyway after re-burning the bootloader with the IDE I can now use my TTL-232R-3V3 to upload sketches.

Such are the mishaps of being new to this :)

Martyn.

retrolefty

Quote
Unfortunately the Arduino IDE can't use the AVRISP MkII using the standard USB drivers so I had find some other way of burning the bootloader.


I don't understand that. Isn't the AVRISP Mkll driver already installed when you set it up to function with AVR studio? Once the driver is installed it's the PC that senses when you plug in the programmer and uses the preinstalled driver. The IDE does have a AVRISP Mkll choice in the bootloader programmer selection menu, so as long as the programmer is already plugged into the PC, then choosing that programmer should work. That's how it works for my USBtiny programmer, the driver didn't come with the IDE disturbution nor did it install it, that was done prior when the PC first saw the USBtiny was plugged into the PC and asked for a driver source.

Anyway your statement has me confused, could you explain further?

Lefty

ringz


retrolefty


Hi Lefty,

I'm just going on what I read in this thread:

http://arduino.cc/forum/index.php/topic,92114.0.html

Martyn.


Ok, understood. It would seem that you need is to first unistall the driver that avr studio installed for the AVRISP and have someone here identify where you can find the proper driver for it to work under AVRDUDE/arduino IDE.

Anyone have such a lead to the 'correct' driver?

Lefty

ringz

It was easier to use my bog standard Arduino, make the lead, and use those to do the work of ISP programmer than go to all the trouble of uninstalling drivers.

Martyn.

bperrybap

#220
Mar 04, 2012, 11:02 pm Last Edit: Mar 05, 2012, 01:59 am by bperrybap Reason: 1
It could be this issue:
https://savannah.nongnu.org/bugs/?34339
http://code.google.com/p/arduino/issues/detail?id=650&q=avr%20dragon

It is a combination of things that trigger what I believe is a deficiency (technically a bug) in avrdude.
Basically the problem is that the avrdude low level USB code that talks to libusb (it is not libusb)
resets the USB when it closes the USB device but does not wait for devices to show up when opening the
USB and scanning for USB devices.
So anything that does back to back avrdude commands can potentially
see the second avrdude command fail on some USB devices because the USB enumeration
caused by the first avrdude command is not yet complete when the 2nd avrdude command attempts
to locate the USB device.
The 2nd avrdude command will simply not see the device.

Whether it fails to locate the USB device on the 2nd avrdude command or not depends
on a number factors but this unable to locate the device on the 2nd avrdude command
failure will not happen on USBtiny as it uses different code inside avrdude which does not reset the USB when
the device is closed.
But on an avr dragon and some of the other Atmel USB based ISP products,
it will happen pretty much every time on Windows, and Linux.


There are some simple work arounds that could be done in the IDE java code
or in the bootloader makefiles if you are using makefiles to install bootloaders rather than IDE.
The IDE even already has a 1 second sleep in the java code but 1 second is simply not long
enough for the Atmel USB ISP devices.
A better solution than a blind delay is to do everything in a single avrdude command vs
more than 1 avrdude command.
Currently both the IDE and bootloader makefiles are using 2 avrdude commands
instead of a single avrdude command to burn a bootloader.

There is also a small patch that could be done to avrdude to solve it.
I've entered a bug report on avrdude and in the Arduino buglist
but so far I've not been able to get anybody to make any changes to work around this
as there are concerns about the fix and its impact.

So for now, I run my own privately patched avrdude
Before that, I patched the bootloader makefiles to use a single avrdude
command rather than 2 avrdude commands, which works around the avrdude issue.

--- bill

retrolefty

Very infomative Bill, thanks.

Quote
Whether it fails or not depends on a number factors but this failure will not happen
on USBtiny as it uses different code inside avrdude which does not reset the USB when
the device is closed.


And while I've been very satisfied with my USBtiny, I've been told it won't work for an upcoming task I have to burn a bootloader into a mega1284 chip, as the USBtiny can't handle FLASH byte addresses higher then 64k, so I need to look for a solution. I don't know if the standard arduinoISP sketch will perform that task, but if so I'll probably use that. But I was considering purchasing a AVRISP Mkll as I've been told it's a very good programmer, but that may only apply if one is using it with AVR studio?

Lefty

CrossRoads

I just borrowed one from skyjumper to burn optiloader into some 1284's.
For reasons I do not understand, when I burned the bootloader with the MDFLY programmer via the IDE, it was leaving one of the lockbits in a state that prevented the IDE from downloading sketches via FTDI Basic after that. Was also sloooow.
Using AVR Studio 5.1, I can download optliloader much quicker, and clear the lockbits if needed. I am doing 50 cards pretty soon (waiting for assembly to complete in CA) so I needed a reliable way to make sure I could load those.
I purchased my own to have now.
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

bperrybap

I guess I should have been a little bit clearer about the failure type.
When I said:
Quote
Whether it fails or not ...

I really meant,
Whether it fails to locate the USB device or not...

(updated the original post above for clarity).


--- bill


CrossRoads

1284 thruhole, Duemilanove style boards are in!
Prices shipped to US locations:
1-lot $4.50
2-lot $6.75
3-lot $9.25
5-lot $17.00
10-lot $28.25

I've got 50 of them.  28 are spoken for.

So,
JoeO, wade, kfzqd, 000, skyjumper, maniacbug, lefty, westfw, sync - please paypal your payments to
cardinalflyer @ comcast . net
and we'll get them mailed in letter size envelopes for qtys 1, 2, 3, and small boxes in qty 4 & above due to size & stacked thickness.

I'll see if I can get one asssembled & a picture posted.

Thanks!
Robert

(Rats - I don't have regulators. Knew I forgot to order something when I last ordered stuff from anyone.)
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Go Up