Compilation error: exit status 1 message on Arduino Uno

hi, im new to all this, but im learning slowly
Everything was going great until i done something in gsender to be immediately disconnected with exit status 1, and would not allow me to reconnect on gsender, ugs or openbuilds, i have 2 spare boards so i swapped 1 out and it happened again so now i have 3 uno boards with the same message and no access to my cnc machine.
thanksUse code tags to format code for the forum

Please enable verbose output during upload and disable verbose output during compilation under File → Preferences in the IDE, perform an upload and post the result here using code tags (just in case: described in https://forum.arduino.cc/t/how-to-get-the-best-out-of-this-forum/679966#use-code-tags).


```cpp
#include <config.h>
#include <coolant_control.h>
#include <cpu_map.h>
#include <defaults.h>
#include <eeprom.h>
#include <gcode.h>
#include <grbl.h>
#include <jog.h>
#include <limits.h>
#include <motion_control.h>
#include <nuts_bolts.h>
#include <planner.h>
#include <print.h>
#include <probe.h>
#include <protocol.h>
#include <report.h>
#include <serial.h>
#include <settings.h>
#include <spindle_control.h>
#include <stepper.h>
#include <system.h>

/***********************************************************************
This sketch compiles and uploads Grbl to your 328p-based Arduino! 

To use:
- First make sure you have imported Grbl source code into your Arduino
  IDE. There are details on our Github website on how to do this.

- Select your Arduino Board and Serial Port in the Tools drop-down menu.
  NOTE: Grbl only officially supports 328p-based Arduinos, like the Uno.
  Using other boards will likely not work!

- Then just click 'Upload'. That's it!

For advanced users:
  If you'd like to see what else Grbl can do, there are some additional
  options for customization and features you can enable or disable. 
  Navigate your file system to where the Arduino IDE has stored the Grbl 
  source code files, open the 'config.h' file in your favorite text 
  editor. Inside are dozens of feature descriptions and #defines. Simply
  comment or uncomment the #defines or alter their assigned values, save
  your changes, and then click 'Upload' here. 

Copyright (c) 2015 Sungeun K. Jeon
Released under the MIT-license. See license.txt for details.
***********************************************************************/

#include <grbl.h>

// Do not alter this file!

`In file included from C:\Users\dbrit\Documents\Arduino\libraries\grbl/config.h:30:0,
                 from C:\Users\dbrit\Documents\Arduino\libraries\grbl\examples\grblUpload\grblUpload.ino:1:
C:\Users\dbrit\Documents\Arduino\libraries\grbl/grbl.h:68:4: error: #error "Required HOMING_CYCLE_0 not defined."
   #error "Required HOMING_CYCLE_0 not defined."
    ^~~~~
C:\Users\dbrit\Documents\Arduino\libraries\grbl/grbl.h:108:4: error: #error "WCO refresh must be greater than one."
   #error "WCO refresh must be greater than one."
    ^~~~~
C:\Users\dbrit\Documents\Arduino\libraries\grbl/grbl.h:111:4: error: #error "Override refresh must be greater than zero."
   #error "Override refresh must be greater than zero."
    ^~~~~
exit status 1

Compilation error: exit status 1

cheers, i copied from the edit area (save for the forum)`and also from the serial monitor, hope that's what you are after

This is not an upload problem but a programming issue hence your topic has been moved to the programming category of the forum. I apologise that I did paid more attention to the category where you posted than the topic title.

no need to apologise mate, i appreciate all the help i can get.
thanks again

This is peculiar. The grblUpload.ino sketch file, which can be seen in GitHub does not contain the usual setup and loop functions, but just has a giant comment, and a single

#include <grbl.h>

which you can see at the bottom of the code you posted above. But the code you posted above also has about twenty other #include directives before that, which are not present.

Given the files mentioned in the error message

  • You're trying to compile the .ino file that's actually in the library's examples subdirectory. Usually a copy of the example is made, and you compile that.
  • On first line of that file -- grblUpload.ino:1 -- as in the code you posted, is
    #include <config.h>
    
    The error message then has the line number in that file: config.h:30, which is
  • Which then hits the three #error directives, and cause the compile to fail.
  • Among the twenty-ish alphabetically sorted #include directives is <grbl.h> again. So there are two in the same file.

At the top of that file is

similar to what's in config.h: an include guard, a bit of C/C++ insanity which would normally allow for the same header file to be included more than once. The order is supposed to be .ino, grbl.h, config.h. That last one includes grbl.h again, "For Arduino IDE compatibility" -- whatever that means -- but has no effect. Further down in the file, there's

the missing thing that generated the first error. But because the order is .ino, config.h, grbl.h, it fails.

The first thing to try to is create a brand new sketch, erase the empty setup and loop functions, and just put that single line

#include <grbl.h>

See what happens.

I installed, compiled and uploaded version 1.1 no problem.

It looks like you have modified the gbrlupload.ino by adding a bunch of includes.