Pages: 1 [2]   Go Down
Author Topic: ICSP programmer not working  (Read 3505 times)
0 Members and 1 Guest are viewing this topic.
Brazil
Offline Offline
Sr. Member
****
Karma: 0
Posts: 443
..., to learn, to know, to make, to share, to l...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm testing here, and found another problem. (still using Serial Single Sided with Atmega8, parallel port cable)

Using DOS Prompt under WinXP, burnpara.bat from 0007 version works fine: the pin13 led turns off before burning bootloader, and reset button blinks this led.
burnpara from 0010 version doesn't work: the pin13 led remains dim bright before bootloader, and reset button doesn't work.

I saw differences between these files. On 0010 there isn't a command before uisp: -v=4. the line cd.. doesn't work, since the burnpara file is located two levels over root. And the last line cd bootloader doesn't work too, because the directory name is bootloaderS. I made the changes on 0010, and didn't work.
I copyied 0010 on 0007 directory and vice-versa and they run but don't work. The same with uisp file. Can anyone explain this? Can this be related with 0010 bootloader not working with SSS, Mellis?
Logged

PCB Designer

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 12
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Adlison: the burnpara.bat file is a bit outdated, so I'm not surprised it doesn't work.  Have you installed giveio (linked to from the bottom of the parallel programmer page)?  You might need to get permission to access the parallel port (although I would think that uisp would need it too).  Also, in the programmers.txt file in ARDUINO/hardware has a parallel.delay key.  Try increasing the value from 800 (maybe to 1600 or more).  
Logged

Brazil
Offline Offline
Sr. Member
****
Karma: 0
Posts: 443
..., to learn, to know, to make, to share, to l...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Giveio is installed, and XP_stop_polling.reg too. Under 0007 directory, burnpara always works. Under 0010, it doesn't.

I changed parallel.delay to 1600, 16000 and 100000. Not working yet.

Independant of parallel.delay changes, something changed while trying. I didn't change anything, but now 0010 bootloader doesn't erase previous bootload done under 0007. It is sending the same error message while bootloading, but just keeps previous bootload and sketches loaded (blink test).
Logged

PCB Designer

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 12
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

If you set upload.verbose to true in the preferences file (apologies for giving such opaque instructions before), does it display that commands that are used to burn the bootloader (in Arduino 0007 and 0010)?  If so, give it a try from the command line.  That way, if it doesn't work, you can ask the avrdude folks why uisp can burn a bootloader with your setup and avrdude can't.  They might have more of an idea of what's different between the way the two programs work.  The mailing list is here - or post here and I can post to the avrdude list.
Logged

Brazil
Offline Offline
Sr. Member
****
Karma: 0
Posts: 443
..., to learn, to know, to make, to share, to l...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Mellis,

the first command used by arduino 0010 is:
avrdude -avrdude.conf -v -v -v -v -pm8 -cdapa -i800 -e -Ulock:w:0x3F:m -Uhfuse:w:0xca:m -Ulfuse:w:0xdf:m

it doesn't work. I think because it finds the wrong value for device signature of atmega8 (expects 1e9307, but always changing each time you try bootloading - 0x000100, 0x000102,...)

I added -F instruction in this command line and it worked fine.

I saw before in the forum that there is a second command line, like this:
avrdude -avrdude.conf  Or the results are the same?-v -v -v -v -pm8 -cdapa -i800 -e -Uflash:w:d:\arduino-0010\hardware\bootloaders\atmega8\ATmegaBOOT.hex:i -Ulock:w:0x3F:m
I couldn't see it on arduino 0010 messages, because the first command line didn't work, so the second command line is not shown.

Like the first, it nedded the -F instruction to works. But it tooks 10 minutes!

I saw something similar here:
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1192727600
and I think is a better place to post, since it seems to be a software problem.

The time needed to burn bootloader is almost 10 minutes, but with arduino 0007 is almost 30 seconds here.

My first question is: are there some difference between these bootloaders (0010 and 0007) for the use of Arduino Board? Or the results are the same on chip functions and memory space usage?

My second question:
Can this time (10 minutes) be reduced on arduino 0010?

My third question:
Is there some file to change these command lines to add -F instruction and use it under Arduino 0010?

