Go Down

Topic: avrdude on Mac how?  (Read 2702 times) previous topic - next topic

JonnyAlpha

Hi,
I have an Arduino Nano clone whose USB port is no longer recognised, this happened when during an upload my Mac suddenly rebooted.
The red power LED comes on but I cannot upload programs to it.

Having tried other methods, such as ISCP using another Nano, as a last resort I want to use avrdude from the command line on my Mac 10.9.5.

What do I need to install to use avrdude and program Arduinos from my Mac using terminal and not the Sketch IDE?

I am going to try Adafruits slow burn option?

dmjlambert

Recommended steps to figure this out:

step 1

At the top of the Installation and Troubleshooting forum are sticky posts.  Have a look at the Loopback Test Instructions.  Test the USB-to-serial part of the Nano with that test.

If test fails, meaning you don't see the characters coming back to the serial monitor, or if you can't connect at all, the USB-to-serial chip or connector is probably bad. 

step 2

Uploading a sketch such as blink to the ATmega328P using ISP programming.  Probably easiest way is to program it with another Arduino using the ArduinoISP sketch.    After ISP programmer is hooked up, open the blink sketch, choose the programmer type in the Tools, Programmer menu (like Arudino as ISP if you are using another Arduino with the ArduinoISP sketch loaded), In the Tools, Board menu choose Nano, and in the Tools, Port menu choose the port of the ISP programmer.  In the Sketch menu choose Upload Using Programmer.  If you can upload a sketch to the bad Nano that way, it confirms the processor still works.

step 3a

If the USB-to-serial chip is bad but processor is good, decide what to do with the Nano.  You can just upload to it via ISP from now on, or burn the bootloader on it and use it like a Pro Mini from now on, uploading to it with an FTDI or similar USB-to-serial adapter.  To use it as a Pro Mini, I would remove the DTR to RST capacitor from the bottom of the board to disconnect the reset line from the FTDI or CH340G chip.  Then when you connect the external FTDI adapter, connect the DTR or GRN pin of the adapter to a 0.1uF cap, and the other pin of the cap to RST on the Nano. 

step 3b

If the USB-to-serial chip is good and processor is good, use ISP programming to burn a fresh bootloader on the Nano.   Then it should work like normal again.



JonnyAlpha

Well I tried these steps using Sketch but no joy, see below:

Step 1:

Cannot do the Loopback test as the USB Serial Port is not recognised.

Step 2:

Not sure about this step, how are the 2 x Nano's connected via ISP? Tried this and I just get an invalid device signature message:
vrdude: Device signature = 0xffffff
avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override
         this check.

Any ideas?

Recommended steps to figure this out:

step 1

At the top of the Installation and Troubleshooting forum are sticky posts.  Have a look at the Loopback Test Instructions.  Test the USB-to-serial part of the Nano with that test.

If test fails, meaning you don't see the characters coming back to the serial monitor, or if you can't connect at all, the USB-to-serial chip or connector is probably bad. 

step 2

Uploading a sketch such as blink to the ATmega328P using ISP programming.  Probably easiest way is to program it with another Arduino using the ArduinoISP sketch.    After ISP programmer is hooked up, open the blink sketch, choose the programmer type in the Tools, Programmer menu (like Arudino as ISP if you are using another Arduino with the ArduinoISP sketch loaded), In the Tools, Board menu choose Nano, and in the Tools, Port menu choose the port of the ISP programmer.  In the Sketch menu choose Upload Using Programmer.  If you can upload a sketch to the bad Nano that way, it confirms the processor still works.

step 3a

If the USB-to-serial chip is bad but processor is good, decide what to do with the Nano.  You can just upload to it via ISP from now on, or burn the bootloader on it and use it like a Pro Mini from now on, uploading to it with an FTDI or similar USB-to-serial adapter.  To use it as a Pro Mini, I would remove the DTR to RST capacitor from the bottom of the board to disconnect the reset line from the FTDI or CH340G chip.  Then when you connect the external FTDI adapter, connect the DTR or GRN pin of the adapter to a 0.1uF cap, and the other pin of the cap to RST on the Nano. 

step 3b

If the USB-to-serial chip is good and processor is good, use ISP programming to burn a fresh bootloader on the Nano.   Then it should work like normal again.




cmiyc

What do I need to install to use avrdude and program Arduinos from my Mac using terminal and not the Sketch IDE?
Use the copy that is included with the Arduino IDE.

/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin
Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

dmjlambert

For step 2 uploading sketch using an Arduino such as a Nano  as an ISP programmer you would connect the Nanos together as shown here

https://www.arduino.cc/en/Tutorial/ArduinoISP

The top picture named "Circuit (targeting Arduino Uno, Duemilanove, or Diecimila)" is also good for Nano.

Just like mentioned for Uno, you'll need to connect a 10 uF capacitor between reset and ground on the Arduino you are using as the programmer (after uploading the ArduinoISP sketch).  The negative or striped side of the capacitor goes to GND.

After getting the ArduinoISP sketch uploaded to the programmer Nano and wiring just re-read step 2 again and finish.

Go Up