Skip to content

Electronics Setup

Electronics setup

Once you have the Klipper stack up and running, you may proceed with its configuration.

Configuration consists mainly of:

  • Flashing Klipper to your CNC boards.
  • Assigning the correct pin names to stepper motors, endstops, or other electronic components connected to the robot's micro-controller units (MCUs).
  • Setting the machine's motion limits.

Note

This guide is aimed at advanced makers, engineers, or wisepeople that know what they are doing.

Firmware

This section holds instructions to compile and install Klipper on a controller board (a.k.a MCU).

Before you start, stop the Klipper service:

# If using systemd:
sudo systemctl stop klipper.service

# If using the user unit:
# systemctl --user stop klipper.service

# Older systems use "service".
# sudo service klipper stop

Info

More details available at Klipper's documentation.

Select a board

On the Raspberry Pi, run the following commands:

cd ~/klipper/
make menuconfig
  1. In the menu that appears, select the microprocessor that corresponds to your Arduino.
    • For the Duet2 WiFi, select the SAM3/SAM4/SAM E70 (Due and Duet) architecture, and the SAM4e8e (Duet Wifi/Eth) processor model, and you're done.
    • For Arduino UNO boards, select the Atmega AVR architecture, and the atmega328p processor model.
    • Additionally, enable the Enable extra low-level configuration options, and enter the Optional features (to reduce code size) menu.
    • There, uncheck all options. Then press ESC to return to the main menu.
    • If you find errors, read the troubleshooting section.
    • For Arduino MEGA boards, select the Atmega AVR architecture, and the atmega2560 processor model.
  2. Press q and then y to exit the application and save the configuration.
    • This will create a .config file.

Compile the firmware

Run the following command to compile the firmware:

# Compile the firmware.
make
Problem: error compiling for the Arduino UNO

Have you encountered an error while flashing for the Arduino UNO similar to the following?

/usr/lib/gcc/avr/5.4.0/../../../avr/bin/ld: address 0x800931 of out/klipper.elf section `.bss' is not within region `data'

If so, head to the troubleshooting section below.

Identify the boards

Before flashing the firmware, we need to identify which "serial devices" correspond to the boards connected to the Raspberry Pi (or Linux PC).

First connect the Raspberry Pi to the controller board with a suitable USB cable:

  • Arduino UNO / Arduino MEGA: USB-A to USB-B cable.
  • Duet2: USB-A to Micro-USB cable.

The following commands will list the serial device IDs of all connected USB devices:

# List MCUs by ID.
ls -l /dev/serial/by-id/

# You can also try listing MCUs by path.
# ls -l /dev/serial/by-path/

Now identify the device ID for your MCU. Here are some examples of what yours may look like:

  • Original Arduino UNO: usb-Arduino__www.arduino.cc__0043_557303238313513132A0-if00.
  • UNO "clone": usb-1a86_USB_Serial-if00-port0.
  • Duet 2 WiFi: usb-Klipper_sam4e8e_00323053354B50483031303332303133-if00

Tip

An easy way to be sure about which ID corresponds to each connected device is to compare the output of the ls -l /dev/serial/by-id/ command before and after plugging it through USB.

There should be a new device listed in after connecting a board which is not found before. That one should be the device you just plugged in.

Problem: device not listed

If no devices are listed, try resetting the boards or changing the USB cable.

We have found that some boards do not like low-quality USB cables, and can fail to be recognized by the OS.

Running sudo dmesg -w and reconnecting the board may reveal connection issues.

Problem: duplicate IDs

Arduino clones may have identical IDs, which will conflict with each other if more than one is connected simultaneously. In this case, list them by path by using the second command above, and replace /dev/serial/by-id/ with /dev/serial/by-path/ in the commands above.

Install the firmware

  1. Run the following command, replacing YOUR-BOARD-ID with the serial device ID of your board, once for each MCU:
