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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-05-02 7:52 AM - edited ‎2023-11-20 6:40 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-05-02 11:16 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-05-02 1:49 PM
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.
Up vote any posts that you find helpful, it shows what's working..
