EEVblog Electronics Community Forum

Electronics => Microcontrollers => Topic started by: kgavionics on March 01, 2023, 04:33:57 pm

Title: [STM32F407] System configuration controller clock question?
Post by: kgavionics on March 01, 2023, 04:33:57 pm
Hello
AFAIK, the first step to configure external interrupts is to enable System configuration controller clock in the RCC APB2ENR register (bit 14), but to my surprise my external interrupts are working fine without enabling it!
Can someone shed some light on this subject please?
Thanks in advance
Title: Re: [STM32F407] System configuration controller clock question?
Post by: Siwastaja on March 01, 2023, 05:01:32 pm
STM32 SYSCFG is a weird thing. It just seems some kind of catch-all name under which some random registers were put in absence of better placement.

I'm not surprised at all that some of these registers seem to work without enabling the SYSCFG clock. It's probably something like the SYSCFG-located EXTI configuration registers being clocked from EXTI and not SYSCFG; i.e., maybe the registers are, after all, in one place, with rest of EXTI registers (EXTI_IMR etc.). If this is the case, it's beyond me why they are documented as being part of SYSCFG, but it would be typical ST. This is just a guess though.

But don't count on it working reliably, or with every device.
Title: Re: [STM32F407] System configuration controller clock question?
Post by: kgavionics on March 01, 2023, 05:22:45 pm
Thank you for the clarification, Siwastaja!
Title: Re: [STM32F407] System configuration controller clock question?
Post by: wek on March 01, 2023, 08:29:59 pm
> my external interrupts

Let me guess: on PAx pins?

JW
Title: Re: [STM32F407] System configuration controller clock question?
Post by: kgavionics on March 01, 2023, 08:39:12 pm
> my external interrupts

Let me guess: on PAx pins?

JW
yes!
Is there something special with GPIOA pins?
Title: Re: [STM32F407] System configuration controller clock question?
Post by: wek on March 01, 2023, 08:42:28 pm
They are selected by default in SYSCFG->EXTICRx, so you don't need to set anything in those registers.

If SYSCLK does not have clock, it means you can't set those registers, but not that they "don't work" - these in particular are pure memory-like registers which hold the value they've written, and internally they drive the EXTI input multiplexers. They hold zero after reset, and that corresponds to PAx pins in the EXTI multiplexers.

JW
Title: Re: [STM32F407] System configuration controller clock question?
Post by: kgavionics on March 01, 2023, 08:50:52 pm
They are selected by default in SYSCFG->EXTICRx, so you don't need to set anything in those registers.

If SYSCLK does not have clock, it means you can't set those registers, but not that they "don't work" - these in particular are pure memory-like registers which hold the value they've written, and internally they drive the EXTI input multiplexers. They hold zero after reset, and that corresponds to PAx pins in the EXTI multiplexers.

JW
Thank you Wek for this nice explanation! That makes sense now!