Skip to main content
ENGIN TANRIKULU
Associate III
May 2, 2023
Question

ST community Hello, my question is I want to use two generic interrupts on STM32F302R8T6 but one of them is not working. TIM6->DIER |= (1<<0); TIM2_IRQHandler works when I comment out this part. How to use global truncation for both?

  • May 2, 2023
  • 2 replies
  • 1282 views


_legacyfs_online_stmicro_images_0693W00000bjDZWQA2.png

This topic has been closed for replies.

2 replies

gbm
Lead III
May 2, 2023

I suspect the problem here:

NVIC->ISER =

NVIC->IP[...] =

This definitely doesn't do what you think. IP registers are accessed as 32 bits, and a single register contains 4 priorities for 4 interrupts.

Use NVIC_EnableIRQ() and NVIC_SetPriority() instead of your home-made code.

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice
Tesla DeLorean
Guru
May 2, 2023

Don't use the TIMx->SR &= forms, use TIMx->SR = mask, it clears the interrupt and is safe

If the interrupt doesn't clear properly it will reenter/saturate, but that doesn't look to be the issue here.

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..