And the Fourth:
the page:
http://www.arduino.cc/en/Hacking/Bootloader?from=Main.Bootloader
says:

Quote
* bootloader.atmega8.unlock_bits (default value: 0xFF) is the value to write to the ATmega8 lock byte to unlock the bootloader section.

but the first command line on arduino 0010 says:
Quote
-Ulock:w:0x3F:m

Does this different values for Unlock bits cause some problem? Are they intentional or it is an error?

Sorry if I'm asking too much.
« Last Edit: December 30, 2007, 10:53:19 pm by adilson » Logged

PCB Designer

Brazil
Offline Offline
Sr. Member
****
Karma: 0
Posts: 443
..., to learn, to know, to make, to share, to l...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Mellis,

I don't know if is this related (since both works with avrdude), but I tested to Upload sketch without bootloader with Arduino 0010 on Arduino SSS Board and it didn't work. But works fine and fast(!) at dos prompt, with changes on command line (removing [glow]""[/glow] caracters of command line).
http://www.arduino.cc/en/Hacking/Programmer

The command line at IDE is:
Code:
avrdude[glow]" "[/glow]avrdude.conf[glow]"[/glow] -v -v -v -v -pm8 -cstk500v1 -P\\.\COM1 -b19200 -D -Uflash:w:d:\Arduino\sketchbook\examples\led_blink\applet\led_blink.hex:i error=193

        at java.lang.Win32Process.create(Native Method)

      at java.lang.Win32Process.<init>(Unknown Source)

      at java.lang.Runtime.execInternal(Native Method)

      at java.lang.Runtime.exec(Unknown Source)

      at java.lang.Runtime.exec(Unknown Source)

      at java.lang.Runtime.exec(Unknown Source)

      at processing.app.Uploader.executeUploadCommand(Uploader.java:123)

      at processing.app.AvrdudeUploader.avrdude(AvrdudeUploader.java:139)

      at processing.app.AvrdudeUploader.uploadUsingPreferences(AvrdudeUploader.java:57)

      at processing.app.Sketch.upload(Sketch.java:1632)

      at processing.app.Sketch.exportApplet(Sketch.java:1701)

      at processing.app.Editor$41.run(Editor.java:2004)

      at java.awt.event.InvocationEvent.dispatch(Unknown Source)

      at java.awt.EventQueue.dispatchEvent(Unknown Source)

      at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)

      at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)

      at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

      at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

      at java.awt.EventDispatchThread.run(Unknown Source)
Logged

PCB Designer

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 12
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The bootloader should be the same whether you burn it with Arduino 0007 or Arduino 0010.  

It's strange that it takes 10 minutes to burn the bootloader with avrdude.  Did it work?  What happens if you remove -i800 from the command line?  Or lower the value from 800 to something smaller?

Right now, you can't specify explicit command line parameters to the Arduino IDE. I'll have to investigate why the device signature is wrong with the parallel programmer and maybe add the -F in that case.  

As for the 0xff vs. 0x3f: the high two lock bits aren't used anyway, so those two values are effectively equivalent.  avrdude gets confused if you give it 0xff, since when it reads the bits back, it treats the unused ones as 0 and complains that they weren't set properly (since it tried to write 0xff and read back 0x3f).

When you say that uploading without a bootloader works fine from the command prompt, what do you mean?  Are you uploading a normal sketch to a board that has a chip with a bootloader on it?  Or are you uploading a sketch to a chip using the parallel programmer?  The latter isn't supported in Arduino 0010, but it will be in Arduino 0011.
Logged

Brazil
Offline Offline
Sr. Member
****
Karma: 0
Posts: 443
..., to learn, to know, to make, to share, to l...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Mellis,

thanks for answering.

Yes, it works, but only in DOS Prompt. Like I said, not only me, but here http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1192727600 too. I removed the -i800 and it tooks only 40-50 seconds.
I found another problem here, still using DOS, AVRdude under 0010 directory and bootloading.
When the command uses -Ulock:w:0x3F:m (avrdude -Cavrdude.conf -v -v -v -v -pm8 -cdapa -Ulock:w:0x3F:m -Uhfuse:w:0xca:m -Ulfuse:w:0xdf:m -F -b115200), sometimes it returns an error that breaks execution, asking:
Code:
avrdude: safemode: hfuse changed! Was ca, and is now ff
Would you like this fuse to be changed back? [y/n]
If answer is NO, the command return:
"avrdude: safemode: Fuses OK

