1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

49 Commits

Author SHA1 Message Date
Marian Buschsieweke
97b91b4f8f
boards/stm32: use GPIO LL for LEDs
This fixes a race in `LED<NUM>_TOGGLE`, which is a read-copy-write
operation. Any access to a GPIO pin on the same GPIO port that
happens concurrently could result in data corruption. Using the
GPIO LL API, which is thread-safe, fixes the issue.

Note: The used GPIO LL functions will work even in when the GPIO LL
      module is not used.
2024-08-02 09:55:24 +02:00
MrKevinWeiss
e0fdc3c16c
*Kconfig*: Modify Kconfig to remove dep model 2024-03-27 10:28:12 +01:00
Kyle Burk
986488db85
cpu/stm32/f1: prevent corrupting AFIO->MAPR
The `SWJ_CFG` field of the `AFIO_MAPR` register is write only and values
read are undefined (random). Hence, using `AFIO->MAPR |= mask;` to
enable flags can corrupt the state of the `SWJ_CFG` (configure it to
an unintended value).

Two helper functions have been introduced:
- `afio_mapr_read()` reads the value, but sanitizes the `SWJ_CFG` field
  to zero
- `afio_mapr_write()` writes the given value, but applies the `SWJ_CFG`
  configured by the board before writing.

Finally, the `nucleo-f103rb` and `bluepill*`/`blackpill*` boards have
been updated to no longer specify `STM32F1_DISABLE_JTAG`, as this
is handled by the `SWJ_CFG` setting (which defaults to disabling JTAG).
2023-11-20 20:28:52 +01:00
Marian Buschsieweke
8a4b4fb8dd
boards/common/blxxxpill: Update pinout
Also document the OSC32 connection of PC14/PC15 in the pinout.
2023-02-28 08:35:17 +01:00
Marian Buschsieweke
660990afd3
boards/common/blxxxpill: Fix mixup in pinout
TX0 and RX0 in the pinout got mixed up. This swaps them back.
2023-02-08 14:54:45 +01:00
Marian Buschsieweke
d2a3ff3d83
boards/{bluepill*,blackpill*}: rename and improve doc
- renamed:
    - `bluepill` --> `bluepill-stm32f103c8`
    - `bluepill-128kib` --> `bluepill-stm32f103cb`
    - `blackpill` --> `blackpill-stm32f103c8`
    - `blackpill-128kib` --> `blackpill-stm32f103cb`
- doc:
    - added link to corresponding hardware page on the STM32-base
      project
    - added picture
2023-01-02 16:23:10 +01:00
Gunar Schorcht
9fa01d69d8 boards/common/blxxxpill: enable riotboot feature 2022-11-30 19:28:14 +01:00
Gunar Schorcht
941d6be666 boards: make DFU_USB_ID and DFU_USE_DFUSE overridable 2022-11-30 19:28:14 +01:00
Marian Buschsieweke
051a1f1e32
boards/common/blxxxpill: rework periph configuration
The peripheral configuration has been completely reworked to resolve
pin conflicts while provided as much of the peripherals as possible.
The changes include:

- Move `I2C_DEV(0)` from PB6/PB7 to PB8/PB9 to solve pin conflict with
  `QDEC_DEV(2)`.
- Use pins PB0, PB1, PB4, and PB5 for PWM instead PA8, PA9, PA10, and
  PA11
    - PA9 and PA10 is in pin conflict with `UART_DEV(0)` which is used
      for stdio with `stdio_uart`, PA8 was in conflict with
      `QDEC_DEV(0)`, PA11 was in conflict with USB D-
- Use PB6, PB7 as `QDEC_DEV(0)` (previously `QDEC_DEV(2)`), as this is
  the only completely conflict free setting
- Use PB4/PB5 instead of PA6/PA7 for QDEC_DEV(1)
    - This fixes a pin conflict with `SPI_DEV(0)` MISO (and
      `ADC_LINE(4)`)
- Only provide QDEC at PB4/PB5 when PWM is not used to avoid conflict
- Only provide QDEC at PA8/PA9 when UART is not used to avoid conflict
- Use SPI2 (PB15, PB14, PB13, PB12) as `SPI_DEV(0)` instead of SPI1,
  use SPI1 (PA7, PA6, PA5, PA4) as `SPI_DEV(1)`
