Go Down

Topic: Burning bootloader to NANO using a MEGA. (Read 584 times) previous topic - next topic

hzd1977

Hi there.

I can't seem do get this to work.
I've tried following this video: https://www.youtube.com/watch?v=mq5PhM_Fz9Y
I've also tried to connect to the 2x3 pins instead of pins 10 11 12 13

Do I need to change the pins in the ArduinoISP code?
Or maybe, my NANO is just very dead. (When resetting or powering up, the led flashes once, if that is any indicator. Read that it is supposed to flash three times, to indicate, it is ok)


pert

Please do this:
  • Tools > Preferences > Show verbose output during: > compilation (uncheck) > upload (check) > OK
  • Tools > Burn Bootloader
  • After the process fails you'll see a button on the right side of the orange bar "Copy error messages". Click that button.
  • Paste the error messages in a reply here USING CODE TAGS (</> button on the toolbar).

hzd1977

I didn't find the "Tools > Preferences > Show verbose output during: > compilation (uncheck) > upload (check) > OK"

I'm on mac, by the way. I found preferences under the Arduino menu, but nothing that looked like Show verbose....

Code: [Select]
Arduino: 1.8.0 (Mac OS X), Board: "Arduino Nano, ATmega328"

/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf -v -patmega328p -cstk500v1 -P/dev/cu.usbmodemFA131 -b19200 -e -Ulock:w:0x3F:m -Uefuse:w:0x05:m -Uhfuse:w:0xDA:m -Ulfuse:w:0xFF:m

avrdude: Version 6.3, compiled on Dec 16 2016 at 13:32:25
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "/Applications/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf"
         User configuration file is "/Users/HZD/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/cu.usbmodemFA131
         Using Programmer              : stk500v1
         Overriding Baud Rate          : 19200
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00

avrdude done.  Thank you.

Error while burning bootloader.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Budvar10

Hi there.

I can't seem do get this to work.
I've tried following this video: https://www.youtube.com/watch?v=mq5PhM_Fz9Y
I've also tried to connect to the 2x3 pins instead of pins 10 11 12 13

Do I need to change the pins in the ArduinoISP code?
Or maybe, my NANO is just very dead. (When resetting or powering up, the led flashes once, if that is any indicator. Read that it is supposed to flash three times, to indicate, it is ok)
Arduino MEGA2560 has ISP on pins 53, 51, 50, 52. It is written also below the video you've linked. Of course, you can use ISP (2x3) connector on MEGA also - pins 1, 4, 3 instead of 50, 51, 52. It is the same but pin 53 must be connected to RESET on target device.
You need not to change the ArduinoISP code.
Arduino as ISP technique works pretty reliable. Response 0 points to wrong connection in 95% of cases.
Arduino clone with ATmega1284P   http://forum.arduino.cc/index.php?topic=277260.0

pert

I didn't find the "Tools > Preferences > Show verbose output during: > compilation (uncheck) > upload (check) > OK"
Oops, I meant File > Preferences, but even that's a bit different on Mac I guess.

pert

pin 53 must be connected to RESET on target device.
That video is using Arduino IDE 1.0.1. The ArduinoISP sketch included with all recent versions of the IDE always uses pin 10 unless you're using a HoodLoader board:
https://github.com/arduino/Arduino/blob/1.8.3/build/shared/examples/11.ArduinoISP/ArduinoISP/ArduinoISP.ino#L73

So even when using the Mega you still need to connect pin 10 on the board used as Arduino as ISP to the reset pin on the target board.

Budvar10

Aha, I'm 'old dog'. :)
I'm still using old ArduinoISP and in addition modified by myself.
+1
Arduino clone with ATmega1284P   http://forum.arduino.cc/index.php?topic=277260.0

hzd1977

So, still no luck when using pin 10 on the MEGA connected to RST pin on NANO.

This is the error messages after the burn process fails.


Code: [Select]
Arduino: 1.8.0 (Mac OS X), Board: "Arduino Nano, ATmega328"

/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf -v -patmega328p -cstk500v1 -P/dev/cu.usbmodemFA131 -b19200 -e -Ulock:w:0x3F:m -Uefuse:w:0x05:m -Uhfuse:w:0xDA:m -Ulfuse:w:0xFF:m

avrdude: Version 6.3, compiled on Dec 16 2016 at 13:32:25
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "/Applications/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf"
         User configuration file is "/Users/HZD/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/cu.usbmodemFA131
         Using Programmer              : stk500v1
         Overriding Baud Rate          : 19200
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00

