-
Notifications
You must be signed in to change notification settings - Fork 230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to Compile for Arduino Mega and Ramps 1.4 #157
Comments
Hi @Technican, Your config.h update is not correct. To use an Arduino Mega with RAMPS 1.6, you need to comment the two first definitions and uncomment the two other like this:
Then, if you have other compile error message, please, tell us what is your system, Windows or Linux, which version, which compiler and version, and any other information which can help us to help you... @++; |
Hi Gauthier,
Thanx for the fast answer. The changes from you helps me. I am using macOS 12 , avr-gcc from Homebrew , Version 9.3.0.3.
Only a warning appears during the Compilation, is this a problem?
Great Rewards from Germany ,
Sven
grbl/eeprom.c: In function 'memcpy_to_eeprom_with_checksum':
grbl/eeprom.c:133:26: warning: '<<' in boolean context, did you mean '' ? [-Wint-in-bool-context]
133 | checksum = (checksum << 1) || (checksum >> 7);
| ~~~~~~~~~~^~~~~
grbl/eeprom.c: In function 'memcpy_from_eeprom_with_checksum':
grbl/eeprom.c:144:26: warning: '<<' in boolean context, did you mean '' ? [-Wint-in-bool-context]
144 | checksum = (checksum << 1) || (checksum >> 7);
| ~~~~~~~~~~^~~~~
… Am 10.04.2022 um 18:16 schrieb Gauthier Brière ***@***.***>:
Hi @Technican <https://github.com/Technican>,
Your config.h update is not correct. To use an Arduino Mega with RAMPS 1.6, you need to comment the two first definitions and uncomment the two other like this:
// Define CPU pin map and default settings.
// NOTE: OEMs can avoid the need to maintain/update the defaults.h and cpu_map.h files and use only
// one configuration file by placing their specific defaults and pin map at the bottom of this file.
// If doing so, simply comment out these two defines and see instructions below.
//#define DEFAULTS_GENERIC
//#define CPU_MAP_2560_INITIAL
// To use with RAMPS 1.4 Board, comment out the above defines and uncomment the next two defines
#define DEFAULTS_RAMPS_BOARD
#define CPU_MAP_2560_RAMPS_BOARD
Then, if you have other compile error message, please, tell us what is your system, Windows or Linux, which version, which compiler and version, and any other information which can help us to help you...
@++;
Gauthier.
—
Reply to this email directly, view it on GitHub <#157 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AKQMYKT7LS4HLREZT7SWFKTVEL5E5ANCNFSM5TA5GAEQ>.
You are receiving this because you were mentioned.
|
I work under Linux Debian, and the current version in Debian stable is GCC 5.4.0. |
That looks like it was a typo -- it squashes the checksum down to a single bit of information, when it looks like it intended to roll it right one bit, so the final checksum ends up either zero or one larger than the last character in the data: Lines 130 to 149 in df87b36
Maybe it was supposed to be
That's what they use in grblHAL: https://github.com/grblHAL/core/blob/3a84b58d301f04279268b4ef1045fd6bc0961be5/nuts_bolts.c#L267-L278 |
Very old subject... Already discussed in 2017 here : |
I have tried to compile it for the Arduino Mega 2560 and Ramps 1.4 Board.
I changed the in the Config.h:
#include "grbl.h" // For Arduino IDE compatibility.
// Define CPU pin map and default settings.
// NOTE: OEMs can avoid the need to maintain/update the defaults.h and cpu_map.h files and use only
// one configuration file by placing their specific defaults and pin map at the bottom of this file.
// If doing so, simply comment out these two defines and see instructions below.
#define DEFAULTS_GENERIC
#define CPU_MAP_2560_INITIAL
// To use with RAMPS 1.4 Board, comment out the above defines and uncomment the next two defines
//#define DEFAULTS_RAMPS_BOARD
#define CPU_MAP_2560_RAMPS_BOARD
Is that correct?
After that , with make in the Terminal:
avr-gcc -Wall -Os -DF_CPU=16000000L -mmcu=atmega2560 -I. -ffunction-sections -flto -MMD -MP -c grbl/main.c -o build/main.o
In file included from grbl/grbl.h:47,
from grbl/main.c:22:
grbl/cpu_map.h:160: warning: "STEP_DDR" redefined
160 | #define STEP_DDR(i) DDR(STEP_PORT##i)
|
In file included from grbl/grbl.h:47,
from grbl/main.c:22:
grbl/cpu_map.h:36: note: this is the location of the previous definition
36 | #define STEP_DDR DDRA
|
In file included from grbl/grbl.h:47,
from grbl/main.c:22:
grbl/cpu_map.h:162: warning: "STEP_PORT" redefined
162 | #define STEP_PORT(i) _STEP_PORT(i)
|
In file included from grbl/grbl.h:47,
from grbl/main.c:22:
grbl/cpu_map.h:37: note: this is the location of the previous definition
37 | #define STEP_PORT PORTA
|
In file included from grbl/grbl.h:47,
from grbl/main.c:22:
grbl/cpu_map.h:163: warning: "STEP_PIN" redefined
163 | #define STEP_PIN(i) PIN(STEP_PORT##i)
|
In file included from grbl/grbl.h:47,
from grbl/main.c:22:
grbl/cpu_map.h:38: note: this is the location of the previous definition
38 | #define STEP_PIN PINA
|
In file included from grbl/grbl.h:47,
from grbl/main.c:22:
grbl/cpu_map.h:174: warning: "DIRECTION_DDR" redefined
174 | #define DIRECTION_DDR(i) DDR(DIRECTION_PORT##i)
|
In file included from grbl/grbl.h:47,
from grbl/main.c:22:
grbl/cpu_map.h:45: note: this is the location of the previous definition
45 | #define DIRECTION_DDR DDRC
|
and so on. Any ideas?
The text was updated successfully, but these errors were encountered: