-
Notifications
You must be signed in to change notification settings - Fork 296
Compiling and configuring G2 on Windows
Download and install MinGW, installation is covered here: Getting Started
Cygwin is another option to using MinGW, but is not currently covered here.
This provides you with the GNU build system that is required to compile many cross platform, embedded and open source projects. It also provides compilers for native code and much more.
You also need a copy of GNU tools for ARM embedded, which can be obtained here: GNU ARM Embedded
This provides you with the C and C++ cross compilers required to compile ARM code on your Windows machine. I strongly recommend you install this in a low-level folder without spaces to avoid problems.
Note: I will be using _C:\GTAE54_ for all further illustrations.
Clarification: There is a bug in this toolsuite that under some circumstances (advanced optimization) will fail linking with an error unless the folder name is short and has no spaces or other characters that will need to be escaped when parameter passed between programs. The G2 project will not trigger this bug regardless of where you choose to install, but heeding the warning may save you headaches in the future.
If you are familiar with Git, simply clone the repository into a local folder - but remember there are submodules.
If you do not want to use Git, you can just download any repository as a .zip file:
Go to the G2 repository and click Clone or download, then Download ZIP and unpack that file to a local folder. Click the Motate submodule and repeat the process. The Motate folder should go in the G2 folder such that your local folder content matches that of the G2 repository.
Note: I will be using _C:\cnc\g2_ for all further illustrations. You may use any folder you like.
Looking in C:\cnc\g2\Motate\Tools\win32, the folder should be empty at this time.
You need to create a folder here called gcc-arm-none-eabi which contains the ARM toolchain to use when compiling G2. There are two ways to do this: symlink or a simple copy.
As for the copy method, simply copy your GNU tools for ARM embedded folder to C:\cnc\g2\Motate\Tools\win32 and name it gcc-arm-none-eabi.
The symlink method involves creating a link that looks like a folder but actually just references another folder.
Start an administrator command prompt and navigate to C:\cnc\g2\Motate\Tools\win32 and run mklink /D gcc-arm-none-eabi C:\GTAE54
Open a command prompt and navigate to _c:\cnc\g2\g2core_.
Run make CONFIG=Othermill
You should now have a binary at c:\cnc\g2\g2core\bin\Othermill-g2v9k\g2core.bin
'make' is not recognized as an internal or external command,
operable program or batch file.
There is a problem with your MinGW installation, or your PATH environment variable is not properly set up. Please consult the MinGW getting started article again.
... && make "ARCH=gcc-arm-none-eabi"
/usr/bin/bash: make: command not found
You have not set up your symlink/copy of the ARM toolchain, please refer to the previous chapter.
Open c:\cnc\g2\g2core\boards.mk in your favorite text editor.
Here you will find a list of all available configurations for use with the make CONFIG=
command.
When you have a standard machine and just want to tweak things a bit.
Open c:\cnc\g2\g2core\settings\settings-<YourMachine>.h in your favorite text editor and change the settings.
After you make your changes, just re-compile and upload to the board to test it out.
When you have connected a custom built or heavily modified machine to a supported board.
Open c:\cnc\g2\g2core\boards.mk.
Looking at the existing configurations, choose a board to use as a template and make a copy of it. Right underneath is fine.
Name your configuration by editing this line: ifeq ("$(CONFIG)","MyNewMachine")
Change the settings file by editing this line: SETTINGS_FILE="settings_MyNewMachine.h"
You may now make a copy of the original settings file in _c:\cnc\g2\g2core\settings_ and modify that according to your hearts desires.
When it is time to compile, you can now make CONFIG=MyNewMachine
When you have have built your own custom controller or shield.
Change the board name by editing this line: BOARD=MyCustomBoard
Open c:\cnc\g2\g2core\board\ArduinoDue.mk.
Looking at the existing boards, choose your template and make a copy of it.
Name your board by: ifeq ("$(BOARD)","MyCustomBoard")
Change pinout file by: DEVICE_DEFINES += MOTATE_BOARD="MyCustomBoard"
You may now make a copy of the original pinout file in c:\cnc\g2\g2core\board\ArduinoDue and modify that according to your custom board.
Getting Started Pages
- Home
- What is g2core?
- Who uses g2core?
- Jerk-Controlled Motion
- Getting Started with g2core
- Connecting to g2core
- Configuring g2core
- Flashing g2core
- Troubleshooting
Reference Pages
- Gcodes
- Mcodes
- Text Mode
- JSON Communications
- GPIO Digital IO
- Alarms & Exceptions
- Power Management
- Coordinate Systems
- Status Reports
- Status Codes
- G2 Communications
- Tool Offsets and Selection
- Probing
- Feedhold, Resume, Job Kill
- Marlin Compatibility
- 9 Axis UVW Operation
- gQuintic Specs
Discussion Topics
- Roadmap
- GPIO for 1.X Releases
- Toolheads
- Raster Streaming Prototol
- g2core REST Interface
- Gcode Parsing
- G2 3DP Dialect
- Consensus Gcode
- Digital DRO
- Overview of Motion Processing
Developer Pages
- Development & Contribution
- Branching and Release - DRAFT
- Getting Started with g2core Development
- Project Structure & Motate
- Compiling G2
- OSX w/Xcode
- OSX/Linux Command Line
- Windows10 w/AtmelStudio7
- Debugging G2 on OSX
- Board and Machine Profiles
- Arduino Due Pinout
- Arduino DUE External Interfaces
- Diagnostics
- Debugging w/Motate Pins
- Development Troubleshooting
- g2core Communications
- Git Procedures
- Windows 10 / VMware 8 Issues
- Dual Endpoint USB Internals
- G2core License
- VSCode Setup
- Compatibility Axioms
- Wiki History