jakobjung10 opened a new pull request, #21422:
URL: https://github.com/apache/nuttx/pull/21422
## Summary
The STM32F0 Kconfig never selected `STM32_HAVE_SYSCFG`, so `STM32_SYSCFG`
could not be enabled and `stm32f0_rcc.c` never turned on the SYSCFG clock. With
the clock off, writes to `SYSCFG_EXTICR` are ignored and every EXTI line stays
on port A: an interrupt on a pin of any other port never fires.
This PR selects `STM32_HAVE_SYSCFG` for the STM32F0, as the L0 already does.
`STM32_SYSCFG` then defaults to `y`, and the existing code in `stm32f0_rcc.c`
enables the clock.
## Impact
STM32F0 only. GPIO interrupts on ports B to F now work. Pins on port A
worked before only because port A is the reset value of `SYSCFG_EXTICR`.
In-tree, the PC13 user button of nucleo-f072rb and nucleo-f091rc
(`ARCH_IRQBUTTONS` in their `nsh` configurations) is affected; I have not
tested those boards. Flash grows by 8 to 16 bytes; no defconfig changes. No
documentation change.
## Testing
Host: Windows 10, building in an Ubuntu 24.04 container with
arm-none-eabi-gcc 13.2.1, on nuttx 6569424c and nuttx-apps 09a59b9.
Hardware: an STM32F072VB board with an `nsh` configuration that configures
PD0 and PD1 as EXTI inputs (buttons). Registers read through SWD after boot:
before: RCC_APB2ENR 0x00400000 SYSCFG_EXTICR1 0x00000000
after: RCC_APB2ENR 0x00400001 SYSCFG_EXTICR1 0x00000033
With the SYSCFG clock enabled, presses on PD0 and PD1 produce button events
in `examples/buttons`. This check was done before rebasing onto 6569424c.
All six `boards/arm/stm32f0` configurations build before and after this PR,
with the same warnings and the same `savedefconfig` output.
`tools/checkpatch.sh` passes.
<details>
<summary>Build log</summary>
before nucleo-f072rb:nsh build=0 flash=87252 warnings=0 STM32_SYSCFG=0
before nucleo-f072rb:usb-cdc-uart build=0 flash=109704 warnings=4
STM32_SYSCFG=0
before nucleo-f091rc:nsh build=0 flash=46104 warnings=0 STM32_SYSCFG=0
before nucleo-f091rc:sx127x build=0 flash=86012 warnings=1 STM32_SYSCFG=0
before stm32f051-discovery:nsh build=0 flash=34336 warnings=0
STM32_SYSCFG=0
before stm32f072-discovery:nsh build=0 flash=34404 warnings=0
STM32_SYSCFG=0
after nucleo-f072rb:nsh build=0 flash=87268 warnings=0 STM32_SYSCFG=1
after nucleo-f072rb:usb-cdc-uart build=0 flash=109720 warnings=4
STM32_SYSCFG=1
after nucleo-f091rc:nsh build=0 flash=46116 warnings=0 STM32_SYSCFG=1
after nucleo-f091rc:sx127x build=0 flash=86024 warnings=1 STM32_SYSCFG=1
after stm32f051-discovery:nsh build=0 flash=34344 warnings=0
STM32_SYSCFG=1
after stm32f072-discovery:nsh build=0 flash=34412 warnings=0
STM32_SYSCFG=1
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]