- Only provide `SPI_DEV(1)` if the ADC is not in used to resolve a
  pin conflict
- Move PB0 and PB1 at the end of the ADC lines (previously
  `ADC_LINE(6)` and `ADC_LINE(7)`, now `ADC_LINE(8)` and `ADC_LINE(9)`)
   - Only provide them when PWM is not in use (to resolve pin conflict
     with PWM)
   - Also do not provide them for the Blackpill boards, which are
     missing pins PB0 and PB1 on the headers

To make life of users easier, a Pinout diagram with the new
configuration was added.
2022-10-27 14:28:07 +02:00
Benjamin Valentin
d3d89aaec8
boards/blxxxpill: configure usbdev_fs 2022-10-13 21:59:47 +02:00
Marian Buschsieweke
8d1476933b
Merge pull request #18415 from maribu/boards/common/stm32
boards/common/stm32: clean up LED definitions
2022-08-25 20:17:44 +02:00
Marian Buschsieweke
a1ed6f3b78
boards/common/blxxxpill: use UART_DEV(0) for stdio
Using `UART_DEV(0)` (UASRT1) for stdio allows to use the same TTL
adapter that is used for programming via `stm32flash` to be used for
serial, without re-wiring after flashing.
2022-08-12 19:13:29 +02:00
Marian Buschsieweke
1fd9913293
boards/common/stm32: clean up LED definitions
Let boards only define the port and pin number of each LEDs. The common
definitions in `stm32_leds.h` will provide `LED<x>_ON`, `LED<x>_OFF`,
`LED<x>_TOGGLE`, `LED<x>_PIN`, `LED<x>_MASK` and `LED<x>_PORT`.

