aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* rp2040: Avoid using memcpy() on USB dpramKevin O'Connor2024-11-141-7/+30
| | | | | | | | Some versions of the system memcpy() may make unaligned memory accesses, which can result in a bus fault when accessing the usb dpram device memory. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* rp2040: Rename rp2040_link.lds.S to rpxxxx_link.lds.SKevin O'Connor2024-11-133-3/+3
| | | | | | This is in preparation for rp2350 support. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* rp2040: Rename CONFIG_RP2040_yyy Kconfig symbols to CONFIG_RPXXXX_yyyKevin O'Connor2024-11-135-34/+44
| | | | | | | Rename the Kconfig symbols. This is in preparation to adding support for the rp2350 mcu. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* armcm_boot: Support ARM cortex-m33 chipsKevin O'Connor2024-11-133-3/+8
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* lib: Update lib/rp2040 to v2.0.0 SDK releaseKevin O'Connor2024-11-131-6/+11
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* lib: Move lib/rp2040/elf2uf2 to lib/elf2uf2Kevin O'Connor2024-11-131-4/+4
| | | | | | | | Recent versions of the rp2040 sdk no longer contain the elf2uf2 tool. So, move that code to a new dedicated directory. This is in preparation for updating the rp2040 sdk version. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* atsamd: allow i2c rate to be 400kHzWulfsta2024-11-121-4/+10
| | | | Signed-off-by: Luke Vuksta <wulfstawulfsta@gmail.com>
* sensor_lis2dw: add lis3dh sensor and i2c communicationWulfsta2024-11-124-26/+141
| | | | Signed-off-by: Luke Vuksta <wulfstawulfsta@gmail.com>
* atsamd: Add Kconfig definition for SAME51N19 chipKevin O'Connor2024-10-281-2/+6
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Kconfig: Remove references to manufacturers in KconfigKevin O'Connor2024-10-284-17/+17
| | | | | | | | Avoid referring to particular board manufacturers in "make menuconfig". This information becomes rapidly outdated and is sometimes viewed by competing manufacturers as being unfair. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* trsync: Don't require callers of trsync_do_trigger() to disable irqsKevin O'Connor2024-10-261-3/+6
| | | | | | | | | Disable irqs within trsync_do_trigger(). This fixes a bug in ldc1612 - as that code was calling trsync_do_trigger() without first disabling irqs. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sched: Improve timer vs task priority checkKevin O'Connor2024-10-266-11/+15
| | | | | | | | | | | | | | | Rename sched_tasks_busy() to sched_check_set_tasks_busy() and change it to only return true if tasks are active (running or requested) for two consecutive calls. This makes it less likely that timers will yield to tasks except when tasks really are notably backlogged. This also makes it less likely that multiple steppers controlling the same rail will be interrupted by tasks mid-step. This should slightly improve the timing, and make it less likely that a halt during homing/probing will occur with these steppers taking a different number of total steps. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mpu: shutdown on i2c errorsTimofey Titovets2024-10-261-6/+12
| | | | Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* ldc1612: shutdown on i2c errorsTimofey Titovets2024-10-262-1/+3
| | | | Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* i2ccmds: move status checks to functionTimofey Titovets2024-10-262-31/+26
| | | | Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* stm32: forward i2c errors to i2ccmdTimofey Titovets2024-10-261-13/+23
| | | | Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* rp2040: forward i2c errors to i2ccmdTimofey Titovets2024-10-261-18/+24
| | | | Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* linux: forward i2c errors to i2ccmdTimofey Titovets2024-10-261-7/+15
| | | | Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* i2c_software: forward errors to i2ccmdTimofey Titovets2024-10-261-18/+39
| | | | Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* i2c: handle errors at i2ccmdsTimofey Titovets2024-10-2620-49/+123
| | | | Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* i2ccmds: abstract i2c dev from bus implementationTimofey Titovets2024-10-264-23/+35
| | | | | | | | Added wrapper around sw/hw bus API, pins.py code will ensure that pins will not mix between HW/SW buses. Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* stm32: Add support for USART3 on PC11/PC10 on STM32G474. (#6704)Liam Powell2024-10-242-0/+12
| | | Signed-off-by: Liam Powell <liam@liampwll.com>
* atsam: Enable TCM and cache for atsame70Wulfsta2024-10-215-13/+188
| | | | Signed-off-by: Luke Vuksta <wulfstawulfsta@gmail.com>
* atsam: Add data memory barrier to USB driverWulfsta2024-10-211-0/+1
| | | | Signed-off-by: Luke Vuksta <wulfstawulfsta@gmail.com>
* stm32: allow 400Khz in stm32f0_i2c.c (#6694)Timofey Titovets2024-10-091-0/+7
| | | Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* stm32: Fix i2c clock speeds for chips with a peripheral clock over 48MhzKevin O'Connor2024-09-221-5/+13
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Reduce peripheral clock speed on stm32g4 chipsKevin O'Connor2024-09-221-2/+2
| | | | | | A 170mhz (or 150mhz) peripheral clock is too fast for some peripherals. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* rp2040: Check for i2c NACK/Start NACK (#6692)Timofey Titovets2024-09-221-0/+22
| | | Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* STM32: Check for NACK (#6687)Timofey Titovets2024-09-222-0/+4
| | | Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* i2c: drop i2c_modify_bitsTimofey Titovets2024-09-221-33/+0
| | | | | | No longer used and niche Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* stm32: Fix setting USB clock with USB to CANbus mode on stm32g4/stm32l4Kevin O'Connor2024-08-292-2/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sensor_hx71x: Signal an overflow from the timer handlerKevin O'Connor2024-08-141-10/+18
| | | | | | | | Check for overflows in the timer handler instead of checking the elapsed query time. This should be a better check as it also accounts for task delays that occur before the query starts. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* src: Current code produces warnings for possible value overflows. (#6665)Bevan Weiss2024-08-143-4/+9
| | | | | | | | | | As the input values are uint8_t types, any shift may result in value loss. Explicit promotion to the output type (uint32_t) keeps things safe. Have also changed the int32_t in ads1220_read_adc to uint32_t, type promotion and bit manipulation are a bit 'weird' on signed integers, so keep it as an unsigned to align with following function call parameter type. Have retained the prior explicit sign extension logic however. Signed-off-by: Bevan Weiss <bevan.weiss@gmail.com>
* stm32: Fix getting wrong ADC value on PA0 of STM32G431 (#6660)Nicholas Huskie2024-08-081-21/+23
| | | | | | | * Fix getting wrong ADC value on PA0 * Fix invalid/unused pin being used as adc channel on STM32H7/G431/L4 Signed-off-by: Nicholas Huskie <huskie@idealfuture.org.cn>
* ads1220: Add ADS1220 bulk sensor to load_cellGareth Farrington2024-07-313-1/+171
| | | | | | Add support for the ADS1220 as an alternative to HX71x that supports SPI and higher sample rates. Signed-off-by: Gareth Farrington <gareth@waves.ky>
* hx71x: Load Cell Skeleton and HX71x bulk ADCGareth Farrington2024-07-313-1/+254
| | | | | | | * Create the load_cell host module skeleton to create the sensors and start taking samples. * Add support for the HX717 and HX711 ADC sensors. Signed-off-by: Gareth Farrington <gareth@waves.ky>
* rp2040_link: Explicitly set klipper.elf output section flags to avoid warningKevin O'Connor2024-06-171-5/+15
| | | | | | | Avoid pointless "LOAD segment with RWX permissions" linker warnings during the rp2040 build. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* armcm_link: Fix build on recent arm gcc/newlibc versionsKevin O'Connor2024-06-178-9/+14
| | | | | | | | It seems recent arm gcc versions no longer build correctly using the "--specs=nano.specs --specs=nosys.specs" linker flags. Replace those linker flags with "-nostdlib -lgcc -lc_nano". Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* command: Support 2-byte message idsKevin O'Connor2024-06-103-8/+33
| | | | | | | | Allow command ids, response ids, and output ids to be either 1 or 2 bytes long. This increases the total number of message types from 128 to 16384. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sensor_bulk: Change maximum data size from 52 to 51 bytesKevin O'Connor2024-06-102-3/+3
| | | | | | | | | | | | Reduce the maximum data size from 52 bytes to 51 bytes. This will enable support for 2-byte response ids. This change would alter the behavior of the ldc1612 sensor support. Force an ldc1612 command name change so that users are alerted that they must rebuild the micro-controller code upon update of the host code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: STM32F031 updates (#6607)Elias Bakken2024-05-252-2/+4
| | | | | | | Add support for STM32F031x6 which is the 32 KB version of the STM32F031 MCU. Add new I2C bus variant. Signed-off by: Elias Bakken <elias@iagent.no>
* sensor_ldc1612: Halt homing if sensor reports a warningKevin O'Connor2024-05-211-2/+9
| | | | | | | Explicitly check for sensor warnings during homing and report an error code back to the host. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sensor_ldc1612: Create new check_home() helper functionKevin O'Connor2024-05-211-15/+22
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sensor_ldc1612: Add support for chips with INTB line routed to mcuKevin O'Connor2024-05-211-8/+38
| | | | | | If the INTB line is available it can reduce the MCU load. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>