Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drivers: pinctrl: stm32: fix F1 SWJ_CFG application #43605

Merged
merged 6 commits into from
Mar 16, 2022

Conversation

GeorgeCGV
Copy link
Collaborator

@GeorgeCGV GeorgeCGV commented Mar 9, 2022

Based on LL and HAL libraries the value of AFIO_MAPR_SWJ_CFG has to be applied to the MAPR upon enabling of a remap. That solved the issue of a not working SPI 1 remap on F103VC and allowed it to be debuggable when the CONFIG_GPIO_STM32_SWJ_NOJTAG option is enabled.

The SWJ CFG initialization into pinctrl /pinmux (deprecated) modules.
Kconfig SWJ options were moved into F1 pinctrl /pinmux DTS.

Fixes #43452
Fixes #43640

Signed-off-by: Georgij Cernysiov [email protected]

@github-actions github-actions bot added the platform: STM32 ST Micro STM32 label Mar 9, 2022
@GeorgeCGV GeorgeCGV force-pushed the rework_f103_pin_remap branch 7 times, most recently from df0396d to 416640e Compare March 9, 2022 18:58
@zephyrbot zephyrbot requested a review from mnkp March 9, 2022 19:59
drivers/pinmux/pinmux_stm32.c Outdated Show resolved Hide resolved
drivers/pinctrl/pinctrl_stm32.c Outdated Show resolved Hide resolved
drivers/pinctrl/pinctrl_stm32.c Outdated Show resolved Hide resolved
drivers/pinmux/pinmux_stm32.c Outdated Show resolved Hide resolved
Removed SWJ_CFG initialization. The functionality
is moved into pinctrl / pinmux modules.

Signed-off-by: Georgij Cernysiov <[email protected]>
The Serial Wire JTAG configuration is moved to
F1 pinctrl DTS.

The configuration in GPIO didn't apply to the
majority of the STM MCUs except F1.

Signed-off-by: Georgij Cernysiov <[email protected]>
@GeorgeCGV GeorgeCGV force-pushed the rework_f103_pin_remap branch 3 times, most recently from 29b5490 to 1b446bf Compare March 12, 2022 21:21
Copy link
Member

@erwango erwango left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor comments, otherwise lgtm

dts/bindings/pinctrl/st,stm32f1-pinctrl.yaml Outdated Show resolved Hide resolved
drivers/pinctrl/pinctrl_stm32.c Outdated Show resolved Hide resolved
drivers/pinctrl/pinctrl_stm32.c Outdated Show resolved Hide resolved
Adds 'swj-cfg' property to the F1 pinctrl. It is an optional
property that allows to control Serial Wire JTAG
configuration.

Different configurations allow to free certain IO
pins that can be used in remap or standalone.

That replaces previously used Kconfig approach.

Signed-off-by: Georgij Cernysiov <[email protected]>
@GeorgeCGV GeorgeCGV force-pushed the rework_f103_pin_remap branch 3 times, most recently from c18fdca to f601aec Compare March 14, 2022 11:46
drivers/pinmux/pinmux_stm32.c Outdated Show resolved Hide resolved
drivers/pinmux/pinmux_stm32.c Outdated Show resolved Hide resolved
drivers/pinmux/pinmux_stm32.c Outdated Show resolved Hide resolved
drivers/pinctrl/pinctrl_stm32.c Outdated Show resolved Hide resolved
drivers/pinctrl/pinctrl_stm32.c Outdated Show resolved Hide resolved
drivers/pinctrl/pinctrl_stm32.c Outdated Show resolved Hide resolved
drivers/pinctrl/pinctrl_stm32.c Outdated Show resolved Hide resolved
drivers/gpio/Kconfig.stm32 Show resolved Hide resolved
- Move SWJ_CFG initialization into pinctrl.
- Don't disable the AFIO clock after SWJ_CFG
  initialization.
- Apply '111' to the SWJ_CFG bits upon remap
  application, that fixes the remap usage.

Signed-off-by: Georgij Cernysiov <[email protected]>
- Move SWJ_CFG initialization into pinmux.
- Don't disable the AFIO clock after SWJ_CFG
  initialization.
- Apply '111' to the SWJ_CFG bits upon remap
  application, that fixes the remap usage.

Signed-off-by: Georgij Cernysiov <[email protected]>
STM32 F1 SWJ_CFG Kconfig options were removed in
favor of pinctrl/pinmux device tree properties.

Signed-off-by: Georgij Cernysiov <[email protected]>
@GeorgeCGV GeorgeCGV force-pushed the rework_f103_pin_remap branch from f601aec to 7e961bb Compare March 14, 2022 14:20
@GeorgeCGV GeorgeCGV requested a review from nashif as a code owner March 14, 2022 14:20
@github-actions github-actions bot added area: Documentation Release Notes To be mentioned in the release notes labels Mar 14, 2022
@mbolivar-nordic mbolivar-nordic requested a review from erwango March 15, 2022 16:43
@carlescufi carlescufi merged commit aa00781 into zephyrproject-rtos:main Mar 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

stm32f1: Convert choice GPIO_STM32_SWJ to dt Missing SPI SCK on STM32F103vctx
5 participants