avrdude done.  Thank you.

Error while burning bootloader.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.


So I'm guessing, my NANO is in worse shape, than I hoped for. Right?

kprims

Mine won't work unless I put a 10uF Capacitor between Reset and ground on my Mega after loading the ArduinoISP sketch and selecting the Nano/Uno I want to put the bootloader on. I'm boot loading a Uno for my test.

hzd1977

Well. Now I have a new UNO board. Will I still need a 10 uF between reset and ground?

kprims

Using Arduino as ISP is like playing the lottery. :-) Some days I need the 10uF cap. and other days ,other Arduinos I don't need it. If you can't burn the bootloader, then try the 10uF cap.

Better yet, get a couple Usbasps and read up about putting the 1.06 version on it. I have been using the Usbasp for over a year and have burned 8Mhz internal bootloader on bare m128 chips that I soldered on pcb's (around 30) with very few problems. If you plug it in right it just works.

https://forum.arduino.cc/index.php?topic=363772.0

Budvar10

#11
Jun 29, 2017, 07:49 am Last Edit: Jun 30, 2017, 08:04 am by Budvar10
Quote
Using Arduino as ISP is like playing the lottery.
:smiley-eek-blue:
No, it is not. Arduino as ISP works reliably. It should use stk500v1 programmer for correct action (avrdude command, -c parameter) which is not generate reset pulse. Neither it is desirable. We do not want to reset the board with ISP sketch but the target. Reset pulse is generated by ISP sketch to the target board. Maybe this can help: https://forum.arduino.cc/index.php?topic=342977.0.
Problem with Arduino as ISP is very slow uploading, 19200 baud. The speed can be easily increased to twice by excluding the indication. Finally, who is using this indication for additional LED. Uploads with the newest avrdude 6.3 are more efficient so the speed 19200 is no such big problem.
On the other hand, big plus is possibility to generate clock signal (small modification of sketch), e.g. for bricked chip.
Arduino clone with ATmega1284P   http://forum.arduino.cc/index.php?topic=277260.0

kprims

OK, so maybe I exaggerated a little. :)  But with thousands of people like me telling newcomers how to use Arduino as ISP there is bound to be many different stories.

This is my story this morning, maybe this afternoon I will have a different story. I know I have been able to burn bootloader without using the 10uF capacitor before. 

   Burning bootloader  using Mega 250 with 10uF Capacitor between Reset and GND.

-v -patmega328p -cstk500v1 -P/dev/ttyUSB0 -b19200

 
Code: [Select]
Programmer Type : STK500
         Description     : Atmel STK500 Version 1.x firmware
         Hardware Version: 2
         Firmware Version: 1.18
         Topcard         : Unknown
         Vtarget         : 0.0 V
         Varef           : 0.0 V
         Oscillator      : Off
         SCK period      : 0.1 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x1e950f (probably m328p)
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 "/home/kprims/ken/Downloads/arduino-1.8.3/hardware/arduino/avr/bootloaders/optiboot/optiboot_atmega328.hex"
avrdude: writing flash (32768 bytes):



Burning bootloader using Mega 250 without 10uF Capacitor.

-v -patmega328p -cstk500v1 -P/dev/ttyUSB0 -b19200

Code: [Select]
Using Port                    : /dev/ttyUSB0
         Using Programmer              : stk500v1
         Overriding Baud Rate          : 19200
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding

Budvar10

#13
Jun 30, 2017, 07:07 am Last Edit: Jun 30, 2017, 07:24 am by Budvar10
Hmm... Is it directly from the command line? The stk500v1 surely doesn't generate reset pulse. It should be observable, the difference between e.g. -cArduino and -cSTK500v1.
BTW: You need not upload the hex for the test, just -v command for verbose output or any read is enough to be sure if it works or not. Don't waste flash writes. (K+ for your effort)
Arduino clone with ATmega1284P   http://forum.arduino.cc/index.php?topic=277260.0

Budvar10

I did quick check of avrdude source code (v6.3), as I have doubts about my claim after your post. Exactly as I said, STK500v1 does not toggle DTR and RTS on serial port but Arduino yes. I'm out for couple days without possibility of testing on real board.
Arduino clone with ATmega1284P   http://forum.arduino.cc/index.php?topic=277260.0

Go Up