avrdude done.  Thank you."

aborting the bootload.
If you try the second command line right after
Code:
avrdude -Cavrdude.conf -v -v -v -v -pm8 -cdapa -e -Uflash:w:ATmegaBOOT.hex:i -Ulock:w:0x3F:m -b115200 -F
it runs, but nothing happens (pin13 led keeps bright).

If you answer YES, it keeps bitbanging for a long long time (more than 30 minutes. I did'nt wait until the end.

But using -Ulock:w:0xCF:m there are some errors reported, but it is possible to burn bootloader, in 40 seconds.

And about the sketches upload question, sorry. I uploaded in a chip with the bootload on it. But note that on IDE I couldn't upload it. The error message is:
Code:
Couldn't determine program size:    text         data          bss          dec          hex      filename

C:\avrdude -Cavrdude.conf -v -v -v -v -pm8 -cstk500v1 -P\\.\COM1 -b19200 -D -Uflash:w:C:\Blink.hex:i

java.io.IOException: CreateProcess: C:\avrdude -Cavrdude.conf -v -v -v -v -pm8 -cstk500v1 -P\\.\COM1 -b19200 -D -Uflash:w:C:\Blink.hex:i error=193

      at java.lang.Win32Process.create(Native Method)

      at java.lang.Win32Process.<init>(Unknown Source)

      at java.lang.Runtime.execInternal(Native Method)

      at java.lang.Runtime.exec(Unknown Source)

      at java.lang.Runtime.exec(Unknown Source)

      at java.lang.Runtime.exec(Unknown Source)

      at processing.app.Uploader.executeUploadCommand(Uploader.java:123)

      at processing.app.AvrdudeUploader.avrdude(AvrdudeUploader.java:139)

      at processing.app.AvrdudeUploader.uploadUsingPreferences(AvrdudeUploader.java:57)

      at processing.app.Sketch.upload(Sketch.java:1632)

      at processing.app.Sketch.exportApplet(Sketch.java:1701)

      at processing.app.Editor$41.run(Editor.java:2004)

      at java.awt.event.InvocationEvent.dispatch(Unknown Source)

      at java.awt.EventQueue.dispatchEvent(Unknown Source)

      at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)

      at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)

      at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

      at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

      at java.awt.EventDispatchThread.run(Unknown Source)


But typing the same command on DOS Prompt, it worked fine:
C:\avrdude -Cavrdude.conf -v -v -v -v -pm8 -cstk500v1 -P\\.\COM1 -b19200 -D -Uflash:w:C:\Blink.hex:i

So, the 0010 IDE is not working here with Parallel Port Programer, SSS, pentium III 700, Windows XP Pro.

And a curious thing:
I've got an Atmega with bootload and blink sketch uploaded.
If I burn bootload again with 0007 (on DOS or IDE): the IC gets clean, blinking only with reset.
If I burn bootload again with 0010 (on DOS): the IC keeps the blink sketch, blinking each second, even with uisp --erase before.
Logged

PCB Designer

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 12
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

If you remove the -F from the avrdude command line, can you still burn the bootloader?  If not, I should add the -F flag when using a parallel port programmer from the IDE, and that should fix the problem.  I'll probably also lower the default delay, since 10 minutes is a ridiculous.  

The java.io.IOException: CreateProcess: (error=193) message that you get when trying to upload a sketch is something to do with avrdude not being a valid executable.  Is avrdude in c:\ ?  Is it really called avrdude, or is it avrdude.exe?  Can you try installing the software in a different location?

The difference in blinking between the bootloader included with 0007 and the one included with 0010 is expected.  In 0007, the bootloader has a 8 second or so delay, so it takes that long between blinks.  In 0010, because of the auto-reset, the timeout is much shorter (less than a second), so the LED blinks - that's just the bootloader timing out and restarting (because there's no other sketch on the board).
Logged

Brazil
Offline Offline
Sr. Member
****
Karma: 0
Posts: 443
..., to learn, to know, to make, to share, to l...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If I remove -F it doesn't work. I don't know why, avrdude can't find the correct device signature. (0007 finds it, so the correct number seems to be there). Removing the delay makes it work fine. Is it (the delay) necessary?

