EXTI Interrupt Issue on STM32

Any bugs you encounter with Flowcode should be discussed here.
LeighM
Valued Contributor
Posts: 488
http://meble-kuchenne.info.pl
Joined: Mon Dec 07, 2020 1:00 pm
Has thanked: 83 times
Been thanked: 261 times

Re: EXTI Interrupt Issue on STM32

Post by LeighM »

Thanks for the info, interesting.

What was the result of the main loop LED flash when running on HSE (crystal)?

liudeqiang_2008
Posts: 52
Joined: Wed Jan 12, 2022 8:25 am
Has thanked: 10 times
Been thanked: 1 time

Re: EXTI Interrupt Issue on STM32

Post by liudeqiang_2008 »

LeighM wrote:
Tue Aug 12, 2025 12:57 pm
Thanks for the info, interesting.

What was the result of the main loop LED flash when running on HSE (crystal)?
The main loop LED flash running ok with HSE.

Br, Deqiang
Attachments
Flowcode1-3.fcfx
(16.09 KiB) Downloaded 78 times

LeighM
Valued Contributor
Posts: 488
Joined: Mon Dec 07, 2020 1:00 pm
Has thanked: 83 times
Been thanked: 261 times

Re: EXTI Interrupt Issue on STM32

Post by LeighM »

Thanks. So, just to confirm what I think you are reporting, with your latest program...
running on HSE...
The main loop flash (1 second on, 1 second off) runs OK, even when the hardware is power cycled.
But the timer interrupt flash often runs much slower when power cycled, but runs OK following program flash and run.
running on HSI...
All works as expected, on reset and on power cycle.

Thanks for your reply, it helps narrow down the possible scenarios.

Might be worth try adding a delay at the start of main, before the interrupt setup?

liudeqiang_2008
Posts: 52
Joined: Wed Jan 12, 2022 8:25 am
Has thanked: 10 times
Been thanked: 1 time

Re: EXTI Interrupt Issue on STM32

Post by liudeqiang_2008 »

LeighM wrote:
Thu Aug 14, 2025 10:46 am
Thanks. So, just to confirm what I think you are reporting, with your latest program...
running on HSE...
The main loop flash (1 second on, 1 second off) runs OK, even when the hardware is power cycled.
But the timer interrupt flash often runs much slower when power cycled, but runs OK following program flash and run.
running on HSI...
All works as expected, on reset and on power cycle.

Thanks for your reply, it helps narrow down the possible scenarios.

Might be worth try adding a delay at the start of main, before the interrupt setup?
Yes, what you summed is corect.

For your suggestion, I have add the delay:

1, 10ms before all the interrupts
2, 50ms before all the interrupts
3,100ms before all the interrupts
4,100ms before each the interrupts

Looks no different. it didn't help.

Br, Deqiang
Attachments
屏幕截图 2025-08-16 113626.png
屏幕截图 2025-08-16 113626.png (209.88 KiB) Viewed 2283 times
Flowcode1-4.fcfx
(16.42 KiB) Downloaded 144 times

LeighM
Valued Contributor
Posts: 488
Joined: Mon Dec 07, 2020 1:00 pm
Has thanked: 83 times
Been thanked: 261 times

Re: EXTI Interrupt Issue on STM32

Post by LeighM »

Thanks for the feedback.

Although I can't see what the problem might be, especially if the main loop LED flash is correct in all cases, which implies that the system clock is setup OK and running as expected.
Why the timer interrupt should differ between using HSE and HSI as a source is eluding me at the moment.
I was initially suspecting crystal startup or crystal frequency issues.
btw. The maximum clock rate for APB1, as used by these timers, is 36MHz, but you do seem to have set that correctly in the config.
Maybe it's worth a test at /4 just to see if that improves things?

Could you provide further information on the hardware used?
I don't have any F3 hardware (I've done numerous projects with F4)
Hopefully Matrix, or others, have an F3 development board and some available time to see if they can replicate the issue?

liudeqiang_2008
Posts: 52
Joined: Wed Jan 12, 2022 8:25 am
Has thanked: 10 times
Been thanked: 1 time

Re: EXTI Interrupt Issue on STM32

Post by liudeqiang_2008 »

LeighM wrote:
Sat Aug 16, 2025 5:20 pm
Thanks for the feedback.

Although I can't see what the problem might be, especially if the main loop LED flash is correct in all cases, which implies that the system clock is setup OK and running as expected.
Why the timer interrupt should differ between using HSE and HSI as a source is eluding me at the moment.
I was initially suspecting crystal startup or crystal frequency issues.
btw. The maximum clock rate for APB1, as used by these timers, is 36MHz, but you do seem to have set that correctly in the config.
Maybe it's worth a test at /4 just to see if that improves things?

Could you provide further information on the hardware used?
I don't have any F3 hardware (I've done numerous projects with F4)
Hopefully Matrix, or others, have an F3 development board and some available time to see if they can replicate the issue?
What type of F4 MCU you are using the most, perhaps I'd better gave up F3, and move to F4 , there is too much small bugs on F3 support...
Thank you

Br, Deqiang

LeighM
Valued Contributor
Posts: 488
Joined: Mon Dec 07, 2020 1:00 pm
Has thanked: 83 times
Been thanked: 261 times

Re: EXTI Interrupt Issue on STM32

Post by LeighM »

I'm not using anything at the moment :roll: Despite retirement, I don't seem to have much spare time.
I've used 205/405 in the past, but don't have any of that hardware now.
So I wouldn't let that sway you.

btw. Did you do any tests at a lower APB1 timer clock speed?
I did wonder if you are getting erratic behavior due to being at the max edge.

liudeqiang_2008
Posts: 52
Joined: Wed Jan 12, 2022 8:25 am
Has thanked: 10 times
Been thanked: 1 time

Re: EXTI Interrupt Issue on STM32

Post by liudeqiang_2008 »

LeighM wrote:
Wed Aug 20, 2025 3:26 pm
I'm not using anything at the moment :roll: Despite retirement, I don't seem to have much spare time.
I've used 205/405 in the past, but don't have any of that hardware now.
So I wouldn't let that sway you.

btw. Did you do any tests at a lower APB1 timer clock speed?
I did wonder if you are getting erratic behavior due to being at the max edge.
Hello

I have tested with 36MHz on APB1, the result is the same, this is not the reason.

Br, Deqiang

LeighM
Valued Contributor
Posts: 488
Joined: Mon Dec 07, 2020 1:00 pm
Has thanked: 83 times
Been thanked: 261 times

Re: EXTI Interrupt Issue on STM32

Post by LeighM »

Hi,
I've bought an STM32F303 development board to play with.
I've not had any issues with the timer interrupt.
However, my testing has thrown up an issue with the 32F303CB FCD, the config section is missing the HSE source divider parameter.
This means it would be easy to accidentally overclock the device.
I've attached an updated FCD that goes into directory C:\ProgramData\MatrixTSL\FlowcodeV10\FCD\ARM if you want to give this a test.
32F303CB.fcdx
(51.85 KiB) Downloaded 2 times
This FCD adds the HSE divider.
If you use this FCD with your existing projects you will need to carefully reset all the config parameters (as the old parameter/value pairs will be out of step).

If you now compare running HSI versus HSE, I suggest you set the HSE source divider to /2, that will then mean HSI and HSE settings will be equivalent.
If all goes well Matrix can merge this change back into the repo.

Post Reply