Commit Graph

976 Commits

Author SHA1 Message Date
Alex Voinea 0972561783 stm32g4: Do not disable SWD by accident
Keep SWEN as 1 in FLASH->ACR register such
that the SWD interface doesn't get disabled.

Signed-off-by: Alex Voinea <voinea.dragos.alexandru@gmail.com>
2022-12-11 20:09:50 -05:00
BIGTREETECH 516fdae2b7
linux: add 'GPIOI' for linux process (#5926)
Signed-off-by: Alan.Ma from BigTreeTech tech@biqu3d.com
2022-12-11 20:07:58 -05:00
bigtreetech a42f615881 stm32: add STM32H723 support
Signed-off-by: Chen.BJ from BigTreeTech chenbj@biqu3d.com
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-12-02 13:55:23 -05:00
Matt Baker c5d56f4438 stm32g4: implement build,usb,can,i2c,spi,serial,adc.
Signed-off-by: Matt Baker <baker.matt.j@gmail.com>
2022-12-02 11:31:42 -05:00
Kevin O'Connor 8977c4e764 rp2040: Fix watchdog enable
The rp2040 watchdog does not actually reset anything by default.  The
psm_hw->wdsel field must be programmed to actually get a reset on a
watchdog failure.  Program that field so the watchdog is usable.

Also, disable the watchdog before attempting a reboot into the
bootloader.  Otherwise the machine may just reboot a second time due
to a missed watchdog event in the bootloader.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-11-19 10:13:50 -05:00
Kevin O'Connor b9a378c1ca rp2040: Fix boundary check for max gpio pin
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-11-19 10:13:50 -05:00
Eric Callahan 5b1a667659
linux: use correct gpio bias flags (#5878)
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-11-08 09:56:52 -05:00
Kevin O'Connor 6485ff800b rp2040: Support CanBoot as bootloader
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-11-08 09:53:04 -05:00
Kevin O'Connor 42e9adcfc9 armcm_reset: Introduce Kconfig FLASH_BOOT_ADDRESS value
Specify the arm architecture flash bootup address for each chip type
in Kconfig using a new FLASH_BOOT_ADDRESS setting.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-11-08 09:53:04 -05:00
Kevin O'Connor 11dd273b34 fdcan: Remove spurious executable flag on fdcan.c
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-11-04 11:15:32 -04:00
Kevin O'Connor 762e2c49c7 stm32: Use consistent memory position/size on stm32h743
Use the same memory start address and size on both stm32h750 and
stm32h743.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-11-02 15:35:50 -04:00
Kevin O'Connor 972ae4ab7c stm32: Use stm32f0_serial.c on stm32h7 chips
The stm32h7 uses similar usart hardware as the stm32f0 and stm32g0
chips.  Use the same code implementation for all these chips.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-10-31 15:12:30 -04:00
Alex Voinea 26e6ade175 stm32: fix USART ORE status flag handling
If an USART RX overrun happened on a stm32g0/f0/h7, the ORE flag
would get set by hardware. This flag would also trigger an interrupt.
The problem was that this flag was never cleared on these 3 mcu families
since the ORE flag clear sequence is different to all of the older
chips.
Since the ORE flag is not used in any meaningful way anyway, it was
disabled during the init sequence.

Signed-off-by: Alex Voinea <voinea.dragos.alexandru@gmail.com>
2022-10-31 13:50:15 -04:00
D4SK 00191b5cc4 stm32: Enable instruction and data cache on stm32h7
Signed-off-by: Konstantin Vogel <konstantin.vogel@gmx.net>
2022-10-21 20:29:12 -04:00
Kevin O'Connor e4c8a24711 stm32: Remove incorrect "spi3" definition from stm32h7
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-10-17 11:01:05 -04:00
Kevin O'Connor 4b77f29c1b atsamd: Add support CANbus on ATSAME5x chips
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-10-13 11:28:27 -04:00
Kevin O'Connor 0a9becc391 atsamd: Move bootloader_request() from usbserial.c to main.c
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-10-13 11:27:14 -04:00
Kevin O'Connor bdf79caac4 atsamd: Add Kconfig definitions for same51j19 and same54p20 chips
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-10-13 11:27:14 -04:00
Kevin O'Connor 69bd26b757 lib: Add atmel same51 and same54 build definitions
This also replaces the samd51 component files with the definitions
from the same54 repository.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-10-13 11:27:14 -04:00
Kevin O'Connor 960fd0b1f3 lib: Remove unused gcc/ directories from samd21 and samd51 directories
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-10-13 11:27:14 -04:00
Kevin O'Connor 2c6671d8e1 stm32: Protect message ram with barrier() calls instead of voltaile in fdcan.c
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-10-13 11:21:37 -04:00
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