Skip to content

Flashing Grbl to an Arduino

chamnit edited this page Jan 20, 2012 · 12 revisions

This wiki is intended to provide various instructions on how to flash grbl to an Arduino. Please feel free to contribute more up-to-date or alternative methods.

For Mac OS X:

Last updated: 2012-01-20 Tested on OS X 10.7 and 10.4 and the Arduino Uno

As with compiling grbl, the tools for flashing grbl to an Arduino are included in the Arduino IDE software. All you need to do is directly access them through the Terminal.app. The following instructions has been tested and works for the Arduino Uno. For others, your mileage may vary.

For most people, the path to the Arduino compiler tools will be: /Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr (Note the absence of /bin from the compiling grbl page.) Depending on where you place the Arduino IDE, the /Applications/Arduino.app path may be different. So, lets call your compiler tools path $AVRPATH to help shorten the following commands.

Next you will need to find the device path to your Arduino. First, connect your Arduino to a Mac USB port. To find the device path, from a Terminal.app window, type: /dev/tty.usb and hit Tab once or twice. This will either give you one device path, which is your Arduino, or multiple paths, if you have more than one usbmodem type device connected to your computer. If you have multiple, simply unplug your Arduino, repeat the process, and eliminate the remaining devices that are still listed. Your Arduino device path should like something like this: /dev/tty.usbmodem1811 and lets call this $DEVPATH.

To Flash Grbl: Using the Terminal.app, first make sure you're in the same directory as the grbl.hex file you want to flash to the Arduino, which we'll call $GRBLHEX. Then, type the following commands to flash.

For Release 0023 and prior: $AVRPATH/bin/avrdude -C$AVRPATH/etc/avrdude.conf -pm328p -cstk500v1 -P$DEVPATH -D -Uflash:w:$GRBLHEX

For v1.0: $AVRPATH/bin/avrdude -C$AVRPATH/etc/avrdude.conf -pm328p -carduino -P$DEVPATH -D -Uflash:w:$GRBLHEX

Note the only change between the two versions is the -c flag from the stk500v1 programmer to the arduino programmer. This programmer flag was updated in the v1.0 IDE. If all goes according to plan, you should see three sequential progress bars of reading, writing, and verifying and you're good to go!

For Windows:

Flashing a hex file to your Arduino is simple with windows. First, plug in your Arduino into any USB port of your Windows machine and then determine the assigned COM port of your Arduino.

To Determine your Arduino's COM port:

  • Windows XP: Right click on "My Computer", select "Properties", select "Device Manager".

  • Windows 7: Click "Start" -> Right click "Computer" -> Select "Manage" -> Select "Device Manager" from left pane

  • In the tree, expand "Ports (COM & LPT)"

  • Your Arduino will be the USB Serial Port (COMX), where the “X” represents the COM number, for example COM6.

  • If there are multiple USB serial ports, right click each one and check the manufacturer, the arduino will be "FTDI".

To flash a grbl hex to an Arduino:

  1. Download and extract xloader.

  2. Open xloader and select your Arduino's COM port from the drop down menu on the lower left.

  3. Set the BAUD Speed to 57600.

  4. Select the appropriate device from the dropdown list titled "Device".

  5. Now use the browse button on the top right of the form to browse to your grbl hex file.

  6. Once your grbl hex file is selected, click "Upload"

After clicking upload, you'll see the RX/TX lights going wild on your Arduino. The upload process generally takes about 10 seconds to finish. Once completed, a message will appear in the bottom left corner of xloader telling you how many bytes were uploaded. If there was an error, it would show instead of the total bytes uploaded. Steps should be similar and may be done through the command prompt.

Other references:

  • DANK (Last updated 2/2011)