In addition to code de-duplication, this also makes it easier to use
LEDs in GPIO LL, which can be beneficial for super low overhead
debugging output - e.g. when a bug is timing sensitive and `DEBUG()`
would spent to much time for stdio to reproduce a bug.
2022-08-08 23:35:06 +02:00
Benjamin Valentin
5d111e71aa boards: drop board_init() from board.h 2022-02-25 15:08:58 +01:00
Francisco Molina
464d941a3e boards: drop empty custom board_init & empty board.c 2022-02-22 18:27:37 +01:00
Benjamin Valentin
468ea89953 boards: drop LED init
This is handled by periph_init_leds now
2022-02-18 14:35:43 +01:00
MrKevinWeiss
deda2cfb97
boards: Fix stm32 based boards kconfig models 2021-12-15 09:31:45 +01:00
Benjamin Valentin
fc88c4c4e5 boards: drop cpu_init() 2021-10-13 23:36:41 +02:00
a657ff39d6
boards/blxxxpill: remove dfu-util conditionals 2021-02-23 21:22:54 +01:00
6d5a5b9528
make: namespace dfu-util optional flags var 2021-02-23 21:22:53 +01:00
7201acdcd0
boards: remove conditional for st-link version 2021-02-23 21:22:52 +01:00
b801d57f0c
Merge pull request #15555 from dylad/pr/makefiles/dfu_optionnal_dfuse
boards: move DfuSe specific argument at board level
2020-12-09 14:08:50 +01:00
dylad
47f8d69845 boards: update boards using DfuSe
Update these boards to make use of a new argument to keep using DfuSe mode of dfu-util
2020-12-09 11:48:37 +01:00
75d2002e76
boards/stm32f1/f3: adapt Kconfig for clock configuration 2020-12-08 17:36:52 +01:00
39e06babf5
boards/stm32: use generic clk_conf.h header 2020-10-27 08:44:56 +01:00
e9bf08e6d5
boards/stm32f1*: adapt to new clock configuration 2020-09-24 11:27:24 +02:00
1b8460d68f
boards/stm32f1: use shared default clock configuration 2020-08-31 08:40:17 +02:00
hugues
228a71f96e boards/common/blxxxpill/include/periph_conf.h: reorder adc_config[] 2020-08-27 23:27:42 +02:00
hugues
c6362a5441 boards/common/blxxxpill: declare adc_config[] directly in periph_conf.h 2020-08-27 03:56:26 +02:00
hugues
6c35a6a69f boards/common/blxxxpill: DMA feature added 2020-08-19 18:25:03 +02:00
2068c11837
blxxxpill: remove obsolete spi_divtable 2020-08-18 16:55:02 +02:00
589e187f17
boards/common/blxxxpill: model features in Kconfig 2020-07-16 11:34:03 +02:00
Gabriel Moyano
2367ff3885 boards/blxxxpill: add TIM1, TIM3 and TIM4 as qdec dev 2020-05-29 22:08:25 +02:00
facb626b02
boards/stm32*: adapt for new stm32 cpu organization 2020-05-20 13:39:10 +02:00
benpicco
e45777d077
Merge pull request #13809 from Vinggui/master
Added a new flashing parameter for generic cheap St-link and bluepill(-128kib) boards.
2020-05-12 11:48:43 +02:00
Vinicius G. Guimaraes
f8776a989f boards/blxxxpill: add support for stm32duino bootloader and for generic St-Link V2. 2020-05-04 19:36:15 -07:00
Francisco Molina
b78e4efb56
cpu/stm32f1: dont provide periph_rtc at cpu level
stm32f1 periph_rtc implementation gets a 1s resolution by dividing
CLOCK_LSx by 32768. This only make sense if CLOCK_LSE is set,
otherwise CLOCK_LSI=~40000, which will lead to an imprecise rtc.
2020-04-27 08:59:21 +02:00
Francisco Molina
a72abe5903
boards/common/blxxxpill: provide periph_rtt 2020-04-24 10:44:57 +02:00
Hoernchen20
c64f7f72c2 boards/common/blxxxpill: Drop ADC lines used for stdio 2020-04-22 21:16:20 +02:00
Hoernchen20
4e87682ba1 boards/common/blxxxpill: Add internal ADC lines 2020-04-22 21:08:20 +02:00
Gunar Schorcht
5b8d503bc9 boards/common/blxxxpill: fix broken links 2020-03-24 10:38:40 +01:00
631fbd9fc8
boards/blxxxpill: rework programmer specific configuration 2020-03-10 11:42:10 +01:00
f56470925b
boards: include common dfu logic where applicable 2020-03-10 11:42:10 +01:00
Marian Buschsieweke
8fd8c8273f
boards/{nucleo-f103rb,b*pill}: Expose JTAG pins as GPIOs
The Nucleo-F103RB comes with an internal SWD programmer/debugger. Thus, the JTAG
pins are not going to be used for debugging / programming anyway. The pins are
exposed on the headers, so allowing them to be used as GPIOs make a lot of
sense.

The Bluepill / Blackpill boards only expose the SWD pins on the debug header,
but the JTAG pins (not also used by SWD) are exposed on the GPIO pin headers.
Hence, exposing them as regular GPIOs seems to be a reasonable choice.
2020-03-08 13:06:34 +01:00
kcant
f770c6fffd Update doc.txt
Broken links correction to https://web.archive.org/web/20190428082446/ *
2019-12-28 18:38:27 +01:00
Marian Buschsieweke
c510ad858c
boards/common/blxxxpill: Use STM32 programmer conf 2019-11-12 19:48:05 +01:00
Gaëtan Harter
fc9f2a0f65
boards: remove duplicate include 'RIOTCPU/cpu/Makefile.features'
When 'CPU' is defined, the CPU Makefile.features is included by the
build system in the main Makefile.features.
No need to do it manually anymore.
2019-09-30 12:38:01 +02:00
243b02d8e0
boards/blxxxpill: move CPU/CPU_MODEL to Makefile.features 2019-09-29 18:51:41 +02:00
Marian Buschsieweke
09d1dcf6b3
boards: Split off 128KiB version of bl*pill
- Created new `bluepill-128kib` as 128KiB version of the `bluepill`
- Created new `blackpill-128kib` as 128KiB version of the `blackpill`
- Updated `openocd.cfg` to allow flashing 128KiB of ROM
2019-09-29 16:42:44 +02:00