How to flash grbl to your Arduino (Tutorial)

Discussion about the arduino based g-code interpreter, grbl
Post Reply
Cboogs95
Posts: 1
Joined: Thu Jun 13, 2013 7:16 pm

How to flash grbl to your Arduino (Tutorial)

Post by Cboogs95 » Fri Jun 14, 2013 1:29 am

Flashing GRBL to Arduino from Mac…
by Colin Grundey
June 12, 2013

Hopefully this tutorial is easy to understand. If not then check this one out: http://dank.bengler.no/-/page/show/5471 ... checkpoint. This tutorial teaches you how to flash grbl to your Arduino board from a Mac. If you accidentally uploaded the blink program or you want the latest grbl software, then this is the tutorial that you want.

Prerequisites:
Arduino IDE downloaded (http://arduino.cc/en/main/software)

[IMPORTANT NOTE]
Before you perform the next set of instructions, make sure that when you copy and paste the Orange statements you don't add or remove any extra spaces.

BEGIN:
First go to this page and download the latest version of grbl(This file will be flashed to the Arduino): https://github.comgrbl/grbl/downloads. Then save the file under the name grbl_file.hex to your Desktop for easy access. If you don't save it there under that exact name, then the rest won't work so make sure you do that exactly the way it says.

To access my Arduino Uno, I used the path /dev/tty.usbmodemfa141/. This will definitely be different for you, so open up your Arduino application and plug in your Arduino into a usb port. Unplug any other devices from your usb ports to make this easier. If you can't unplug something like a mouse, then keep it plugged in and continue. Plug your Arduino into the same port every time so that you don't have to keep changing the path. Then, with your Arduino application open, go to the menu bar at the top of your screen, click on Tools, hover over Serial Port, and write down on a piece of paper all of the options that aren't bluetooth and start like /dev/tty.usbmodem. If you only have one of these paths, then that is good. If you have multiple, then you will have to do some guessing.

Open up your Terminal application (search Terminal in Spotlight or Finder if you don't know where it is) and paste the following Orange statement in your Terminal window and hit return:

cd Desktop/

Paste one of the Orange statements into Terminal and type your path** that you wrote down somewhere where it says {PASTE USB PATH HERE}.
**If you have multiple paths then try one and if it doesn't work, then try another.

If you have an Arduino Uno,

/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf -pm328p -carduino -P{PASTE USB PATH HERE} -D -Uflash:w:grbl_file.hex

If you have an Arduino Duemilanove,

/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf -pm328p- -carduino -P{PASTE USB PATH HERE} -b57600 -D -Uflash:w:grbl_file.hex

The purple statement is exactly what mine looked like and yours should look quite similar:
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf -pm328p -carduino -P/dev/tty.usbmodemfa141 -D Uflash:w:grbl_9.hex

Press return and nothing should happen for a little. Then this should appear:

avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.01s
avrdude: Device signature = 0×1e9406
avrdude: erasing chip
avrdude: reading input file “grbl.hex”
avrdude: input file grbl.hex auto detected as Intel Hex
avrdude: writing flash (14228 bytes):
Writing | ################################################## | 100% 8.06s
avrdude: 14228 bytes of flash written
avrdude: verifying flash memory against grbl.hex:
avrdude: load data flash data from input file grbl.hex:
avrdude: input file grbl.hex auto detected as Intel Hex
avrdude: input file grbl.hex contains 14228 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 6.45s
avrdude: verifying …
avrdude: 14228 bytes of flash verified
avrdude: safemode: Fuses OK
avrdude done. Thank you.

Making Sure that you succeeded:

If you accidentally downloaded the blink program before this tutorial, then your Arduino should not be blinking anymore. To double check that it is working, wire up your motors to the grbl and scroll down this page until you see DOWNLOADS and download the latest version(https://github.com/johnlauer/Universal-G-Code-Sender). Double click on the file in Finder to unzip it and open up the unzipped folder. Open the .jar file and an application should open up. On the top left, click on the port option bar and select the path that you used to access your Arduino. Then give power to your grbl board and click open. Finally, click on machine control and click the + or - for all of the axes and your motors should spin up. If this all works then you have successfully flashed grbl to your Arduino.



Troubleshooting:

First, make sure all spelling and spaces are correct. Then try to paste the orange statements into Terminal again.

If it still doesn't work...
You should have the path for 4 things:
1. grbl hex file
2. avrdude
3. avrdude.conf
4. usb to Arduino

The problem you are most likely having is path #4. If you have multiple things plugged in, then you will have to try the different possibilities that you wrote down earlier, which should look something like /dev/usbmodem*something*/, and paste each on into on of the Orange statement where it says {PASTE USB PATH HERE}, without adding or removing any spaces, until one works.

If it still doesn't work...
Path #1 should be right if you followed my directions above closely by naming the downloaded file grbl_file.hex and saving it on your Desktop.
Path #2 and #3 should be what I said they were because that is where Arduino stores them by default. If they are not there, then my suggestion (which sounds unnecessary) is to uninstall Arduino and reinstall it. The files should be in the right place.

getSurreal
Posts: 13
Joined: Thu Jul 11, 2013 3:40 pm

Re: How to flash grbl to your Arduino (Tutorial)

Post by getSurreal » Fri Aug 02, 2013 1:46 am

Good summary. Information I got from other sites was not as concise.

You're purple command is missing the dash in front of the U parameter though.

Code: Select all

/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avrdude -C /Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf -p m328p -c arduino -P /dev/tty.usbmodem1441 -D -U flash:w:grbl_v0_8c_atmega328p_16mhz_9600.hex
Shapeoko 1868F
"The only difference between a madman and me is that I'm not mad" - Salvador Dali

ez-set
Posts: 1
Joined: Tue Apr 29, 2014 10:16 pm

Re: How to flash grbl to your Arduino (Tutorial)

Post by ez-set » Tue Apr 29, 2014 11:47 pm

/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf -p m328p -c arduino -P/dev/{tty. Add your port here} -b57600 -D -U flash:w:grbl_file.hex (<—this works)

after trying many times using you previous posts, I noticed there were several spots that needed spaces to make this work.

Zen Toolworks 7x7
Arduino Duemilanove
GRBL and GRBL Controller
Macbook Air 11"
OSX Mavericks

Signals
Posts: 108
Joined: Sun Apr 06, 2014 2:52 am

Re: How to flash grbl to your Arduino (Tutorial)

Post by Signals » Fri Nov 21, 2014 3:06 am

/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf -pm328p -carduino -P/dev/tty.usbmodem641 -D -Uflash:w:grblv9.hex

That syntax worked on mine. Copied right from the terminal, so if you just change the tty.usbmodem part and the hex name, might work on yours!

derrak
Posts: 2
Joined: Wed Apr 22, 2015 7:23 pm
Location: Portland, OR

Re: How to flash grbl to your Arduino (Tutorial)

Post by derrak » Fri Oct 23, 2015 5:08 am

Looks like the paths within the Arduino app have changed. This worked:

/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf -p m328p -c arduino -P /dev/cu.usbmodem1411 -D -U flash:w:grbl_file.hex

Post Reply