1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-26 06:53:52 +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
..
2023-01-08 22:26:12 +01:00
2023-01-08 22:26:12 +01:00
2023-09-18 12:40:33 +02:00
2023-10-19 19:01:12 +00:00
2023-06-28 11:55:34 +02:00
2023-01-08 22:26:12 +01:00
2023-01-08 22:26:12 +01:00
2023-01-08 22:26:12 +01:00
2023-07-18 10:47:46 +00:00
2023-07-11 22:42:10 +02:00
2023-05-24 09:53:23 +02:00
2023-09-23 19:26:30 +02:00
2021-07-09 10:47:42 +02:00