aboutsummaryrefslogtreecommitdiffstats
path: root/src/stm32
Commit message (Collapse)AuthorAgeFilesLines
* stm32: Support reading chip based temperature sensor on stm32f0Kevin O'Connor2020-10-291-2/+10
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Reduce adc_pins storage size in stm32f0_adc.cKevin O'Connor2020-10-291-19/+7
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Support reading chip based temperature sensor on stm32f1/2/4Kevin O'Connor2020-10-291-5/+24
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Don't default to HID bootloader in KconfigKevin O'Connor2020-10-131-6/+8
| | | | | | | 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>
* stm32: Fixed CAN bus for STM32F4, there were syntax errors that prevented ↵bondus2020-10-111-3/+3
| | | | | | compilation Signed-off-by: Pontus Borg <liquidpontus@yahoo.se>
* config: Added TronXY X5SA support (#3265)Cabia Rangris2020-08-301-0/+3
| | | | | | | Added printer-tronxy-x5sa-v6 config. Added "chitu" bootloader option to stm32 Kconfig. Added chitu_crypt. Signed-off-by: Vladimir Serov <me@cab404.ru>
* stm32: Improvements to CAN bus ID generation. And added a small fast hash ↵bondus2020-08-092-6/+7
| | | | | | | | 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>
* stm32: Improved CAN support for STM32 (#2976)bondus2020-06-247-279/+493
| | | | | | | | | 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: Initial support for stm32f2 (#3001)combolek2020-06-234-6/+46
| | | | | | | 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>
* stm32: Support for 20KiB bootloader offset. (#3008)kianusch2020-06-201-0/+3
| | | Signed-off-by: Kianusch Sayah Karadji <kianusch@gmail.com>
* Kconfig: Add a new CONFIG_HAVE_STRICT_TIMING build definitionKevin O'Connor2020-05-311-0/+1
| | | | | | | | 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>
* 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>
* stm32f4: Add support for HID bootloaderArksine2020-05-282-2/+16
| | | | Signed-off-by: Eric Callahan <arksine.code@gmail.com>
* stm32f1: Add support for HID BootloaderArksine2020-05-283-4/+16
| | | | Signed-off-by: Eric Callahan <arksine.code@gmail.com>
* stm32: add support for i2c readArksine2020-05-051-3/+39
| | | | Signed-off-by: Eric Callahan <arksine.code@gmail.com>
* stm32: Wait for setup complete to enable ep0 rx in usbotg.cArksine2020-05-031-4/+11
| | | | | | | | 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>
* stm32: Wait for setup complete notification in usbotg.cKevin O'Connor2020-05-031-6/+13
| | | | | | | | 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>
* stm32: Slow ADC frequency to 4.5MhzKevin O'Connor2020-04-302-4/+4
| | | | | | | 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>
* stm32: Add support for 64KiB bootloader on stm32f103Kevin O'Connor2020-03-241-2/+5
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Explicitly reset peripheral clocks on stm32f1Kevin O'Connor2020-03-241-0/+5
| | | | | | It appears some bootloaders do not properly reset some peripherals. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Add support for a bootloader on stm32f0Kevin O'Connor2020-03-042-2/+26
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Revert "stm32: performance improvement for spi on stm32f0"Kevin O'Connor2020-03-041-8/+4
| | | | | | | | | | | This reverts commit a2c309a2b02d16ec15fee5702463621239261266. 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>
* stm32: Fix broken clock setup on stm32f1Kevin O'Connor2020-02-291-2/+2
| | | | | | | | | 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>
* stm32: The stm32f1 can only reach 64Mhz when using an internal clockKevin O'Connor2020-02-141-0/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Fix typo that broke selection of alternate serial port pinKevin O'Connor2020-02-092-2/+2
| | | | | | Fix a typo in commit aea15250. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Reset adc calibration prior to starting calibrationKevin O'Connor2020-01-251-8/+17
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Increase adc sample timeKevin O'Connor2020-01-251-4/+4
| | | | | | | Increase the sample time register from 3 to 4 (which adds about ~1.5us to each adc sample). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Only declare alternate usart2 on stm32f0Kevin O'Connor2020-01-233-49/+41
| | | | | | | Also, try to improve the structure of the #if/#else/#endif layout in serial.c. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Don't export spi1a/spi2a on stm32f1Kevin O'Connor2020-01-231-4/+6
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: add alternate pinout for USART2Arne Jansen2020-01-233-1/+16
| | | | | | Added to both generic stm32 and stm32f0 Signed-off-by: Arne Jansen <arne@die-jansens.de>
* stm32: add alternate pinouts for spi1/2Arne Jansen2020-01-231-3/+9
| | | | | | | In addition to spi3, spi1 and spi2 also have alternate pins. Add them as spi1a and spi2a, similar to spi3. Signed-off-by: Arne Jansen <arne@die-jansens.de>
* stm32: performance improvement for spi on stm32f0Arne Jansen2020-01-231-4/+8
| | | | | | | | | | The stm32 has a small queue for spi tx/rx. The current code only uses the spi with a single byte buffer, effectively waiting for each byte to complete before starting the next transfer. This patch changes the structure of spi_transfer() to make use of the queue and achieve back-to-back transfer of bytes on spi. Signed-off-by: Arne Jansen <arne@die-jansens.de>
* stm32: fix spi_transfer for stm32f0Arne Jansen2020-01-231-2/+8
| | | | | | | | | | The current code accesses the DR as 32 bit. This enabled data packing mode, effectively adding a 00 byte between each sent byte. The receive side had similar problems. To prevent this, all accesses are 8 bit now, even though this is not necessary on stmf[14]. Signed-off-by: Arne Jansen <arne@die-jansens.de>
* stm32: STM32F0 CAN featureEug Krashtan2020-01-144-0/+290
| | | | | Signed-off-by: Eug Krashtan <eug.krashtan@gmail.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: HSI selection fix; Pin swap rename; Add CAN selectionEug Krashtan2020-01-142-7/+11
| | | | | Signed-off-by: Eug Krashtan <eug.krashtan@gmail.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* config: Fysetc S6 generic configuration (#2220)Tobias Weiß2019-12-181-3/+3
| | | Signed-off-by: Tobias Weiß <t.weiss@bk.ru>
* stm32: Fix typo in setting of SMPR1 register on stm32f103Kevin O'Connor2019-11-271-1/+2
| | | | | | Only the stm32f4 has a SMP18 field; it's not present on the stm32f103. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Fix typo in adc startup delayKevin O'Connor2019-11-271-1/+6
| | | | | | Fix (harmless) typo and add comments on adc timing. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Enable chipid as usb serial numberKevin O'Connor2019-11-253-1/+35
| | | | | Signed-off-by: Matt Baker <baker.matt.j@gmail.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Allow external crystal speed to be customized in KconfigKevin O'Connor2019-11-254-55/+60
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32f0: Initial support for i2c on stm32f0Kevin O'Connor2019-11-144-6/+100
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: adc for new stm32f0 common code (#2120)clearchris2019-11-054-3/+144
| | | | | | | 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: Define PGx pins on stm32f103Kevin O'Connor2019-11-021-2/+7
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* flash_usb: Pass -t $CONFIG_MCU to flash_usb on all targetsKevin O'Connor2019-10-261-5/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Add support for flashing over usb on stm32f042Kevin O'Connor2019-10-262-0/+16
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: stm32f4 usb boot check only needed when CONFIG_USBSERIALKevin O'Connor2019-10-261-2/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32f4: Add support for flashing over USBKevin O'Connor2019-10-262-1/+15
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Implement armcm_main() in arch specific codeKevin O'Connor2019-10-246-30/+40
| | | | | | | 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>
* armcm_boot: Use armcm_main() instead of main() to start board codeKevin O'Connor2019-10-241-5/+5
| | | | | | | | | | The main() function has a special meaning to gcc and using it can result in different code generation. Use armcm_main() to avoid that. Also, invoke SystemInit() from the board specific armcm_main() code. This gives the board code more control over board initialization. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Support PA11/PA12 pin remap on stm32f042 tsop20 chipKevin O'Connor2019-10-232-0/+12
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>