make flash FLASH_DEVICE=/dev/serial/by-id/YOUR-BOARD-ID
Problem: error flashing to the Duet2

Have you encountered this error while flashing Klipper on a Duet 2?

No device found on /dev/serial/by-id/usb-Duet3D_Duet-if00
Failed to flash to /dev/serial/by-id/usb-Duet3D_Duet-if00: Error running bossac
make: * [src/atsam/Makefile:63: flash] Error 255

If so, read the troubleshooting section here.

  1. Restart the Klipper service:
# If using systemd:
sudo systemctl start klipper.service

# If using the user unit:
# systemctl --user start klipper.service

# Older systems use "service".
# sudo service klipper start
  1. Open Mainsail and check that Klippy has connected to the MCUs successfully (e.g. visit your Pi's IP address, or try http://raspberrypi.local if mDNS/Avahi/zeroconf is enabled and working in your network and computer).

Using a different board

The procedure to use a different controller board is almost identical, as long as Klipper supports its microcontroller.

You would need to:

  1. Select the appropriate MCU with the make menuconfig application.
  2. Update all pins in the Klipper configuration files to match your board's connections.
    • If the MCU on your board is supported by klipper, you will find most of the pin assignments pre-configured in the Klipper example configurations forlder. Use these as a base.
    • To fine-tune and check pin assignments, read the connections section.
Running an OT2 with Klipper

You can definitely install Klipper on existing robots, such as the smoothieboard on an OT2, and use it with Pipettin's software.

Sounds fun! Let us know if you want help with this.

Connections

Connecting boards to motors and limit switches (a.k.a. endstops) is a critical step. Failing to connect them properly will damage your electronics.

Here are a few pieces of advice, before you start:

  • Completely remove power from the controller boards before connecting or disconnecting any motor. Else, you may destroy your stepper motor drivers.
  • Each board is different. Triple-check the polarity and wiring of your cables, such that they match the pinout on the controller board. Else, you may damage or destroy your controller board.

Pin names

Klipper uses microcontroller pin names, which is a generic way to address pins regardless on which board they are mounted.

Here we provide a short list of resources to help match these MCU pin names to the labels found on the controller boards:

Handy aliases for pin names can be included in a Klipper config file. Aliases help reference pins by more readable names, that also relate to the lables on actual CNC boards (instead of unrecognizable microcontroller pin names).

Pin maps

The pin aliases and the pin map below are for the Arduino CNC-Shield v3.0:

cnc shield pin map

Wiring

Overall, we wire the motors and endstops by following the lables on the controller boards, when available. Refer to the documentation of you board's manufacturer, linked in the pin names section.

Example

For example, connect the X-axis stepper to the 4-pin connector labeled "X-axis", and it's endstop to the connector the corresponding label.

Considerations for the CNC shield:

  • Add jumpers to configure an independent "A" axis. Note that this reuses SpinDir and SpinEn (PB4), to Adir (PB5) and Astep (PB4) respectively.
    • This means that they can not be used for something else; instead use a free adjacent pin.
  • Connect the remote actuator's motor to the A axis.
  • Connect and configure the endstop of the remote actuator using one of the available analog pins (A0-A5).
    • For example, we used the "Coolant Enable" pin, which corresponds to PC3 / A3.
  • Set the heater pins to unused pins on the CNC shield.
    • For example, we used the SDA and SCL pins (PC4/A4 and PC5/A5, respectively).
    • These pins need to be configured, but are not actually used by a non-heating extruder like syringes.
CNC shield: jumpers for independent A-axis

Add a pair of jumpers to the A-axis configuration header, in the lower position.

a-axis jumpers

Considerations for the RAMPS board:

Microstepping:

  • On CNC shield and RAMPS boards, add jumpers to set microstepping to ⅛ or 1/16, according to your drivers, and update the configurations.
    • See the pin map above, and the Last Minute Engineer guides for A4988 and DRV8825 stepper drivers.
  • On the duet, the microstepping values on TMC drivers are set through software, and read from the configuration files.
  • Using higher microstepping values may introduce issues (e.g. lower torque or MCU overloading), and may also not introduce any appreciable increase in precision, which depends on the quality of the stepper motor, the mechanics of the actuator, and the load.
CNC shield: microstepping jumpers

Add two jumpers to the microstepping configuration pins at each stepper driver slot of the CNC shield, as shown on the image below. This will set ⅛th microstepping on each driver.

These pins right under the capacitors, and will be hidden under the stepper drivers if they are already in place.

alt text

Considerations for the Duet2 and RAMPS boards:

  • Connect the motors to their corresponding connectors on the board, as indicated by the lables written on them.
  • Use the matching base configurations provided by Klipper's example configs.
    • Use E0 for the remote actuator, and E1 for the pipette.
    • As before, heater and sensor pins for "extruder axes" need to be defined in the configuration, but will not be physically connected to anything (when using pipette tools).

Configure the CNC firmware

For this section, you'll need:

  • Control boards with Klipper firmware installed.
  • A Raspberry Pi set-up and running, and its current IP address.
  • Electronic connections between the boards and motors, limit-switches, etc.

Before making changes to the configuration, study the following documentation:

Base configuration

Each version of the robot has a defined set of Klipper configuration files. You can get them from the configs folder at the main repository.

Because you may have already downloaded the main repository to a directory named pipettin-bot at the home folder, those configurations should already be available to you locally at ~/pipettin-bot/code/klipper-setup/configs/.

Look for README.md files in those directories, and the wisdom within.

Disclaimer

We provide these configurations as a base, but checking that they are correct is up to you.

Brief setup instructions follow:

  1. Copy the base configurations to ~/printer_data/config with the following command: cp -r ~/pipettin-bot/code/klipper-setup/configs/* ~/printer_data/config/
  2. Edit the ~/printer_data/printer.cfg file to select a base configuration that is closest to the robot you are building (e.g. 2x-CNC-Shield, Duet 2 Wifi, single-tool, multi-tool, etc.).
  3. Make changes to the base configurations, if needed, by editing the files inside the selected folder.
Uploading configs through Mainsail

You can also open Mainsail in your browser and upload them on a folder on the MACHINE menu. We also recommend to have your own folder in order to create a copy of the following files. By doing that, you can modify them freely and keep a backup.

folder_name.png

To select a base configuration, you may open the main printer.cfg file (i.e. the one at the top-level directory in Mainsail) and "include" the path of a secondary printer.cfg file that resides in the folder of the configuration set you selected.

To include a base configuration, add a line to the main printer.cfg file looking like this:

[include folder_name/printer.cfg]
Using comments to disable configs

If there are other lines including printer.cfg files from other subdirectories, you must comment them out by adding a # symbol, as shown below.

# [include an_old_config/printer.cfg] # Commented out.
[include new_shiny_config/printer.cfg]

Only one printer.cfg file must be included here, unless two or more boards are connected and in use.

Follow Klipper's configuration check guide to help confirm the pin settings. Skip the temperature-related checks unless you are actually using plastic extruders or heated beds.

Advanced configuration

This section provides brief explanations of the main configuration sections.

For a more comprehensive understanding, we highly recommend referring to Klipper's Configuration Reference as it was our source of information for this setup.

Because we have forked Klipper for this project, a few configuration options (e.g. extruder_home) are only documented in the klipper-for-cnc repository at GitLab.

printer.cfg

This file is the central configuration file, it's commonly used to define fundamental settings for your robot.

Here you may, for example, specify your machine's kinematics (e.g. cartesian_abc), withing in the [printer] section of the file.

The remaining configuration options have been organized into different files, which must be "included" in order to have an effect.

Additional configuration files are included with the following syntax:

[include some_subdirectory/file_name.cfg]
mcu

You must add the paths of the serial devices of each controller board in [mcu] sections.

If we used two Arduino boards, we would include both of them as shown below:

[mcu] # main mcu, used for the XYZ axes.
serial: /dev/serial/by-id/arduino_id_1  # <-- update this value with yours

[mcu tools] # second mcu, used for the tools.
serial: /dev/serial/by-id/arduino_id_2  # <-- update this value with yours

You can obtain the MCU IDs with the ls -l /dev/serial/by-id/ command, as previously explained.

stepper

This section defines settings for different stepper motors (X, Y, Y1, and Z) and end-stops that control the movement of different axes. Each [stepper_...] section contains specific parameters to the corresponding motor configuration.

The pin configuration in this file must reflect exactly the connections made in the electronics assembly guide (specifically the stepper motor and endstop connections sections).

Note

Aways triple-check pin assignments and connections before powering on the machine.

We've set aside files specifically to configure the stepper motors and end-stops for the micropipette tools, which are configured as "extruders". They contain essentially the same settings as the steppers_xyz.cfg files.

The key distinction lies in the specific pin referencing method required here, because the tools may be connected to a "secondary" MCU.

As mentioned in the mcu section, the second MCU is labeled as [mcu tools]. Since we've connected the tools' electronics to this second Arduino, the pin referencing should follow this syntax:

step_pin: tools:PD4  # Set the step pin to PD4 from the "tools" MCU.

Note

Note the addition of "tools:" right before the pin's name (PD4). This indicates that the pin is on the tools MCU, and not on the main MCU.

extruder

The [extruder] sections define steppers that associate to the E axis in GCODE commands.

They also define pins for temperature control, that we will not be connecting to any sensor or heater, in the case of pipette tools For this reason we need to disable tempearture checks in all [extruder] sections.

We also need to disable some features related to plastic extrusion, around speed and other limits.

Here is an example of these overrides: stepper_remote.cfg

Note the following changes:

# Override temperature limits.
min_temp: -273.15
max_temp: 999999
min_extrude_temp: -273.15

# Override motion limits.
max_extrude_only_distance: 300
max_extrude_cross_section: 100
max_extrude_only_velocity: 2.0

Homing parameters are also required:

# Homing stuff
position_endstop: 9.8
position_min: 0.0    # LIMITS ARE ENFORCED
position_max: 9.8  # LIMITS ARE ENFORCED
homing_speed: 2.0
endstop_pin: ^!PC3 # PC3 is Coolant Enable.
gcode_macro

The gcode_macro sections are used to define custom commands. For example, to set origins, homing axes, switching between tools, etc.

Klipper macros

In Klipper, a macro refers to a sequence of predefined commands grouped together under a single name. These macros simplify complex operations by allowing users to execute a series of commands with a single line of code.

Essentially, instead of manually inputting numerous individual commands every time a specific action is needed, a macro condenses these commands into a single command, making it easier to perform repetitive tasks or abstract complex actions.

We define a few important macros related to:

Here is an example macro that homes axes in a particular order:

# Some macros may be required by the "piper" controller module.
[gcode_macro HOME_ALL]
gcode:
  G28 Y
  G28 Z
  G28 X
  HOME_E0
  HOME_E1

Note

We use macro variables like active for different extruders for managing the state or status of each extruder.

extruder_home

This section sets the homing configuration for homing extruder stepper motors. It defines macros and configurations for homing two different "extruders": extruder (tool 0), extruder1 (tool 1), and so on.

These are accompanied by tool-homin macros, next to each tool's [extruder] definition.

An example homing configuration for the remote stepper is available.

Example:

# Enable extruder stepper homing commands for the remote actuator.
[extruder_home extruder]

[gcode_macro HOME_T0]
description: Homing macro for the main extruder (tool T0).
gcode:
  # Select tool T0.
  T0
  # Home the extruder.
  HOME_EXTRUDER EXTRUDER=extruder
mainsail

The mainsail.cfg file is a configuration file for Mainsail, a web font-end to Moonraker and Klipper.

This file defines various custom G-code macros and settings to control how your robot behaves during certain events such as pausing, resuming, canceling prints, or moving the extruder. If these macros are not included, several harmless warnings will appear.

We recommend not making any modifications to this file.

Custom mainsail.cfg

Unfortunately Mainsail overrides basic commands and uses custom GCODE macros in ways that do not make sense for generic robots (e.g. CANCEL_PRINT, PAUSE, and RESUME overrides, and _CLIENT_EXTRUDE macros for manual extrusions).

We have modified this file to avoid problems with those overrides, saved as not-mainsail.cfg.

Current adjustment

In stepper driver circuits, the "reference voltage" limits the maximum current, protecting the motors from overheating. This comes at the cost of reduced torque, which may cause loss of steps in situations requiring it (e.g. when changing tools, placing tips, high acceleration,etc.).

The reference voltage (Vref) in a stepper driver is what limits current flow through your steppers.

The main trade-off here is the following:

  • Limiting the current is a good idea! Their coils will be damaged by the excess heat produced by excess current. Furthermore, the 3D-printed supports for the steppers may waken or deform under this heat.

  • However, a lower current limit will cause loss of steps during high-force moves (i.e. docking tools and placing/ejecting tips).

How hot is too hot

How hot is too hot for a stepper motor?

If you can keep your fingers on it, then it's not bad for the stepper. This is around 60ºC which is not terrible for a motor, but it will tend to soften 3D-printed parts.

Any plastic parts will become softer and probably warp over time if exposed to minor heat, and deform immediately if the stepper is too hot.

In some versions of the robot, the steppers are secured to the structure using 3D-printed parts. Excess temperature will deform or even melt the plastic parts, so limiting the current may be a great idea in the mid-term.

Consider lowering the current limit on the stepper motor drivers by:

Learn more over here: https://3dprinting.stackexchange.com/a/8485

Check connections

A few checks before powering anything on:

  • Logic: triple-check all connections to endstops and sensors (voltages, polarity, etc.). Any accidental shorts will cause damage to your electronics.
  • Power: triple-check all power connections (voltages, polarity, etc.), ensuring that nothing will catch fire or explode.

Disclaimer

Failing to connect things properly will damage your boards, set something on fire, or possibly harm you. These guides are provided as is, with no guarantees, and you are responsible for their use.

Pololu drivers

The current limit in the A4988 and DRV8825 divers can be changed by setting their "reference voltage" (i.e. Vref) to an appropriate value.

You'll need:

  • The resistance value of the "sense resistor" on the driver (a.k.a. rsense or Rs).
  • A multimeter with fine probes (not crocs).
  • A small screwdriver.
  • The current limit of your steppers.
  • Patience.

Warning

Even though A4988 drivers are sold under the same name, there are several variants each with different rs values.

The procedure involves:

  1. Choosing a current limit: Imax (from your motor ratings)
  2. Figuring out the value of the sense resistor: rs (guides linked below)
  3. Calculating the target voltage value: Vref (equation below)
  4. Measuring the present Vref voltage.
  5. Turning the adjustment screw on the driver.
  6. Repeat steps 3 and 4 until the measured Vref matches the calculated target Vref.

The formula for the reference voltage is the following:

Vref = Imax x (8 x rs)

Tip

The all3DP and E3D guides are very helpful:

Warning

When using the multimeter, be very careful not to touch or short any other pins or components on the controller.

Follow these steps to adjust the reference voltage:

  1. Find the maximum current rating of your stepper motors in their specifications or datasheets. Choose a lower target current (e.g. 25% of maximum).
  2. Calculate the reference voltage (Vref) for your particular stepper drivers and motors (e.g. A4988, DRV8225, and others).
  3. Locate the Vref adjustment potentiometer on the drivers.
  4. Connect the controller board to the power supply and turn it on.
  5. Probe the driver's GND pin with the negative end of a multimeter.
  6. Probe potentiometer with the positive end of a multimeter.
  7. Note the voltage value measured by the multimeter. This is the present valof the reference voltage (Vref).
  8. Turn the potentiometer using a small screwdriver to change the reference voltage, and make a new measurement.
    • You can also connect the positive end of the multimeter to the screwdriver's shaft, and make the adjustment while reading out the voltage on the multimeter simultaneously.
  9. Repeat steps 5-8 until the Vref readout matches the target value calculated previously.
  10. In the future remember to check the temperature of the motors. Lower the Vref if its too high.

Tip

If the voltage reading is 0, you may need to connect the microcontroller (in this case an Arduino) to a USB power supply as well.

Tip

If steps are lost at the maximum Vref/current setting, use larger stepper motors. Also consider using a PSU with a voltage that is close to the driver's maximum voltage rating. This helps them produce sharper steps.

01_print_post11.png

TMC drivers

Current limits on the TMC drivers can be set by firmware configuration.

Klipper can set the current limit on TMC drivers. Lots of information can be found here.

TMC2660 drivers are found, for example, in the Duet2 WiFi board that we use in one variant of the Pipettin Bot. To set the current limit, edit the Klipper configuration files accordingly. For example:

[tmc2660 stepper_x]
run_current: 1.25A
#idle_current_percent: 50

Tip

Additonally, it is important to set a "hold current" (or "idle_current_percent") that is high enough. Low hold currents may cause step skipping.

The A4988 and DRV8825 drivers do not have this feature, and will constantly draw full power when enabled. Read more about this here.

End-stop adjustments

Endstops are a switch or trigger that is placed at the zero position of each axis so that the a CNC machine knows when the zero position is reached for a given axis.

An endstop is a reference point that can turn relative motion to absolute motion:

  • In version MK3 of the robot, these sense the maximum position of each axis on the motion system and tool-changer remote actuator.
  • On pipette tools, the endstop's position corresponds to the zero coordinate instead. This is such that an extrusion/dispense move occurs in the positive direction of the tool's coordinate system.

The status of each endstop can be monitored through Mainsail, in the "Machine" tab. As oyu make changes and test them, hit the refresh button.

query_probe_endstops

Adjustments for the motion system endstops:

  • The configuration of end-stops (e.g. active low/high, pull-up/pull-down resistors).
  • The mount points of all end-stops, such that they trigger properly.
  • The set-screw and nut on the Z-axis that triggers its end-stop.

Adjustments for the tool endstops:

  • The configuration of end-stops (e.g. active low/high, pull-up/pull-down resistors).
  • The position of the tool's main endstop. Not too high (as it would leak) and not too low (loss of range).
  • Tip sensor endstops (if any, as found in the Gilson pipette adapter).
  • Parking post sensors (if any, as found in the old MK0 prototype of the robot).

Tests

Electronics tests

TO DO

A guide is due.

  • Motors.
  • Direction.
  • End-stops.
  • Klipper: use mainsail to check that endstops are triggered when they should (e.g. check their state and trigger them manually).
  • Update CNC configuration if necessary.

To test motor connections

Motion tests

Warning

A guide is due.

  • Set the origin by software (avoid homing moves at this stage).
  • Send some commands for small displacements (e.g. G1 X1), check that they turn in the expected directions.
  • Double check the end-stops, parking sensors, or probe sensors.
  • Home the axes one at a time (e.g. G28 X). Hold you finger above the emergency stop button, just in case.
  • Test torque with a tool-change.

Next steps

Congrats! You've setup the firmware for your robot. That was tough!

You may now:

Troubleshooting

Error while flashing: "address is not within region"

Have you encountered an error while flashing for the Arduino UNO similar to the following?

/usr/lib/gcc/avr/5.4.0/../../../avr/bin/ld: address 0x800931 of out/klipper.elf section `.bss' is not within region `data'

This is because Klipper has not kept up with newer OS libraries, which have made the firmware too large for the Arduino UNO.

We track this problem at this issue, and a workaround has been found here.

To fix this, we need to disable the features we don't need in the .config file, thereby making the firmware smaller.

Note

The .config file is created by the make config config, and does not exist before running it.

Manually edit the .config file in the klipper directory, such that it reads the following:

CONFIG_WANT_GPIO_BITBANGING=n
CONFIG_WANT_DISPLAYS=n
CONFIG_WANT_SENSORS=n
CONFIG_WANT_LIS2DW=n
CONFIG_WANT_SOFTWARE_I2C=n
CONFIG_WANT_SOFTWARE_SPI=n

#
# Optional features (to reduce code size)
#
# end of Optional features (to reduce code size)

CONFIG_CANBUS_FREQUENCY=1000000
CONFIG_HAVE_GPIO=y
CONFIG_HAVE_GPIO_ADC=n
CONFIG_HAVE_GPIO_SPI=y
CONFIG_HAVE_GPIO_I2C=y
CONFIG_HAVE_GPIO_HARD_PWM=y
CONFIG_HAVE_STRICT_TIMING=y
CONFIG_HAVE_LIMITED_CODE_SIZE=y
CONFIG_INLINE_STEPPER_HACK=y

Finally, run make clean and try running make once more.

Note

Even if you disabled all optional features in make menuconfig, some of the edits above are needed anyway. I had to disable CONFIG_HAVE_GPIO_SPI and CONFIG_HAVE_GPIO_I2C, for it to compile. Note that disabling CONFIG_HAVE_GPIO_ADC, which is ok since the UNO does not have GPIO ADC pins, causes a "protocol error" later on with the message Firmware constant 'ADC_MAX' not found.

Lost communication with MCU

This might be due to:

  • Poor power supply on the Raspberry Pi.
  • Bad USB cables.
  • Interference issues (EMI) due to nearby electronics or motor/Pi power supply.
  • Obscure USB connection issues that do now show up on dmesg.
  • Check the bytes_retransmit count in the klipper logfile. If its high, there is a connection quality issue.

There are some guides on this already:

Actions yo may take:

  • Check the links above,
  • Try reducing the baudrate (first in make menuconfig, then re-flash, and set it in the printer.cfg file too).
  • To check if its the Pi's fault, or something else, try connecting the MCU to a PC with Klipper setup (guide here).
  • If you're unable to resolve this, try another Pi, or use a PC.

Error while flashing: "Error running bossac"

This error may show up when running make flash on a Duet board, with more recent Raspbian distributions.

bossac-error

To flash Klipper to a Duet 2 Wifi board yo may need to:

  1. Compile Klipper for the Duet 2 WiFi, setting it to USB mode.
  2. Add a jumper between the "ERASE" pins on the Duet (image below).
  3. Press the RESET button.
  4. Remove the jumper.
  5. Flash Klipper using make flash.

We have some additional notes on flashing klipper on the Duet in GitLab, and a workaround for this issue exists.

jumper-cable-erase-pin-duet2

Duet2 disconnects after a firmware restart

Symptoms:

  • The Duet2 fails to connect, and is not listed under /dev/serial/by-id/
  • A firmware restart causes the Duet2 to not reconnect correctly, and Klipper fails to find it on the usual serial port.
  • In that state the ls -l /dev/serial/by-id/ command shows a Duet2 board with an incomplete name (e.g. usb-Klipper_sam4e8e_00313753595252533136303532303436-if00 instead of usb-Klipper_sam4e8e_00313753595252533136303532303436-if00)
  • The sudo dmesg -w command shows warnings about not being able to reset the Duet, or says unable to enumerate USB device.
  • The issue can be worked around by disconnecting the board from usb, and reconnecting it to a different USB port.

Solution:

  • Re-flash the firmware from another operating system.

Related Klipper issue: