aboutsummaryrefslogtreecommitdiffstats
path: root/src/stm32
Commit message (Collapse)AuthorAgeFilesLines
* stm32: Apply race fixes to stm32h7_adc.cKevin O'Connor2022-12-121-19/+18
| | | | | | | Improve handling of race conditions with hardware updates. This is the same changes applied to stm32f0_adc.c in commit 88325b6c. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32g0: Do not disable SWD by accidentAlex Voinea2022-12-111-2/+5
| | | | | | 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>
* stm32g4: Do not disable SWD by accidentAlex Voinea2022-12-111-1/+1
| | | | | | 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>
* stm32: add STM32H723 supportbigtreetech2022-12-024-61/+113
| | | | | Signed-off-by: Chen.BJ from BigTreeTech chenbj@biqu3d.com Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32g4: implement build,usb,can,i2c,spi,serial,adc.Matt Baker2022-12-0210-19/+318
| | | | Signed-off-by: Matt Baker <baker.matt.j@gmail.com>
* armcm_reset: Introduce Kconfig FLASH_BOOT_ADDRESS valueKevin O'Connor2022-11-081-0/+4
| | | | | | | 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>
* fdcan: Remove spurious executable flag on fdcan.cKevin O'Connor2022-11-041-0/+0
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Use consistent memory position/size on stm32h743Kevin O'Connor2022-11-021-3/+1
| | | | | | | Use the same memory start address and size on both stm32h750 and stm32h743. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Use stm32f0_serial.c on stm32h7 chipsKevin O'Connor2022-10-313-110/+36
| | | | | | | 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>
* stm32: fix USART ORE status flag handlingAlex Voinea2022-10-313-3/+8
| | | | | | | | | | | 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>
* stm32: Enable instruction and data cache on stm32h7D4SK2022-10-211-0/+3
| | | | Signed-off-by: Konstantin Vogel <konstantin.vogel@gmx.net>
* stm32: Remove incorrect "spi3" definition from stm32h7Kevin O'Connor2022-10-171-4/+0
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Protect message ram with barrier() calls instead of voltaile in fdcan.cKevin O'Connor2022-10-131-22/+25
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: No need for fdcan_ram global pointer in fdcan.cKevin O'Connor2022-10-131-24/+10
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Minor code movement in fdcan.cKevin O'Connor2022-10-131-37/+41
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32l4: add stm32l412 support with adc,i2c,spi,usbMatt Baker2022-09-158-32/+305
| | | | Signed-off-by: Matt Baker <baker.matt.j@gmail.com>
* stm32: Fix i2c on stm32g0Kevin O'Connor2022-09-112-0/+34
| | | | | | Fix the gpio function. Also, add buses found only on stm32g0. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Add a gpio_valid() helper functionKevin O'Connor2022-09-051-12/+12
| | | | | | Add a function to validate that a gpio pin is valid on the chip. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* serial_irq: Support side channel for entering bootloaderKevin O'Connor2022-09-051-0/+1
| | | | | | Add a mechanism to request the bootloader when using serial input. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32f0: implement i2c_read endpointMatt Baker2022-09-011-1/+20
| | | | Signed-off-by: Matt Baker <baker.matt.j@gmail.com>
* stm32: Add Hardware PWM support for STM32G0 processors (#5714)Ben Jackson2022-09-013-4/+66
| | | | | | | | | | | 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>
* stm32: add FDCAN support for STM32H743 (SKR-3 Series) (#5668)BIGTREETECH2022-08-233-8/+85
| | | Signed-off-by: Chen.BJ from BigTreeTech <chenbj@biqu3d.com>
* stm32: Fix the STM32H743 mcu temp on SKR 3 (#5711)adelyser2022-08-191-1/+1
| | | Signed-off-by: Aaron DeLyser <bluwolf@gmail.com>
* stm32: Use new CONFIG_USB to determine if USB needs to be configuredKevin O'Connor2022-08-164-10/+9
| | | | | | | | | | | | 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>
* stm32: Remove stm32f4 canbus warningKevin O'Connor2022-07-291-1/+0
| | | | | | The canbus code has been successfully tested on stm32f4. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* usb_cdc: Rename usb_request_bootloader() to bootloader_request()Kevin O'Connor2022-07-295-18/+21
| | | | | | | 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>
* stm32: Add CCRDY check to stm32g0 adcKevin O'Connor2022-07-251-0/+9
| | | | | | | 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>
* stm32: stm32g0/h7 usb_dfu_bootloader support (#5596)BIGTREETECH2022-06-302-1/+34
| | | Signed-off-by: Alan.Ma from BigTreeTech <tech@biqu3d.com>
* usb_canbus: Initial support for USB to CAN bridge modeKevin O'Connor2022-06-272-6/+58
| | | | | | | 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>
* canserial: Rename canbus.c to canserial.cKevin O'Connor2022-06-274-5/+7
| | | | | | | | | | 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>
* stm32: Add support for disabling the canbus filterKevin O'Connor2022-06-272-7/+15
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Add MCU temp for Stm32h7 (#5606)adelyser2022-06-271-2/+11
| | | | | Added mcu temperature to the stm32h7 processor. Signed-off-by: Aaron DeLyser <bluwolf@gmail.com>
* stm32: Add Kconfig option for stm32f103x6 chip (with only 10KiB ram)Kevin O'Connor2022-06-201-1/+6
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: support stm32f401 adc_temperature sensor (#5572)Kamil Trzciński2022-06-201-2/+4
| | | | | | | | | > 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>
* Kconfig: Move SERIAL, USBSERIAL, and CANSERIAL definitions to src/KconfigKevin O'Connor2022-06-161-6/+0
| | | | | | There is no need to define these options in every board Kconfig file. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* canbus: Move canbus uuid calculation to canbus.cKevin O'Connor2022-06-164-15/+7
| | | | | | | | 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-162-28/+36
| | | | 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-162-156/+48
| | | | | | | | | | | | 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>
* 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>
* 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-041-4/+0
| | | | 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-046-3/+5
| | | | 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-031-0/+3
| | | | 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>