aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert "Makefile: Don't disable gcc's use-linker-plugin option"Kevin O'Connor2025-04-161-1/+0
| | | | | | | | This reverts commit 8087200ffe2fbbe62265dd480ce8be67db8349eb. The change can break the build on some versions of gcc. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* atsamd: Enable HAVE_LIMITED_CODE_SIZE on small atsamd chipsKevin O'Connor2025-04-162-0/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Kconfig: Add some user visible comments to the optional features menuKevin O'Connor2025-04-161-7/+13
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Simplify MakefileKevin O'Connor2025-04-161-31/+19
| | | | | | Breakout selection of timer and gpioperiph objects. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Kconfig: Add new WANT_ADC option to reduce code sizeKevin O'Connor2025-04-168-18/+28
| | | | | | | Make it possible to not compile in support for ADC on chips with small flash sizes. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Kconfig: Add new WANT_I2C option to reduce code sizeKevin O'Connor2025-04-168-33/+43
| | | | | | | Make it possible to not compile in support for I2C on chips with small flash sizes. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Kconfig: Add new WANT_SPI option to reduce code sizeKevin O'Connor2025-04-168-27/+34
| | | | | | | Make it possible to not compile in support for SPI on chips with small flash sizes. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Kconfig: Add new WANT_HARD_PWM option to reduce code sizeKevin O'Connor2025-04-168-7/+14
| | | | | | | Make it possible to not compile in support for hardware pwm on chips with small flash sizes. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Enable gcc -Os option on CONFIG_HAVE_LIMITED_CODE_SIZEKevin O'Connor2025-04-161-0/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: Enable gcc -Os option on CONFIG_HAVE_LIMITED_CODE_SIZEKevin O'Connor2025-04-161-1/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Kconfig: Replace WANT_DISPLAYS with individual optionsKevin O'Connor2025-04-162-4/+12
| | | | | | Support setting WANT_ST7920 and WANT_HD44780 individually. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Kconfig: Replace WANT_GPIO_BITBANGING with individual optionsKevin O'Connor2025-04-162-7/+30
| | | | | | | | Support setting individual options instead of one global option ( WANT_BUTTONS, WANT_TMCUART, WANT_NEOPIXEL, WANT_PULSE_COUNTER, WANT_HX71X). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Makefile: Don't disable gcc's use-linker-plugin optionKevin O'Connor2025-04-161-0/+1
| | | | | | | | | | | | | | | | This option seems to be confusing ld's region usage checks (builds that could fit in small chips are being reported as not fitting). The option was disabled back in commit 4e8674d5 because it showed worse results. However, recent versions of gcc seem to produce the same results even if this option is enabled, so change the build to avoid disabling that option on newer versions of gcc (those that have the -ffat-lto-objects option - which is needed to ensure compile_time_requests sections can be extracted with objcopy). The PRU build is dependent on -fuse-linker-plugin, so enable that option explicitly in its build. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* i2c_software: Fix i2c_delay()Kevin O'Connor2025-04-081-12/+9
| | | | | | | The i2c_delay() function did not properly handle counter rollovers. It also performed an expensive run-time divide. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Turn on can.c error interruptsKevin O'Connor2025-04-031-1/+1
| | | | | | | | It seems both ERRIE and LECIE must be enabled to get hardware error interrupts. Without this, the rx_error and tx_error reports are likely to always be zero. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Add support for additional i2c busRussell Cloran2025-04-021-0/+3
| | | | Signed-off-by: Russell Cloran <rcloran@gmail.com>
* stm32: Fix RESERVE_PINS_CAN pin ordering in fdcan.cKevin O'Connor2025-04-011-1/+1
| | | | | | Always report the reserved pins in the same order (rx,tx). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Added PH13/14 CAN pin option for stm32h743 (#6857)FrY Sennberg2025-03-272-0/+14
| | | | | Added the option to select PH13/PH14 as CAN pins. Signed-off-by: Christoph Frei <fryakatkop@gmail.com>
* rp2040: define spi bus on pins 12,11,10Timofey Titovets2025-03-251-0/+3
| | | | | | Mellow FLY SHT36 Pro toolboard uses those pins Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* stepper: Support disabling optimized "step on both edges" in "make menuconfig"Kevin O'Connor2025-03-202-9/+24
| | | | | | | Add a new "low level option" to allow users to configure if they want to optimize for Trinamic drivers or traditional stepper motor drivers. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Support step on both edges with custom minimum pulse durationKevin O'Connor2025-03-209-30/+46
| | | | | | | | | | Add support for "step on both edges" to the main stepper_event_full() code. This makes that mode of operation available even when the micro-controller is not compiled for "optimized step on both edges". It also enables the custom pulse duration support (step_pulse_ticks) when in "step on both edges" mode. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Add support for USART6 on STM32F401Marius Petcu2025-03-072-2/+28
| | | | | | | | | STM32F401 has USART6 on PA12/PA11 and PC7/PC6 with alternate function mapping AF08. This can be used, for example, to connect to the Elegoo Neptune 3, where PA12/PA11 are wired to an RJ10 plug going to the stock screen. Signed-off-by: Marius Petcu <marius@petcu.me>
* icm20948: Add support for ICM20948 accelerometer (#6756)Paul Hansel2025-03-043-1/+193
| | | Signed-off-by: Paul Hansel <github@paulhansel.com>
* usb_canbus: Send echo frame before processing the frameKevin O'Connor2025-02-271-34/+37
| | | | | | | | | | | The Linux kernel reports a canbus message as transmitted when it gets the echo frame back. Processing the message prior to sending the echo frame can lead to odd looking debugging logs (as the response messages may appear to predate the request messages). This doesn't impact the Klipper code, but it does make analyzing logs harder. Fix by sending the echo frame prior to processing the frame. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* usb_canbus: Minor code cleanup - add new drain_host_queue() helperKevin O'Connor2025-02-271-15/+22
| | | | | | Separate code in usbcan_task() to new drain_host_queue(). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* usb_canbus: Minor code cleanup - code movement and comment updatesKevin O'Connor2025-02-271-36/+57
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* usb_canbus: Wake usbcan_task when sending from canbus_sendKevin O'Connor2025-02-271-1/+1
| | | | | | | | | | | | | | Don't limit the canbus_notify_tx() wakeup to cases where notify_local is set - perform the wakeup whenever the host_status field indicates the main task has work pending. This fixes a small race condition where the main task could block sending a usb echo frame, and the canbus_send() code gets called as the usb bandwidth becomes available but before a usb wakeup notification is sent. In that situation, the usb code may not issue a wake event and the echo frames may be delayed. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* rp2040: Fix build of rp2350Kevin O'Connor2025-02-261-6/+6
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* rp2040: set clock to 200MhzTimofey Titovets2025-02-261-2/+18
| | | | Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* stm32: Add support for stm32f070x6 mcusKevin O'Connor2025-02-162-9/+13
| | | | | | This mcu has smaller memory and may require remapping of PA11/PA12. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* usb_cdc: Avoid ending a transmission with a max size usb packetKevin O'Connor2025-02-151-3/+5
| | | | | | | | | | | | | | | It seems the Linux kernel will consider a maximum size usb packet to be a transaction that will continue into the next usb packet. It will thus hold on to the traffic from the first packet until it gets the next packet. However, if the mcu has no further data to send after the first packet then the data could get delayed for an extended period of time. To avoid this, check for transmissions that could end on a maximum sized packet and send that data in two packets instead. This avoids this unusual corner case. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* usb_cdc_ep: Define endpoint sizes in usb_cdc_ep.hKevin O'Connor2025-02-153-8/+15
| | | | | | | | Move the definition of the usb endpoint sizes from usb_cdc.h to usb_cdc_ep.h . This allows individual boards to override the default endpoint sizes. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: h7 spi support reload mode & frequencyTimofey Titovets2025-02-062-3/+17
| | | | Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* usb_canbus: Detect canbus stalls when in usb to canbus bridge modeKevin O'Connor2025-02-021-3/+57
| | | | | | | | | | | | | | | If the low-level canbus stops working then it could become impossible to send messages to and from the canbus bridge node itself. This can make it difficult to diagnose canbus problems. Change the canbus bridge code to detect if message transmits become stalled for 50+ milliseconds and go into a "discarding" state. In this discarding state, messages destined for the canbus will be discarded until the canbus becomes active again. In this discarding state it will therefore be possible to transmit messages to and from the canbus bridge node. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* canbus_stats: Periodically report canbus interface statisticsKevin O'Connor2025-02-021-1/+20
| | | | | | | | | Add support for a new get_canbus_status command to canserial.c . Add new canbus_stats.py module that will periodically query canbus mcus for connection status information. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* atsam: Add support for reporting canbus stateKevin O'Connor2025-02-021-2/+47
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* atsamd: Add support for reporting canbus stateKevin O'Connor2025-02-021-2/+47
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* rp2040: Add support for reporting canbus stateKevin O'Connor2025-02-021-1/+18
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Add support for reporting canbus state from fdcan.cKevin O'Connor2025-02-021-2/+47
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Add support for reporting canbus state from can.cKevin O'Connor2025-02-022-2/+57
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Kconfig: Simplify WANT_XXX definitionsKevin O'Connor2024-12-122-31/+26
| | | | | | | | | | | | | Use WANT_ADXL345 and WANT_MPU9250 instead of WANT_SENSOR_ADXL345 and WANT_SENSOR_MPU9250. This makes these definitions similar to the other accelerometer defintions. Order menu so accelerometers are close to each other in the menu. Simplify Makefile as Kconfig already assures a symbol will only be defined if its dependencies are met. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* angle: mt6826s added supportTimofey Titovets2024-12-121-0/+38
| | | | Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* angle: mt6816 added supportTimofey Titovets2024-12-121-5/+40
| | | | Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* Kconfig: split sensorsTimofey Titovets2024-12-122-11/+37
| | | | Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* rp2040: Add spi0_gpio4_gpio3_gpio2 bus to support fysetc PITB V2 (#6683)Jessica Hunt2024-11-271-3/+24
| | | | | | | | | | | | | | | | The Fysetc PITB V2 board uses a spi bus config that is supported by the RP2040 chip, but not klipper, so this adds the relevant config to the file to allow you to run the tmc5160's on the board via hardware SPI. This resolves the issue of software spi not working on this board, which I was unable to fully understand. I have also seen other users encounter similar bus config issues with the rp2040 setting up things like accelerometers and such with this pin layout. As requested, this also uses the new convention for spi bus naming, while maintaining the old bus names for compatibility. Signed-off-by: Jessica Hunt <hunt.jessica@proton.me>
* rp2040: Improve indentation in Kconfig fileKevin O'Connor2024-11-141-34/+34
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* rp2040: Add rp2350 bootrom based chipid and reboot to bootloader codeKevin O'Connor2024-11-144-9/+65
| | | | | | | This adds the bootrom code needed to implement "reboot into bootloader" and "chipid" capabilities. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* rp2040: Move chipid reading to bootrom.cKevin O'Connor2024-11-144-108/+120
| | | | | | | | | | | Rewrite chipid.c so that it contains just the USB and canbus id manipulation code. Move the low-level chipid reading to bootrom.c. Also, introduce a new bootrom_reboot_usb_bootloader() function in bootrom.c so that the main.c code does not need to know the specifics of rebooting into the bootrom. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* rp2040: Initial rp2350 supportKevin O'Connor2024-11-146-24/+62
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* rp2040: Use a higher USB PLL internal frequencyKevin O'Connor2024-11-141-1/+5
| | | | | | | The rp2350 chip requires a higher internal frequency, so choose a value that works for both rp2040 and rp2350. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>