Smoothie can be compiled using GCC.
First of all, get Smoothie’s source.
You do not need to do any of this if you just want to use your board. This is only needed if you want the absolute latest firmware, or are modifying Smoothie’s source.
V1 Compilation: For Smoothieware v1 running on the LPC1769 platform, follow the guide below.
V2 Compilation: For Smoothieware v2 running on the STM32H745 platform, the build system and process differ from v1. See the version-specific sections below.
To compile smoothie, you need a toolchain (a compiler, a linker, etc…).
V1 Toolchain:
Smoothie V1 provides install scripts to automatically install a working toolchain.
V2 Toolchain:
Smoothie V2 requires a specific GCC version (10.3.1). Do NOT use newer or older versions, as the firmware depends on specific compiler behavior.
V1 Installation:
Go into the Smoothie folder, then run the install script appropriate for your platform:
win_install.cmdmac_installlinux_installThis will download and install a working toolchain.
The toolchain requires a 32-bit environment to run in…
In Ubuntu Linux 64bit, you will also need to install libc6-dev-i386
You might also need to install the build-essential package.
You can then run the BuildShell script which will be created during the install to properly configure the PATH environment variable
In Linux or OSX:
./BuildShell
or you can take the appropriate directories and add them to your PATH through your existing environment configuration options/scripts.
V2 Installation:
V2 uses Rake (Ruby Make) as its build system, which requires:
For a specific platform, check the V2 repository build instructions, as toolchain setup varies by OS.
V1 Compilation:
Once BuildShell is created, you want to launch it, and compile all of the code that Smoothie consists of:
make clean all
The command “make clean all” will compile/recompile everything needed for Smoothie. The end result will be the file main.bin in the subfolder LPC1768.
V2 Compilation:
V2 uses Rake as the build system. Basic build commands:
rake target=Prime -m # Build for Smoothieboard v2 Prime
rake target=Prime debug=1 # Build with debug output
rake testing=1 -m # Build with unit tests
rake target=Prime testing=1 flash # Build and DFU flash to board
The output binary will be in smoothiev2_Prime/smoothiev2.bin (or respective target directory).
Available targets:
Prime: Smoothieboard v2 Prime (production board)Nucleo: NUCLEO-H745ZI-Q development boardDevebox: Devebox 743 development/testing board64-bit Linux Systems: If you are running a 64bit GNU/Linux system, you might get an error like this:
Compiling vendor/NXP/capi/analogin_api.c
make[[3|]]: arm-none-eabi-gcc : command not found
or
Compiling vendor/NXP/capi/analogout_api.c
arm-none-eabi-gcc: fatal error: cannot execute 'cc1': execvp: No such file or directory
This is because the toolchain is 32bit but your system is 64bit. To solve this you need to install the 32bit libraries on your system.
On Debian/Ubuntu:
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libc6:i386
For Fedora/RPM users:
sudo dnf install glibc.i686 zlib.i686
On older Debian/Ubuntu systems, you might need:
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install ia32-libs
or
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install lib32z1 lib32ncurses5
After this, the make command should work.
It is possible to compile Smoothie without having to install a compiler using the mBed online compiler, but please note that this only supports a very old version of Smoothie: Smoothie on Mbed
This is not at all a recommended method.
Windows sh.exe conflict: On Windows, if you get an error like process_begin: CreateProcess(NULL, echo Building src, ...) failed., this means that there is a sh.exe somewhere on your path (such as the one installed by the Windows GitHub client, or WINAVR) - this confuses GNU Make 3.81 into thinking you’re on a Unix-like system. Also make sure WinAVR is removed from your PATH. Any failures to build a clean source branch will be due to an environment problem in your windows shell and is NOT a bug.
One solution is to replace build\win32\make.exe with a copy of version 3.82 - downloaded from here, perhaps.
More information on the process of getting mBed code to compile with GCC can be found here (recommended read).
V1 Build Variants:
Building CNC version: If you are trying build the “CNC” version of Smoothie (with grbl_mode enabled by default and the special “CNC” control panel screen), you need to do:
make clean
make CNC=1
Building with extruders and spindle: If you are trying build a version of Smoothie that has extruders, temperature control and spindle, you need to do:
make clean
make INCLUDE_MODULE="tools/drillingcycles tools/spindle"
Building no-MSD version: To build the no-msd version of Smoothie (with Mass Storage over USB disabled, for example if your computer is abusing the interface by accessing it for no good reason, causing bugs), do:
make clean
make DISABLEMSD=1
Setting build defaults: If you want your branch to default to some things, let’s say for example you want your branch to build as CNC=1 without having to specify make CNC=1 each time you build, you can:
In the src directory create a file called default_excludes.mk and in that file add:
CNC=1
export EXCLUDE_MODULES = tools/laser tools/filamentdetector tools/scaracal tools/temperaturecontrol tools/extruder
V2 Build Variants:
For V2, module selection and build options are configured differently:
rake target=Prime modules=tools/spindle -m # Build with only spindle module
rake target=Prime nonetwork=1 -m # Build without network support
rake target=Prime debug=1 -m # Build with debug output
Configuration of enabled modules and features is primarily handled through the config.ini file at runtime, rather than build-time compilation flags. Check the V2 repository’s Rakefile for available build options.
V1: Flashing via SD Bootloader
If you are using a smoothieboard, the SD bootloader is already present.
If you are using an mBed please see here.
If you are using an LPCXpresso1769 then you must first install the SD bootloader.
Once it is compiled, then simply copy the generated .bin file to the SD card with the name firmware.bin, then reset and it will be flashed to the board automatically.
Example:
make
cp LPC1768/main.bin /media/smoothieboard-or-mbed/firmware.bin
V2: Multiple Flashing Methods
V2 provides several ways to flash firmware:
Method 1: SD Card (flashme.bin) - Safest, recommended for production
# Build and manually copy
rake target=Prime -m
cp smoothiev2_Prime/smoothiev2.bin /media/sdcard/flashme.bin
On boot, the board validates and auto-flashes if valid.
Method 2: DFU (Development) - For development and recovery
rake target=Prime flash
# Or manually:
dfu-util -a 0 -D smoothiev2_Prime/smoothiev2.bin --dfuse-address 0x08000000
Method 3: ST-Link - Alternative hardware programmer
STM32_Programmer_CLI -q -c port=usb1 -w smoothiev2_Prime/smoothiev2.bin 0x08000000 -rst
Method 4: Network Update - Over-the-air (OTA)
# Send command to board via Telnet/Web UI
update http://example.com/firmware.bin
Board downloads, validates (MD5), and flashes on next boot.
Detailed instructions can be found on the Flashing Smoothie page.
An alternative way to flash firmware is to use a utility called dfu-util.
DFU is not enabled by default, to use it you must add the following to your config file:
dfu_enable true # enable dfu
You can then use make upload to flash the new firmware, as long as smoothie is currently running.
If smoothie has crashed, then you can manually put the bootloader into DFU mode by:
Install using your package manager e.g. apt or homebrew.
C:\Program Files\dfu--util (or another location of your choice)make followed by make upload. dfu-util will detect your smoothieboard, which will reset into DFU mode. However, dfu-util will hang here.You should now be able to use make upload to flash smoothie.
For V2, DFU flashing is integrated into the build system and is used during development:
rake target=Prime flash
This automatically handles DFU mode entry and flashing. For manual DFU control, you can use dfu-util directly as shown in the flashing methods above.