How to properly upload Grbl v0.9 code to A4988 driver board R3 ARDUINO UNO?

When I try to upload GRBLv.9 (GitHub - grbl/grbl: An open source, embedded, high performance g-code-parser and CNC milling controller written in optimized C that will run on a straight Arduino) code to my A4988 driver board R3 I get the following error message:


Arduino: 1.8.5 (Windows 10), Board: "Arduino/Genuino Uno"

In file included from C:\Users\sagex\Documents\Arduino\libraries\grbl/grbl.h:43:0,

                 from C:\Users\sagex\Documents\Arduino\libraries\grbl\examples\grblUpload\grblUpload.ino:27:

C:\Users\sagex\Documents\Arduino\libraries\grbl/nuts_bolts.h:25:0: warning: "false" redefined

 #define false 0

 ^

In file included from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:24:0,

                 from sketch\grblUpload.ino.cpp:1:

c:\program files (x86)\arduino\hardware\tools\avr\lib\gcc\avr\4.9.2\include\stdbool.h:42:0: note: this is the location of the previous definition

 #define false false

 ^

In file included from C:\Users\sagex\Documents\Arduino\libraries\grbl/grbl.h:43:0,

                 from C:\Users\sagex\Documents\Arduino\libraries\grbl\examples\grblUpload\grblUpload.ino:27:

C:\Users\sagex\Documents\Arduino\libraries\grbl/nuts_bolts.h:26:0: warning: "true" redefined

 #define true 1

 ^

In file included from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:24:0,

                 from sketch\grblUpload.ino.cpp:1:

c:\program files (x86)\arduino\hardware\tools\avr\lib\gcc\avr\4.9.2\include\stdbool.h:43:0: note: this is the location of the previous definition

 #define true true

 ^

In file included from C:\Users\sagex\Documents\Arduino\libraries\grbl/grbl.h:43:0,

                 from C:\Users\sagex\Documents\Arduino\libraries\grbl\examples\grblUpload\grblUpload.ino:27:

C:\Users\sagex\Documents\Arduino\libraries\grbl/nuts_bolts.h:51:0: warning: "max" redefined

 #define max(a,b) (((a) > (b)) ? (a) : (b))

 ^

In file included from sketch\grblUpload.ino.cpp:1:0:

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:93:0: note: this is the location of the previous definition

 #define max(a,b) ((a)>(b)?(a):(b))

 ^

In file included from C:\Users\sagex\Documents\Arduino\libraries\grbl/grbl.h:43:0,

                 from C:\Users\sagex\Documents\Arduino\libraries\grbl\examples\grblUpload\grblUpload.ino:27:

C:\Users\sagex\Documents\Arduino\libraries\grbl/nuts_bolts.h:52:0: warning: "min" redefined

 #define min(a,b) (((a) < (b)) ? (a) : (b))

 ^

In file included from sketch\grblUpload.ino.cpp:1:0:

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:92:0: note: this is the location of the previous definition

 #define min(a,b) ((a)<(b)?(a):(b))

 ^

In file included from C:\Users\sagex\Documents\Arduino\libraries\grbl/grbl.h:43:0,

                 from C:\Users\sagex\Documents\Arduino\libraries\grbl\examples\grblUpload\grblUpload.ino:27:

C:\Users\sagex\Documents\Arduino\libraries\grbl/nuts_bolts.h:55:0: warning: "bit" redefined

 #define bit(n) (1 << n) 

 ^

In file included from sketch\grblUpload.ino.cpp:1:0:

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:123:0: note: this is the location of the previous definition

 #define bit(b) (1UL << (b))

 ^

Sketch uses 30058 bytes (93%) of program storage space. Maximum is 32256 bytes.
Global variables use 1486 bytes (72%) of dynamic memory, leaving 562 bytes for local variables. Maximum is 2048 bytes.
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0xf2
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0xf2
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0xf2
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0xf2
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0xf2
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0xf2
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0xf2
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0xf2
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0xf2
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0xf2
Problem uploading to board.  See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.

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

I tried to upload example code from Arduino IDE, even blank code, but every attempt failed.

I’m trying to use this as controller for my cnc machine but can’t seem to find answer to this. I’m using fresh GRBL code with no changes (from the git repo mentioned above). Is my driver wrong or what? Thanks! :slight_smile:

Link to my board:


https://www.aliexpress.com/item/4-x-A4988-Stepper-Motor-Driver-with-Heat-Sink-UNO-R3-Board-CNC-Shield-Expansion-Board/32655336905.html?spm=2114.search0104.3.8.1a207f47CHx9Y6&ws_ab_test=searchweb0_0,searchweb201602_2_10065_10068_10344_10342_10343_10340_10341_10084_10083_10618_10307_10615_10313_10059_10534_100031_10103_441_10624_442_10623_10622_10621_10620_10142,searchweb201603_28,ppcSwitch_2&algo_expid=f66e04ac-1c9d-47be-acaf-2ef910ed5b2a-1&algo_pvid=f66e04ac-1c9d-47be-acaf-2ef910ed5b2a&transAbTest=ae803_5&priceBeautifyAB=0

The compiler warnings are just warnings (and appear to be no problem)

The problem is the sync error on upload. This can have a great many causes. Have you connected anything to the board? If so, remove it.

I would also try uploading with "nano" and "pro mini" selected for the board. Sometimes vendors of unofficial boards (like yours) screw up and put chips with the wrong bootloader onto the board, so it acts like one of the other '328p based boards.

Thanks for help, but it still doesn't work. Nothing was connected to the board so I tried changing the board types as you suggested but it still displays the same error, really don't know how to approach this problem. :confused:

I’m having the same issue and it permenently damages the fuses in the atmega chip it has already killed two of my atmega 328p-pu’s and I still don’t know what is causing it maybe we should try an earlier version but it also doesn’t work if you program it via arduinoISP but you should be careful because it damages your chip best of luck and if you figure it out please send the solution so I can also use my cnc

Have 4 of those boards here and no issue at all with either a real or clone UNO or a real or clone MEGA.

Win 7 x64 using USB 2.0 ports as USB 3.0 can on occasion cause issues with Arduinos.
Have both 1.9 and 1.1 GRBL.

You may get a low memory warning but that can be ignored.
Not seen it kill a single Arduino here despite my best efforts.
Nor does it touch the fuses as I have uploaded different sketches to Arduinos that have had GRBL on them with both CREATE and the desktop IDE.

GRBL is uploaded to the ARDUINO and NOT to the driver boards as they simply do what the Arduino tells them to do. You can kill the driver boards if they are incorrectly set up or you dont use heatsinks in some configurations.

It took me about 7 nights of intensive reading before I got to grips with GRBL and the fact that sometimes you need to tweak GRBL's settings which can be done with either the IDE or most of the GRBL based CNC software.

Also have two of the NANO based CNC shields but they require an odd version of GRBL as the pins are reversed but that can be fixed in software.

If you are quite new to ARDUINO based CNC then do take the time to read up first as it will save you some heartache and head scratching.