In fact, Avrdude is not at C:\. It is at another place, under many directories. But I changed it to C:\ to test if the problem was long directory names. But didn't work. I just renamed it all (the command lines), removing directories at forum to reduce lines and makes it easy to understand. But gonna try at other directories too.

You misunderstood the blink question. The 0010 bootload doesn't erase the previous uploaded sketch (blink led sketch) - even with "uisp --erase" or "avrdude -e". But 0007 bootload erases all.
Logged

PCB Designer

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 12
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Okay, it sounds like in Arduino 0011 I should add a -F and lower the delay for parallel port programmers.  The delay was in there because David Fowler from ucHobby reported that he needed it to get the bootloader burning to happen reliably, but it may have just been his setup.

Can you post the actual error message you get when trying to upload a sketch with Arduino 0010 (with the real paths in place)?  The error that you're getting implies that Windows can't find avrdude, so the path is an important piece in tracking down the problem.  Did you move avrdude from where it was relative to the Arduino directory?  

Are you sure that the burning the bootloader from 0010 doesn't remove the previous sketch?  Have you tried it with different sketches on the board before hand?  Does the bootloader still work (i.e. allow you to upload new sketches) even if it didn't erase the previous sketch?
Logged

Brazil
Offline Offline
Sr. Member
****
Karma: 0
Posts: 443
..., to learn, to know, to make, to share, to l...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Mellis,

Avrdude is under arduino0010 directory.
When I try to upload a new sketch using arduino0010 IDE, the error message is:
(Blinking Sketch)
Code:
Stable Library
=========================================
Native lib Version = RXTX-2.1-7
Java lib Version   = RXTX-2.1-7
Binary sketch size: 864 bytes (of a 7168 byte maximum)
C:\arduino-0010\hardware/tools/avr/bin/avrdude -CC:\arduino-0010\hardware/tools/
avr/etc/avrdude.conf -v -v -v -v -pm8 -cstk500v1 -P\\.\COM1 -b19200 -D -Uflash:w
:C:\arduino-0010\examples\Digital\Blink\applet\Blink.hex:i

java.io.IOException: CreateProcess: C:\arduino-0010\hardware/tools/avr/bin/avrdu
de -CC:\arduino-0010\hardware/tools/avr/etc/avrdude.conf -v -v -v -v -pm8 -cstk5
00v1 -P\\.\COM1 -b19200 -D -Uflash:w:C:\arduino-0010\examples\Digital\Blink\appl
et\Blink.hex:i error=193
        at java.lang.Win32Process.create(Native Method)
        at java.lang.Win32Process.<init>(Unknown Source)
        at java.lang.Runtime.execInternal(Native Method)
        at java.lang.Runtime.exec(Unknown Source)
        at java.lang.Runtime.exec(Unknown Source)
        at java.lang.Runtime.exec(Unknown Source)
        at processing.app.Uploader.executeUploadCommand(Uploader.java:123)
        at processing.app.AvrdudeUploader.avrdude(AvrdudeUploader.java:139)
        at processing.app.AvrdudeUploader.uploadUsingPreferences(AvrdudeUploader
.java:57)
        at processing.app.Sketch.upload(Sketch.java:1632)
        at processing.app.Sketch.exportApplet(Sketch.java:1701)
        at processing.app.Editor$41.run(Editor.java:2004)
        at java.awt.event.InvocationEvent.dispatch(Unknown Source)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)

        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.run(Unknown Source)


(Button Sketch)
Code:
Stable Library
=========================================
Native lib Version = RXTX-2.1-7
Java lib Version   = RXTX-2.1-7

Couldn't determine program size:

C:\arduino-0010\hardware/tools/avr/bin/avrdude -CC:\arduino-0010\hardware/tools/
avr/etc/avrdude.conf -v -v -v -v -pm8 -cstk500v1 -P\\.\COM1 -b19200 -D -Uflash:w
:C:\arduino-0010\examples\Digital\Button\applet\Button.hex:i

