Try to make it more clear that Discord is not Discourse, as the two
similarly sounding services are often confused by users unfamiliar
with them.
The Klipper Discourse and Klipper Discord are available for many
topics related to Klipper - reword some sections to make their use
more open.
Avoid referring to the Klipper github repo in this Contact document as
we no longer use Klipper github issues at all.
Remove the table of contents as it is largely redundant for the
document.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Use two different files for the Octopus Pro and Octopus (non-Pro).
The configs are the same in practice, but the difference in version
and naming can lead to confusion.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This reverts commit 6749985302.
A defect was found in the above commit (the input shaper code calls
note_step_generateion_scan_time() for many steppers, so the
input_shaper class can't be used as the index).
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
In the "Verify endstops" section there is an example of adding an
exclamation point to the pin definition to invert its logic. I
believe the intention in the example is to keep the hardware pull-up
^ and follow it with ! to invert the pin logic, but the ! is missing.
Signed-off-by: Tom Dunn <thomas.dunn@gmail.com>
The atsam USB hardware only requires that the ACM endpoint be endpoint
3. As of commit 11828387 the atsam chips can therefore use the
default USB endpoints.
This will allow CAN bridge support for the SAME70 to function
(upstream host driver has hardcoded endpoints).
Signed-off-by: Alex Maclean <monkeh@monkeh.net>
Recently tested on my ender 5 pro that came from creality with a v1.1.5 board. Works. Tested all endstops, motors, and heaters.
Signed-off-by: Jake Aronleigh <jakestar98@outlook.com>
Wait for two tx packets before startup, and make sure one of those
packets is acked before sending a third tx packet.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Klipper logs an error on a failed CANbus write. Unfortunately, if the
bus becomes permanently disabled (eg, due to a user removing power to
devices on the CANbus) then it can result in the logs filling with
error messages.
Permanently disable the low-level processing of messages if CANbus
writes continually fail for at least 10 seconds. This avoids filling
the log with redundant messages.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Commit cd8d57c2 added USB double buffering mode on transmits.
However, when enabling double buffering mode, the hardware seems to
always send at least two packets. Spurious transmissions could cause
the Linux gs_usb driver to get confused, which could lead to the can0
device becoming unavailable on restarts. Fix by waiting for two USB
packets to be available before enabling the endpoint.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The bulk out endpoint should not be enabled in tx mode, and the bulk
in endpoint should not be enabled in rx mode.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Prioritize sending responses back to the host over transmitting new
messages from the host. Otherwise, the gs_usb host usb
acknowledgments could saturate the usb bandwidth for extended periods.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Read USB messages arriving from the host into a queue. This makes it
less likely that USB "bulk out" packets will be NAK'ed on the USB bus,
which improves USB bus utilization.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Copy the code for these two functions to their respective callers.
This is in preparation for double buffer support.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Add helper functions for manipulating the buffer memory and packet
control registers. This is in preparation for double buffer support.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Implement the usbfs fast buffer switching mechanism on the "bulk in"
endpoint. This can improve the overall USB throughput and bus
utilization.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Implement the usbfs fast buffer switching mechanism on the "bulk out"
endpoint. This can improve the overall USB throughput and bus
utilization.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The usbfs device supports two buffers for each endpoint - typically
one for rx and one for tx. Add support for explicit handling of both
buffers. This is in preparation for improved "double buffering"
support.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Replace the set_stat_x_bits() functions with a single calc_epr_bits()
function. This new function supports setting bits other than the stat
field in the epr register.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Add support for can2040_stop()
Add data_state_go_error() helper
Add new can2040_get_statistics() API function
Call report_note_discarding() after setting MS_DISCARD state
Convert report_is_rx_eof_pending() to report_is_not_in_tx()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Previous version of the code assumed that dual carriages home away
from each other, which is not true on some machines, which have the
second dual carriage homing on the first carriage. The new code
correctly identifies the relative order of the carriages now.
This fixes discrepancies between the documentation and the actual
implementation of the carriages kinematic ranges calculation.
Notes about dual_carriage homing and proximity checks changes
Fixed clearing of homing state after homing in certain modes
In case of multi-MCU homing it is possible that the carriage position
will end up outside of the allowed motion range due to latencies in data
transmission between MCUs. Selecting certain modes after homing could
result in home state clearing instead of blocking the motion of the
active carriage. This commit fixes this undesired behavior.
Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
The RetryAsyncCommand code needs to ensure that any response messages
are not from a previous (unrelated) query. To do that it compares the
'#sent_time' from potential responses to ensure they are not from a
previous session. However, if there are any low-level serial
retransmits then the low-level code sets the '#sent_time' to zero (to
indicate that the query send time is not strictly known). That could
result in a valid response not being accepted by RetryAsyncCommand.
If a low-level connection is experiencing a small amount of periodic
retransmits it could result in multiple high-level retry attempts
failing to the point that there is a user-facing error. This could
result in "Timeout on wait for 'tmcuart_response' response" errors.
Fix by accepting responses even if there is a low-level retransmit
once the code can confirm that there can be no previous query still in
progress.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Limit the maximum temperature in MAX31865.calc_adc() to the melting
point of platinum. Above this temperature the Callendar-Van Dusem
formula does not make sense. The default value for max_temp is
99999999.9 and at this temperature the result of this formula is
negative. This sets max_sample_value to 0 which causes the mcu
to shutdown.
Set max adc value to (1<<15)-1 . This is needed because the max value of the adc register
of the MAX31865 is 0b1111 1111 1111 1110 which represents
32767 and not 32768.
Signed-off-by: David van 't Wout <github@yoctobyte.nl>
PR to add the newer version of the Ender 2 Pro with the CR-FDM-v2.5.54.170 motherboard with the HC3232F460 chip.
Confirmed as working with discord member NyftHeart and using configs from Steve Gotthardt, with his permission to use and submit.
Signed-off-by: James Hartley <james@hartleyns.com>
Commit 594c0243 updated the workflows from actions/stale@v3 to
actions/stale@v8, but did not make the corresponding updates to the
config parameters. This resulted in the closing of some PRs. Update
the config parameters to avoid this regression.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Implements AxisTwistCompensation, and Calibrater
Supports calibration of z-offsets caused by x gantry twist
Modify PrinterProbe._probe function to check if the probed z value should be adjusted
based on axis_twist_compensation's configuration
Add documentation for [axis_twist_compensation] module
Signed-off-by: Jeremy Tan <jeremytkw98@gmail.com>
COPY and MIRROR mode implementation
Correctly apply input shaper params to new dual_carriage
Added SAVE_/RESTORE_IDEX_STATE commands
Documentation updates for the new IDEX modes
Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
I am endeavoring to rewrite some of the docs to be more front end agnostic to reflect the different front ends available since these docs were written. I am starting with this one, as it quite often used.
Signed-off-by: James Hartley <james@hartleyns.com>
image->num_blocks is of type unsigned size_t thus unsigned int
or unsigned long int.
%lu specifies a type of long unsigned int. Thus resulting in compiler warning about type mismatch on some systems.
Fix this by printing the value with length modified z.
Signed-off-by: Martin Botka <martin.botka@somainline.org>
- Open log files in text mode,
- Normalize the encoding of tmcuart messages,
- Fix a bug where StatsStream.get_lines() would return None timestamps for lines
before the first Stats line. Timestamps are now back-propagated.
Signed-off-by: Maël Kerbiriou <m431kerbiriou@gmail.com>
It has been discovered on the discord by the user Pizn that the blouch pins are swapped in this config and don't include the ^ pull on the sensor pin.
This has been tested and confirmed by the user.
Signed-off-by: James Hartley <james@hartleyns.com>
Existing `mesh_min` values start probing too far away from the edge.
Additionally `mesh_max` Y value of 197 is out of bed movement range (197 + `bltouch.y_offset` = 237.5) and causes Y stepper to overhit, which can potentially damage the printer in the long run.
Signed-off-by: Aleksandr Ivanov <aux@hexmode.org>
Adds the new BTT SKRat V1.0 controller board to the board_defs for the flash-sdcard.sh tool.
The new board definition was tested by me without any errors.
Signed-off-by: Dennis Kuehn <denniskuehn@online.de>
The reference to `my_nozzle_fan` in these configs could be confusing and misleading, leading users to think it is the parts/print cooling fan, changed to heatbreak_cooling_fan as used in other configs.
Signed-off-by: James Hartley <james@hartleyns.com>
The reference to my_nozzle_fan is misleading and could cause people to skip over the [fan] definition and assume this is the parts/print cooling fan. Alias changed to reflect heatbreak_cooling_fan as used in most configs that have a controllable hotend fan.
Signed-off-by: James Hartley <james@hartleyns.com>
Clarifying the ADXL345 on pi instructions. Previously, the instructions on installing the linux klipper instance were in a confusing place.
Signed-off-by: Adam Kramer <akramer@gmail.com>
This change is required to sucessfully use PA13/PA14 for UART. Otherwise
they function as SWDIO/SWCLK.
Relevant excerpt from the reference manual (translated):
The initial state of PA13, PA14, PA15, PB3, and PB4 ports is that the
JTAG/SWD function is valid after reset. When configuring FSEL[5:0] to
select the function, you need to write 0 to the corresponding bit of the
register PSPCR to invalidate the JTAG/SWD function.
Signed-off-by: Boris-Chengbiao Zhou <bobo1239@web.de>
This fixes serial communication when selecting the PH2/PB10 pins.
The chip datasheet (not reference manual) assigns pins to one of two
communication function groups (`Func_Grp1/2`). Pins in group 1 have
access to USART1/2 while group 2 has access to USART3/4. PH2/PB10 belong
to group 2 so we now correctly use USART3 for them.
Signed-off-by: Boris-Chengbiao Zhou <bobo1239@web.de>
The relative_reference_index will now refer to a coordinate that is
static and cannot be changed at runtime. If new mesh parameters
are specifed and the reference lies outside of the mesh then the
reference location will be probed.
Additionally this introduces a 'zero_reference_position' option which
accepts a specific X/Y coordinate. This may be used in place of the
relative_reference_index.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
When mesh parameters change the substituted indices need to be
updated, even when using the default point set. Always generate
new points to perform this update rather than cache
the "orig_points".
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
It seems opening the canbus socket can sometimes throw an os.error (in
addition to can.CanError). Catch that error to avoid Klipper
reporting an internal error.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This PR is to remove `move_to_previous: true` from the ender 3 S1 and S1 plus configs. This is a confusing option, it is not really useful on these type of printers and can cause issue to the end user
Signed_off_by; James Hartley <james@hartleyns.com>
Add a new HAVE_LIMITED_CODE_SIZE symbol that enables a menu to select
optional features. This symbol is enabled on chips with small build
sizes.
Replace the HAVE_GPIO_BITBANGING with four new symbols:
WANT_GPIO_BITBANGING, WANT_DISPLAYS, WANT_SENSORS, WANT_SOFTWARE_SPI,
and WANT_SOFTWARE_I2C. This allows users a little more flexibility
when selecting features they need.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Add clock speed selection
Add Flash App Address selection
Add alternate serial connection and remove company specific names
Signed-off-by: Steven Gotthardt <gotthardt@gmail.com>
The header documentation currently shows the year the Creality Ender 3 V2 Neo as being the 2020 model. This is likely a copy/paste error from the header of the original Creality Ender 3 V2 config. The year the Creality Ender 3 V2 Neo came out was in 2022 as indicated by the name of this config file. This patch fixes the copy/paste typo by updating the year in the header documentation from 2020 to 2022.
Signed-off-by: Jason W. Thompson <jason@jasonthompson.dev>
If the stepper already executed some steps with the basic
stepper_kinematics, subsequent creation of a new one for input_shaper
would result in stepcompress errors unless position and time tracking
flags are also copied over.
Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
Sample the BME680 every .8 seconds, matching that of the
BME280. This resolves an issue where `get_report_time_delta()`
returns a value that doesn't match the actual delta.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Change the default CANbus frequency from 500000 to 1000000. A higher
frequency allows for greater data transfer rates, lower latency of
messages, and should overall be more robust.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Recommend USB to CAN adapter and no longer recommend using the
waveshare rpi hat.
Recommend using allow-hotplug for all USB adapters.
Note bandwidth limitations when using USB to CAN bridge mode.
Note that a USB to CAN mcu is not a USB serial device.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
In hybrid_corexy and hybrid_corexz, the update_limits function is (only) called by the DualCarriage implementation, whenever the carriage changes.
Unfortunately, these limits also keep track of homing status, when they're unhomed they are set to 1 to -1 (invalid range).
As a fix, if the limit was set to "unhomed", we keep it that way, and only update it with the new rail limits if it was already properly homed before.
Signed-off-by: Frans-willem Hardijzer <fw@hardijzer.nl>
Disable tx state machine before resetting it
Check for rx message with same id as tx but different payload
Do not use canrx line to alter bit timing of cantx line
Improve bit time synchronization with slow transmitters
Implement tx synchronization to faster transmitters
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Check for untracked files in the klippy/extras/ and klippy/kinematics/
directories and report those files in the log. This helps identify
code modifications when inspecting a log.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
New printer : Longer LK4X configuration
This configuration is based on the one provided by Longer with some tweaks.
Signed-off-by: Thomas Lété <bistory@gmail.com>
On a USB bus reset the controller address needs to be reset to zero.
Otherwise, the device becomes unresponsive after a USB reset and will
remain unresponsive until a power cycle. This often shows up in the
Linux system logs as "device descriptor read/64, error -32" messages.
Make sure USB_INTE_BUS_RESET_BITS is enabled and clear the USB address
on a bus reset.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
There is no need to heavily prioritize the sending of canbus packets
over USB. A single check to flush the incoming canbus packets is
sufficient.
Also, be sure to wake up canserial_notify_tx() even if canhw_send()
blocks.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The canserial code already advertizes a receive window, so the host
should never flood the canserial code. Remove the extra scheduling
checks to simplify the usb_canbus code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
A buffer of only 8 canbus packets is only 64 bytes of data, which
could be exceeded if the usb-to-canbus mcu gets busy doing other work.
Increase the buffer to 32 packets.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The DAINTMSK prevents irqs but does not prevent the status reporting
in the GINTSTS and DAINT fields. Thus, the mask bits should be
checked prior to sending a wakeup notification.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The control bytes for the AHT20 and AHT21 are identical to the AHT10, but I had not been able to test just yet to ensure the sensor code supported the other sensors. I've wrapped up testing and updated the comments/docs to reflect this additional support.
Signed-off-by: Scott Mudge <mail@scottmudge.com>
Correction for table "Recommended connection scheme for I2C (i2c0a) on the RP2040", line 160, to match the correct writing in the Fritzing image shown above, RP2040 pin 36 in place of 39;
Correction of typo in line 346, "pins" in place of "pin"
Signed-off-by: Adrian Rose <adrian@crazyroses.net>
Fixes common MPU-9250 accelerometer issues for RPi Linux MCU and
improves reliability on all other architectures by adjusting the MPU-*
reading algorithm to only read whole Klipper messages' worth of
data from MPU-* and eliminating many unnecessary checks of the MPU FIFO
fill-level that consumed bus bandwidth needed for data transfer. Fixes
intermittent "Lost communication with MCU 'rpi'" due to "Timer too
close" and transposed / corrupted data due to FIFO overrun/data loss
when using MPU-* accelerometers. In addition FIFO overrun checks are
performed by testing the MPU interrupt flag vs. inferring from the FIFO
fill level.
Stress tested for 13hrs with two MPU-6500 attached to one I2C bus on RPi
and one on a PR2040
Stress tested for 23hrs with two MPU-6500 attached to one I2C bus on RPi
and one on a ATmega328P (Seeduino Nano)
Signed-off-by: Matthew Swabey <matthew@swabey.org>
In some condition ,“drvstrength 2” does not work. According to page 17, some mosfets need “drvstrength” set to 0 .
From datasheet rev1.15, the DRVSTRENGTH reset default is 0 . (instead of 2)
Signed-off-by: Albert Lin <vcore85@gmail.com>
Avoid some gcc warnings by using uint32_t for iterators
Better document the fallthough case statement in crc_bytes()
Fix txpending race from report_line_ackdone()
Make can2040_transmit() multi-cpu atomic
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The stalled_bytes counter refers to the number of bytes that are not
yet eligible for transmission. However, the naming leads to confusion
as it could be interpretted as an inability to transmit data. Rename
to upcoming_bytes to try to avoid that confusion.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit adds support for the I2C-based AHT10 ambient temperature sensor. The sensor comes pre-calibrated and has a fairly simple command interface, so the interface class is in-turn relatively simple. So far this has been tested on a BTT GTR 1.0 MCU board (STM32F4), and seems to work fine.
Signed-off-by: Scott Mudge <mail@scottmudge.com>
As found on the discord by user Qtin, this board now ships with one of STM32H743 or STM32H723
Example config updated to reflect this. This has been tested on the users board. To note, the H743
bin will flash to the H723 chip, but will not work.
Signed-off-by: James Hartley <james@hartleyns.com>
Add an optional REGISTER parameter to DUMP_TMC so that the output is more filtered/cleaner for manual TMC calibration.
Signed-off-by: Alex Voinea <voinea.dragos.alexandru@gmail.com>
This adds support for the stock configuration of the V-Minion printer from Ratrig, based on the Octopus v1.1 (STM32F446)
Signed-off-by: Benjamin Lesher <bbro44@protonmail.com>
Realtime programming best practice is to lock realtime code
memory to prevent paging which will lead to unbounded latencies. The
Linux MCU process has well bounded memory and small RAM footprint
so locking the entire process' RAM has no downsides and will improve
behavior when the system comes under memory pressure.
(See bootlin training and Linux Foundation documentation linked below.)
RT process priority ranges from 0-99 (although POSIX only requires 32),
boost MCU process priority to half the max/2 to improve robustness when
the system comes under pressure from other RT Kernel or user processes.
Reference links:
bootlin: https://bootlin.com/doc/training/preempt-rt/preempt-rt-slides.pdf
Linux Foundation: https://wiki.linuxfoundation.org/realtime/documentation/howto/applications/application_base#howto_build_a_simple_rt_application
Signed-off-by: Matthew Swabey <matthew@swabey.org>
Having the controller fan PA14 in the config is important for the stepper drivers not to overheat and skip steps.
Signed-off-by: Robert Lilienthal <13837429+RobLil@users.noreply.github.com>
Ability to specify `VELOCITY` as a parameter for SET_TMC_FIELD. Useful for configuring at runtime the TSTEP based fields of the driver.
Signed-off-by: Alex Voinea <voinea.dragos.alexandru@gmail.com>
Implement a helper for calculating velocity based thresholds for tmc drivers. This code was written in such a way that it can be used with more fields than just tpwmthrs.
Signed-off-by: Alex Voinea <voinea.dragos.alexandru@gmail.com>
If tcoolthrs is configured (not the default 0), then do not force
the value of tcoolthrs=0xfffff during homing. This way, tcoolthrs
can be set to a custom value during homing.
`tpwmthrs` and `en_pwm_mode`/`en_spreadcycle` are now also
correctly restored if they were changed after startup.
Signed-off-by: Alex Voinea <voinea.dragos.alexandru@gmail.com>
`multistep_filt` was not configured at all on tmc2240 and tmc5160. As such, it would default to the value of 0 when the GCONF field was sent to the driver. However, that field has a default value of 1 in the driver, so klipper was overriding the defaults by accident.
This field improves the stability of velocity based thresholds (it's effectively TSTEP filtering) and it also improves the current regulation stability in stealthchop2 (according to the datasheet).
This field was already set to 1 correctly in the tmc2208/tmc2209 driver code.
Signed-off-by: Alex Voinea <voinea.dragos.alexandru@gmail.com>
Add the default base config for the Ender 3 v2 Neo (as released 2022).
This config also works with the newer D32F303 based 4.2.2 boards.
Signed-off-by: Sam McLeod <sammcj@users.noreply.github.com>
Reading an I2C device from the Linux MCU used a separate write(2)
to select the target register & read(2) to get the value(s). This
implementation uses ioctl(file, I2C_RDWR, ...) to skip a large bus idle
period and extra process sleep by combining them like the stm32.
I2C_RDRW requires I2C_FUNC_I2C flag in the I2C driver. I2C_FUNC_I2C
is defined in:
BCM2835: Pi 1 Models A, A+, B, B+, the Raspberry Pi Zero, the
Raspberry Pi Zero W, and the Raspberry Pi Compute Module 1
BCM2836: Pi 2 Model B
Identical to BCM2835 except Cortex
BCM2837: Pi 3 Model B, later models of the Raspberry Pi 2 Model B,
and the Raspberry Pi Compute Module 3
BCM2837B0: Pi 3 Models A+, B+, and the Raspberry Pi Compute Module 3+
BCM2711: Pi 4 Model B, the Raspberry Pi 400, and the Raspberry Pi
Compute Module 4
RK3xxx: Rockchips SoCs NanoPi, RockPi, Tinker, etc.
SUNXI: H2, H3, etc. Orange Pi
AMLOGIC: S905x, Banana Pi, Odroid, etc.
TEGRA: NVidia Jetson etc.
MediaTek: Several SBCs in other ranges
Signed-off-by: Matthew Swabey <matthew@swabey.org>
Purely esthetic. Make all tmc driver init code similar to one another. The various fields were grouped based on the register which they affect or the function they perform.
Signed-off-by: Alex Voinea <voinea.dragos.alexandru@gmail.com>
Previously, the globalscaler was calculated during the config parsing and set to a fixed value. If the current was changed for any reason after the initialization, only IRUN and IHOLD would be changed. This however caused issues:
- If the new current was lower, then the resolution of the possible current values would be low since there are only 32 IRUN/IHOLD steps.
- If the new current was higher, it wouldn't actually work since IRUN and IHOLD are capped at 31, so it wouldn't be possible to increase the current without increasing globalscaler.
With this commit, the globalscaler is recalculated whenever necessary in order to ensure the correct range of IRUN/IHOLD is used.
Signed-off-by: Alex Voinea <voinea.dragos.alexandru@gmail.com>
Fix filament sensor and remove unneeded config changes in extruder
The filament sensor on the printer used for initial testing had been removed prior to flashing klipper to it. Only a basic test to see it if triggered or not was preformed. It was discovered by someone else doing some testing on another printer that it would frequently pause. This was a simple oversight, assuming it was a runout switch.
Removed section of config related to filament runout switch and replaced with basic config for filament motion so they printer will simply pause when no more motion is detected. Also notated to add CLEAR_PAUSE to start gcode if using this sensor as it will trigger a paused state when loading or unloading filament. If printer is in a paused state at the start of the print, the attempt to pause will cause the printer to rapidly pause and unpause itself.
Removed min_extruder_temp and max_extrude_only_distance from the extruder section, as they were there only for macros on a test system that is not put into this sample config
Signed-off-by: Zachary Welvaert <zwelvaert@gmail.com>
The actual board name is EZBoard V2 without the lite. Renaming the file and correcting the intro text to reflect the actual board name.
Signed-off-by: Anthony Dellett <anthony.dellett@gmail.com>
This is an update to the script that looks for the new systemd service and restarts it if appropriate.
Signed-off-by: James Hartley <james@hartleyns.com>
Use mcu.lookup_command().get_command_tag() instead of
mcu.lookup_command_tag(). This improves error reporting on a protocol
mismatch. It also enables support for a msgtag that is negative.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Adds sdio support for the stm32f4 to allow for SD card flash updates
without power cycling some boards, e.g. BTT Octopus Pro.
Signed-off-by: H. Gregor Molter <gregor.molter@secretlab.de>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The recent PR to change this to say `#!/usr/bin/env python` instead of `#!/usr/bin/env python2` can cause issues on non rpi based OS's where `python` is not mapped to `python3`.
`#!/usr/bin/env python3` should work in both situations.
Signed-off-by: James Hartley <james@hartleyns.com>
Some users may not desire this behavior and others
may wish to initialize to a profile not named default.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Config file contains pin mappings to suit Lulzbot Mini 2 using Lulzbot SingleExtruder(0.5mm) and Lulzbot flexible magnetic bed.
Mini 2 uses Einsy Retro mainboard.
Signed-off-by: Trent Sheather <trent.sheather@gmail.com>
The pca9685_pwm set_pwm() code can be called from a background thread
(when the pin controls a heater). Propagate updates to the main
thread for enable tracking.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Using the CAN2 interface still requires that CAN1 be enabled, and the
filtering hardware is always on the CAN1 hardware block.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The existing sample times are not long enough to reliably sample the
internal temperature sensor. Longer sample times should also improve
results with temperature sensors that have a higher inductance.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Prefer explicitly setting the CR hardware register to defined values
during initialization.
Also, prefer "#if CONFIG_MACH_STM32H7" over bit definitions to make it
clear that the code applies only on stm32h7.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The stm32l412 doesn't have a PLLSAI1 clock and therefore the CKMODE
should not be set to zero.
The stm32h7 chips run the adc at 25mhz, so BOOST should be set to
0b10.
Improve timing comments.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Use the common lookup_clock_line() code to lookup the adc clock lines.
This also enables resets on the adc1/adc2 hardware block.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Not all chips implement hardware oversampling. The software already
implements oversampling, and additional hardware oversampling is
unlikely to improve results. Remove the hardware oversampling to
simplify the code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
On all chips, the JQDIS bit is set and the CONT, RES, ALIGN bits are
clear after a reset. There is no need to program the OVRMOD bit. Use
the same logic across chips to help unify the adc implementation.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Not all chips have the LDORDY flag, while all chips will stabilize in
10us. There is no need for two different implementations as it is
safe to wait 20us on all chips.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Sort using comparison on only first item in list to avoid greater/less
than comparison of stepper objects (which causes an error on Python3).
Reported by discourse user salbang.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
If note_kinematic_activity() has a time far in the future it could
result in a single flush attempt of that time range. Be sure to break
up that range into small chunks using the normal _update_move_time()
mechanism.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
It was possible a note_kinematic_activity() call could increase
last_kin_move_time, but _process_moves() could reset it. Fix by
making sure _process_moves() only ever increases last_kin_move_time.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Later addition of a F429 variant SKR2 was released. Changed btt-skr2 to btt-skr-2-f407 and added a new alias for btt-skr-2-f429
Signed-off-by: James Hartley <james@hartleyns.com>
Issue specific to Python 3, NoneType is being used to compare heartbeat time (actually caused by invalid condition operator), and by returning NoneType in timer functions.
Signed-off-by: Clifford Roche <clifford.roche@gmail.com>
As discussed with user HiitsameAsh on discord, he has confirmed this addition will flash a Fysetc Cheetah V2
Signed-off-by: James Hartley <james@hartleyns.com>
Existing code uses very restrictive build volume constraint checking
with just narrow cone on top of fully cylinder for delta printers.
Code here implements more permissive and still safe build volume
constraint checks.
Signed-off-by: Jan Herich <jan.herich@gmail.com>
Check for the build symbol prior to calling bootloader_request().
Enable the build symbol on rp2040, atsam, and atsamd chips.
This also enables serial bootloader requsts on rp2040, atsam, and
atsamd.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Rename the build symbol. This is in preparation for enabling
HAVE_BOOTLOADER_REQUEST on usb and canbus.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Make all the microstep lookup table registers configurable via the
config file. It also loads the default values.
TMC220x and TMC2660 do not support this feature.
Signed-off-by: Alex Voinea <voinea.dragos.alexandru@gmail.com>
Current Z_OFFSET_APPLY_ENDSTOP command only works for printers
with cartesian architecture which have separate Z axis defined.
But this functionality (persisting Z babystep value to endstops)
is exactly as convinient for delta printers, therefore this
PR implements it.
Signed-off-by: Jan Herich <jan.herich@gmail.com>
Add a check to the start of initial_pins_setup() to make it easier for
gcc to optimize the code if it is not in use.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Rename canserial_send() to canbus_send() and canserial_set_filter() to
canbus_set_filter(). This makes it more clear where the code should
reside.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Rename canbus_send() to canhw_send() and rename canbus_set_filter() to
canhw_set_filter(). This makes it more clear where the code should
reside.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Improve handling of race conditions with hardware updates. This is
the same changes applied to stm32f0_adc.c in commit 88325b6c.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
add G17, G18 and G19 commands to select arc planes
enhance G2/G3 to support arc moves in XY, XZ and YZ planes
Signed-off-by: Andrew Mirsky <andrew@mirsky.net>
Minor fix. The screw labels "back left" and "back right"
where swapped in [screws_tilt_adjust] section.
Signed-off-by: Frank Roth <developer@freakydu.de>
After a G28 z-axis homing, there is a final z hop.
It was hoping to height z_hop as an absolute z height rather than relative.
If the z-axis home leaves the head at a z height higher than z_hop,
e.g. because you were using a probe to do z homing,
this meant that it was z hopping in the negative z direction, which
could result in crashing the toolhead.
Signed-off-by: Joshua Redstone <redstone@gmail.com>
Fix PIO "sync" register overflow check
Reduce latency of tx scheduling
Clear ackdone irq from report_note_eof_success()
Defer ack inject until after rx fifo drained
Improve passive/dominant bit conflict check on tx reschedule
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Minor comment change to unstuf_pull_bits()
Introduce unstuf_get_raw() helper function
Move crc stuffed bit calculation to data_state_go_crc()
Restore stuffed_bits state on missing ack
Use a single pio_irq_set() function
Reschedule tx if previous tx unexpectedly finished transmit
Simplify report_state handling
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The rp2040 watchdog does not actually reset anything by default. The
psm_hw->wdsel field must be programmed to actually get a reset on a
watchdog failure. Program that field so the watchdog is usable.
Also, disable the watchdog before attempting a reboot into the
bootloader. Otherwise the machine may just reboot a second time due
to a missed watchdog event in the bootloader.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Remove the custom.md github issue template so that github only shows
the choices listed in the config.yml file.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Specify the arm architecture flash bootup address for each chip type
in Kconfig using a new FLASH_BOOT_ADDRESS setting.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This will hide features in the Klipper Display menu that isn't applicable
for the machine, therefore we can add extra alignment tools in the Control
menu as well.
Also conditionally displays Setup/Calibration options.
Signed-off-by: Nickolas Grigoriadis <nagrigoriadis@gmail.com>
The stm32h7 uses similar usart hardware as the stm32f0 and stm32g0
chips. Use the same code implementation for all these chips.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
If an USART RX overrun happened on a stm32g0/f0/h7, the ORE flag
would get set by hardware. This flag would also trigger an interrupt.
The problem was that this flag was never cleared on these 3 mcu families
since the ORE flag clear sequence is different to all of the older
chips.
Since the ORE flag is not used in any meaningful way anyway, it was
disabled during the init sequence.
Signed-off-by: Alex Voinea <voinea.dragos.alexandru@gmail.com>
According to ADXL345/ADXL343 datasheets, at 3.3V supply voltage,
which is most frequent in the various boards, the sensitivity of
X and Y axes changes to 265 LSB/g from 256 LSB/g at 2.5V.
Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
Works for unmodified stock Artillery Sidewinder X2,
year 2022 with Artillery Ruby v1.2 mainboard.
All by default connected things are working fine.
Build firmware with architecture STM32F401 with "No bootloader".
Other settings keep ther defaults
Signed-off-by: Frank Roth <developer@freakydu.de>
If a maximum acceleration is changed between two consecutive moves,
this allows to correctly compute the junction velocity between them.
Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
it seems I made an error with my code for the SKR 3, and I copied the code from the wrong host , this PR fixes that. I have just retested with the right code and works as expected, this is confirmed by @adelyser who brought the issue to my attention.
Signed-off-by: James Hartley <james@hartleyns.com>
Fix gpio function selection for PIO1 usage.
Minor variable name changes.
Allow scheduling tx "matched" event after a crc match.
Allow for up to 5 passive bits after unstuf_clear_state().
Pause PIO "rx" bit reception after 10 passive bits.
Signal the CPU to process data every 10 read bits.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Corrected the build instructions for the TH3D EZBoard V2 to include the command to convert Klipper.elf to a SREC bin format named firmware.bin. The SREC format is required for the bootloader installed on the board.
Signed-off-by: Anthony Dellett <anthony.dellett@gmail.com>
As discussed with Arksine, he has created new working settings for the Creality 4.2.x boards as the original 4.2.7 entry did not work, plus addition of SKR2 and SKR3. Tested on 4.2.2 and SKR2 and SKR3EZ.
These are using the new skip_verify functionality that was recently merged due to them using SDIO
Also removed a double definition for `monster8` it was in main definitions and aliased.
Signed-off-by: James Hartley <james@hartleyns.com>
This adds a gcode command that can be used insight the slicer to pass the total layer count and current layer information.
Signed-off-by: Stefan Dej <meteyou@gmail.com>
M105 expects get_temp method. Module crashes when gcode_id parameter
is set and M105 called. Add methods as hotfix.
Signed-off-by: Robert Pazdzior <robertp@norbital.com>
Introduce a new handle_fault() method to handle processing of sensor
faults. This simplifies the calc_temp() methods.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Send the fault information explicitly in the query_thermocouple fault
field for max6675, max31855, and max31865.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Update printer-anycubic-vyper-2021.cfg
better pause and end print, beeper support, mroe accurate value.
* Update printer-anycubic-vyper-2021.cfg
* Update printer-anycubic-vyper-2021.cfg
* Update printer-anycubic-vyper-2021.cfg
* Update printer-anycubic-vyper-2021.cfg
delete unnecessary gcode
* Update printer-anycubic-vyper-2021.cfg
remove unneccessary part.
* Update printer-anycubic-vyper-2021.cfg
* Update printer-anycubic-vyper-2021.cfg
according to https://www.klipper3d.org/Example_Configs.html point 7f
delete field values that are set to their default value
* Update printer-anycubic-vyper-2021.cfg
small change
* Update printer-anycubic-vyper-2021.cfg
If a tmc driver can't find the stepper config section it reports a
"missing microsteps" error which can be confusing. Provide a more
explicit error message.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
As found on discord bt user David Carey.
uart_address for y and z are swapped. Discovered while setting up sensorless homing.
Signed off by: James Hartley <james@hartleyns.com>
Added a SET_DIGIPOT command to the mcp4018 implementation.
Previously the mcp4018 was read only, and set at the time of
configuration. This allows you to change the value during a
print, which is needed for some older printers that need to
lower the stepper current during preheating.
Signed-off-by: Jake Bordens <jake@allaboutjake.com>
Also added status report for extruder_stepper objects with the
current pressure advance parameters values.
Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
Uses existing common code for STM32. Adds a table for device-
specific PWM mappings. Adds support for enabling all TIM timer
devices. Makes it a runtime error to enable devices the code
doesn't know how to enable.
I have verified performance of the fan pins (PC6, PC7, PB15)
on the SKR Mini E3 V3.
Signed-off-by: Ben Jackson <ben@ben.com>
Removes a call to gcmd.respond_info which writes 'VARIABLE SAVED' to the
console every time the SAVE_VARIABLE command is called.
Signed-off-by: Andre LeBlanc <mapleleafmakers@gmail.com>
Raised from issue #5645, UTF-8 encoded symbols or other unexpected symbols on the UART raise an exception which causes klipper to stop. This change support UTF-8 encoded characters (from file names) as well as ignoring unexpected bytes.
Signed-off-by: Clifford Roche <clifford.roche@gmail.com>
This is a working config with full LCD and stepper settings (only thing missing is the kill switch, which did not appear to work)
Signed-off-by: Rui Carmo <rui.carmo@gmail.com>
Introduce a CONFIG_USB build symbol that is set whenever
CONFIG_USBSERIAL or CONFIG_USBCANBUS is set. Use that symbol during
setup so that the USB controller is properly initialized for both usb
serial and usb canbus bridge configurations.
This fixes the clock configuration for usb canbus bridge mode on
stm32f446.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This is a working config with full LCD and stepper settings (only thing missing is the kill switch, which did not appear to work)
Signed-off-by: Rui Carmo <rui.carmo@gmail.com>
An mcu device acting as an "mcu bridge" should only be reset after
other normal devices are reset - otherwise the bridge wont be able to
pass along the reset message to the downstream mcus.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Use bootloader_request() instead of try_request_canboot(). This
allows the bootloader machanism to work for more bootloaders.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Rename this board API function to a more generic name. This is in
preparation for calling the function from the canbus code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Starting with nodeid 4 instead of nodeid 0 can reduce bitstuffing of
the id field in common configurations.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The stm32g0 specification states that it is required to wait for the
CCRDY flag to be raised after changing the channel configuration.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This PR serves to fix a longstanding misnomer in some config files. Many configs state a nozzle_cooling_fan alias for what is usually a "hotend cooling fan". This causes ambiguity and confusion with the parts fan. I have identified all 24 files with this and changed them here.
Signed-off-by: James Hartley <james@hartleyns.com>
A new release of markdown (v3.4.1) breaks the website deployment
scripts. Force the existing version.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Rename to "match" state machine instead of "ack".
Minor simplification to tx_note_crc_start().
Call pio_match_clear() from report functions.
Add pio_match_calc_key() helper function.
Raise irq after 6 passive eof bits for faster rx message notification.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Support a USB interface that shows up as a canbus adapter to linux.
Route both local and real canbus packets over that interface.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Rename the canbus.c code to canserial.c and introduce new wrapper
functions in canbus.c that connect the low-level canbus hardware code
to the high-level canserial.c code.
This is in preparation for adding "usb to canbus bridge mode".
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The `logging.basicConfig` does not reconfigure default logger.
This results in printing only warnings/errors to stderr
instead of also info (or debug).
This fixes the issue by setting log level on root logger.
Signed-off-by: Kamil Trzciński <ayufan@ayufan.eu>
Calling python functions can have high overhead. Inline the
twos_complement code in the _extract_samples() inner loop.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The MPU9250CommandHelper() class is nearly a duplicate of
ADXL345CommandHelper(). Rename ADXL345QueryHelper() to
AccelCommandHelper and remove user facing references to "adxl345". Use
it directly from mpu9250.py .
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The mpu9250.ClockSyncRegression() class is a duplicate of
adxl345.ClockSyncRegression(). Remove the duplicate copy and use the
code from adxl345.py .
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The MPU9250QueryHelper() class is a duplicate of ADXL345QueryHelper().
Rename ADXL345QueryHelper() to AccelQueryHelper() and use it directly
from mpu9250.py .
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Adds a save_config_pending_items to the status reported by
configfile reflecting the items and values that a future
SAVE_CONFIG would actually persist.
Signed-off-by: Kurt Haenen <kurt.haenen@gmail.com>
Move the uuid hash calculation to canbus.c and call canbus_set_uuid()
from src/stm32/chipid.c . This simplifies the low-level canbus
hardware code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Previously the code had canbus_read() which was called from task
context (for admin messages), and canbus_process_data() which was
called from irq context (used for data messages). Change that to a
single canbus_process_data() function that is called from irq context
(used for all messages). This simplifies the low-level hardware
specific canbus code and should make it easier to support other
hardware implementations.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Create a single CanData global variable to track the canbus state.
ARM micro-controllers generally produce better code when global
variables are in a struct.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Use a USB hex id to indicate that the device is already in bootloader
mode. This makes the rp2040 flashing code similar to the other
boards.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Introduce support for the stock Creality CR10 v3 printer, including the filament runout sensor. It also supports the optional BLTouch.
Signed-off-by: Luís Palma Nunes Mendes <luis.p.mendes@gmail.com>
The rp2040 USB may not connect after a reset. Implementation the
recommended workaround.
Signed-off-by: Lasse Dalegaard <dalegaard@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The CanBoot bootloader can often fit in 4KiB and that may be useful
for some devices with small flash sizes.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Just log an error on a fault.
Remove the host check for min/max temperature as the micro-controller
code already implements that check.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Allows a limited number of DS18B20 read failures
before stopping the printer. This is designed to
tolerate spurious read errors, while still stopping
for serious issues.
The printer will stop when the sensor
fails to report a value five times in a row.
Implementation works as follows:
The MCU reports any read errors using a new "fault"
parameter in its answers.
The Python code tracks the number of errors
and triggers the shutdown. This paves the way for
more sophisticated error handling in the future,
as well as an example for other sensors to follow.
Signed-off-by: Lorenzo Pfeifer <Lorenzo.Pfeifer+github@googlemail.com>
When CanBoot is detected set its bypass signature when a
reset is requested.
Add a "try_request_canboot()" method that may be called
from from USB and Canbus bootloader requests.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Adding Klipper functionality to support cancelling objects while
printing.
This module keeps track of motion in and out of objects and adjusts
movements as needed. It also tracks object status and provides that to
clients.
The Klipper module is relatively simple, and only provides one piece of
the workflow. Moonraker already supports processing uploaded files to
insert the required gcode markers for cancelling objects, using
https://github.com/kageurufu/cancelobject-preprocessor. This library is
also available as an executable for use in slicers, and pip
installations also include the script as a callable.
Mainsail has integrated support, and code changes for Fluidd are
available. Support in other interfaces is planned, and we've spoken to
several other developers about integrating frontend support in their
projects.
Signed-off-by: Troy Jacobson <troy.d.jacobson@gmail.com>
Co-authored-by: Franklyn Tackitt <git@frank.af>
Co-authored-by: Eric Callahan <arksine.code@gmail.com>
The latest text of the GNU GPLv3 license updates the web references to
https (instead of the older http). Update to that latest text.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Add PROBE and CHIP to TEST_RESONANCES
Since it's possible to specify more than one chip
in TEST_RESONANCES the CHIP parameter has been
renamed to CHIPS
Signed-off-by: Mikkel Schmidt <mikkel.schmidt@gmail.com>
Create configuration file for Fly-Gemini-v1 motherboard
Add stm32f405 and generic-mellow-fly-gemini-v1.cfg to test cases
Signed-off-by: Xiaokui Zhao <xiaok@zxkxz.cn>
It's more likely that python3 will be installed than python2 on a
typical modern Linux distribution, so use python3 by default.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This adds a command which allows an external script to broadcast a
bootloader request, using a supplied UUID to match the request.
Included is a method to process requests to enter the canboot
bootloader.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Make sure whitespace isn't in the pin description. Also make sure an
alias doesn't map to an invalid pin.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Minor indentation and variable name changes.
Don't remove linebreaks from message_protocol_error lines.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The MCU protocol error message often confuses users, especially after getting bombarded with the config format error line. This PR tries to improve it and has the following goals:
- Put the technical error at the end to prevent confusion and avoid the immediate jump to help channels instead of continuing to read
- Inform the user first what the type of error is (In this case: MCU Protocol error) and not at the end of the long error message
- Give the users a clear instruction what to do (pretty much unchanged), but possibly more approachable because the user is not confused by the technical error anymore
- Shows the version numbers of Klipper separate from all MCU version numbers so that it is more obvious that this is the version of Klipper
- Separates the version numbers between outdated MCUs and up-to-date MCUs, so that it becomes obvious if a MCU flash failed because the MCU doesn't disappear from the outdated list
- Previously, when viewing the errors in a web frontend, additional line breaks made it extremely hard to read the message, sometimes with as little as one word on one line. The error messages are now formatted to not have rogue line breaks, improving readability.
Signed-off-by: Felicia Alexa Hummel <felicia@drachenkatze.org>
There is concern that some users are interpreting the benchmark table
in Features.md as a list of "supported boards" or possibly
"recommended boards". This was not the intent.
Remove the board names from the list to make it more clear the intent
is only to describe the benchmarks.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This is needed for the Creality Ender 3 S1 with the STM32F401 chips to enable a 64kib bootloader offset
Signed-off-by: James Hartley <james@hartleyns.com>
If the final update in a series of SET_LED update commands didn't
alter a color than the transmit would not occur - even if prior
commands did make color changes. Refactor the update code and fix.
Reported by @mstansberry.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Update and rename printer-twotrees-sapphire-pro-2020.cfg to printer-twotrees-sapphire-pro-sp-3.cfg
I renamed the file since the printer name now changed and is sold with this name, there is only one version so year can be removed.
-Added detailed instructions for flashing in the header.
-Corrected rotation distances for axes, it was wrong.
-Added gear ratio for extruder that is useful for future changes.
-Added heater fan to HE1 pins for automatic shutdown with temp.
-Reduced speed and accel for Z since a 2mm screw is used.
* Create printer-twotrees-sapphire-plus-sp-5-v1.1.cfg
I created the file since the printer name now changed and is sold with this name, there are 2 main versions (V1 and V1.1) so I will make 2 different configs for them since there are some hardware change and people are confused in what to change.
The difference with V1 is that all 2225 drivers are now used, since microsteps tables change for these drivers and by factory all jumpers are in the microstep setting is 32, people don't know this and will have half movement with the v1 config, there is a lot of confusion in communities so I think adding another file is the best option.
Signed-off-by: Lorenzo Cascone <laurienzudesign@gmail.com>
The reference to the linux mcu was helpful to understand what a linux mcu was but didn't help with understanding the technical reasons why it's not supported.
Signed-off-by: Karl Bowden <karl@bearded.sexy>
Support for language translations on the klipper3d.org site was
disabled in commit c067d4df. Fully remove the support in this commit.
This is in preparation for an alternate implementation.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Accidentally introduced in 8049243221,
renders the AFE non-functional on SAME70. Should have had little impact
on SAM4E.
Signed-off-by: Alex Maclean <monkeh@monkeh.net>
Previously the section for stepper_bed was intertwined with printer. This commit makes it match (../config/example-polar.cfg).
Signed-off-by: Charles Pickering <me@charlespick.xyz>
This file includes the build instructions and generic configuration for the TH3D EZBoard Lite v2.0 3d printer control board.
Signed-off-by: Anthony Dellett <anthony.dellett@gmail.com>
Added PCA9632 LED module support using software I2C from MCP4018
modulo drive the LED strip of a FlashForge Dreamer 3D printer.
Based on the PCA9533 module.
Signed-off-by: Ricardo Alcantara <ricardo@vulcanolabs.xyz>
Similarly to commit 8cf1b512 for SPI, the Rpi4 has more i2c busses to offer
This change allows klipper to use up to I2c bus 6
/boot/configtxt
dtparam=i2c_arm=on
dtoverlay=i2c6
and
pi@fluiddpi:~ $ ls -1 /dev/i2c*
/dev/i2c-1
/dev/i2c-6
Signed-off-by: Sylvain Dansereau <brutus_dansereau@hotmail.com>
Temporarily disable support for multiple languages on the main
klipper3d.org site. The search functionality isn't working correctly
with translations.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Check that a SET_PRESSURE_ADVANCE without an explicit EXTRUDER
parameter isn't done after the user disables or reassociates the
extruder stepper motor (via SYNC_EXTRUDER_MOTION). Otherwise, it
could lead to very confusing results.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
With recent changes, the extruder_stepper may be used for new
purposes, and synchronizing to the "extruder" motion queue at startup
may become a confusing default.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The serial device needs to be enabled before setting the DLAB bit.
This prevented UART3 from working.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Document that spaces and special characters should not be in the
config filename.
Remove reference to step_distance and pin_map deprecated features, as
those features are now fully removed.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Change from the "material translate icon" to the "material language
icon" for the language selection icon. (The "material language icon"
is an alias for the "material web icon" and it seems we can't use the
alias, so we directly set the icon to "material/web".)
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Lines 94 and 97. Fan speed should be 1 and not 0.5
removed lines to use default settings.
[heater_fan hotend_fan]
pin: PG14
[fan]
pin: PG13
Signed-off-by: Scott Schering <sschering@gmail.com>
The stm32 specs indicate that the SPE bit must be cleared before
changing the CPHA or CPOL bits.
Reported by @cbc02009 and @bigtreetech.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
It's possible for the SCLK pin to still be updating even after the
last byte of data has been read from the receive pin. (In particular
in spi mode 0 and 1.) Exiting early from spi_transfer() in this case
could result in the CS pin being raised before the final updates to
SCLK pin.
Add an additional wait at the end of spi_transfer() to avoid this
issue.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Deprecate SET_EXTRUDER_STEP_DISTANCE and SYNC_STEPPER_TO_EXTRUDER.
Recommend using SET_EXTRUDER_ROTATION_DISTANCE and
SYNC_EXTRUDER_MOTION.
Deprecate the extruder "shared_heater" option and reocmmend using
extruder_stepper config sections to obtain the same functionality.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This command is a rename of SYNC_STEPPER_TO_EXTRUDER. This change is
in preparation for the removal of SYNC_STEPPER_TO_EXTRUDER.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Support altering the extruder distance using the higher-level
rotation_distance. This is in preparation for removal of the
SET_EXTRUDER_STEP_DISTANCE command.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Separate out message parsing into individual classes. This should
make the code a little eaiser to understand.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Running "make" directly after a "make distclean" can lead to a corrupt
out/board symbolic link. Rework the make rules so that the board
symbolic link is created in a new make instance that has the updated
definition of CONFIG_BOARD_DIRECTORY.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Break listing up by module name. Provide links to "extended"
commands. Sort reference by module name.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
It's no longer necessary to update the printer.cfg file to alter the
max_accel and square_corner_velocity parameters. Update the
Resonance_Compensation.md document to reflect this.
Also, recommend using STEP_DELTA in the TUNING_TOWER commands.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The rp2040 can be flashed without sudo when using udev rules to give the
user permission, but in a standard configuration sudo is required.
Here we make it possible for flash_usb to use sudo for the rp2040
target, and make it the default when using `make flash` for the rp2040.
As for other targets, one can set `NOSUDO=1` to not call through sudo.
Signed-off-by: Lasse Dalegaard <dalegaard@gmail.com>
Wraps lines to 80 columns. Only use triple backticks on multi-line
code excerpts. Add backticks around "sudo raspi-config". Move
"Enabling SPI" section to be near pwm and gpio configuration.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The G2 / G3 command might be renamed using `gcode_macro` + `rename_existing`. This change allow detecting clockwise / anti-clockwise moves when the command gets renamed.
Signed-off-by: Nick Douma <n.douma@nekoconeko.nl>
Commit 7ef7bf60 broke the special handling for M117 commands that
start with a number or special character. Fix that support and extend
to M118 as well.
Also improve handling of commands not separated by a space (eg,
"M117HELLO").
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Refactor the extruder_stepper support so that it uses the
ExtruderStepper class defined in extruder.py.
Support the SYNC_STEPPER_TO_EXTRUDER command on steppers defined in
either extruder_stepper or extruder config sections.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Store the pressure_advance value in "struct extruder_stepper" instead
of in the trapq's "struct move". This makes it possible for multiple
stepper motors to have different pressure advance values while still
using the same trapq.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
It is preferable to program the tmc drivers with an irun (or cs)
setting near 31, as otherwise the driver may have reduced microstep
precision. It was possible for the driver to be programmed with
irun=16 or irun=17 when it could have been configured with irun=31
with vsense=1 instead. This would occur on tmc2130/tmc2208/tmc2209
drivers for values around 0.900 to 1.000 amps (when using a typical
sense_resistor settings of 0.110 Ohms).
Change the code to prefer using vsense=1 to avoid this issue.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The fan pin PA0 is not correct for the 2021 revision of the CR-6 SE using the
4.5.3 revision of the Creality board. Changed the pin to PB15 in order to
get it working
Signed-off-by: Filip Trplan <filip@trplan.si>
Previously accidentally used 'default' state name instead of the
stated one ('PAUSE_STATE'). This might collide with user usage of the
SAVE_GCODE_STATE macro.
Signed-off-by: David Grundberg <individ@acc.umu.se>
This implements I2C for the rp2040 target. All output groupings of both
I2C blocks are available for use.
Signed-off-by: Lasse Dalegaard <dalegaard@gmail.com>
TMC2130/5160 can make use of `spi3`, which is operated on the software SPI pins in the current configuration. The supplied defaults for software SPI do not currently work.
Heater0 pin was marked incorrectly, should be `PB0`
Signed-Off-By: Wijnand Modderman-Lenstra <maze@maze.io>
Many non-English speaking countries use a comma as a decimal separator for printed numbers. This can create some confusion in documentation and config files when not surrounded by contextual clues like parenthesis. Improve documentation by adding spaces to coordinates.
Signed-off-by: Paul McGowan <mental450@gmail.com>
This adds `make flash` support for the rp2040 target. Flashing is
performed using a custom `rp2040_flash` tool that uses the PICOBOOT
protocol. Root is not required.
The user specifies the serial device of the rp2040 they wish to flash as
the device. This device is reset into bootsel mode and `rp2040_flash`
is invoked on the original USB device path.
If the device is already in bootloader mode, the user can specify
'first' as `FLASH_DEVICE` which will simply invoke `rp2040_flash` with
no bus/address options.
Signed-off-by: Lasse Dalegaard <dalegaard@gmail.com>
Unify the handling of the enable_pclock() and is_enabled_pclock() code
across all stm32 chips. All chips will now perform a peripheral reset
on enable_pclock() (this is a change for stm32f0 and stm32h7). The
enable_pclock() code will now also disable irqs during the enable.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Avoid read-modify-write operations where possible. The register
values are in a known state so prefer absolute writes.
Improve handling of race conditions with hardware updates.
Remove the adc reference from "struct gpio_adc" as it is a constant.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Use a fixed layout for the USB transfer memory and remove the ep_mem
struct definition.
This is in preparation for stm32g0 support.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The gpio_peripheral() code is the same in stm32f0.c, stm32f4.c, and
stm32h7.c. Move that function to a new gpioperiph.c file to avoid
code duplication.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
There is no reason to explicitly set the interpolate flag to true in
the example configs as that is already the default.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Now that the documentation recommends that hold_current not be set,
update the example config files to not specify a hold_current.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Changing motor current may itself introduce unwanted motor movement.
As such, document that specifying a hold_current is not recommended.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Some links are pointing to a beta bl (v0.5-beta) instead of the newest release (v0.7).
Raspberry Pi documentation had changed to adocs
Signed-off-by: Yifei Ding <yifeiding@protonmail.com>
Commit 689231df changed the default step_pulse_duration to 100ns for
TMC drivers that are configured in UART/SPI mode, but it failed to
document that change in Config_Changes.md and Config_Reference.md.
Update those documents to reflect that change.
Update the code so that a user may specify a custom
step_pulse_duration even on TMC drivers that are configured in
UART/SPI mode. This may be useful for drivers that use a level
shifter on the step pin that requires more than a ~300ns to detect a
level change.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Add a new automation to lock closed issues with no recent updates.
This is intended to reduce updates to old tickets that few people will
see.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The mcu can only enforce the max duration if the start value is the
same as the shutdown value, so verify that before configuing the mcu.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Updates for generic-bigtreetech-skr-2.cfg to include comment on newly shipped board with STM32F429 instead of the original STM32F407
Signed-off-by: James Hartley <james@hartleyns.com>
Don't go above 400Mhz as otherwise it causes 32bit rollover issues.
(Parts of the code expect a rollover will not occur faster than 10
seconds.)
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Multiplying the desired bitrate by 4 results in half the
desired period and thus twice the desired bitrate.
Signed-off-by: Alex Maclean <monkeh@monkeh.net>
This clock is only needed for low-power operation mode,
and wasn't correctly configured anyway (should be 48MHz).
Signed-off-by: Alex Maclean <monkeh@monkeh.net>
Create a copy of the dictionary prior to updating the the variable field.
This fixes an issue where webhooks holds a reference to the variables
dict returned by get_status().
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
The `<!-- {% raw %} -->` tags are no longer needed now that the Jekyll
package is no longer used to process the markdown documentation.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
It seems the common "beta 3950" thermistors generally follow a
temperature table defined by the new "Generic 3950" definition. Using
a table that actually follows the "beta 3950" temperature curve is
generally less accurate. Deprecate the existing "NTC 100K beta 3950"
definition to avoid this common issue.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Move the definitions of the default thermistors from thermistors.py to
the temperature_sensors.cfg file.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Move the default list of sensor modules from heaters.py to a new
temperature_sensors.cfg config file.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Commit 9ecddd1b fixed a serious error (introduced in 7d95a004). Force
a protocol version change so users are aware of the need to update the
mcu code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Commit 7d95a004 introduced a defect - if the cached timer pointed to
by last_insert did not reschedule itself then the cache would not be
in a valid state and other active timers may not get properly
rescheduled.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Add an optimized step function for drivers that support stepping on
both rising and falling edges of the step pin. Enable this
optimization on 32bit ARM micro-controllers. Automatically detect
this capability in the host code and enable on TMC drivers running in
SPI/UART mode.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Remove the STEP_DELAY Kconfig option and replace it with a per-stepper
step_pulse_duration printer.cfg config option.
The AVR code will continue to have optimized code to step and "unstep"
in the same function (which is automatically activated when the step
delay is 40 ticks or less). This change removes the Kconfig option
for single function step/unstep on 32bit processors.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Remove support for default_parameter_xxx config options. Remove
support for direct access to command parameters.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Avoid using unicode() types on Python2 as it can lead to subtle
errors.
Also, accept utf8 on gcode input (instead of just ascii).
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The floating point unit must be enabled in order to use it and Klipper
does not currently implement that. Newer versions of gcc may spill
registers to the floating point unit causing failures.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The floating point unit must be enabled in order to use it and Klipper
does not currently implement that. Newer versions of gcc may spill
registers to the floating point unit causing failures.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The floating point unit must be enabled in order to use it and Klipper
does not currently implement that. Newer versions of gcc may spill
registers to the floating point unit causing failures.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This resolves an issue where the timer can get stuck
in an attempt to transition from Ready to Idle if
the printer is shutdown.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Tracking of the last reset is no longer needed after commit 8f76e53c.
Remove the code tracking that status and remove the flag definition.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Some architectures do better if the global variables accessed from the
timer dispatch code are in a struct.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The code automatically reduces the hold_current so that it is no
greater than the run_current. However, this could lead to confusing
behavior if one reduced and then increased the run_current via
SET_TMC_CURRENT commands. To avoid that, this change adds support for
tracking the requested hold_current - thus changes to run_current
don't subtly alter the hold_current.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Some versions of gcc, in some cases, decide that it is OK to move the
read to `INTR` to right after clearing the `SETUP_REC` bit of
`SIE_STATUS`, instead of after the `memcpy`.
The rp2040 datasheet doesn't appear to say anything about how quickly
the `SETUP_REC` bit will be cleared in `INTR`, but regardless the
compiler should not be re-ordering the read like this.
Here we force the correct ordering using a memory barrier.
Signed-off-by: Lasse Dalegaard <dalegaard@gmail.com>
Example default config for Tronxy XY-2 Pro.
It is default config for printer Tronxy XY-2 Pro (mainboard Chitu V6). This config based on config for Tronxy X5SA with mainboard Chitu V6.
Signed-off-by: Konstantin Bazhenin <kby@list.ru>
Copy the parameters of calls to console_sendf() on pru1 to pru0 and
then call that function on pru0. Although copying the parameters is a
"hack", the code size reduction is notable.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Update mkdocs to v1.2.3 to avoid a github "dependabot" warning for
CVE-2021-40978. (The CVE doesn't impact the klipper3d.org site, but
no harm in updating.)
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Klipper with Fluid complains about `position_endstop` line if `endstop_pin:
probe:z_virtual_endstop` used
Signed-off-by: Ilia Rebane <Agilatosay@gmail.com>
The F042 and F072 chips are in the same series and the code should be
nearly identical for these chips. Implement the alias and enable USB
for the F072 chips.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The previous OSPEEDR value of 0x2 was copied from the stm32f4.c code,
but the stm32f0 interprets that value the same as 0x0 - which is "low"
speed. Change the OSPEEDR value to "medium" speed so that it matches
the configuration of stm32f1 chips.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This change has been expanded to include all STM32F4 processors, since they share a common TIMER mapping with some processors just not having all of the timers and pins.
Signed-off-by: Jerome Helbert <jerome@helbert.net>
This commit contains a configuration for the Anycubic Vyper printer from 2021.
It uses a clone of the STM32F103 chip named GD32F103.
There are 2 Mainboard versions out there v0.0.5 and v0.0.6, this config has
been tested with the v0.0.6 only. It should probably work for v0.0.5 as well
since there are no different changes in the Anycubic Marlin firmware.
The LCD is not supported yet (might work, but didn't try yet).
Signed-off-by: Marc Neuhaus <marc@neuhaus.nrw>
Signed-off-by: Manuel Fichtner <manuel.fichtner@me.com>
Scale the max_z_velocity limit by the amount of movement in the Z.
This should improve bed_mesh and vase mode prints on delta printers.
Reported by @hywelmartin and @dalegaard.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The backport of Python3's configparser causes issues when there is
unicode characters in the config file. To avoid introducing new
errors, go back to using the Python2 version of ConfigParser when
running on Python2.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Explicitly specify the comment_prefixes as regular Python2 strings -
otherwise the configparser wont ignore non-ascii characters in
comments.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The F405, F407, and F429 chips are in the same series and almost all
code definitions should apply to all chips in that series. Implement
the alias and fix defintions in adc.c and Kconfig that were only
applying to a subset of that series.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Newer versions of configparser no longer default to ignoring trailing
comments that start with a semicolon. Add that setting explicitly to
avoid breaking existing config files.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Add a test case to verify that every optional module successfully
loads on both Python2 and Python3. This is intended to catch syntax
and module imports that are not compatible between Python versions.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The error checking is not complete in this change - the code should
handle the case where an input string is not valid utf8.
The code will continue to run on Python2 after this change, however
the execution time on Python2 is measurably slower after making this
change.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.