Commit Graph

5023 Commits

Author SHA1 Message Date
Kevin O'Connor 51526fd627 stm32: ADC timing rework and fixes in stm32h7_adc.c
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>
2023-01-17 18:22:21 -05:00
Kevin O'Connor cef0b70c88 stm32: Move clock line mapping from stm32h7_adc.c to lookup_clock_line()
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>
2023-01-17 18:22:21 -05:00
Kevin O'Connor 1034f19134 stm32: Simplify setting of adc_common fields in stm32h7_adc.c
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2023-01-17 18:22:21 -05:00
Kevin O'Connor 0bf073ba08 stm32: Use a consistent bank size of 20 across all chips in stm32h7_adc.c
Add a pad entry to adc_pins[] on stm32l4 so that it matches the other
chips.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2023-01-17 18:22:21 -05:00
Kevin O'Connor f571618376 stm32: Simplify setting of 12bit mode on stm32h7 in stm32h7_adc.c
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2023-01-17 18:22:21 -05:00
Kevin O'Connor 876c3ffffd stm32: No need to use hardware oversampling in stm32h7_adc.c
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>
2023-01-17 18:22:21 -05:00
Kevin O'Connor efdc29f589 stm32: Simplify CFGR register setup in stm32h7_adc.c
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>
2023-01-17 18:22:21 -05:00
Kevin O'Connor 9b7dcfa333 stm32: No need for LDORDY check in stm32h7_adc.c
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>
2023-01-17 18:22:21 -05:00
Stefan Dej e631840ad6 scripts: add systemd klipper-mcu.service example
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2023-01-17 18:17:25 -05:00
Stefan Dej deed7f829a docs: update RPi_microcontroller.md to systemd
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2023-01-17 18:17:25 -05:00
Stefan Dej cf25c3907c scripts: remove initd klipper-mcu-start.sh
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2023-01-17 18:17:25 -05:00
Stefan Dej 5502be01f7 linux: add -I attribute for user defined socket paths
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2023-01-17 18:17:25 -05:00
Kevin O'Connor 86acee6e8b z_tilt: Improve python3 compatibility
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>
2023-01-17 18:11:57 -05:00
Kevin O'Connor 4671cf2d0e docs: Improve SET_PIN documentation in G-Codes.md
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2023-01-13 11:25:06 -05:00
Kevin O'Connor bca2671efb toolhead: Flush in chunks from flush_step_generation()
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>
2023-01-08 10:40:52 -05:00
Kevin O'Connor 52b33c1b81 toolhead: Rename last_kin_flush_time to force_flush_time
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2023-01-08 10:40:52 -05:00
Kevin O'Connor bd2a849566 toolhead: Fix note_kinematic_activity()
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>
2023-01-08 10:40:52 -05:00
Kevin O'Connor f1203d56f6 chelper: Minor declaration movement in __init__.py
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2023-01-07 23:17:37 -05:00
Kevin O'Connor 4ea11dbb4f trapq: Minor code movement in trapq.c
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2023-01-07 14:13:00 -05:00
Kevin O'Connor 01f90e8f28 console: No need to import pins module
The pins module is no longer used in console.py.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2023-01-07 12:00:16 -05:00
Kevin O'Connor 4395ae96a7 serialhdl: Add a get_serialqueue() method
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2023-01-06 11:59:35 -05:00
Kevin O'Connor a564824009 serialqueue: Add comment to do_write()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2023-01-05 03:09:43 -05:00
Kevin O'Connor cbc17a7cb6 docs: Note v0.11.0 release in Config_Changes.md
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2023-01-04 12:04:45 -05:00
JamesH1978 3cd8a72e60
spi_flash: Add SKR2 F429 chip variant to spi_flash (#5956)
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>
2023-01-04 12:01:28 -05:00
Kevin O'Connor 448c1a1488 stm32: Reindent ifdefs in stm32f0_i2c.c
A whitespace and comment change only - no functional changes.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2023-01-03 12:52:35 -05:00
Alex Voinea 9c2ccceb9f
stm32: Expand stm32g0 family (#5838)
Add stm32g07x family support.

Signed-off-by: Alex Voinea <voinea.dragos.alexandru@gmail.com>
2023-01-03 12:43:46 -05:00
Stas Yakobov b337cc3ee8
config: Added precise location of [bed_screws] for Ender-3-s1 (#5944)
Signed-off-by: Stas Yakobov <stas@3os.org>
2023-01-02 15:22:46 -05:00
Clifford Roche 40d8c2ef16 palette2: Fix errors with bad handling of NoneType in a few locations
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>
2022-12-31 21:03:37 -05:00
JamesH1978 6ae6aaf711
board_defs: Add Fysetc Cheetah V2 to spi_flash (#5952)
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>
2022-12-31 18:26:30 -05:00
CODeRUS f57ff2c07e docs: Fix typo in mpu9250 documentation
Adding MPU-6515, replacing MPU-9255 duplicate

Signed-off-by: Andrei Kozhevnikov <coderusinbox@gmail.com>
2022-12-30 22:28:59 -05:00
janherich 29ba5ab05a delta: Better delta build volume constraint check
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>
2022-12-30 21:39:32 -05:00
Kevin O'Connor 1ff0a5494a stm32: Check for CONFIG_HAVE_BOOTLOADER_REQUEST in dfu_reboot.c
Support disabling dfu_reboot if HAVE_BOOTLOADER_REQUEST is disabled in
the Kconfig rules.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-12-30 21:28:32 -05:00
Kevin O'Connor b51b068442 avr: No need to define bootloader_request()
Since avr does not define HAVE_BOOTLOADER_REQUEST it is not necessary
to define the function.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-12-30 21:28:32 -05:00
Kevin O'Connor c620f4836e canserial: Only call bootloader_request() if CONFIG_HAVE_BOOTLOADER_REQUEST
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-12-30 21:28:32 -05:00
Kevin O'Connor 34fd3f41ea usb_cdc: Only call bootloader_request() if CONFIG_HAVE_BOOTLOADER_REQUEST
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>
2022-12-30 21:28:32 -05:00
Kevin O'Connor 806cf233ec stm32: Include "misc.h" in stm32l4.c and stm32g4.c
Include for bootloader_request() definition.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-12-30 21:28:32 -05:00
Kevin O'Connor 4ca1e5f670 serial_irq: Rename SERIAL_BOOTLOADER_SIDECHANNEL to HAVE_BOOTLOADER_REQUEST
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>
2022-12-30 21:28:32 -05:00
Kevin O'Connor 4753315601 Kconfig: No need to specify "default n" in main Kconfig file
A "bool" option already defaults to "n" so no need to state that
explicitly.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-12-30 21:28:32 -05:00
Alex Voinea 9b60daf62d
tmc: Configurable microstep lookup table (#5920)
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>
2022-12-21 21:23:23 -05:00
Chris Lee aac613bf44 scripts: support CanBoot on RP2040 in flash_usb.py
Signed-off-by: Chris Lee <clee@mg8.org>
2022-12-19 15:42:53 -05:00
janherich f078a27905 manual_probe: Add Z_OFFSET_APPLY_ENDSTOP for delta
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>
2022-12-19 13:14:06 -05:00
Keyan Mobli 8621ebbed2
bed_mesh: Allow bedmeshing at 1mm spaced intervals (#5918)
Signed-off-by: Keyan Mobli <keyan@kmobli.com>
2022-12-19 11:14:45 -05:00
Kevin O'Connor 4af8786587 stm32: Move dfu reboot logic to new dfu_reboot.c file
Move the stm32 DFU reboot logic to a new dfu_reboot.c file.  This
simplifies the per-chip code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-12-18 19:50:08 -05:00
Kevin O'Connor b6cd77f6e3 stm32: Separate out USB DFU reboot logic in stm32l4.c
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-12-18 19:50:08 -05:00
Kevin O'Connor be74c72555 stm32: Separate out USB DFU reboot logic in stm32g4.c
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-12-18 19:50:08 -05:00
theophile 2a25733cd8
screws_tilt_adjust: Add get_status() method (#5921)
Signed-off-by: Christopher Meredith <chmeredith@gmail.com>
2022-12-17 11:39:25 -05:00
Kevin O'Connor 3c1ed3bb27 initial_pins: Add check to reduce compile time size when not in use
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>
2022-12-16 22:46:47 -05:00
Kevin O'Connor 0c43ae1fd4 stm32: Just clean dcache instead of disabling on stm32h7 dfu reboot
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-12-16 17:29:45 -05:00
Kevin O'Connor 02b45c91fb armcm_reset: Flush dcache before rebooting into canboot
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-12-16 17:26:41 -05:00
Kevin O'Connor b0d9cbfb4b stm32: Fix usb build on stm32g0b0
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-12-15 18:43:25 -05:00