2014-08-26 05:31 AM
Hi All,
please could you help me ... i'm using STM32F407 and i don't know what to do ...i catch Timer IRQ using NVIC, inside procedure of timer IRQ i need to do something that takes time ... but it should be executing without any delay ( spool and run from main while ), and i need to process SPI IRQ using NVIC - it's sufficient to spool received byte into buffer, but i don't see that SPI IRQ is raised during processing timer IRQ, if i test SPI IRQ without any other IRQs ... work correctly ... please help me to find out solution ...Thanks for all replies , Kind regards2014-08-26 06:44 AM
Use preemption levels.
2014-08-26 07:42 AM
Hi Clive1,
Thank You for the reply ... so i was looking for some infos and i forgot in first message that i'm using usb at FullSpeed in CDC and there is BSP with predefined IRQ priorities ... do you have some advice to setup optimal configuration of priorities ? i'm not sure if BSP can be or should not be interrupted :( and BSP is preconfigured to use 1bit preemption and 3 bits subpriorities, so ... is this configuration of levels good ? : SPI @ Preemption Level 0 , Subpriority 1 Timer @ Preemption Level 1 , Subpriority 1 (subpriority is probably irrelevant if preemption level is different ... )and what about BSP ? can be :BSP @ Preemption Level 1, Subpriority 2 ?2014-08-26 08:49 AM
I'd probably opt for the 2-bit/2-bit mode, and park the TIM at Preempt 3. You should also evaluate why you need to dwell in the interrupt excessively.
If you have interrupt routines which are quick and decisive, have them at the highest level (lowest #), especially where switching context is at least as expensive as just finishing, and tail-chaining. Suggest a review of the TRM NVIC docs, and Joseph Yiu's books on the Core/NVIC2014-08-26 09:07 AM
it works perfectly ...
i decided to use IRQ because of precise timing ... i was afraid of ART and compiler :) when i was asking for help i was thinking about stoped NVIC :(so Clive1 ... Thank You very much ... Kind regards