aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Kconfig: Move SERIAL, USBSERIAL, and CANSERIAL definitions to src/KconfigKevin O'Connor2022-06-166-22/+6
| | | | | | There is no need to define these options in every board Kconfig file. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mpu9250: Adding support for MPU-9250 (and MPU-6050) accelerometerbluesforte2022-06-164-4/+298
| | | | | | Add support for mpu9250 accelerometer over I2C bus. Signed-off-by: Harry Beyel <harry3b9@gmail.com>
* canbus: Move canbus uuid calculation to canbus.cKevin O'Connor2022-06-167-25/+21
| | | | | | | | Move the uuid hash calculation to canbus.c and call canbus_set_uuid() from src/stm32/chipid.c . This simplifies the low-level canbus hardware code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Support passing through RTR and EFF canbus framesKevin O'Connor2022-06-163-28/+39
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Support PA11/PA12 and PB8/PB9 on fdcanKevin O'Connor2022-06-162-16/+20
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Simplify fdcan tx irq handlingKevin O'Connor2022-06-161-8/+4
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* canbus: Use single method for reading canbus messagesKevin O'Connor2022-06-164-198/+125
| | | | | | | | | | | | Previously the code had canbus_read() which was called from task context (for admin messages), and canbus_process_data() which was called from irq context (used for data messages). Change that to a single canbus_process_data() function that is called from irq context (used for all messages). This simplifies the low-level hardware specific canbus code and should make it easier to support other hardware implementations. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* canbus: Move global variables into a structKevin O'Connor2022-06-161-55/+65
| | | | | | | | Create a single CanData global variable to track the canbus state. ARM micro-controllers generally produce better code when global variables are in a struct. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* rp2040: Implement workaround for USB errata "rp2040-e5"Kevin O'Connor2022-06-121-3/+99
| | | | | | | | The rp2040 USB may not connect after a reset. Implementation the recommended workaround. Signed-off-by: Lasse Dalegaard <dalegaard@gmail.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Support 4KiB bootloader on stm32f1 and stm32f0Kevin O'Connor2022-06-101-0/+3
| | | | | | | The CanBoot bootloader can often fit in 4KiB and that may be useful for some devices with small flash sizes. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* lpc176x: add support for canboot usbEric Callahan2022-06-101-0/+2
| | | | Signed-off-by: Eric Callahan <arksine.code@gmail.com>
* ds18b20: Allow some read errorsfunctionpointer2022-06-081-22/+33
| | | | | | | | | | | | | | | | | | | | | Allows a limited number of DS18B20 read failures before stopping the printer. This is designed to tolerate spurious read errors, while still stopping for serious issues. The printer will stop when the sensor fails to report a value five times in a row. Implementation works as follows: The MCU reports any read errors using a new "fault" parameter in its answers. The Python code tracks the number of errors and triggers the shutdown. This paves the way for more sophisticated error handling in the future, as well as an example for other sensors to follow. Signed-off-by: Lorenzo Pfeifer <Lorenzo.Pfeifer+github@googlemail.com>
* stm32: Enable Automatic retransmission feature to avoid data loss caused by ↵BIGTREETECH2022-06-061-2/+0
| | | | | bus conflict for STM32G0B1 fdcan (#5550) Signed-off-by: Alan.Ma from BigTreeTech <tech@biqu3d.com>
* Kconfig: Move CANBUS_FREQUENCY definition from src/stm32/Kconfig to src/KconfigKevin O'Connor2022-06-042-4/+5
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* armcm_reset: Add a armcm_reset.h header file for try_request_canboot()Kevin O'Connor2022-06-049-9/+18
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: use TME bits to find the canbus tx mailboxEric Callahan2022-06-031-1/+5
| | | | Signed-off-by: Eric Callahan <arksine.code@gmail.com>
* stm32: call "try_request_canboot" for bootloader requestsEric Callahan2022-06-035-0/+5
| | | | Signed-off-by: Eric Callahan <arksine.code@gmail.com>
* canbus: use "try_request_canboot" methodEric Callahan2022-06-032-15/+4
| | | | Signed-off-by: Eric Callahan <arksine.code@gmail.com>
* armcm_reset: support canboot detectionEric Callahan2022-06-031-0/+32
| | | | | | | | | | When CanBoot is detected set its bypass signature when a reset is requested. Add a "try_request_canboot()" method that may be called from from USB and Canbus bootloader requests. Signed-off-by: Eric Callahan <arksine.code@gmail.com>
* stm32: Rework kconfig to use CONFIG_CANSERIAL for both can.c and fdcan.cKevin O'Connor2022-06-012-13/+8
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: stm32g0b1 fdcan support (#5488)BIGTREETECH2022-06-015-2/+347
| | | Signed-off-by: Alan.Ma from BigTreeTech <tech@biqu3d.com>
* stm32: Don't allow USB on internal clock for stm32f103/stm32f070Kevin O'Connor2022-05-231-1/+2
| | | | | | Reported by @kaidegit. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* misc: Import misc.h in all files defining console_sendf()Kevin O'Connor2022-05-133-0/+3
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Remove unused header from can.cKevin O'Connor2022-05-101-1/+0
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* canbus: Rename CANBUS_CMD_SET_NODEID to CANBUS_CMD_SET_KLIPPER_NODEIDKevin O'Connor2022-05-101-5/+5
| | | | | | | Rename the command name for consistency with the canbus_query.py script. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: add 8 KiB bootloader option for F0x2 devicesEric Callahan2022-05-101-1/+1
| | | | Signed-off-by: Eric Callahan <arksine.code@gmail.com>
* canbus: send 8 bytes in the id responseEric Callahan2022-05-101-1/+2
| | | | | | | The last byte contains the "node id" command, which is used to identify the application. Signed-off-by: Eric Callahan <arksine.code@gmail.com>
* canbus: add bootloader supportEric Callahan2022-05-101-0/+27
| | | | | | | | | This adds a command which allows an external script to broadcast a bootloader request, using a supplied UUID to match the request. Included is a method to process requests to enter the canboot bootloader. Signed-off-by: Eric Callahan <arksine.code@gmail.com>
* stm32: Fix typo in i2c.cKevin O'Connor2022-05-071-2/+2
| | | | | | Reported by @kaidegit. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Add 64kib bootloader offset option to STM32F401 (#5457)JamesH19782022-04-251-1/+1
| | | | | This is needed for the Creality Ender 3 S1 with the STM32F401 chips to enable a 64kib bootloader offset Signed-off-by: James Hartley <james@hartleyns.com>
* spicmds: Allow inversion of CS pin for SPI bussesMartin Hierholzer2022-04-221-12/+14
| | | | | Signed-off-by: Martin Hierholzer <martin@hierholzer.info> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Add STM32F072 16KiB bootloader option (#5404)alstoepp2022-04-131-1/+1
| | | Signed-off-by: Alexander Stöpperger <a.stoepperger@gmx-topmail.de>
* stm32: Add support for additional i2c busesKevin O'Connor2022-04-111-0/+17
| | | | | | Reported by @StoneColdCrazy. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sensor_angle: Support TLE5012b frame counter for timingKevin O'Connor2022-03-291-14/+57
| | | | | | | Use the tle5012b internal frame counter to calculate the time of each measurement. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sensor_angle: Add support for bulk querying of spi angle sensorsKevin O'Connor2022-03-294-1/+291
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* atsam: Fix typo in sam4e_afecAlex Maclean2022-03-281-1/+1
| | | | | | | | Accidentally introduced in 80492432210f1cf7817b7808245d196f3420021e, renders the AFE non-functional on SAME70. Should have had little impact on SAM4E. Signed-off-by: Alex Maclean <monkeh@monkeh.net>
* atsam: Add support for SAM E70Alex Maclean2022-03-2615-74/+425
| | | | Signed-off-by: Alex Maclean <monkeh@monkeh.net>
* linux: Update i2c.c (#5295)Blinker732022-03-141-1/+1
| | | | | | | | | | | | | | | Similarly to commit 8cf1b512 for SPI, the Rpi4 has more i2c busses to offer This change allows klipper to use up to I2c bus 6 /boot/configtxt dtparam=i2c_arm=on dtoverlay=i2c6 and pi@fluiddpi:~ $ ls -1 /dev/i2c* /dev/i2c-1 /dev/i2c-6 Signed-off-by: Sylvain Dansereau <brutus_dansereau@hotmail.com>
* stm32: Allow 32KiB bootloader to be specified for all STM32F4 buildsKevin O'Connor2022-03-141-1/+1
| | | | | | Reported by @GerogeFu. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Clarify CCIPR2 setting in stm32g0.cKevin O'Connor2022-03-111-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Simplify CCIPR2 register assignment on stm32g0Kevin O'Connor2022-03-091-5/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: USB clock source from PLLQCLK on stm32g0 (#5341)BIGTREETECH2022-03-091-6/+4
| | | Signed-off-by: Alan.Ma from BigTreeTech <tech@biqu3d.com>
* lpc176x: Fix serial ordering of initializationKevin O'Connor2022-03-011-1/+1
| | | | | | | The serial device needs to be enabled before setting the DLAB bit. This prevented UART3 from working. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Clear SPE flag on a change to SPI CR1 registerKevin O'Connor2022-02-101-0/+6
| | | | | | | | | The stm32 specs indicate that the SPE bit must be cleared before changing the CPHA or CPOL bits. Reported by @cbc02009 and @bigtreetech. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Wait for transmission to complete before returning from spi_transfer()Kevin O'Connor2022-02-101-2/+5
| | | | | | | | | | | | | It's possible for the SCLK pin to still be updating even after the last byte of data has been read from the receive pin. (In particular in spi mode 0 and 1.) Exiting early from spi_transfer() in this case could result in the CS pin being raised before the final updates to SCLK pin. Add an additional wait at the end of spi_transfer() to avoid this issue. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Fix ADC on stm32h7 (#5239)adelyser2022-02-061-1/+3
| | | | | | Don't reset the ADC peripheral if the clock is already enabled. Fixes #5236 Signed-off-by: Aaron DeLyser <bluwolf@gmail.com>
* flash_usb: use sudo for rp2040 flashingLasse Dalegaard2022-01-311-1/+1
| | | | | | | | | | | The rp2040 can be flashed without sudo when using udev rules to give the user permission, but in a standard configuration sudo is required. Here we make it possible for flash_usb to use sudo for the rp2040 target, and make it the default when using `make flash` for the rp2040. As for other targets, one can set `NOSUDO=1` to not call through sudo. Signed-off-by: Lasse Dalegaard <dalegaard@gmail.com>
* stm32: Add remap CAN to PD0/PD1 for stm32f103 (#5173)Sergey15602022-01-262-1/+4
| | | Signed-off-by: Sergey Terentiev <sergey@terentiev.me>
* rp2040: implement I2CLasse Dalegaard2022-01-124-0/+227
| | | | | | | This implements I2C for the rp2040 target. All output groupings of both I2C blocks are available for use. Signed-off-by: Lasse Dalegaard <dalegaard@gmail.com>
* stm32: Update Kconfig as CANBUS isn't available on stm32f401Kevin O'Connor2022-01-071-8/+15
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>