Commit Graph

955 Commits

Author SHA1 Message Date
Kevin O'Connor ef98cd9aba stm32: No need for fdcan_ram global pointer in fdcan.c
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-10-13 11:21:37 -04:00
Kevin O'Connor 465aaf383f stm32: Minor code movement in fdcan.c
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-10-13 11:21:37 -04:00
Kevin O'Connor 6288da13ac rp2040: Suppress spurious gcc v12 array bounds warning
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-09-29 11:03:22 -04:00
Kevin O'Connor 51da02b7f8 thermocouple: Only shutdown on multiple consecutive sensor errors
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-09-23 11:56:20 -04:00
Kevin O'Connor 4e930294b8 thermocouple: Report fault information in fault field
Send the fault information explicitly in the query_thermocouple fault
field for max6675, max31855, and max31865.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-09-23 11:55:43 -04:00
Matt Baker d9c917b950 stm32l4: add stm32l412 support with adc,i2c,spi,usb
Signed-off-by: Matt Baker <baker.matt.j@gmail.com>
2022-09-15 11:51:26 -04:00
Matt Baker 30d25834c5 samd21: fix erroneous register bit reference.
Signed-off-by: Matt Baker <baker.matt.j@gmail.com>
2022-09-11 21:27:10 -04:00
Kevin O'Connor 989d0f8097 stm32: Fix i2c on stm32g0
Fix the gpio function.  Also, add buses found only on stm32g0.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-09-11 21:18:32 -04:00
Kevin O'Connor 97a5b39aab stm32: Add a gpio_valid() helper function
Add a function to validate that a gpio pin is valid on the chip.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-09-05 17:57:51 -04:00
Kevin O'Connor 84ec2813ab serial_irq: Support side channel for entering bootloader
Add a mechanism to request the bootloader when using serial input.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-09-05 14:27:25 -04:00
Kevin O'Connor ba38897a35 lpc176x: Move bootloader_request() from usbserial.c to main.c
Move bootloader_request() function so that it can be used when not
using USB.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-09-05 14:27:25 -04:00
Matt Baker ec4ecd7a70 stm32f0: implement i2c_read endpoint
Signed-off-by: Matt Baker <baker.matt.j@gmail.com>
2022-09-01 15:03:06 -04:00
Ben Jackson b220b8bfaf
stm32: Add Hardware PWM support for STM32G0 processors (#5714)
Uses existing common code for STM32. Adds a table for device-
specific PWM mappings. Adds support for enabling all TIM timer
devices. Makes it a runtime error to enable devices the code
doesn't know how to enable.

I have verified performance of the fan pins (PC6, PC7, PB15)
on the SKR Mini E3 V3.

Signed-off-by: Ben Jackson <ben@ben.com>
2022-09-01 13:30:11 -04:00
BIGTREETECH a8883d83e3
stm32: add FDCAN support for STM32H743 (SKR-3 Series) (#5668)
Signed-off-by: Chen.BJ from BigTreeTech <chenbj@biqu3d.com>
2022-08-23 17:53:35 -04:00
adelyser 9e4994cbdb
stm32: Fix the STM32H743 mcu temp on SKR 3 (#5711)
Signed-off-by: Aaron DeLyser <bluwolf@gmail.com>
2022-08-19 14:42:20 -04:00
chestwood96 724b007c50
rp2040: Enabled hw pullups for the I2C pins (#5710)
Signed-off-by: Adrian Joachim <adi.joachim12@gmail.com>
2022-08-19 14:39:30 -04:00
Kevin O'Connor 2357221bb4 atsamd: Use CONFIG_USB instead of CONFIG_USBSERIAL during clock init
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-08-16 21:21:45 -04:00
Kevin O'Connor 6aec6efcc9 stm32: Use new CONFIG_USB to determine if USB needs to be configured
Introduce a CONFIG_USB build symbol that is set whenever
CONFIG_USBSERIAL or CONFIG_USBCANBUS is set.  Use that symbol during
setup so that the USB controller is properly initialized for both usb
serial and usb canbus bridge configurations.

This fixes the clock configuration for usb canbus bridge mode on
stm32f446.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-08-16 21:21:45 -04:00
Kevin O'Connor b026f1d2c9 canserial: Fix typo in canserial.h
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-07-29 11:40:54 -04:00
Kevin O'Connor 9e3feab0b4 stm32: Remove stm32f4 canbus warning
The canbus code has been successfully tested on stm32f4.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-07-29 11:40:54 -04:00
Kevin O'Connor 751bff7d38 mcu: Delay reset signaling for usb to canbus bridge nodes
An mcu device acting as an "mcu bridge" should only be reset after
other normal devices are reset - otherwise the bridge wont be able to
pass along the reset message to the downstream mcus.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-07-29 11:40:54 -04:00
Kevin O'Connor 2d74b3d358 canserial: Request bootloader via bootloader_request()
Use bootloader_request() instead of try_request_canboot().  This
allows the bootloader machanism to work for more bootloaders.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-07-29 11:40:54 -04:00
Kevin O'Connor 18ff84aa04 usb_cdc: Rename usb_request_bootloader() to bootloader_request()
Rename this board API function to a more generic name.  This is in
preparation for calling the function from the canbus code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-07-29 11:40:54 -04:00
Kevin O'Connor db6346e7e5 serialqueue: Improve canbus timing
Adjust timing based on the minimum transmission time of canbus
messages.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-07-29 11:40:54 -04:00
Kevin O'Connor 3796a31959 stm32: Add CCRDY check to stm32g0 adc
The stm32g0 specification states that it is required to wait for the
CCRDY flag to be raised after changing the channel configuration.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-07-25 10:21:29 -04:00
Kevin O'Connor be503b2b9b rp2040: Add support for USB to CANbus bridge mode
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-07-06 00:28:48 -04:00
Kevin O'Connor a831254e83 rp2040: Initial support for CANbus
Add support for CANbus on the rp2040 using the can2040 "software
canbus" implementation.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-07-06 00:28:48 -04:00
BIGTREETECH 1636a9759b
stm32: stm32g0/h7 usb_dfu_bootloader support (#5596)
Signed-off-by: Alan.Ma from BigTreeTech <tech@biqu3d.com>
2022-06-30 13:58:00 -04:00
Kevin O'Connor 790ff4d8d7 usb_canbus: Initial support for USB to CAN bridge mode
Support a USB interface that shows up as a canbus adapter to linux.
Route both local and real canbus packets over that interface.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-06-27 10:50:23 -04:00
Kevin O'Connor c8cc98ce5d canserial: Rename canbus.c to canserial.c
Rename the canbus.c code to canserial.c and introduce new wrapper
functions in canbus.c that connect the low-level canbus hardware code
to the high-level canserial.c code.

This is in preparation for adding "usb to canbus bridge mode".

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-06-27 10:50:23 -04:00
Kevin O'Connor 11828387d9 usb_cdc_ep: Change default endpoint numbers
Change the default endpoint numbers to make it possible to implement
the "gs_usb" canbus protocol.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-06-27 10:50:23 -04:00
Kevin O'Connor f5d5f53914 stm32: Add support for disabling the canbus filter
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-06-27 10:50:23 -04:00
adelyser 84b2bfe313
stm32: Add MCU temp for Stm32h7 (#5606)
Added mcu temperature to the stm32h7 processor.

Signed-off-by: Aaron DeLyser <bluwolf@gmail.com>
2022-06-27 10:16:09 -04:00
Kevin O'Connor d3c4ba4839 rp2040: Add a Kconfig option for selecting "generic_03H" flash type
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-06-20 13:03:58 -04:00
Kevin O'Connor 9e52dc337f rp2040: Add options to Kconfig for "stage2" flash chip options
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-06-20 13:03:58 -04:00
Kevin O'Connor cf9d96434c stm32: Add Kconfig option for stm32f103x6 chip (with only 10KiB ram)
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-06-20 12:37:23 -04:00
Kamil Trzciński 0256967def
stm32: support stm32f401 adc_temperature sensor (#5572)
> The temperature sensor is internally connected to the ADC_IN18

> The TSVREFE bit must be set to enable the conversion of both internal channels: the ADC1_IN16 or ADC1_IN18 (temperature sensor) and the ADC1_IN17 (VREFINT).

Ref.: https://www.st.com/resource/en/reference_manual/dm00096844-stm32f401xb-c-and-stm32f401xd-e-advanced-arm-based-32-bit-mcus-stmicroelectronics.pdf

Signed-off-by: Kamil Trzciński <ayufan@ayufan.eu>
2022-06-20 12:13:02 -04:00
Kevin O'Connor 3f3713ee97 Kconfig: Move SERIAL, USBSERIAL, and CANSERIAL definitions to src/Kconfig
There is no need to define these options in every board Kconfig file.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-06-16 14:59:03 -04:00
bluesforte f55b9d3e57 mpu9250: Adding support for MPU-9250 (and MPU-6050) accelerometer
Add support for mpu9250 accelerometer over I2C bus.

Signed-off-by: Harry Beyel <harry3b9@gmail.com>
2022-06-16 11:09:33 -04:00
Kevin O'Connor fc7838855f canbus: Move canbus uuid calculation to canbus.c
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>
2022-06-16 11:03:48 -04:00
Kevin O'Connor 3f7d05dd18 stm32: Support passing through RTR and EFF canbus frames
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-06-16 11:03:48 -04:00
Kevin O'Connor 913c6a913d stm32: Support PA11/PA12 and PB8/PB9 on fdcan
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-06-16 11:03:48 -04:00
Kevin O'Connor ce186c6af6 stm32: Simplify fdcan tx irq handling
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-06-16 11:00:15 -04:00
Kevin O'Connor 84d798f516 canbus: Use single method for reading canbus messages
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>
2022-06-16 11:00:15 -04:00
Kevin O'Connor da755c3c1b canbus: Move global variables into a struct
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>
2022-06-16 11:00:15 -04:00
Kevin O'Connor ea4f6d6a77 rp2040: Implement workaround for USB errata "rp2040-e5"
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>
2022-06-12 11:25:57 -04:00
Kevin O'Connor 7ffd01de4c stm32: Support 4KiB bootloader on stm32f1 and stm32f0
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>
2022-06-10 11:48:13 -04:00
Eric Callahan b6feda4eae lpc176x: add support for canboot usb
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-06-10 11:23:04 -04:00
functionpointer 2dc20c011d ds18b20: Allow some read errors
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>
2022-06-08 12:39:12 -04:00
BIGTREETECH ada571ecb8
stm32: Enable Automatic retransmission feature to avoid data loss caused by bus conflict for STM32G0B1 fdcan (#5550)
Signed-off-by: Alan.Ma from BigTreeTech <tech@biqu3d.com>
2022-06-06 10:59:18 -04:00