java.io.IOException: CreateProcess: C:\arduino-0010\hardware/tools/avr/bin/avrdu
de -CC:\arduino-0010\hardware/tools/avr/etc/avrdude.conf -v -v -v -v -pm8 -cstk5
00v1 -P\\.\COM1 -b19200 -D -Uflash:w:C:\arduino-0010\examples\Digital\Button\app
let\Button.hex:i error=193
        at java.lang.Win32Process.create(Native Method)
        at java.lang.Win32Process.<init>(Unknown Source)
        at java.lang.Runtime.execInternal(Native Method)
        at java.lang.Runtime.exec(Unknown Source)
        at java.lang.Runtime.exec(Unknown Source)
        at java.lang.Runtime.exec(Unknown Source)
        at processing.app.Uploader.executeUploadCommand(Uploader.java:123)
        at processing.app.AvrdudeUploader.avrdude(AvrdudeUploader.java:139)
        at processing.app.AvrdudeUploader.uploadUsingPreferences(AvrdudeUploader
.java:57)
        at processing.app.Sketch.upload(Sketch.java:1632)
        at processing.app.Sketch.exportApplet(Sketch.java:1701)
        at processing.app.Editor$41.run(Editor.java:2004)
        at java.awt.event.InvocationEvent.dispatch(Unknown Source)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)

        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.run(Unknown Source)

Sometimes, if I run avrdude under DOS, I can upload sketch. Sometimes don't.
When it doesn't runs, the message is:
Code:
C:\arduino-0010\hardware\tools\avr\bin>avrdude -CC:\arduino-0010\hardware/tools/
avr/etc/avrdude.conf -v -v -v -v -pm8 -cstk500v1 -P\\.\COM1 -b19200 -D -Uflash:w
:C:\arduino-0010\examples\Digital\Blink\applet\Blink.hex:i

avrdude: Version 5.4-arduino, compiled on Oct 11 2007 at 19:12:32
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

         System wide configuration file is "C:\arduino-0010\hardware/tools/avr/e
tc/avrdude.conf"

         Using Port            : \\.\COM1
         Using Programmer      : stk500v1
         Overriding Baud Rate  : 19200
avrdude: ser_open(): setting dtr
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: Send: Q [51]   [20]
avrdude: Recv:
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51

avrdude done.  Thank you.

About the problem on burning bootloader and remaining previous sketch, I testing it again, but seems to be a mistake I've done.
Logged

PCB Designer

Brazil
Offline Offline
Sr. Member
****
Karma: 0
Posts: 443
..., to learn, to know, to make, to share, to l...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sorry,

about the sketch not uploading on DOS sometimes, was my fault. I didn't press reset. smiley-razz

And the uploading sketches on IDE was my fault too. I removed the "arduino-0010-win" directory
keeping only "arduino-0010". That was causing the error 193.
I didn't thought this could be a problem because I removed the 0007  directory too, and it is still working. But now I understand there's a difference using uisp or avrdude (java).

So the only remaining problem is bootloading with IDE(perhaps including -F and removing -i can solve it).
« Last Edit: January 08, 2008, 04:59:45 pm by adilson » Logged

PCB Designer

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 12
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Cool.

BTW, where was the arduino-0010-win directory?  What was in it?  Was it in your path?  It would be good to know in case anyone runs into the same error again.
Logged

Brazil
Offline Offline
Sr. Member
****
Karma: 0
Posts: 443
..., to learn, to know, to make, to share, to l...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The file Arduino-0010-win.zip was in this path:
d:\Antigo\Gizmo\Drivers e Programas\Arduino\Software\Arduino-0010-win.zip

when extracted the Arduino-0010-win directory become:
d:\Antigo\Gizmo\Drivers e Programas\Arduino\Software\Arduino-0010-win\

with a subdirectory
d:\Antigo\Gizmo\Drivers e Programas\Arduino\Software\Arduino-0010-win\Arduino-0010

I removed Arduino-0010-win to get this:
d:\Antigo\Gizmo\Drivers e Programas\Arduino\Software\Arduino-0010

Like the version 7
d:\Antigo\Gizmo\Drivers e Programas\Arduino\Software\Arduino-0007 (that works fine)

So, the problem is to keep all directory structure with no changes (Arduino-0010-win\Arduino-0010). The directory where it is located is not important.

And don't forget to exclude -i and include -F on 0011. Take note.

Logged

PCB Designer

Pages: 1 [2]   Go Up
Jump to: