aboutsummaryrefslogtreecommitdiffstats
path: root/src/stm32/stm32f0.c
Commit message (Collapse)AuthorAgeFilesLines
* stm32: Use new CONFIG_USB to determine if USB needs to be configuredKevin O'Connor2022-08-161-5/+4
| | | | | | | | | | | | 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>
* usb_cdc: Rename usb_request_bootloader() to bootloader_request()Kevin O'Connor2022-07-291-3/+4
| | | | | | | 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>
* armcm_reset: Add a armcm_reset.h header file for try_request_canboot()Kevin O'Connor2022-06-041-0/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: call "try_request_canboot" for bootloader requestsEric Callahan2022-06-031-0/+1
| | | | Signed-off-by: Eric Callahan <arksine.code@gmail.com>
* stm32: Unify enable_pclock() codeKevin O'Connor2021-12-301-35/+14
| | | | | | | | | Unify the handling of the enable_pclock() and is_enabled_pclock() code across all stm32 chips. All chips will now perform a peripheral reset on enable_pclock() (this is a change for stm32f0 and stm32h7). The enable_pclock() code will now also disable irqs during the enable. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Fix DFU entry point on stm32f072Kevin O'Connor2021-12-231-0/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Reorganize usb bootloader code in stm32f0.cKevin O'Connor2021-12-231-38/+65
| | | | | | Reorganize stm32f0.c into major code blocks. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Add new gpioperiph.c file for gpio_peripheral() codeKevin O'Connor2021-12-231-26/+1
| | | | | | | | 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>
* stm32: Add a MACH_STM32F0x2 alias for F042 and F072 chipsKevin O'Connor2021-10-131-3/+3
| | | | | | | | 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>
* stm32: Change stm32f0 OSPEEDR to "medium" speedKevin O'Connor2021-10-121-1/+1
| | | | | | | | | 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>
* stm32: Add comments to configuration of OSPEEDR gpio speedKevin O'Connor2021-10-121-1/+3
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Simplify USB/Serial/CANbus Kconfig selectionKevin O'Connor2021-03-181-1/+2
| | | | | | | Combine the various communication options into a single "make menuconfig" menu item. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Adding support for STM32F031x6 (#3871)Elias Bakken2021-02-031-1/+2
| | | | | | | Add support for alt usart 1 Do not select all functions on 16 K mcu Signed-off-by: Elias Bakken <elias@iagent.no>
* stm32: Support setting the stm32f0 internal clock trim valueKevin O'Connor2021-01-181-1/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Only use the HSI48 clock when doing "usb clock recovery"Kevin O'Connor2020-12-081-1/+2
| | | | | | | | 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>
* stm32: Improved CAN support for STM32 (#2976)bondus2020-06-241-1/+1
| | | | | | | | | 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>
* stm32: Fix typo causing internal clock to always be used on stm32f042Kevin O'Connor2020-05-281-1/+1
| | | | | | Reported by Pontus Borg. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Add support for a bootloader on stm32f0Kevin O'Connor2020-03-041-0/+19
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: HSI selection fix; Pin swap rename; Add CAN selectionEug Krashtan2020-01-141-3/+3
| | | | | Signed-off-by: Eug Krashtan <eug.krashtan@gmail.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Allow external crystal speed to be customized in KconfigKevin O'Connor2019-11-251-6/+8
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32f0: Initial support for i2c on stm32f0Kevin O'Connor2019-11-141-2/+8
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: adc for new stm32f0 common code (#2120)clearchris2019-11-051-0/+13
| | | | | | | Derived from stm32/adc.c and stm32f0/adc.c with additional changes. Tested on Monoprice Mini Delta (malyan) stm32f070xb board. Signed-off-by: Chris Lombardi <clearchris@hotmail.com>
* stm32: Add support for flashing over usb on stm32f042Kevin O'Connor2019-10-261-0/+15
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Implement armcm_main() in arch specific codeKevin O'Connor2019-10-241-2/+8
| | | | | | | Move armcm_main() to stm32f0.c, stm32f1.c, and stm32f4.c. This gives the arch specific code more control on the early boot setup. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Support PA11/PA12 pin remap on stm32f042 tsop20 chipKevin O'Connor2019-10-231-0/+8
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Support stm32f042 build from stm32/ directoryKevin O'Connor2019-10-231-1/+27
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Initial support for stm32f070Kevin O'Connor2019-10-231-0/+136
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>