Commit Graph

4980 Commits

Author SHA1 Message Date
Kevin O'Connor 3377f29bc5 usb_canbus: Minor code reformatting of drain_hw_queue()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2023-04-24 11:31:06 -04:00
Kevin O'Connor f10c60eea7 usb_canbus: Increase rx canbus packet buffer to 32
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>
2023-04-24 11:31:06 -04:00
Kevin O'Connor 8b2074e068 stm32: Fix usbotg irq wakeup notification
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>
2023-04-24 11:29:43 -04:00
Scott Mudge 10e816979e aht10: update comments and docs for AHT20/AHT21 support
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>
2023-04-24 11:10:00 -04:00
crazyroses 5a49372dec
docs: Update Measuring_Resonances.md (#6177)
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>
2023-04-24 11:07:10 -04:00
jdonagher 9b59d745f1
docs: Update Bed_Mesh.md (#6143)
Fix typo.

Signed-off-by: John Donagher <jdonagher@gmail.com>
2023-04-24 11:00:50 -04:00
Dr. Matthew Swabey 011b4e39e6
docs: Fix nested list in Measuring_Resonances (#6157)
Signed-off-by: Matthew Swabey <matthew@swabey.org>
2023-04-19 22:00:03 -04:00
Dr. Matthew Swabey 80a7744b42
sensor_mpu9250: Fix or improve reliability (#6170)
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>
2023-04-19 12:34:22 -04:00
Justin Schuh c2fe372925 gcode_macro: Catch variable encoding errors
Catch parsing and json encoding errors at variable assignment.

Signed-off-by: Justin Schuh <code@justinschuh.com>
2023-04-19 12:22:20 -04:00
Justin Schuh d68a6c28ba webhooks: Log json encoding errors
Signed-off-by: Justin Schuh <code@justinschuh.com>
2023-04-19 12:22:20 -04:00
Florin Popescu 40b4b34998
stm32: Support for USART5 on STM32G0B1 (#6105)
Support for USART5 on PD2,3

Add exception on RCC bits for USART5&6

Signed-off-by: Florin Popescu <florinsgpopescu@gmail.com>
2023-04-19 11:47:18 -04:00
xpeng cba119db3a
config: Add printer configuration for Anycubic Kobra Go (#6166)
Signed-off-by: Yipeng Zhou <yipeng_zhou@foxmail.com>
2023-04-15 22:24:02 -04:00
Scott Mudge 4748dffd7a
docs: Add AHT10 temperature sensor doc section in Config_Reference.md (followup #6138) (#6167)
Followed general outline used by HTU21D and BME280.

Signed-off-by: Scott Mudge <mail@scottmudge.com>
2023-04-15 19:17:54 -04:00
Nathan a8b1b0ef05
docs: Fix duplicate section in Measuring_Resonaces.md (#6160)
Removed a duplicated section in Measuring_Resonances.md.
Also fixed its header level.

Signed-off-by: Nathan Chiu <nhchiu2009@gmail.com>
2023-04-11 11:48:20 -04:00
vcore85 c2b2278a49
tmc5160: add DRV_CONF Register for TMC5160 (#6154)
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>
2023-04-11 11:43:19 -04:00
flowerysong d16adc356b
docs: Add missing code block indicators to Slicers.md(#6161)
Signed-off-by: Paul Arthur <paul.arthur@flowerysong.com>
2023-04-11 11:39:41 -04:00
Kevin O'Connor aa8a6f4cf1 lib: Update to latest can2040 code
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>
2023-04-11 11:20:57 -04:00
Kevin O'Connor 83308a1051 tmc: Support reporting tmc2240 temperature in driver get_status()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2023-04-07 15:20:40 -04:00
Kevin O'Connor 22ee889f41 serialqueue: Rename stalled_bytes stat to upcoming_bytes
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>
2023-04-07 15:17:43 -04:00
Scott Mudge acca55b074
aht10: Added support for AHT10 ambient temperature sensor (#6138)
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>
2023-04-07 13:41:06 -04:00
JamesH1978 754a67af4e
config: SKR3, update for second chip choice (#6153)
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>
2023-04-07 13:05:55 -04:00
visilya 8850084fcf
scripts: Fix flash linux when OUT argument provided (#6133)
Signed-off-by: Ilya Vislotsky <write2ilya@gmail.com>
2023-04-07 12:32:23 -04:00
Kevin O'Connor e5ed245ff2 stm32: Improve ifdef indent in hard_pwm.c
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2023-04-07 12:27:09 -04:00
Kevin O'Connor ecc23fc6fa stm32: Prefer "MACH_STM32F1" test over "MACH_STM32F103 || MACH_N32G45x"
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2023-04-07 12:25:27 -04:00
Kevin O'Connor ef34c5bb5d config: Update comment header in printer-voxelab-aquila-2021.cfg
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2023-04-07 12:21:22 -04:00
Alexey 23e82d37f1
stm32: Add support for Nation N32G45x mcus (#6116)
N32G452/G455 are mostly compatible with STM32F103 but have M4 core and different ADC.

Signed-off-by: Alexey Golyshin <stas2z@gmail.com>
2023-04-07 12:20:14 -04:00
Dr. Matthew Swabey 27dab0ee51
docs: Measuring_Resonances.md improved information on I2C accelerometers and AVR support (#6132)
More information on I2C accelerometers.

Added in table of MCUs with 400kbit/s I2C support

Signed-off-by: Matthew Swabey <matthew@swabey.org>
2023-04-07 11:45:54 -04:00
Alex Voinea fec7ddd8ae
docs: Fix typo in docs (#6147)
Signed-off-by: Alex Voinea <voinea.dragos.alexandru@gmail.com>
2023-03-30 12:30:48 -04:00
Alex Voinea c9731a6fe2 tmc: DUMP_TMC optional REGISTER parameter
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>
2023-03-30 11:41:51 -04:00
Kevin O'Connor 36e0afea2d config: Fix motor4 comment in manta m8p configs
Reported by @jakep82.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2023-03-29 14:19:26 -04:00
spinixguy 9fe3152e23
config: Add config printer-sovol-sv05-2022.cfg (#6122)
Adding Sovol SV06 printer config

Signed-off-by: Joseph Spainhour <spinixguy@gmail.com>
2023-03-29 09:55:02 -04:00
bbro44 d8a9ab5ef7
config: Add Ratrig V-Minion (#6120)
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>
2023-03-29 09:53:54 -04:00
Dr. Matthew Swabey 4026365270
linux: Lock Memory and Increase Priority (#6131)
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>
2023-03-27 21:34:24 -04:00
BIGTREETECH d518152ab2
stm32: Enable I2C on stm32h7 (#6130)
Signed-off-by: Alan.Ma from BigTreeTech <tech@biqu3d.com>
2023-03-27 21:32:42 -04:00
BIGTREETECH 346e3901f6
tmc: Enable sg_angle_offset for smooth switching from Stealthchop to Spreadcycle (#6123)
Signed-off-by: Alan.Ma from BigTreeTech <tech@biqu3d.com>
2023-03-27 21:18:06 -04:00
Jess 1a2033aba8
scripts: add install script for Ubuntu 22.04 Jammy (#6112)
python-dev package is not  available on Jammy; specifies python3-dev.

Signed-off-by: Jess Sullivan <jess@sulliwood.org>
2023-03-27 21:09:46 -04:00
Chris Thompson e93f39444c
docs: Document how to connect ADXL345 to Pico then on to Pi. (#5996)
This is based on documentation from:
https://klipper.discourse.group/t/raspberry-pi-pico-adxl345-portable-resonance-measurement/1757

Signed-off-by: Christopher Thompson <chris@hypocrite.org>
2023-03-27 20:38:26 -04:00
Kevin O'Connor 16f54c8200 stale-issue-bot: Update github lock-threads action to v4
Update to latest version in hopes it will reduce failure reports.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2023-03-27 20:22:44 -04:00
Robert 52f4e20c26
config: Update printer-anycubic-vyper-2021.cfg (#6113)
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>
2023-03-21 15:12:58 -04:00
Dr. Matthew Swabey 2466b7a2c6
avr: Allow I2C bus speed to be set by Klipper (#6111)
Allow I2C bus speed to be set by appropriate Klipper commands.

Signed-off-by: Matthew Swabey <matthew@swabey.org>
2023-03-21 15:02:58 -04:00
bbro44 e2d7c59812
config: Add Fysetc Cheetah V2.0 (#6119)
This adds support for the Cheetah v2.0 mainboard from Fysetc.

Signed-off-by: Benjamin Lesher <bbro44@protonmail.com>
2023-03-20 11:06:44 -04:00
Alex Voinea 73f4c6cd00 tmc: SET_TMC_FIELD VELOCITY
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>
2023-03-20 10:58:25 -04:00
Alex Voinea 0469710a69 tmc: Implement TMCtstepHelper
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>
2023-03-20 10:58:25 -04:00
Kevin O'Connor c54d83c9f1 tmc: Initialize self.coolthrs in TMCVirtualPinHelper constructor
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2023-03-15 16:46:35 -04:00
Alex Voinea a9feeaa9eb tmc: Do not override tcoolthrs if it is configured
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>
2023-03-15 16:45:36 -04:00
Kevin O'Connor fd167894a0 docs: Update reviewers in CONTRIBUTING.md
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2023-03-15 14:55:51 -04:00
Alex Voinea dd39091388 tmc: Enable `multistep_filt` for drivers that support it
`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>
2023-03-15 11:09:10 -04:00
Alex Voinea 117c1d42ac tmc2209: Remove duplicate `pdn_disable` initialization
Signed-off-by: Alex Voinea <voinea.dragos.alexandru@gmail.com>
2023-03-15 11:06:24 -04:00
D4SK 0d5b96a601 reactor: Fix typo
Signed-off-by: Konstantin Vogel <konstantin.vogel@gmx.net>
2023-03-14 22:08:13 -04:00
D4SK 136283bd14 reactor: Fix typo
Signed-off-by: Konstantin Vogel <konstantin.vogel@gmx.net>
2023-03-14 22:08:13 -04:00