Joshua DeWeese
264a7c8ef9
cpu/stm32/periph/dma: fix DMA2 on STMF3 families
...
As it was, the calculation of DMA2's IRQ number was inccrorect for some
STM families. The implmentation alocates streams numbers 0 to 7 for the
first DMA controller and 8 and up for the second DMA controller. This
offset of +8 was not accounted for when IRQ's of the second DMA
controller was calculated. This patch corrects this.
2022-10-26 09:36:44 -04:00
Marian Buschsieweke
40dd3bd68e
cpu/stm32: fix periph_usb modeling for STM32F1
...
- Fix source selection for STM32F105xx and STM32F107xx
- Fix KConfig modeling for STM32F105xx and STM32F107xx
2022-10-14 16:20:04 +02:00
Marian Buschsieweke
ea53b35d75
cpu/stm32: fix KConfig modeling for STM32F1 / usbdev_synopsys_dwc2
...
This fixes incorrect module selection for STM32F1 boards with feature
periph_usbdev, a regression introduced by
https://github.com/RIOT-OS/RIOT/pull/17812
2022-10-14 10:05:12 +02:00
Benjamin Valentin
aa6e8cafcf
cpu/stm32: enable usbdev_fs for STM32F1
2022-10-13 12:00:22 +02:00
Gunar Schorcht
a76297c55e
cpu/stm32/periph/usbdev_fs: small cleanup of comment formatting
2022-10-12 15:15:10 +02:00
Gunar Schorcht
dde72ad41b
cpu/stm32/periph/usbdev_fs: implement PMA access schemes
...
There are two schemes for accessing the packet buffer area (PMA) from the CPU:
- 2 x 16 bit/word access scheme where two 16-bit half-words per word can be accessed. With this scheme the access can be half-word aligned and the PMA address offset corresponds therefore to the local USB IP address. The size of the PMA SRAM is usually 1024 byte.
- 1 x 16 bit/word access scheme where one 16-bit half word per word can be accessed. With this scheme the access can only be word-aligned and the PMA address offset to a half-word is therefore twice the local USB IP address. The size of the PMA SRAM is usually 512 byte.
Which access scheme is used depends on the STM32 model.
2022-10-12 15:15:10 +02:00
Gunar Schorcht
0177018277
cpu/stm32/periph/usbdev_fs: always use 16-bit addresses for PMA
...
The addressing of the Packet buffer Memory Area (PMA) is done locally in the USB IP core in half-words with 16-bit. The `_ep_in_buf` and `_ep_out_buf` arrays which hold these USB IP local addresses in the PMA for initialized EPs therefore always use `uint16_t`.
2022-10-12 14:19:30 +02:00
Gunar Schorcht
add766f3e1
cpu/stm32/periph/usbdef_fs: emulate disconnect/connect
...
If the MCU does not have an internal D+ pullup and there is no dedicated GPIO to simulate a USB disconnect, the D+ GPIO is temporarily configured as an output and pushed down to simulate a disconnect/connect cycle to allow the host to recognize the device. However, this requires an external pullup on D+ signal to work
2022-10-12 14:19:23 +02:00
Gunar Schorcht
58ebf02e58
cpu/stm32/periph/usbdev_fs: configure USB clock predivider
...
If `RCC_CFGR_USBPRE` is defined, the USB device FS clock of 48 MHz is derived from the PLL clock. In this case the PLL clock must be configured and must be either 48 MHz or 72 MHz. If the PLL clock is 72 MHz it is pre-divided by 1.5, the PLL clock of 48 MHz is used directly.
2022-10-12 14:18:55 +02:00
MrKevinWeiss
82dca7841f
cpu/stm32: fix stm32f3 kconfig model
...
MODULE_USBDEV_SYNOPSYS_DWC2 was being selected when it shouldn't
2022-10-10 12:37:10 +02:00
Gunar Schorcht
08bd418baa
cpu/stm32/periph/usbdev_fs: coding style fix
2022-10-05 09:15:29 +02:00
Gunar Schorcht
7f4613da34
cpu/stm32/periph/usbdev_fs: changes to support STM32F3
2022-10-05 09:15:29 +02:00
Gunar Schorcht
1fde5a4401
cpu/stm32/periph/usbdev_fs: support GPIO for USB connect/disconnect
...
Since some STM32 MCU don't have internal D+ pullup, there are boards that use a GPIO for USB bus connect/disconnect.
2022-10-05 09:15:29 +02:00
Gunar Schorcht
3d1a3bf560
cpu/stm32/periph/usbdev_fs: allow USB signals as additional function
...
For a number of STM32 MCUs with the USB-FS device interface the signals USB_DP and USB_DM are not defined as GPIO alternative function but as additional function. Additional functions are directly selected/enabled through peripheral registers hand have not to be configured. In this case, the configuration defines GIO_AF_UNDEF as alternative function.
2022-10-04 13:59:43 +02:00
Gunar Schorcht
20bdd3452e
cpu/stm32/periph/usbdev_fs: conditional configuration of CRS
...
Conditional configuration of CRS_CR_AUTOTRIMEN allows the compilation of the driver for STM32 MCUs that don't have Clock Recovery System.
2022-10-04 13:59:43 +02:00
Gunar Schorcht
66d0f948ba
cpu/stm32/periph/usbdev_fs: fix register name
...
RCC_APB1SMENR1 is used if RCC_APB1SMENR_USBSMEN is defined. Without this fix, the conditional doesn't have any effect.
2022-10-04 13:59:43 +02:00
benpicco
429ee839cc
Merge pull request #18676 from krzysztof-cabaj/nucleo-l4r5zi-ADC
...
boards/nucleo-l4r5zi: support for ADC
2022-10-04 13:26:16 +02:00
krzysztof-cabaj
3a23f2632e
boards/nucleo-l4r5zi: add ADC support
2022-10-03 17:13:20 -04:00
Gunar Schorcht
78fc60c700
cpu/stm32: use usbdev_synopsys_dwc2 driver as periph_usbdev
2022-09-27 01:00:57 +02:00
Gunar Schorcht
7db66e49b3
drivers: add USB OTG FS/HS driver for Synopsys DWC2 IP core
2022-09-27 01:00:57 +02:00
Marian Buschsieweke
e402f1d885
Merge pull request #18418 from maribu/cpu/stm32/periph/stm32_eth_tracing
...
cpu/stm32/periph_eth: Add stm32_eth_tracing
2022-09-18 22:19:34 +02:00
Benjamin Valentin
838a5e4bd3
netdev_drivers: make sure to signal LINK_UP at least once
2022-09-16 22:57:28 +02:00
Benjamin Valentin
7abaae7bbd
treewide: fix typos
2022-09-15 12:12:23 +02:00
Marian Buschsieweke
44b62e879d
cpu/stm32/periph_eth: add stm32_eth_tracing
...
Add tracing support via GPIOs to trace the basic state of the Ethernet
peripheral. The following signals are provided:
- One GPIO pin is toggled on entry of the Ethernet ISR
- On TX start an GPIO is set, on TX completion it is cleared
- On RX complete an GPIO is set, once this is passed to the upper layer
the GPIO is cleared again
In order to reduce the overhead, GPIO LL is used. By default the
on-board LEDs are used as tracing GPIOs. This makes it easy to debug
when the state machine gets stuck without the need to attach a scope or
logic analyzer.
2022-09-14 14:00:27 +02:00
Marian Buschsieweke
efc307455e
cpu/stm32/periph_eth: increase debug output
2022-09-14 13:58:40 +02:00
Benjamin Valentin
74dc558972
cpu/{sam0_common, stm32}: select netdev_legacy_api in KConfig
2022-08-17 23:37:05 +02:00
Leandro Lanzieri
2dd59236c8
Merge pull request #18423 from MrKevinWeiss/pr/disable/hashchecks
...
.murdock: disable hash checks of kconfig/make
2022-08-17 18:30:36 +02:00
MrKevinWeiss
f79f43903d
cpu/periph_eth: Fix kconfig model
...
This probably can be done better as the periph_eth should not be
only part of the stm32 as the sam0 also uses it.
2022-08-17 14:37:22 +02:00
Marian Buschsieweke
bf67a9cdc5
cpu/stm32/periph_eth: optimize IRQ handler
...
We can just clear both TX and RX IRQ flags in any case, as clearing a
non-set flag is just a nop.
2022-08-09 07:33:34 +02:00
Marian Buschsieweke
82fbe08728
cpu/stm32/periph_eth: fix typo in initialization code
...
A single character type resulted in way fewer TX descriptors being
available than allocated. Not only resulted this in wasting memory,
but also when more iolist chunks than descriptors are send, the
```C
assert(iolist_count(iolist) <= ETH_TX_DESCRIPTOR_COUNT);
```
does not trigger. As a result, old TX descriptors are being overwritten
in this case.
2022-08-08 15:13:27 +02:00
Leandro Lanzieri
1716638792
cpu/stm32/periph_eth: model in Kconfig
2022-07-25 11:08:32 +02:00
benpicco
9b8f032c04
Merge pull request #17981 from maribu/gpio_ll/stm32
...
cpu/stm32: Implement periph/gpio_ll{,_irq} except for STM32F1
2022-05-24 11:34:53 +02:00
Marian Buschsieweke
bae91c1660
Merge pull request #17723 from benpicco/periph_timer_periodic-set_stopped
...
drivers/periph/timer: add TIM_FLAG_SET_STOPPED flag
2022-05-03 12:06:37 +02:00
Benjamin Valentin
d6b5bf33b2
cpu/stm32: timer: implement TIM_FLAG_SET_STOPPED
2022-04-28 13:27:59 +02:00
Marian Buschsieweke
8bab36f1c5
cpu/stm32: Implement periph/gpio_ll{,_irq} except for STM32F1
...
Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
Co-authored-by: Alexandre Abadie <alexandre.abadie@inria.fr>
2022-04-22 14:34:57 +02:00
eb6afbba98
cpu/stm32: adapt ltdc periph disp_dev interface
2022-04-13 12:49:58 +02:00
Leandro Lanzieri
37908431a1
cpu/stm32/eth: call netdev register from the setup function
2022-03-24 09:44:54 +01:00
cb5fef4486
cpu/stm32: use HSI with I2C
2022-03-23 10:10:08 +01:00
Fabian Hüßler
e3509fc023
cpu/stm32: add sampling time to F4/F7 ADC driver
2022-02-21 10:49:43 +01:00
Fabian Hüßler
33c2944076
cpu/stm32: add VBAT for stm32
2022-02-21 10:49:43 +01:00
Karl Fessel
5e42af7935
cpu/stm32: i2c include panic.h
2022-02-12 18:30:58 +01:00
Fabian Hüßler
70d3d647d1
cpu/{cortexm_common, stm32}: add support for backup RAM
2022-01-21 15:53:18 +01:00
Francisco Molina
579ca6d941
drivers/periph_spi: spi_init_with_gpio_mode mode by reference
2022-01-18 16:22:18 +01:00
4e582b360f
cpu/stm32: add disp_dev interface for LTDC
2022-01-07 14:32:24 +01:00
deccc720e3
cpu/stm32: add support for LTDC periph
2022-01-07 14:32:24 +01:00
796e127df9
boards/stm32: replace GPIO_UNDEF with SPI_CS_UNDEF
2022-01-06 12:34:09 +01:00
2f0efa8c9e
cpu/stm32: add initial support for stm32u5 family
2021-12-23 11:04:41 +01:00
Francisco Molina
9438c20c59
cpu/stm32/periph: remove unused xtimer includ
2021-12-09 12:14:42 +01:00
Marian Buschsieweke
e071098d26
cpu/stm32/periph: use uintptr_t instead uintptr_t *
2021-12-03 14:21:54 +01:00
Marian Buschsieweke
509ced8abb
cpu/stm32/periph_can: use container_of()
...
This silences false positives of -Wcast-align
2021-12-03 10:12:35 +01:00
4d96c1f8e0
Merge pull request #17281 from dylad/pr/cpu/stm32/usbdev_fs_support
...
cpu/stm32: add new usbdev FS support
2021-12-02 21:57:49 +01:00
Marian Buschsieweke
ec39b8e3aa
Merge pull request #17320 from aabadie/pr/cpu/stm32_ztimer
...
cpu/stm32: migrate adc and eth periphs to ztimer
2021-12-02 20:05:43 +01:00
dylad
083e53406d
cpu/stm32: add support for a new USBDEV periph
...
Also rename the other usbdev driver to avoid conflicts
2021-12-02 14:26:03 +01:00
924c2fd6da
cpu/stm32/adc: migrate to ztimer
2021-12-02 13:44:03 +01:00
0c7d2a0f55
cpu/stm32/eth: migrate to ztimer
2021-12-02 12:22:41 +01:00
f07696e7a2
cpu/stm32/usbdev: poweron USB during initialization
2021-12-01 10:15:19 +01:00
Gunar Schorcht
007e29ebb5
cpu/periph/i2c: update implementations to new I2C API
...
Make all `spi_acquire` implementations return `void` and add assertions to check for valid device identifier where missing.
2021-11-29 06:35:25 +01:00
c81df904ea
stm32/usbdev: Adapt to xmit API
2021-11-16 20:17:04 +01:00
76215adef1
Merge pull request #17154 from maribu/cpu/stm32/periph_usb
...
cpu/stm32/periph/usbdev: fix alignment issues
2021-11-16 11:20:34 +01:00
Francisco Molina
63c51d4add
cpu/stm32/wl: initial periph_adc implementation
2021-11-15 09:52:45 +01:00
Marian Buschsieweke
825a598ca7
cpu/stm32/periph/usbdev: fix alignment issues
...
Make sure in `_usbdev_new_ep()` that `usbdev_ep_t::buf` is always aligned to 4
bytes. With this in mind, add intermediate casts to `uintptr_t` before casting
`usbdev_ep_t::buf` to `uint32_t *` to silence `-Wcast-align`, as we now manually
enforced correct alignment.
2021-11-06 20:19:39 +01:00
766ebf0af5
stm32/usbdev: Use ztimer instead of xtimer
2021-10-27 18:56:42 +02:00
Dave VanKampen
55ea8cfb97
boards/stm32g031-disco,examples,tests: Added STM32G031-DISCO board
2021-10-13 12:14:45 -04:00
Dave VanKampen
6414c64f89
cpu/stm32: added ADC for g0
2021-09-24 10:20:09 -04:00
Francisco Molina
8e17b67a2f
cpu/stm32: add rtc_mem
2021-09-07 10:06:31 +02:00
Hugues Larrive
f292cfc8ce
drivers/periph_spi: remove duplicated includes introduced in #15902
2021-09-02 09:40:31 +02:00
Francisco
a1cbcc9ede
Merge pull request #15902 from maribu/spi-api-change-1
...
drivers/periph_spi: let spi_acquire return void
2021-09-02 08:50:56 +02:00
Marian Buschsieweke
f04b522601
cpu/periph_spi: update implementations to new API
...
Make all spi_acquire() implementations return `void` and add assertions to
check for valid parameters, where missing.
2021-09-01 21:38:40 +02:00
Benjamin Valentin
f903ec90d4
drivers/flashpage: flashpage_page() takes a const argument
...
All addresses to flashpage_page() must be in flash. Flash memory is
`const`, therefore this function must also take `const` pointers.
2021-08-27 14:08:25 +02:00
Jan Romann
4384795cb9
treewide: Remove excessive newlines
2021-08-13 19:50:38 +02:00
benpicco
775d6095bc
Merge pull request #16660 from fjmolinas/pr_lora_e5_dev
...
boards/lora-e5-dev: initial support
2021-07-21 14:36:58 +02:00
Francisco Molina
c62f6e0590
cpu/stm32/flashpage: adapt to non dual-core stm32wl
2021-07-21 11:28:16 +02:00
benpicco
4f905bfa8c
Merge pull request #15493 from benpicco/riotboot-serial
...
riotboot: implement serial flasher
2021-07-21 11:01:31 +02:00
Benjamin Valentin
a93deb4e95
cpu/stm32: usbdev: fix pm_layered include
2021-07-20 22:51:59 +02:00
aidiaz
5b9d8bd6c8
Update rtc_all.c for CPU_FAM_STM32L5 support.
2021-07-19 10:49:38 -04:00
Jose Alamos
97f20198a0
stm32/eth: avoid explicit cast to netdev
2021-07-09 10:38:35 +02:00
Akshai M
d3aa6ca00b
stm32/periph/spi : Add check for GPIO_UNDEF
2021-07-08 13:38:07 +02:00
MrKevinWeiss
02a2de4916
cpu/stm32: Add Kconfig dependency modeling
2021-07-02 15:11:05 +02:00
Francisco
52f5746904
Merge pull request #16545 from aidiaz/periph_rtt_l5
...
cpu/stm32/periph/rtt_all: RTT peripheral support for CPU_FAM_STM32L5
2021-06-15 18:19:11 +02:00
aidiaz
fc1cd85c76
cpu/stm32/periph_rtt: RTT peripheral support for CPU_FAM_STM32L5
2021-06-15 09:49:55 -04:00
Jean Pierre Dudey
5fd6daac3e
Merge pull request #16319 from jue89/fix/stm32-gpio_all-isr
...
cpu/stm32/gpio_all: fix IRQ handler for G0/L5/MP1 families
2021-05-23 21:40:02 +02:00
Francisco
967cbcd7e1
Merge pull request #16478 from jue89/fix/stm32-gpio_f1-isr
...
cpu/stm32/gpio_f1: fix IRQ handler
2021-05-19 08:55:04 +02:00
Hugues Larrive
1cf34afb76
cpu/stm32/periph/adc_f3.c: e-mail update
2021-05-15 05:53:45 +02:00
Francisco Molina
fc9fc5c057
cpu/stm32/periph/spi: fix wrong parameter order
2021-04-30 09:17:38 +02:00
Benjamin Valentin
49585fc517
cpu/stm32: flashpage: use common helper functions
2021-04-27 16:52:37 +02:00
Akshai M
1f7a10305a
stm32/periph/flashpage: Reset cache
...
Co-authored-by: Francisco <femolina@uc.cl>
2021-04-20 21:04:36 +02:00
Akshai M
efb86039c6
cpu/stm32wl: Add RTT support
2021-04-20 21:04:36 +02:00
Akshai M
2cf081b509
cpu/stm32wl: Flashpage configuration
2021-04-20 21:04:36 +02:00
Akshai M
fd8ddd6161
boards: add nucleo-wl55jc
...
Co-authored-by: Kevin "Tristate Tom" Weiss <weiss.kevin604@gmail.com>
2021-04-20 21:04:29 +02:00
Akshai M
c485c774cf
cpu/stm32: add stm32wl
2021-04-20 20:57:48 +02:00
Jue
80360e5308
cpu/stm32/gpio_f1: fix IRQ handler
2021-04-12 18:45:04 +02:00
Jue
2f503f11fa
cpu/stm32/gpio_all: fix IRQ handler for G0/L5/MP1 families
2021-04-12 17:01:33 +02:00
Francisco
700046238f
Merge pull request #16261 from maribu/cpu/stm32/periph_eth
...
cpu/stm32/periph_eth: fix format specifier in DEBUG()
2021-04-07 09:32:09 +02:00
Francisco
e04dd4dcce
Merge pull request #16272 from jue89/fix/stm32_gpio_irq
...
cpu/stm32/gpio: fix IRQ handler
2021-04-02 13:07:39 +02:00
Jue
43f83a520b
cpu/stm32/gpio: fix IRQ handler
2021-04-01 19:31:27 +01:00
Marian Buschsieweke
164aa72250
cpu/stm32/periph_eth: fix format specifier in DEBUG()
...
Use PRIu32 instead of lu to make LLVM happy.
2021-03-31 10:11:46 +02:00
Karl Fessel
cf7078ab0a
stm32/ptp: avoid creating a new rounding rule
2021-03-29 16:27:27 +02:00
Marian Buschsieweke
28e6544748
Merge pull request #16236 from maribu/cpu/stm32/periph_eth
...
cpu/stm32/periph_eth: bugfix
2021-03-28 09:20:15 +02:00
Marian Buschsieweke
7b08b97eb6
cpu/stm32/periph_eth: bugfix & cleanup
...
Fix compilation with module `stm32_eth_link_up` when `stm32_eth_auto`
is not used by relying on the compiler to optimize unused functions
and variables out, rather than using the preprocessor.
2021-03-26 17:42:45 +01:00
Marian Buschsieweke
650559276f
cpu/stm32/periph_ptp: bugfix & better debug output
...
- Clear the PTP timer interrupt *after* the user callback is executed
- Otherwise it would be possible that the ISR sets another super
short timeout that triggers during ISR, which also gets cleared
- This is a pretty nasty race condition :-/
- The debug output was a bit too verbose to be generally useful. Some
noise is now silenced unless `DEBUG_VERBOSE` is `#define`d to 1
2021-03-23 22:58:10 +01:00