daa7ed54cd
Merge pull request #15000 from aabadie/pr/boards/stm32l0l1_clock_kconfig_only
...
boards/stm32l0l1: model clock configuration in kconfig
2020-11-03 17:20:00 +01:00
fb35edd22d
cpu/stm32: adapt clock configuration for l0/l1
2020-11-03 14:23:46 +01:00
Leandro Lanzieri
500cf238b8
cpu/stm32/vendor: use submake to fetch CMSIS headers
2020-11-03 13:33:16 +01:00
Marian Buschsieweke
125c892c03
drivers/periph/timer: Use uint32_t for frequency
...
For all currently supported platforms `unsigned long` is 32 bit in width. But
better use `uint32_t` to be safe.
2020-10-30 22:02:12 +01:00
7fbfb92f03
boards/stm32gx: move Kconfig clock config to cpu
2020-10-29 23:00:44 +01:00
Marian Buschsieweke
45dc86acce
cpu/stm32: Fix reception bug in periph_eth
...
The reception code hands RX DMA descriptors back to the DMA right after its
contents were copied into the network stack internal buffer. This increases
the odds that the DMA never runs out of DMA descriptors to fill, even under
high load. However, the loop fetching the Ethernet frame stops to iterate at the
end of the frame. If the DMA used one more descriptor to store the FCS, this
was not returned back to the DMA. This commit fixes it.
2020-10-28 14:23:25 +01:00
Marian Buschsieweke
7ced6a8ac8
cpu/stm32: Improve debug output for periph_eth
2020-10-28 14:22:54 +01:00
benpicco
2050193030
Merge pull request #15273 from aabadie/pr/cpu/stm32_clk_cfg_in_cpu
...
boards/stm32: cpu/stm32: move clock configuration from boards to cpu
2020-10-27 10:04:01 +01:00
0bd70a46bc
cpu/stm32: rework clock configuration documentation
2020-10-27 08:54:09 +01:00
ec5b47fc61
cpu/stm32l4+/wb: centralize max core clock define, adapt related boards
2020-10-27 08:44:55 +01:00
05f67a0a00
cpu/stm32: remove useless include in clock configuration
2020-10-26 11:21:07 +01:00
d6d85a3370
cpu/stm32: add common clock configuration header
2020-10-26 11:21:07 +01:00
f2e2c89424
cpu/stm32: move clock configuration headers to cpu
2020-10-26 11:16:23 +01:00
4e50feb4a8
cpu/stm32: adapt Kconfig for stm32l5
2020-10-23 18:28:27 +02:00
bd24a71fe0
cpu/stm32/kconfig: create family directory if not exist
2020-10-23 18:21:51 +02:00
7f26d5c389
cpu/stm32l5: adapt flashpage periph
2020-10-23 18:21:50 +02:00
a416b2793f
cpu/stm32: add basic support for stm32l5
2020-10-23 18:21:50 +02:00
b1b6c33104
cpu/stm32/dist/irqs: adapt for stm32l5
2020-10-23 18:13:07 +02:00
02c4b05a5a
cpu/stm32: configure stm32l5 cmsis repository version
2020-10-23 18:13:07 +02:00
benpicco
ad294aa340
Merge pull request #15203 from maribu/stm32-eth-negotiate
...
cpu/stm32: periph_eth: Use auto-negotation
2020-10-23 14:22:56 +02:00
Bas Stottelaar
7eb3414cff
cpu/*: remove unneeded ENABLE_DEBUG
2020-10-23 11:29:57 +02:00
Bas Stottelaar
22243aec7a
cpu/*: realign ENABLE_DEBUG
2020-10-23 00:46:26 +02:00
Bas Stottelaar
bd34cf8fc0
cpu/*: reorder ENABLE_DEBUG after last include
2020-10-23 00:45:55 +02:00
Marian Buschsieweke
5f9b55a182
cpu/stm32: Add stm32_eth_auto for auto-negotiation
...
Expose the auto-negotiation feature of the Ethernet device via the
pseudo-module stm32_eth_auto. With this enabled, the static speed configuration
set in the boards periph_conf.h will only be used if the PHY lacks
auto-negotiation capabilities - which is unlikely to ever happen.
2020-10-22 12:37:23 +02:00
Bas Stottelaar
ab6188cea3
cpu/*: add missing include of assert.h
2020-10-22 11:13:08 +02:00
72c17588b9
boards/stm32: remove unused CLOCK_LSE define
2020-10-21 12:11:17 +02:00
9f985e8e56
cpu/stm32: use CONFIG_BOARD_HAS_LSE instead of CLOCK_LSE
2020-10-21 12:10:53 +02:00
fed1c4dbbe
Merge pull request #15259 from aabadie/pr/cpu/stm32_cleanup_disable_hsi
...
cpu/stm32: simplify stmclk_disable_hsi function
2020-10-21 11:19:30 +02:00
84306f1122
cpu/stm32: remove unused CLOCK_HSE define
2020-10-21 10:11:46 +02:00
0480490a2b
cpu/stm32/dist: adapt gen_kconfig.py with new directory
2020-10-21 09:18:30 +02:00
2720c5526c
cpu/stm32: rename kconfig directory to kconfigs
...
The kconfig directory names clashes with Kconfig file on non case sensitive filesystems
2020-10-21 09:18:24 +02:00
42f71914a5
cpu/stm32: simplify stmclk_disable_hsi function
...
There is no need to check for CLOCK_HSE or to check if HSI is used as SYSCLK, this is already checked at compile time in the clock initialization code
2020-10-20 22:13:50 +02:00
2f053c90bd
cpu/stm32gx: improve clock initialization sequence
2020-10-20 15:47:21 +02:00
e2ae50258a
cpu/stm32gx: factorize HSE clock activation
2020-10-20 14:29:22 +02:00
2d603269dd
cpu/stm32gx: disable hsi only if unused
2020-10-20 14:29:11 +02:00
20894e47a6
cpu: boards: stm32gx: use IS_ACTIVE macro for clock config
2020-10-20 14:29:11 +02:00
a96ca57f66
cpu/stm32gx: remove useless LSE clock initialization
2020-10-20 14:29:11 +02:00
d78a316139
cpu: boards: stm32gx: compile code for all possible clock modes
2020-10-20 14:29:11 +02:00
d1724d6718
cpu/stm32l4: correctly handle clock freq > 80MHz
2020-10-20 11:37:46 +02:00
00ea7ffa55
cpu/stm32l4wb: cleanup clock initialization
2020-10-20 11:37:46 +02:00
d7d5d9d651
boards/stm32l4: extend clock configuration
...
- add PLLQ default value
- better tune default PLLM value depending on HSE value
- ensure CLOCK_PLL_SRC is always defined
2020-10-20 11:37:45 +02:00
b11d65ab70
cpu/stm32l4: enable PLLQ as 48MHz source if possible
2020-10-20 11:37:45 +02:00
58ad0168e7
cpu/stm32: stm32l011 lines doesn't provide hwrng
2020-10-15 16:24:33 +02:00
2e2b87dda5
cpu/stm32: define EEPROM size for stm32l011k4
2020-10-15 16:24:33 +02:00
e51279b228
cpu/stm32l0: fix clk control register reset
...
on stm32l011, RCC_CR_CSSON is not defined
2020-10-15 16:24:33 +02:00
044acf1175
cpu/stm32: enable power overdrive on f4 and f7
...
This is only enabled if the HCLK clock is above 168MHz on F4 and 180MHz on f7
2020-10-14 13:36:20 +02:00
Cenk Gündoğan
0741f161ae
Merge pull request #15198 from leandrolanzieri/pr/kconfig/add_error_symbols
...
Kconfig: add error symbols and makefile check
2020-10-13 13:09:42 +02:00
Marian Buschsieweke
d84caa50d2
cpu/stm32: Fix link status in periph_eth
...
Previously, only an link-up event was triggered, not an link down event. And
additionally, once the link-up event was sent, the link status was no longer
monitored. As a result, once a link-up was sent, no further link event were
triggered.
2020-10-12 14:53:41 +02:00
Marian Buschsieweke
6294382627
cpu/stm32: Use mii.h for periph_eth
...
Use shared MII definitions and utilities instead own definitions.
2020-10-12 08:46:20 +02:00
benpicco
94e78cd1dd
Merge pull request #15193 from maribu/stm32_eth_fix
...
cpu/stm32: Fix & cleanup periph_eth
2020-10-11 21:40:36 +02:00
Marian Buschsieweke
0e43c927b1
cpu/stm32: Fix/cleanup periph_eth
...
The methods to read from / write to MII registers had an address argument to
allow specifying the PHY to communicate with. However, only a single PHY is
available on all boards supported and the driver is not able to operate with
multiple PHYs anyway - thus, drop this parameter for ease of use.
This fixes a bug in the _get_link_status() function, which used hard coded the
address 0; which might not be correct for all boards.
2020-10-09 20:20:54 +02:00
Leandro Lanzieri
fe6d66d92a
kconfig: add ERROR symbol for conflicting modules
2020-10-09 18:04:17 +02:00
42067b0091
cpu/stm32/kconfig: restore features provided at cpu lines level
2020-10-09 12:39:22 +02:00
87f2f7ab99
cpu/stm32wb: extend Kconfig cpu lines and models
2020-10-09 12:39:22 +02:00
85a3167e4f
cpu/stm32l4: extend Kconfig cpu lines and models
2020-10-09 12:39:22 +02:00
841f500477
cpu/stm32l1: extend Kconfig cpu lines and models
2020-10-09 12:39:22 +02:00
11f3f2de74
cpu/stm32l0: extend Kconfig cpu lines and models
2020-10-09 12:39:22 +02:00
e8479b8cb5
cpu/stm32g4: extend Kconfig cpu lines and models
2020-10-09 12:39:22 +02:00
f223516a39
cpu/stm32g0: extend Kconfig cpu lines and models
2020-10-09 12:39:22 +02:00
7a510c08ff
cpu/stm32f7: extend Kconfig cpu lines and models
2020-10-09 12:39:22 +02:00
1c63b79a6d
cpu/stm32f4: extend Kconfig cpu lines and models
2020-10-09 12:39:21 +02:00
2c0930a3e7
cpu/stm32f3: extend Kconfig cpu lines and models
2020-10-09 12:39:21 +02:00
3d0c91d486
cpu/stm32f2: extend Kconfig cpu lines and models
2020-10-09 12:39:21 +02:00
3c08d564eb
cpu/stm32f1: extend Kconfig cpu lines and models
2020-10-09 12:39:21 +02:00
2490e01445
cpu/stm32f0: extend Kconfig cpu lines and models
2020-10-09 12:39:21 +02:00
06c3361a15
cpu/stm32/dist: add generator for kconfig cpu lines and models
2020-10-09 12:39:21 +02:00
Marian Buschsieweke
7b4d4c198b
cpu/stm32/periph_eth: Code style
2020-10-08 11:46:39 +02:00
Marian Buschsieweke
ab30865a08
cpu/stm32: Cleanup periph_eth
...
Cleanup functions _rw_phy(), _phy_read(), and _phy_write() and rename them to
_mii_reg_{access,read,write}().
2020-10-08 11:46:39 +02:00
3e1fa30c2f
cpu/stm32/irqs: fix vectors generator script
2020-10-08 08:09:31 +02:00
benpicco
2289a188ed
Merge pull request #15164 from maribu/stm32-eth-fix-link-status
...
cpu/stm32: Fix periph_eth link status
2020-10-06 23:46:34 +02:00
4613f840f4
cpu/stm32: put GPIO in ain before initializing the clocks
2020-10-06 16:10:05 +02:00
0d786e3dbb
cpu: boards: stm32f2/f4/f7: rework clock configuration and init
2020-10-06 16:10:05 +02:00
Marian Buschsieweke
7b738a66c4
cpu/stm32: Fix periph_eth link status
...
The link status was previously not returned via the value parameter, as required
by the netdev_driver_t API. As a result, e.g. the `ifconfig` shell command
showed garbage.
2020-10-06 10:29:38 +02:00
Marian Buschsieweke
7920d32e32
cpu/stm32: Clean up periph_eth
...
Use `addr` instead of `mac` when referring to L2 address.
2020-10-05 16:03:47 +02:00
7159fa03fc
Merge pull request #15119 from hugueslarrive/adc_f3
...
cpu/stm32/periph/adc_f3: add ADC3 and ADC4 management
2020-10-01 17:00:00 +02:00
hugues
3d6b473cd7
cpu/stm32/adc_f3: improve peripheral driver
...
- fix clock enable/disable bitfields
- add management for ADC3 and ADC4
- improve calibration
2020-10-01 11:08:45 +02:00
Francisco
b5c51d244e
Merge pull request #14909 from OTAkeys/pr/conn_can_clean_up
...
can: add proper checks for ifnum validity
2020-10-01 09:22:28 +02:00
Vincent Dupont
590f07b38a
stm32/can: fix features dependency
2020-09-30 12:59:03 +02:00
40262c1b7a
cpu/stm32: reorganize Kconfig files per families
2020-09-30 10:31:38 +02:00
1e6a336227
cpu/stm32/Kconfig: move features declared in models to lines
2020-09-30 10:31:29 +02:00
8738bd5e5c
cpu/stm32: select lines from models in Kconfig
2020-09-30 10:31:29 +02:00
d1bab4a25f
cpu/stm32: add Kconfig config for all cpu lines
2020-09-30 10:31:29 +02:00
ba4edb3c63
cpu/stm32: split main Kconfig
2020-09-30 10:31:29 +02:00
e8c79e7a41
cpu/stm32: extend CPU_LINES for G4 and L1
2020-09-30 10:31:29 +02:00
cada451383
cpu/stm32: document info extracted from CPU model name
2020-09-30 10:31:28 +02:00
d407878bc5
Merge pull request #15112 from aabadie/pr/boards/nucleo64-g431kb
...
boards/nucleo-g431rb: add initial support
2020-09-29 15:26:39 +02:00
Francisco
109012b194
Merge pull request #14923 from aabadie/pr/boards/stm32f0f1f3_clock_kconfig
...
boards/stm32f1/f3: rework clock initialization and configuration
2020-09-29 14:30:58 +02:00
ef742cddb2
cpu/stm32: add support for stm32g431rb
2020-09-29 12:26:26 +02:00
2c6693d68e
Merge pull request #14863 from hugueslarrive/nucleo-f302r8
...
boards/nucleo-f302r8: add ADC feature
2020-09-29 10:45:40 +02:00
2d80bbf7b9
Merge pull request #15109 from aabadie/pr/make/features_bootloader_stm32_cleanup
...
cpu/stm32: cleanup bootloader_stm32 build system management
2020-09-29 10:45:27 +02:00
ef864bba39
cpu/stm32: only build bootloader when the module is loaded
2020-09-28 21:07:01 +02:00
1259a89acf
cpu/stm32: remove useless bootloader dependency resolution
2020-09-28 21:07:01 +02:00
42728db45b
cpu/stm32: fix logical bug when getting l0/g0 CPU_CORE
2020-09-28 17:04:54 +02:00
hugues
9c41e25fff
cpu/stm32/periph/adc_f3: fix for devices which have only one ADC
2020-09-28 10:29:53 +02:00
84f1a70b7f
cpu/stm32/rtt: adapt for stm32g0
2020-09-25 15:20:14 +02:00
25e1fec90c
cpu/stm32: add support for stm32g071rb
2020-09-25 13:08:07 +02:00
da9168c652
cpu/stm32: rename stmclk_fx to stmclk_f2f4f7
...
This commit also removes all f0/f1/f3 specific code from this file
2020-09-24 11:27:24 +02:00
042a550f0d
boards: cpu: stm32f1/f3: rework clock configuration and init
2020-09-24 11:27:24 +02:00
c14d7ec7db
cpu/stm32l0l1: refactor clock initialization sequence
2020-09-22 22:30:20 +02:00
425a2f69a2
cpu/stm32l0l1: ensure PLL is enabled when required
...
PLL is required for the 48MHz output used by HWRNG and also when it's used as system clock
2020-09-22 22:30:20 +02:00
8ac1909ea3
cpu: boards: stm32l0l1: use IS_ACTIVE where possible in stmclk
2020-09-22 22:30:19 +02:00
23117a844e
boards: cpu: stm32l0: rework clock configuration
2020-09-22 22:30:19 +02:00
Francisco
6a826555cf
Merge pull request #14877 from maribu/stm32-eth-fix
...
cpu/stm32/periph/eth: Fix transmission bug
2020-09-16 14:30:44 +02:00
Benjamin Valentin
d9116684e5
cpu/cortexm_common: advertise puf_sram feature
...
`puf_sram` is a feature of the linker script, it does not need vendor
specific hardware support.
2020-09-11 16:30:45 +02:00
4e235b8e76
cpu/stm32l4wb: fix APBx bitfields for divider factor 2
2020-09-09 15:59:38 +02:00
Francisco
adb0bcab47
Merge pull request #14866 from aabadie/pr/boards/stm32l4wb_clock_kconfig
...
boards: cpu: stm32l4/wb: rework clock configuration and initialization
2020-09-09 09:35:29 +02:00
9dd20c0ccb
cpu: boards: stm32l4/wb: use IS_USED for clock where possible
2020-09-08 18:42:42 +02:00
0745cc4a99
cpu: boards: smt32l4: rework clock configuration
2020-09-08 18:42:41 +02:00
7c923da0c8
cpu/stm32: split f0 clock initialization in separate file
2020-09-08 16:03:44 +02:00
ec2e1a15f9
cpu/stm32: move cmsis package Makefile to stm32 cpu
2020-09-02 11:30:49 +02:00
91c9b8c1b0
cpu/stm32: remove hardcoded CPU_IRQ_NUMOF defines
2020-09-02 11:30:49 +02:00
0da196d98d
cpu/stm32: handle generated irqs.h in build system
2020-09-02 11:30:49 +02:00
39d95b1950
cpu/stm32: add tool to generate a header with IRQ numof defines
2020-09-02 11:30:49 +02:00
6cd6d5948f
cpu/stm32/vectors: remove hand crafted vectors_<fam>.c files
2020-09-02 11:30:49 +02:00
29b2a7aec1
cpu/stm32: integrate use of vectors generator in build system
...
The cmsis package is not added as a dependency but used directly before generating the vectors.c file
2020-09-02 11:30:49 +02:00
96ad6e9b84
cpu/stm32/vectors: ignore generated vectors C files
2020-09-02 11:30:48 +02:00
e6bb1a240e
cpu/stm32: add gen_vectors.py script
...
This script can be used to automatically generate the vectors.c file corresponding to an STM32 cpu line
2020-09-02 11:30:48 +02:00
Jannes
f3e934988c
drivers/stm32_eth: add 'NETDEV_EVENT_LINK_UP' event
2020-08-31 20:50:47 +02:00
Marian Buschsieweke
8752e03d3e
cpu/stm32/periph/eth: Fix transmission bug
...
Using the TER bit in the TX descriptors when only using a single descriptor for
sending triggered a hardware bug. Thus, stop using the TER bit and store the
currently active TX descriptor in RAM instead.
2020-08-30 20:23:20 +02:00
7eed33bf78
Merge pull request #14846 from hugueslarrive/adc_config
...
Declare adc_config[] like others peripherals configuration arrays
2020-08-28 09:59:21 +02:00
benpicco
779fb7d470
Merge pull request #14860 from hugueslarrive/adc_f3
...
STM32F3 familly ADC implementation
2020-08-27 16:50:44 +02:00
hugues
e314632c2e
cpu/stm32/periph/adc_f3: initial ADC implementation for f3
2020-08-27 15:43:43 +02:00
hugues
6959a905a2
cpu/stm32/include/periph/f3/periph_cpu.h: add ADC support
2020-08-27 15:43:43 +02:00
hugues
07cdad29d7
cpu/stm32/periph/adc_f0: removes ADC configuration loading
2020-08-27 03:59:44 +02:00
hugues
5a26f74124
cpu/stm32/periph/adc_l0: removes ADC configuration loading
2020-08-27 03:58:33 +02:00
hugues
779d7a3b00
cpu/stm32/periph/adc_l4: removes ADC configuration loading
2020-08-27 03:56:26 +02:00
hugues
05702d5593
cpu/stm32/periph/adc_f2: removes ADC configuration loading
2020-08-27 03:56:26 +02:00
hugues
7680c8e2cb
cpu/stm32/periph/adc_f1: removes ADC configuration loading
2020-08-27 03:56:26 +02:00
hugues
323725bcf5
cpu/stm32/periph/adc_f4: removes ADC configuration loading
2020-08-27 03:56:26 +02:00
hugues
3921a2f925
cpu/stm32/periph/adc_l1: removes ADC configuration loading
2020-08-27 03:56:26 +02:00
077a43948b
Merge pull request #14849 from hugueslarrive/max_adc_speed
...
cpu/stm32/periph/adc: remove MAX_ADC_SPEED from implementations where it is not used
2020-08-26 15:31:19 +02:00
hugues
629a5af8ed
cpu/stm32/periph/adc_f0: remove unused MAX_ADC_SPEED
2020-08-25 17:16:49 +02:00
hugues
205ae92b84
cpu/stm32/periph/adc_l0: remove unused MAX_ADC_SPEED
2020-08-25 17:15:39 +02:00
hugues
c519149979
cpu/stm32/periph/adc_l1: remove unused MAX_ADC_SPEED
2020-08-25 17:14:55 +02:00
a1038aa70e
cpu: boards: stm32g4: improve clock configuration
2020-08-25 12:55:16 +02:00
84bbee784d
cpu/stm32: add transition phase when raising +80MHz clock
2020-08-24 15:42:13 +02:00
b4aa2dae3e
cpu/stm32: remove MPU feature from stm32l052t8
2020-08-21 15:25:26 +02:00
fd71e09b69
cpu/stm32: disable MPU for stm32g0
...
MPU is broken on cortex-m0+ in the current state
2020-08-21 14:56:47 +02:00
5fab8f7a9a
stm32: Add define for when DMA channel selection is not supported
...
This adds a placeholder define for when the DMA peripheral available on
the MCU doesn't support channel/trigger filtering. This is the case on
the stm32f1 and stm32f3 family.
2020-08-19 16:09:55 +02:00
Francisco
4dce666435
Merge pull request #14764 from hugueslarrive/cpu/stm32/periph/dma
...
cpu/stm32/periph/dma: add support for STM32F3
2020-08-19 12:53:35 +02:00
hugues
d06aa3cd63
cpu/stm32/periph/dma: add support for STM32F3
2020-08-19 11:26:04 +02:00
hugues
2f0ac9e820
cpu/stm32/periph/spi: use dma_stop for STM32s that need it
2020-08-19 11:25:34 +02:00
Francisco
cc954274a7
Merge pull request #14763 from hugueslarrive/cpu/stm32/vectors/vectors_f3
...
cpu/stm32/vectors/vectors_f3: a small fix for STM32F334x8
2020-08-19 10:08:31 +02:00
benpicco
4a2d867339
Merge pull request #14749 from bergzand/pr/stm32/dynamic_spi_freqs
...
stm32: Add support for arbitrary SPI clock rates
2020-08-18 17:57:30 +02:00
9d49a30560
stm32: Remove obsolete spi_divtable tool
2020-08-18 16:55:01 +02:00
b9d62e47d3
stm32: Add support for arbitrary SPI clock rates
2020-08-18 16:55:01 +02:00
Francisco Molina
14d4d2aacb
cpu/stm32/f1/rtt: don't trigger callbacks if unset
2020-08-18 14:10:15 +02:00
Francisco Molina
0d60b3370a
cpu/stm32/f1/rtt: some fixes to rtt_set_alarm
...
- disable alarm before setting a new one
- save cb and argument context before enabling the ISR
2020-08-18 13:43:10 +02:00
benpicco
22d3bf7c51
Merge pull request #14594 from maribu/stm32-eth-cleanup
...
cpu/stm32: Clean up / fix periph_eth
2020-08-17 21:16:27 +02:00
Marian Buschsieweke
4fcf37c162
cpu/stm32/periph_eth: Handle lost & spurious IRQs
...
Fixes https://github.com/RIOT-OS/RIOT/issues/13496
2020-08-17 20:30:16 +02:00
Marian Buschsieweke
8d8af31e39
driver/stm32_eth: Integrate into periph_eth
...
The stm32_eth driver was build on top of the internal API periph_eth, which
was unused anywhere. (Additionally, with two obscure exceptions, no functions
where declared in headers, making them pretty hard to use anyway.)
The separation of the driver into two layers incurs overhead, but does not
result in cleaner structure or reuse of code. Thus, this artificial separation
was dropped.
2020-08-17 20:29:33 +02:00
Marian Buschsieweke
28ed07d6e3
cpu/stm32/periph_eth: zero-copy TX (-6 KiB RAM)
...
The Ethernet DMA is capable of collecting a frame from multiple chunks, just
like the send function of the netdev interface passes. The send function was
rewritten to just set up the Ethernet DMA up to collect the outgoing frame
while sending. As a result, the send function blocks until the frame is
sent to keep control over the buffers.
This frees 6 KiB of RAM previously used for TX buffers.
2020-08-17 20:29:33 +02:00
Marian Buschsieweke
51fe77afa4
cpu/stm32/periph_eth: configurable buffer size
...
1. Move buffer configuration from boards to cpu/stm32
2. Allow overwriting buffer configuration
- If the default configuration ever needs touching, this will be due to a
use case and should be done by the application rather than the board
3. Reduce default RX buffer size
- Now that handling of frames split up into multiple DMA descriptors works,
we can make use of this
Note: With the significantly smaller RX buffers the driver will now perform
much worse when receiving data at maximum throughput. But as long as frames
are small (which is to be expected for IoT or boarder gateway scenarios) the
performance should not be affected.
2020-08-17 20:29:29 +02:00
Marian Buschsieweke
932c311ee2
cpu/stm32/periph_eth: Fix RX logic
...
If any incoming frame is bigger than a single DMA buffer, the Ethernet DMA will
split the content and use multiple DMA buffers instead. But only the DMA
descriptor of the last Ethernet frame segment will contain the frame length.
Previously, the frame length calculation, reassembly of the frame, and the
freeing of DMA descriptors was completely broken and only worked in case the
received frame was small enough to fit into one DMA buffer. This is now fixed,
so that smaller DMA buffers can safely be used now.
Additionally the interface was simplified: Previously two receive flavors were
implemented, with only one ever being used. None of those function was
public due to missing declarations in headers. The unused interface was
dropped and the remaining was streamlined to better fit the use case.
2020-08-17 20:28:49 +02:00
hugues
7b3b10303b
cpu/stm32/vectors/vectors_f3: a small fix for STM32F334x8
2020-08-14 14:03:10 +02:00
benpicco
ea42705637
Merge pull request #14564 from benpicco/cpu/stm32-bitarithm_test_and_clear
...
cpu/stm32: GPIO: use bitarithm_test_and_clear()
2020-08-11 14:05:38 +02:00
Marian Buschsieweke
7d9aed7f66
Merge pull request #14391 from benpicco/cpu/stm32-timer_periodic
...
cpu/stm32: implement periph_timer_periodic
2020-08-10 07:58:27 +02:00
Benjamin Valentin
a0972c9e0c
cpu/stm32: implement periph_timer_periodic
...
Seems like the Interrupt flag for a Capture/Compare channel gets set when
- the CC-value is reached
- the timer resets before the CC value is reached.
We only want the first event and ignore the second one. Unfortunately I did
not find a way to disable the second event type, so it is filtered in software.
That is we need to
- ignore the CC-interrupts when the COUNT register register is reset
- ignore the CC-interrupts > TOP value/ARR (auto-reload register)
2020-08-09 22:55:22 +02:00
Marian Buschsieweke
234a720571
Merge pull request #14516 from benpicco/bitband_hw
...
cortexm_common: fix check for bitbanding feature
2020-08-08 14:26:49 +02:00
Benjamin Valentin
97bf000bcd
cpu/stm32: use RIOT_EPOCH
2020-08-07 17:39:25 +02:00
Benjamin Valentin
9970c57cdf
cpu/stm32: GPIO: use bitarithm_test_and_clear()
2020-07-28 12:43:24 +02:00
millotp
69858916c7
boards: enable CAN bus on nucleo-f446re & nucleo-f446ze
...
Changed the pinout for the CAN bus:
CAN RX: PB8
CAN TX: PB9
And added periph_can to FEATURES_PROVIDED and to Kconfig files
2020-07-27 14:36:29 +02:00
Marian Buschsieweke
53375f04bf
cpu/stm32/periph_eth: Optimize / fix flush
...
- Added missing wait for TX flush
- Grouped access to the same registers of the Ethernet PHY to reduce accesses.
(The compiler won't optimize accesses to `volatile`, as defined in the C
standard.)
2020-07-26 22:12:03 +02:00
Marian Buschsieweke
a5dbec33d9
cpu/stm32/periph_eth: Cleanup & fix DMA descriptor
...
- Add missing `volatile` to DMA descriptor, as memory is also accessed by the
DMA without knowledge of the compiler
- Dropped `__attribute__((packed))` from DMA descriptor
- The DMA descriptor fields need to be aligned on word boundries to
properly function
- The compiler can now more efficiently access the fields (safes ~300 B ROM)
- Moved the DMA descriptor struct and the flags to `periph_cpu.h`
- This allows Doxygen documentation being build for it
- Those types and fields are needed for a future PTP implementation
- Renamed DMA descriptor flags
- They now reflect to which field in the DMA descriptor they refer to, so
that confusion is avoided
- Added documentation to the DMA descriptor and the corresponding flags
2020-07-26 22:12:03 +02:00
42eb044ec6
Merge pull request #14482 from hugueslarrive/cpu/stm32/periph/pwm
...
cpu/stm32/periph/pwm: some bugfixes...
2020-07-24 21:05:57 +02:00
Gunar Schorcht
044d08d599
cpu/stm32: GPIO ports definition fix
...
The available GPIO ports may also differ within a family. Therefore, the vendor definitions GPIO* are used instad of CPU_FAM_STM definitions to determine which ports are available for a certain MCU.
2020-07-22 09:13:52 +02:00
dada52ecd2
cpu/stm32: add stm32g0 support
2020-07-21 12:45:25 +02:00
dea506a719
cpu/stm32wb: define missing IMR bit in CMSIS
2020-07-16 17:35:50 +02:00
1a095b36fa
cpu/stm32: adapt UART driver for stm32l4r5 cpu line
2020-07-16 17:35:49 +02:00
8e87dedbce
cpu/stm32: remove not needed CMSIS vendor headers
2020-07-16 17:35:49 +02:00
f21440b176
cpu/stm32: use CMSIS headers from the stm32cmsis package
2020-07-16 17:35:48 +02:00
Benjamin Valentin
8f36c88b93
cpu/stm32: set CPU_HAS_BITBAND
2020-07-16 14:44:28 +02:00
8046a74e50
cpu/stm32: model features in Kconfig
2020-07-16 11:34:02 +02:00
055c43c878
cpu/stm32: enable flashpage feature for stm32f031k6
2020-07-16 11:15:30 +02:00
Marian Buschsieweke
aec9eb7f6a
cpu/stm32: Fix uart_init()
...
- Make use of the fact that gpio_init_af() does not need prior call to
gpio_init() for all STM32 families anymore and drop call to gpio_init()
- Initialize the UART periph first, before initializing the pins
- While uninitialized, the UART periph will send signal LOW to TXD. This
results in a start bit being picked up by the other side.
- Instead, we do not connect the UART periph to the pins until it is
initialized, so that the TXD level will already be HIGH when the pins
are attached.
- This results in no more garbage being send during initialization
2020-07-15 12:12:46 +02:00
Marian Buschsieweke
73c9161517
cpu/stm32: Fix gpio_init() / gpio_int_af()
...
- Do not set an intermediate mode, prepare correct mode settings in a temporary
variable
- Consistently enabled the GPIO periph in gpio_init_af()
- Previously, STM32 F1 did not require a separate call to gpio_init() prior
to a call of gpio_init_af(), but other STM32 families did
- Now, gpio_init_af() can be used without gpio_init() consistently
- STM32 F1: Do not touch ODR for non input pins
- For input pins, this enables / disabled pull up resistors. For outputs,
this register should remain untouched (according to API doc)
2020-07-15 12:12:45 +02:00
hugues
0926a04b08
cpu/stm32/periph/pwm: useless static var and a semicolon removed
2020-07-14 01:41:16 +02:00
Gilles DOFFE
892370121d
cpu/stm32/qdec: test null callback pointer ( #14125 )
...
cpu/stm32/qdec: test if callback pointer is set
Callback pointer is not tested and could result in a hard fault
if the pointer is NULL.
Thus only activate interrupt if a callback provided.
Signed-off-by: Gilles DOFFE <g.doffe@gmail.com>
2020-07-10 15:05:53 +02:00
hugues
304d3f9e8d
cpu/stm32/periph/pwm: some bugfixes...
2020-07-10 13:47:45 +02:00
hugues
d069c6e787
cpu/stm32/periph/pwm: CCMR1 was defined a second time instead of CCMR2
2020-07-10 13:47:45 +02:00
hugues
a5da5953b2
cpu/stm32/periph/pwm: multiple devices PWM_RIGHT mode bugfix
2020-07-10 13:47:09 +02:00
hugues
16e454ccaf
cpu/stm32/periph/pwm: some bugfixes...
2020-07-09 23:49:00 +02:00
hugues
11e847c9af
cpu/stm32: fix off-by-one error in clock frequency assert
2020-07-08 14:17:14 +02:00
Bas Stottelaar
21f9afdb5b
Merge pull request #14318 from benpicco/cpu/stm32-TIMER_CHANNELS
...
cpu/stm32: use TIMER_CHANNEL_NUMOF for consistency
2020-06-24 15:32:22 +02:00
Benjamin Valentin
06cdd30fcb
cpu/stm32: use TIMER_CHANNEL_NUMOF for consistency
2020-06-24 12:58:38 +02:00
25c609f2d3
Merge pull request #12101 from OTAkeys/pr/fix_i2c_release
...
cpu/stm32_common: disable i2c in release
2020-06-23 10:21:15 +02:00
f546c6238b
cpu/stm32: add support for stm32g4
2020-06-19 14:18:17 +02:00
07c78efc83
Merge pull request #14285 from fjmolinas/pr_uart_nb_race
...
sam0/stm32: fix possible uart_nonblocking deadlock
2020-06-17 12:14:25 +02:00
Francisco Molina
09f0fd4526
cpu/stm32: avoid deadlock on nonblocking write
...
If a write to a full tsrb is attempted with disabled interrupts
or in a interrupt then a deadlock will occure. To avoid this make
space in the ringbuffer by synchrnously writing to uart.
2020-06-17 10:01:21 +02:00
Francisco Molina
0b8adb2d27
cpu/sam0-stm32/uart: rename tx buf size to UART_TXBUF_SIZE
2020-06-17 10:01:20 +02:00
Francisco Molina
dd331c91d3
cpu/stm32/uart: enable irq for non blocking uart
2020-06-17 10:01:19 +02:00
Leandro Lanzieri
4d65bc8e0a
cpu: Rename CPU_ARCH to CPU_CORE
2020-06-16 12:05:40 +02:00
Francisco Molina
3107993434
cpu/stm32: add non blocking uart
...
Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
2020-06-11 09:51:41 +02:00
benpicco
f75c971297
Merge pull request #14119 from benpicco/cpu/stm32_usb_bootloader
...
cpu/stm32: implement reset to bootloader
2020-06-10 23:13:50 +02:00
29739be13a
stm32/spi: Use new DMA setup/prepare functions
2020-06-09 10:20:50 +02:00
b7d0cbcd57
stm32/spi: Remove superfluous DMA stop call
...
The DMA stream will automatically disable itself as soon as the transfer
is finished. No need to do this an additional time after the transfer is
finished
2020-06-09 10:20:49 +02:00
fddf0897e8
stm32/spi: Acquire/release the DMA during the SPI acquire/release
2020-06-09 10:20:49 +02:00
3a8dd32265
stm32/spi: Reduce register writes in hot path
...
This combines a number of register writes in the SPI
acquire and transfer code. The DMA enable for SPI is moved to the
acquire function, switching between DMA and regular transfer between
acquires is not possible.
2020-06-09 10:20:49 +02:00
Toon Stegen
ac9afbe4f5
cpu/stm32_common: disable i2c in release
...
the hardware peripheral should be disabled before stopping the
peripheral clock.
2020-06-08 12:27:03 +02:00
Benjamin Valentin
0819f0eb39
cpu/stm32: implement reset to bootloader
...
The STM32 line of microcontrollers comes with a bootloader in the ROM.
It provides the option to flash the device firmware in DFU mode (USB)
or via UART or SPI.
To enter the bootloader we have to jump to a specific address in memory,
but before reset the CPU to make sure the system is in a known state.
This enables us to use the usb_board_reset module on all STM32 platforms.
2020-06-05 18:41:06 +02:00
460c396101
stm32/spi: Add define for default CR2 settings
2020-06-02 16:04:02 +02:00
c28477a4f0
Merge pull request #14096 from bergzand/pr/stm32_common/dma/optimize_hot_path
...
STM32_common/dma: Optimize the latency in the hot path
2020-06-02 16:01:27 +02:00
a3f8a381ab
Merge pull request #14183 from benpicco/cpu/stm32/Makefile.features-HWRNG
...
cpu/stm32/Makefile.features: capture whole family
2020-06-02 14:26:23 +02:00
f583f388be
stm32/dma: Cache DMA stream base address
2020-06-02 11:52:11 +02:00
9ab7e7ef33
stm32/dma: add setup and prepare functions
...
This commit adds two new functions to the DMA peripheral code for the
stm32. The setup function allows for a one-time setup of peripheral
config. The prepare function does the per-transfer setup. This allows
for a single setup call during the peripheral lock step and a
per-transfer call to the prepare function.
2020-06-02 11:52:11 +02:00
bdeec688f5
Merge pull request #14174 from benpicco/cpu/stm32_usb_includes
...
cpu/stm32: don't include usbdev_stm32.h in periph_cpu_common.h
2020-06-02 11:42:19 +02:00
Benjamin Valentin
2c346387f6
cpu/stm32/Makefile.features: capture whole family
...
All members of the stm32f401* family (etc) don't have the HWRNG
peripheral.
Apply a broader wildcard so we don't have to touch this file when
adding new boards with slightly different MCUs.
2020-06-01 16:25:37 +02:00
benpicco
7286c32b5d
Merge pull request #14144 from aabadie/pr/cpu/stm32_cleanup_tim_ccr
...
cpu/stm32: cleanup timer structure in vendor headers
2020-06-01 16:18:57 +02:00
benpicco
1ac9e70f57
Merge pull request #14177 from GabrielDai/blxxxpill-qdec
...
cpu/stm32: add qdec support for CPU_FAM_STM32F1
2020-06-01 16:17:45 +02:00
a858c980c4
cpu/stm32: fix remaining occurence of stm32f1 cpu family
2020-05-30 18:59:36 +02:00
2448b26a8b
cpu/stm32: fix issue with cpu feature name
2020-05-30 18:59:01 +02:00
Gabriel Moyano
52ddeeedb0
cpu/stm32: add qdec support for CPU_FAM_STM32F1
2020-05-29 21:11:54 +02:00
e35914612e
cpu/stm32: restore timer structure in vendor headers
2020-05-29 18:22:00 +02:00
2dc0ec00a1
cpu/stm32: adapt timer driver to common CMSIS timer structure
2020-05-29 18:22:00 +02:00
Benjamin Valentin
7c8f44a368
cpu/stm32: filter availability of RNG by CPU not by board.
...
The old limitation is not valid anymore, we can evaluate $(CPU_MODEL)
here directly.
The output of
make -C tests/periph_hwrng info-boards-supported | wc -w
remains the same.
2020-05-29 18:01:12 +02:00
Benjamin Valentin
e957f339d3
cpu/stm32: don't include usbdev_stm32.h in periph_cpu_common.h
...
`usbdev_stm32.h` will pull in `usb.h` which causes an error if
`USB_H_USER_IS_RIOT_INTERNAL` is not set.
Turns out this include is not needed, so just drop it.
2020-05-29 17:42:19 +02:00
3244b26ab4
Merge pull request #14141 from aabadie/pr/cpu/stm32_fam_short
...
cpu/stm32: use shorten name in CPU_FAM variable
2020-05-27 08:40:01 +02:00
8593176e29
Merge pull request #14140 from aabadie/pr/cpu/stm32_uid_base
...
cpu/stm32: get the cpuid address from the UID_BASE constant defined in CMSIS
2020-05-27 08:39:35 +02:00
af8c4a32f6
Merge pull request #14147 from aabadie/pr/cpu/stm32f1_gpio_cleanup
...
cpu/stm32f1: restore default gpio struct in CMSIS + adapt driver
2020-05-27 08:39:17 +02:00
cc9219c96e
cpu/stm32f1: adapt gpio driver and usage to CMSIS struct
2020-05-26 18:10:04 +02:00
c40f0a79bf
cpu/stm32: adapt rtc driver to default CMSIS exti structure
2020-05-26 17:29:37 +02:00
09c1afe9c5
cpu/stm32l4/wb: restore exti structure in vendor headers
2020-05-26 17:24:59 +02:00
97942ddbe6
cpu/stm32: adapt gpio driver to default CMSIS exti structure
2020-05-26 17:24:58 +02:00
1a8f4d4f25
cpu/stm32f1: restore gpio struct to default in CMSIS header
2020-05-26 16:26:20 +02:00
61d3afcb63
cpu/stm32: remove hardcoded cpuid addr for f1
2020-05-26 15:44:50 +02:00
d78c955e50
cpu/stm32: remove hardcoded cpuid addr for f0
2020-05-26 15:44:50 +02:00
98a30ddadf
cpu/stm32: remove not needed periph_cpu.h for f3
2020-05-26 15:44:50 +02:00
4e33cebb3d
cpu/stm32: remove not needed periph_cpu.h for f7
2020-05-26 15:44:50 +02:00
bf01940ec7
cpu/stm32: use UID_BASE when possible
2020-05-26 15:44:50 +02:00
2313b85a8d
cpu/stm32: use UID_BASE from CMSIS when not defined
2020-05-26 15:44:50 +02:00
7bfdd7718f
cpu/stm32: introduce CPU_FAM_SHORT variable
...
This variable contains the short cpu family name: f1, f2, etc.
2020-05-26 12:27:12 +02:00
8959274165
cpu/stm32: update vendor headers for f1
2020-05-26 11:43:45 +02:00
1e4da87aad
cpu/stm32: update vendor headers for f0
2020-05-26 11:43:44 +02:00
4f96cdbfcd
cpu/stm32: update stm32f334 vendor header
2020-05-26 11:43:44 +02:00
8a5ea2638b
cpu/stm32: update stm32f2 vendor headers
2020-05-26 11:43:44 +02:00
4f30f27e9d
cpu/stm32: update stm32f72x vendor headers
2020-05-26 11:43:37 +02:00
benpicco
4f295a439b
Merge pull request #14131 from aabadie/pr/cpu/stmclk_cleanup
...
cpu/stm32: move stmclk in its own module, remove useless ifdefs
2020-05-25 20:42:11 +02:00
46c4803eba
cpu/stm32: remove useless ifdef around DMA definitions
2020-05-25 13:23:20 +02:00
63a79ae6e4
cpu/stm32: move stmclk in its own module, remove useless ifdefs
2020-05-22 21:21:08 +02:00
Benjamin Valentin
7803cc053c
cpu/stm32: rtc_f1.c: remove executable bit
2020-05-21 11:43:25 +02:00
138c0c2a54
stm32/dma: Remove superfluous asserts from DMA hot path
...
This commit removes a number of assert statements that should already
have been hit before. This is the reason that the assert in the
acquire function is left.
2020-05-21 11:34:54 +02:00
6793e7473b
stm32/dma: Move clear flags to acquire
2020-05-21 11:34:53 +02:00
977d227213
stm32/dma: Move FCR configuration to acquire function
...
The FCR register content might change during mem-to-mem DMA transfers,
Forcing it back in the acquire should be sufficient to ensure proper
operations.
2020-05-21 11:34:52 +02:00
d7b1b7fc7c
stm32/dma: Move one-time config to init function
2020-05-21 11:34:46 +02:00
b6d2231d6d
cpu/stm32: adapt Doxygen documentation
2020-05-20 13:39:11 +02:00
c50afaaf1b
cpu/stm32: remove redundant variables computations
2020-05-20 13:39:10 +02:00
36f6de3ce6
cpu/stm32: unify riotboot specific configuration
2020-05-20 13:39:10 +02:00
81e3e46fc5
cpu/stm32: remove old stm32xx_line.mk
2020-05-20 13:39:10 +02:00
5870e5d647
cpu/stm32: unify stm32_line.mk files
2020-05-20 13:39:10 +02:00
5c810d8535
cpu/stm32: introduce unique directory for stm32 cpus
2020-05-20 13:39:10 +02:00