Commit Graph

219 Commits

Author SHA1 Message Date
Kevin O'Connor 6e8f28117b stm32: Initial support for stm32g0
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-12-23 22:15:25 -05:00
Kevin O'Connor dc3ac2b424 stm32: Enable optimized gpio_clock_enable() function on stm32h7
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-12-23 22:15:25 -05:00
Kevin O'Connor e56b63fd7e stm32: Reorganize stm32h7.c into major code blocks
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-12-23 22:15:25 -05:00
Kevin O'Connor de35790709 stm32: Remove USB boot stubs from stm32h7.c
The USB dfu bootloader wasn't enabled on stm32h7, so remove the
copy-and-paste code stubs for it.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-12-23 22:15:25 -05:00
Kevin O'Connor 617f620f00 stm32: Fix DFU entry point on stm32f072
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-12-23 22:15:25 -05:00
Kevin O'Connor e14dca0f06 stm32: Reorganize usb bootloader code in stm32f0.c
Reorganize stm32f0.c into major code blocks.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-12-23 22:15:25 -05:00
Kevin O'Connor e55011cde8 stm32: Reorganize usb bootloader code in stm32f4.c
Reorganize stm32f4.c into major code blocks.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-12-23 22:15:25 -05:00
Kevin O'Connor d29f97cd99 stm32: Reorganize code in stm32f1.c
Reorganize stm32f1.c into major code blocks.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-12-23 22:15:25 -05:00
Kevin O'Connor 2ee1f48895 stm32: Add new gpioperiph.c file for gpio_peripheral() code
The gpio_peripheral() code is the same in stm32f0.c, stm32f4.c, and
stm32h7.c.  Move that function to a new gpioperiph.c file to avoid
code duplication.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-12-23 22:15:25 -05:00
Kevin O'Connor 2b7d0bba42 stm32: Add option to disable SWD on GigaDevice STM32F103 clones
Tested by @FotoFieber.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-11-25 10:15:58 -05:00
adelyser 4eeb4620cd stm32: Add USBOTG support to stm32h7
Signed-off-by: Aaron DeLyser <bluwolf@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-11-21 08:12:32 -05:00
Kevin O'Connor 8b401382f6 stm32: Enable SPI on stm32h7
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-11-20 18:26:52 -05:00
adelyser 3ac354088a
stm32: Add stm32h7 SPI support (#4850)
Signed-off-by: Aaron DeLyser <bluwolf@gmail.com>
2021-11-20 18:23:23 -05:00
adelyser b480734c88 stm32: Add STM32H743 support
Signed-off-by: Aaron DeLyser <bluwolf@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-11-20 18:11:02 -05:00
Kevin O'Connor 7b69ef0750 stm32: Limit stm32h7 chips to 400Mhz
Don't go above 400Mhz as otherwise it causes 32bit rollover issues.
(Parts of the code expect a rollover will not occur faster than 10
seconds.)

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-11-20 18:11:02 -05:00
adelyser a5ec751406
stm32: Add UART4 to stm32h7 (#4848)
Signed-off-by: Aaron DeLyser <bluwolf@gmail.com>
2021-11-19 10:27:56 -05:00
Eric Callahan a0615e5e17 stm32f4: reset peripherals in enable_pcclock()
Reset peripherals to after enabling to clear stale
registers set by the bootloader.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-11-08 20:10:51 -05:00
Eric Callahan bf9d497ab0 stm32f4: reset peripheral clocks on init
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-11-08 20:10:51 -05:00
Kevin O'Connor 689231df3a stepper: Add support for stepping on both edges of a step pulse
Add an optimized step function for drivers that support stepping on
both rising and falling edges of the step pin.  Enable this
optimization on 32bit ARM micro-controllers.  Automatically detect
this capability in the host code and enable on TMC drivers running in
SPI/UART mode.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-11-04 12:06:27 -04:00
Kevin O'Connor 85d0ef974c stm32: Remove gcc -mfpu=fpv4-sp-d16 floating point option
The floating point unit must be enabled in order to use it and Klipper
does not currently implement that.  Newer versions of gcc may spill
registers to the floating point unit causing failures.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-30 01:10:50 -04:00
Kevin O'Connor 1e226a8893 stm32: Add a MACH_STM32F0x2 alias for F042 and F072 chips
The F042 and F072 chips are in the same series and the code should be
nearly identical for these chips.  Implement the alias and enable USB
for the F072 chips.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-13 11:25:41 -04:00
Kevin O'Connor 50f51d8aa2 stm32: Rework HAVE_GPIO_HARD_PWM in Kconfig
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-13 11:04:56 -04:00
Kevin O'Connor 97d36ac451 stm32: Change stm32f0 OSPEEDR to "medium" speed
The previous OSPEEDR value of 0x2 was copied from the stm32f4.c code,
but the stm32f0 interprets that value the same as 0x0 - which is "low"
speed.  Change the OSPEEDR value to "medium" speed so that it matches
the configuration of stm32f1 chips.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-12 13:43:31 -04:00
Kevin O'Connor 1b801508ba stm32: Add comments to configuration of OSPEEDR gpio speed
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-12 13:32:46 -04:00
Kevin O'Connor 9d9fe3cb1b stm32: Rework #if pin definition clauses in hard_pwm.c
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-11 21:43:56 -04:00
jrhelbert dbafeb8876
stm32: Adding Hardware PWM support for the STM32F4 processors (#4693)
This change has been expanded to include all STM32F4 processors, since they share a common TIMER mapping with some processors just not having all of the timers and pins.

Signed-off-by: Jerome Helbert <jerome@helbert.net>
2021-10-11 16:31:27 -04:00
Manuel Fichtner 5d52a3b19f
config: Anycubic Vyper (#4740)
This commit contains a configuration for the Anycubic Vyper printer from 2021.
It uses a clone of the STM32F103 chip named GD32F103.
There are 2 Mainboard versions out there v0.0.5 and v0.0.6, this config has
been tested with the v0.0.6 only. It should probably work for v0.0.5 as well
since there are no different changes in the Anycubic Marlin firmware.
The LCD is not supported yet (might work, but didn't try yet).

Signed-off-by: Marc Neuhaus <marc@neuhaus.nrw>
Signed-off-by: Manuel Fichtner <manuel.fichtner@me.com>
2021-10-11 16:26:14 -04:00
Kevin O'Connor e3905eb241 stm32: Add an MACH_STM32F4x5 alias for F405, F407, and F429 chips
The F405, F407, and F429 chips are in the same series and almost all
code definitions should apply to all chips in that series.  Implement
the alias and fix defintions in adc.c and Kconfig that were only
applying to a subset of that series.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-06 19:56:46 -04:00
D4SK c1136bef10 stm32: Add hardware pwm for stm32h7
Signed-off-by: Konstantin Vogel <konstantin.vogel@gmx.net>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-06 18:20:29 -04:00
D4SK 0a55489e2c stm32: Add initial support for stm32h7
Signed-off-by: Konstantin Vogel <konstantin.vogel@gmx.net>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-06 18:20:29 -04:00
Kevin O'Connor 0971a8c2e1 stm32: Support PB7/PB6 for USART1 on stm32f0
Add support for USART1 on PB7/PB6.

Remove STM32_SERIAL_USART1_ALT_PA15_PA14 option and allow all serial
mappings to be used on stm32f031.

Reported by @Desuuuu.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-01 13:46:31 -04:00
Simon Hawkenson 698ca1d0ae
stm32: Add 16KiB bootloader option for STM32F103 (#4493)
The Eryone ER-20 is a STM32F103 based 3D printer which ships with a 16KiB bootloader. Their official version of Marlin starts at 0x08004000.

Signed-off-by: Simon Hawkenson <simon@hawkenson.ca>
2021-07-15 14:09:56 -04:00
Henky Prayoga 4802c6d86a
stm32: Allow STM32F401 boards to use STM32 HID Bootloader (#4461)
Signed-off-by: Henky Prayoga <henky.prayoga@callysta-engineering.com>
2021-07-09 11:20:30 -04:00
henrikssn 430578957f
stm32: Add support for STM32F072 (used in the TurboCAN board) (#4412)
* Add menuconfig option for stm32f072
* Add support for internal temp of stm32f072
* Share the temperature calculation logic between stm32f0x2 MCUs

Signed-off-by: Erik Henriksson <erikhenrikssn@gmail.com>
2021-06-27 20:35:34 -04:00
github@matthewlloyd.net 23f466bfce config: Add configs for Prusa Buddy and Mini+
Signed-off-by: Matthew Lloyd <github@matthewlloyd.net>
2021-06-14 12:37:34 -04:00
Kevin O'Connor 4ea434796b stm32: Support spi1 on PB4/PB5/PB3 on stm32f103 and stm32f2
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-05-26 00:04:30 -04:00
Kevin O'Connor f99dca0918 stm32: Allow alternate USART1 and USART2 ports on stm32f1 and stm32f2
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-05-25 23:50:28 -04:00
Kevin O'Connor 273106358d stm32: Reorganize stm32f1 pin remap handling
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-05-25 23:50:28 -04:00
Kevin O'Connor 12acb99a38 stm32: Fix USART3 on stm32f1 and stm32f2
Commit 6a3c357a incorrectly disabled support for USART3 on stm32f1 and
stm32f2 - restore that support.

Also, add support for USART3 on PD9/PD8 on stm32f103.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-05-25 22:13:09 -04:00
Kevin O'Connor 6a3c357a50 stm32: Add alternate serial ports on stm32f4
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-05-24 21:17:51 -04:00
Kevin O'Connor c1e8ee58e7 stm32: Include pin names in STM32_SERIAL_USART?_ALT kconfig symbols
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-05-24 21:06:04 -04:00
Kevin O'Connor 338bc82d0b stm32: Allow 32KiB bootloader on stm32f446
Useful on the Octopus board.  Reported by @bigtreetech.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-05-20 19:12:09 -04:00
Kevin O'Connor bde6215c3f stm32: Enable ADC3 pins on stm32f446
Reported by @bigtreetech.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-05-06 12:43:13 -04:00
Wilhelm Schuster 1fb091c4fa stm32: Allow selecting bootloader size for STM32F446
Signed-off-by: Wilhelm Schuster <ws@rot13.io>
2021-05-03 14:36:18 -04:00
pkElectronics dd7085cbca
stm32: Added mcu temperature support additional mcu (#4211)
Enabled MCU_Temperature sensor for STM32F405 based boards

Signed-off-by: Pascal Wistinghausen <pascal.wistinghausen@ib-wistinghausen.de>
2021-04-25 10:35:15 -04:00
Oliver 41999eb94d stm32: CAN Kconfig typo
Fixed simple typo in the Kconfig and can.c. stm32f4 CAN Pins

Signed-off-by: Oliver Walter <oli1111@web.de>
2021-04-07 13:06:13 -04:00
Arksine 689c2f9baf stm32f1: reset peripherals in enable_pcclock()
Some bootloaders do not disable peripherals in use before jumping to the application.  Reset peripherals to assure correct operation.

SIgned-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-04-07 12:57:21 -04:00
Michael Kurz 59c4c49893 stm32: Add hardware PWM support for STM32F1
This adds hardware PWM support for STM32F1 processors.
This should also work for STM32 F0/F2/F4 processors, but I
don't have one of those to test it.

Signed-off-by: Michael Kurz <michi.kurz@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-03-26 12:04:51 -04:00
Kevin O'Connor 4566392faf stm32: Minor optimization to can.c IRQ data reading
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-03-18 16:55:04 -04:00
Kevin O'Connor fee84c2afb canbus: Support reading CAN packets directly from IRQ handler
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-03-18 15:58:09 -04:00
Kevin O'Connor 1eddc0fd90 stm32: Simplify USB/Serial/CANbus Kconfig selection
Combine the various communication options into a single "make
menuconfig" menu item.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-03-18 13:33:33 -04:00
Kevin O'Connor 6cb419a90a canbus: Rework CAN command protocol
Rework the micro-controller command protocol so that it supports
direct communication with the serialqueue.c code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-03-13 11:29:41 -05:00
Michael Kurz ab979a52cf
stm32: Add support for STM32F1 I2C1 alternate pin mapping (#4012)
This adds support for the alternate pin mapping of
I2C1 on PB8/9 in STM32F1 devices

Signed-off-by: Michael Kurz <michi.kurz@gmail.com>
2021-03-02 23:02:20 -05:00
Kevin O'Connor c4edc7d946 stm32: Add support for 48KiB bootloaders
Reported by @mks-viva.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-02-20 09:37:43 -05:00
Kevin O'Connor 267a2f3a38 stm32: Optimize stm32f401 peripheral clock
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-02-19 12:19:32 -05:00
Arkadiusz Raj 90ffa0685f stm32: stm32f401 pll_freq updates
Signed-off-by: Arkadiusz Raj <arek.raj@gmail.com>
2021-02-19 12:15:44 -05:00
Arkadiusz Raj 28e41806f5 stm32: 25MHz clock fixes
Signed-off-by: Arkadiusz Raj <arek.raj@gmail.com>
2021-02-19 12:15:31 -05:00
Arkadiusz Raj a6e28f7d6a stm32: Fix missing STM32F429 clock initialization
Signed-off-by: Arkadiusz Raj <arek.raj@gmail.com>
2021-02-19 12:14:55 -05:00
Arkadiusz Raj 7f63efdcea stm32: F429 shall use 168Mhz to allow easy USB clock configuration
Signed-off-by: Arkadiusz Raj <arek.raj@gmail.com>
2021-02-19 12:14:19 -05:00
Arek e6d1910ef9
stm32: Add STM32F429 variant (#3926)
* Add F429 variant; add CAN on PD0,PD1; add 25Mhx clock; move CAN1_RX from PI8 to correct position (PI9)

* Add test for STM32F429

Signed-off-by: Arkadiusz Raj <arek.raj@gmail.com>
2021-02-18 20:12:32 -05:00
Kevin O'Connor fc783f9b83 stm32: Add support for spi bus on stm32f407 pins PI2,PI3,PI1
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-02-12 17:32:54 -05:00
Kevin O'Connor 6698b249ce stm32: Minor indention change to spi.c
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-02-12 17:32:49 -05:00
Kevin O'Connor 8666a724db canbus: Call can_notify_rx() at startup so low-level code does not need to
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-02-09 18:51:03 -05:00
Kevin O'Connor 5c4cf54557 canbus: Rename canbus_set_dataport() to canbus_set_filter() and simplify
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-02-09 18:27:29 -05:00
Elias Bakken 8b443acae8
stm32: Adding support for STM32F031x6 (#3871)
Add support for alt usart 1

Do not select all functions on 16 K mcu

Signed-off-by: Elias Bakken <elias@iagent.no>
2021-02-03 12:23:17 -05:00
Kevin O'Connor d9f6abdb56 canbus: Move high-level CAN code to new src/generic/canbus.c
Separate out the high-level command processing logic from the
low-level transmission code.  Place the high-level code in
src/generic/canbus.c .

This also removes the CAN dependency on serial_irq.c .

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-02-02 15:24:11 -05:00
Kevin O'Connor bee544eaca stm32: Simplify can.c irq handler
Don't perform any heavy tasks in the CAN interrupt handler - just
notify a background task to handle anything pending.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-02-02 15:17:14 -05:00
Kevin O'Connor 95adff7431 stm32: Use CAN_TSR_CODE to select next tx fifo in can.c
The spec states that the TX fifo is transmitted in chronological order
if the TXFP bit is set, but it's unclear if the software needs to fill
the tx fifo in a particular order to obtain that result.  Use the TSR
CODE bit field to fill the TX fifo in the order that the hardware
reports as next.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-02-02 15:17:14 -05:00
Kevin O'Connor 95eb00740b stm32: Avoid read+write modify instructions in can.c
Prefer explicitly setting the hardware registers and avoid using C
read and modify instructions where possible.  This avoids race
conditions where an interrupt or hardware change could cause subtle
corruption of the register state.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-02-02 15:17:14 -05:00
Kevin O'Connor c0371c94c8 stm32: Introduce new can_set_filter() helper function in can.c
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-02-02 15:17:14 -05:00
Kevin O'Connor 901ccfcb9d stm32: Update can.c to use more consistent indentation
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-02-02 15:17:14 -05:00
smark- ef4d9c3abd
stm32: Support for STM32F401 (#3853)
This module adds support for the STM32F401 microcontrollers

Signed-off-by: Marco D'Alessio <marco@wrecklab.com>
2021-01-31 19:41:53 -05:00
Matt Shepcar ccaf58a02c
stm32f1: Fix for using 16MHz external crystal (#3814)
Signed-off-by: Matt Shepcar <matt@shepcar.co.uk>
2021-01-24 10:24:11 -05:00
Kevin O'Connor 28bca7da77 stm32: Support setting the stm32f0 internal clock trim value
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-01-18 12:49:41 -05:00
Kevin O'Connor cc39beba0e stm32: Add support for spi4 bus on stm32f446 chip
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-01-04 01:54:41 -05:00
Kevin O'Connor 39a04eac5f stm32: Only use the HSI48 clock when doing "usb clock recovery"
The HSI48 clock on the stm32f042 isn't as accurate as the main HSI
clock.  So, only use the HSI48 clock when using USB to synchronize
that clock.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-12-08 09:00:47 -05:00
Kevin O'Connor 9142200b3a stm32: Support reading chip based temperature sensor on stm32f0
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-10-29 11:55:06 -04:00
Kevin O'Connor a8069e9ba8 stm32: Reduce adc_pins storage size in stm32f0_adc.c
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-10-29 11:55:06 -04:00
Kevin O'Connor d985b53ccb stm32: Support reading chip based temperature sensor on stm32f1/2/4
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-10-29 11:55:06 -04:00
Kevin O'Connor 2885a4c728 stm32: Don't default to HID bootloader in Kconfig
Restore the default of an 8KiB bootloader for stm32f103 and a 32KiB
bootloader for stm32f207/stm32f407.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-10-13 14:25:17 -04:00
bondus 387fceb453 stm32: Fixed CAN bus for STM32F4, there were syntax errors that prevented compilation
Signed-off-by: Pontus Borg <liquidpontus@yahoo.se>
2020-10-11 11:24:05 -04:00
Cabia Rangris 15853da28c
config: Added TronXY X5SA support (#3265)
Added printer-tronxy-x5sa-v6 config.
Added "chitu" bootloader option to stm32 Kconfig.
Added chitu_crypt.

Signed-off-by: Vladimir Serov <me@cab404.ru>
2020-08-30 12:59:28 -04:00
bondus 35d28e880d
stm32: Improvements to CAN bus ID generation. And added a small fast hash library (#3165)
Improved CAM bus ID generation, there were issues with ID collisions.
Added a small fast hash library.

Signed-off-by: Pontus Borg <liquidpontus@yahoo.se>
2020-08-09 21:07:59 -04:00
bondus 7a8e9591e3
stm32: Improved CAN support for STM32 (#2976)
Reworked the STM32F0 CAN bus implementation. It's more robust and higher performance.

Added support for function remapping to different pins.  API is emulating an STM32F0.

Improved and ported CAN bus to STM32F0, F1 and F4.

Signed-off-by: Pontus Borg <glpontus@gmail.com>
2020-06-24 18:59:38 -04:00
combolek 7cab732ae9
stm32: Initial support for stm32f2 (#3001)
Initial support for stm32f2 in general and STM32F207 in particular.

Boots up and communicates on STM32F207VC.

Signed-off-by: Boleslaw Ciesielski <combolek@users.noreply.github.com>
2020-06-23 10:52:15 -04:00
kianusch a4c31bafb0
stm32: Support for 20KiB bootloader offset. (#3008)
Signed-off-by: Kianusch Sayah Karadji <kianusch@gmail.com>
2020-06-20 13:30:10 -04:00
Kevin O'Connor 835ec3513d Kconfig: Add a new CONFIG_HAVE_STRICT_TIMING build definition
Add a new build definition to note micro-controllers that have strict
timing.  The Linux mcu code does not have strict timing - all other
targets currently do.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-31 14:57:06 -04:00
Kevin O'Connor b80d2f7706 stm32: Fix typo causing internal clock to always be used on stm32f042
Reported by Pontus Borg.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-28 15:56:22 -04:00
Arksine ab87af90a3 stm32f4: Add support for HID bootloader
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-05-28 14:44:51 -04:00
Arksine 05efccc874 stm32f1: Add support for HID Bootloader
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2020-05-28 14:44:51 -04:00
Arksine 72b3ab8b29 stm32: add support for i2c read
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-05-05 11:44:19 -04:00
Arksine f8649b4ba9 stm32: Wait for setup complete to enable ep0 rx in usbotg.c
Endpoint 0 OUT needs to NAK everything until the core signals that the
setup stage is complete.

Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-03 12:00:47 -04:00
Kevin O'Connor e93c188766 stm32: Wait for setup complete notification in usbotg.c
A setup packet is only valid after receiving the "setup complete"
notification.

Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-03 11:27:43 -04:00
Kevin O'Connor b6ebf5cb09 stm32: Slow ADC frequency to 4.5Mhz
There are reports that SKR mini boards have more stable ADC results
when running the ADC at a slower frequency.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-04-30 19:47:23 -04:00
Kevin O'Connor 91a27ef083 stm32: Add support for 64KiB bootloader on stm32f103
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-03-24 10:02:21 -04:00
Kevin O'Connor 886530e777 stm32: Explicitly reset peripheral clocks on stm32f1
It appears some bootloaders do not properly reset some peripherals.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-03-24 10:00:45 -04:00
Kevin O'Connor 79e2376993 stm32: Add support for a bootloader on stm32f0
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-03-04 19:50:56 -05:00
Kevin O'Connor 121249c999 stm32: Revert "stm32: performance improvement for spi on stm32f0"
This reverts commit a2c309a2b0.

The above commit is causing crashes on the stm32f103xb chip when spi
is in use.  It's unclear what the cause of the regression is, but the
optimization isn't required so revert it until the root cause can be
determined.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-03-04 18:33:34 -05:00
Kevin O'Connor 31b2c3ea7a stm32: Fix broken clock setup on stm32f1
Commit bd6c25c9 introduced a typo that caused the clock divisors to
not be set correctly on stm32f1.

Reported by @brianrjones69.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-02-29 13:14:12 -05:00
Kevin O'Connor b5c967acd8 stm32: The stm32f1 can only reach 64Mhz when using an internal clock
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-02-14 12:11:50 -05:00