Commit graph

5772 commits

Author SHA1 Message Date
Kevin O'Connor
354b1e666b pca9632: Remove custom software i2c - use normal mcu software i2c instead
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-07-22 14:04:50 -04:00
Kevin O'Connor
4691243179 heaters: Increase time before clearing the temperature of an inactive heater
The get_temp() code will stop reporting the last temperature of the
heater if there hasn't been any recent temperature updates.  However,
on a full mcu communication loss this can cause the verify_heater code
to report a heating error prior to the mcu code reporting the
communication failure.  Increase the heater timeout from 5 to 7
seconds to make it more likely the mcu failure is reported first.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-07-19 11:24:59 -04:00
Timofey Titovets
4e4a5c6336 stm32: make i2c distinguish I2C NACKs
Some checks failed
Build test / build (push) Has been cancelled
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-07-17 19:36:01 -04:00
Timofey Titovets
9323a5dfe2 readlog.py: add support for stallguard data
Some checks failed
Build test / build (push) Has been cancelled
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-07-12 16:17:22 -04:00
Timofey Titovets
b724b3a348 data_logger.py: add tmc/stallguard_dump endpoint
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-07-12 16:17:22 -04:00
Timofey Titovets
317f8c94c8 tmc.py: add track of stallguard
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-07-12 16:17:22 -04:00
Timofey Titovets
9c0d0f6a72 tmc: add enriched UART read
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-07-12 16:17:22 -04:00
Timofey Titovets
5923a2e3a1 tmc: add spi status decode
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-07-12 16:17:22 -04:00
Timofey Titovets
8d67e1a4e9 tmc2660: add enriched SPI read
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-07-12 16:17:22 -04:00
Timofey Titovets
33bd67f9b7 tmc: add enriched SPI read
Currently TMC spi just drop the data that could be useful.
Export that data.

Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-07-12 16:17:22 -04:00
Findlay Feng
993cec0891
sos_filter: fix overflows_int32 (#6976)
Some checks are pending
Build test / build (push) Waiting to run
Modify the inline function overflows_int32 to static inline
Inline functions cannot be debugged in -O mode
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49653

Signed-off-by: Findlay Feng <i@fengch.me>
2025-07-11 11:08:35 -04:00
Kevin O'Connor
697c6e8d28 mcu: Avoid altering self.TIMEOUT_TIME in RetryAsyncCommand
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-07-11 10:56:03 -04:00
Timofey Titovets
2585accfeb sht3x: reads should be retried with at least 0.5s pause
Some checks are pending
Build test / build (push) Waiting to run
SHT3x would return a read NACK on host retries.
When the MCU receives the I2C CMD, it reads out data.
SHT3x clears the data buffer.
The MCU fails to deliver a response to the host.
The host retries, the device returns NACK,
then the MCU goes into the shutdown state.

Make sure there is at least 0.5s between retries.

Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-07-11 10:46:57 -04:00
Timofey Titovets
37ddab223f mcu: allow disable send retries
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-07-11 10:46:57 -04:00
Timofey Titovets
119d007058 stm32: f0 do not send empty write on read
Some checks failed
Build test / build (push) Has been cancelled
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-07-09 15:45:52 -04:00
Timofey Titovets
1931b11001 stm32: f0 make i2c distinguish I2C NACKs
Some devices can return a read NACK on host retries.
When the MCU receives the I2C CMD, reads out data,
but fails to deliver a response to the host.
The host retries, the device returns NACK,
and the MCU goes into the shutdown state.

Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-07-09 15:45:52 -04:00
Kevin O'Connor
c01e6eee1d ads1x1x: Rename local 'config' variable to pcfg
Some checks are pending
Build test / build (push) Waiting to run
Avoid using the name "config" as a local register storage variable as
it can be confused with the common "config" configfile reference.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-07-08 18:55:25 -04:00
Kevin O'Connor
42fbf8256f ads1x1x: Revert incorrect removal of assignment to self.config
Commit d120a313b incorrectly removed an assignment to self.config - in
this instance the reference was to a local variable not related to the
global configfile storage.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-07-08 18:49:12 -04:00
Kevin O'Connor
9346ad1914 load_cell_probe: Fix warnings on avr builds
Some checks failed
Build test / build (push) Has been cancelled
On AVR, integers are 16bit, so be sure to promote math to 32bit where
needed.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-06-18 11:09:58 -04:00
jimmyjon711
0e52f03b5b
stm32: Adding more hardware pwm capable pins for STM32Hx series chips (#6965)
Signed-off-by: Jim Madill <jcmadill1@gmail.com>
2025-06-18 11:05:17 -04:00
Kevin O'Connor
f54b7b9376 sos_filter: Fix validate_section_index() check
Some checks failed
Build test / build (push) Has been cancelled
A section_idx equal to max_sections is also invalid.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-06-11 17:59:02 -04:00
Kevin O'Connor
5666b88c69 ar100: Convert to or1k-elf toolchain
Some checks are pending
Build test / build (push) Waiting to run
The more.musl.cc site is blocking downloads from all github actions,
which makes it difficult to use that site for the ar100 cross build
toolchain.  Convert to the openrisc or1k-elf toolchain as a
replacement.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-06-08 14:15:50 -04:00
Kevin O'Connor
889be5b275 docs: Fix typo in Benchmarks.md
Some checks failed
Build test / build (push) Has been cancelled
klipper3d deploy / deploy (push) Has been cancelled
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-06-08 12:23:02 -04:00
Timofey Titovets
607d0b4237 input_shaper: fix printer obj reference
Some checks failed
Build test / build (push) Has been cancelled
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-06-06 15:43:29 -04:00
Kevin O'Connor
d120a313b7 docs: Note 'config' object shouldn't be accessed after initial load
Some checks failed
Build test / build (push) Has been cancelled
klipper3d deploy / deploy (push) Has been cancelled
Update Code_Overview.md to note that the config object should not be
stored after the "config loading phase".

Remove a few inadvertent cases where a 'config' object was stored
in module member variables.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-06-04 13:46:28 -04:00
Dmitry Butyugin
4d4b9684a5 input_shaper: Track kinematics updates by dual_carriage
Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
2025-06-04 13:40:58 -04:00
Kevin O'Connor
14cbb8dd2d rp2040: Prefer larger postdiv1 on rp2040 chips
Some checks failed
Build test / build (push) Has been cancelled
klipper3d deploy / deploy (push) Has been cancelled
The rp2040 uses a pll vco divider of 6.  Prefer setting postdiv1=6 and
postdiv2=1 (instead of the previous postdiv1=3 and postdiv2=2).

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-06-02 14:10:42 -04:00
Kevin O'Connor
aa3388cc59 klippy-requirements: Update setuptools revision to 78.1.1
A security vulnerability was found in setuptools - increase package
dependency to fixed version.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-06-02 13:31:17 -04:00
Timofey Titovets
d6902240dd htu21: fix crash on unknown dev id
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-06-02 13:17:41 -04:00
Kevin O'Connor
105ce35e1b stm32: Add comments on PLL frequency requirements to clock setup code
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-06-02 13:15:53 -04:00
Kevin O'Connor
c0ca4c5cc7 docs: Update benchmarks with stm32g431 chip
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-06-02 13:15:48 -04:00
Kevin O'Connor
cfa48fe39f stm32: Run stm32g431 at 170Mhz
The chip supports 170Mhz, so no need to run at 150Mhz.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-05-31 15:20:12 -04:00
Ingo Donasch
2dd73d0431
print_stats: Fix for filament statistics bug in print_stats.py for toolchangers (#6946)
Some checks failed
Build test / build (push) Has been cancelled
klipper3d deploy / deploy (push) Has been cancelled
added extruder:activate_extruder event hook to print_stats.py to update self.last_epos

Signed-off-by: Ingo Donasch <ingo@donasch.net>
2025-05-31 13:06:44 -04:00
Kevin O'Connor
d25602e88d docs: Update CAN bus command rate benchmarks
Add a benchmark for the rp2350 device when running via CAN bus.
Remove the old stm32f042 CAN bus benchmark as that test predates a
number of importnat CAN bus code changes and is likely no longer
accurate.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-05-31 12:24:40 -04:00
Kevin O'Connor
1f3b4cc749 stm32: Fix spi overflow issue on stm32h7
Some checks are pending
Build test / build (push) Waiting to run
Completely filling the spi transmit fifo could lead to a situation
where the rx fifo overflows.  Make sure not to write past the rx fifo
size.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-05-30 20:36:09 -04:00
Kevin O'Connor
8e58f8fb39 rp2040: Fix spi overflow issue
Completely filling the spi transmit fifo could lead to a situation
where the rx fifo overflows.  Make sure not to write past the rx fifo
size.

Also, be sure to wait for the transmission to fully complete before
exiting spi_transfer().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-05-30 16:34:49 -04:00
Timofey Titovets
f4130aa948 rp2040: spi - enable fifo
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-05-30 15:18:07 -04:00
Kevin O'Connor
de182b1d14 stm32: Support using CANBUS on PB5/PB6 on stm32h7 chips
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-05-30 15:15:13 -04:00
Kevin O'Connor
f5956b5395 stm32: Simplify Kconfig HAVE_STM32_CANBUS checks
Avoid unnecessary (HAVE_STM32_CANBUS && MACH_STM32xx) checks in
Kconfig.  The HAVE_STM32_CANBUS is a helper symbol for all the chips
that support canbus, there's no need to mix it with a check for a chip
that is already known to have canbus.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-05-30 15:15:13 -04:00
Kevin O'Connor
8d7e487149 sos_filter: Improve error checking on section_idx
Some checks failed
Build test / build (push) Waiting to run
klipper3d deploy / deploy (push) Has been cancelled
Validate host provided index prior to accessing memory using that
index.

Also, consistently use a uint8_t for max_sections (to account for
integer overflow issues).

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-05-29 19:30:45 -04:00
Kevin O'Connor
eb43b20e3b load_cell_probe: Avoid peeking directly at config.section member variable
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-05-29 19:17:45 -04:00
Gareth Farrington
388fe1b23f docs: Load Cell Probe Documentation
Add documentation updates for Homing & Probing with load cell probe

Signed-off-by: Gareth Farrington <gareth@waves.ky>
2025-05-29 19:11:05 -04:00
Gareth Farrington
f6d878a898 filter_workbench: Add Filter Workbench
Add a filter workbench Jupiter notebook to help printer developers tune filters based on probing data

Signed-off-by: Gareth Farrington <gareth@waves.ky>
2025-05-29 19:10:51 -04:00
Gareth Farrington
b3e894f241 load_cell_probe: Create LoadCellProbe
Initial setup of Load Cell Probing. This implementation supports triggering from the Load Cell Probe on the MCU. It also supports, optiopnal, filtering of the force signal by sos filter to eliminate drift caused by bowden tubes or other mechanical causes.

Signed-off-by: Gareth Farrington <gareth@waves.ky>
2025-05-29 19:10:21 -04:00
Gareth Farrington
3dbac01e1d probe: Create ProbeVirtualEndstopDeprecation
As probes stop supporting `probe:z_virtual_endstop` this class will give users a polite and specific configuration error.

Signed-off-by: Gareth Farrington <gareth@waves.ky>
2025-05-29 19:08:32 -04:00
Gareth Farrington
69507a0354 sensor_hx71x: Update Sensors to report to load_cell_probe
Signed-off-by: Gareth Farrington <gareth@waves.ky>
2025-05-29 19:07:49 -04:00
Gareth Farrington
42c9031c81 load_cell_probe: Create load_cell_probe MCU object
Implement MCU features that enable using an adc to stop an axis

Signed-off-by: Gareth Farrington <gareth@waves.ky>
2025-05-29 19:06:48 -04:00
Gareth Farrington
cb0c38f7d8 sos_filter: Second Order Sections MCU Filter
This is an implementation of the SOS fliltering algorithm that runs on the MCU.

The filter opperates on data in fixed point format to avoid use of the FPU as klipper does not support FPU usage.

This host object handles duties of initalizing and resetting the filter so client dont have to declare their own commands for these opperations. Clients can select how many integer bits they want to use for both the filter coefficients and the filters output value. An arbitrary number of filter sections can be configured. Filters can be designed on the fly with the SciPy library or loaded from another source.

Signed-off-by: Gareth Farrington <gareth@waves.ky>
2025-05-29 19:01:38 -04:00
Timofey Titovets
0181023954 lis2dw: if spi is used - disable i2c
Some checks failed
Build test / build (push) Has been cancelled
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-05-26 18:44:29 -04:00
Timofey Titovets
07b3726d31 stm32: h7 spi - add a delay on SCK polarity change
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-05-26 18:44:29 -04:00