AnsweredAssumed Answered

NVIC - Defining software interrupt

Question asked by melamud.michael on Aug 8, 2013
Latest reply on Aug 8, 2013 by waclawek.jan
Hi ,

I want to add a new interrupt to the system ,   i know that the NVIC can support up to 256 interrupts , currently in my evaluation boad ( stm32f4g-eval) there are only 81 used .

So i added a new one here :

.word     DMA2_Stream7_IRQHandler           /* DMA2 Stream 7                */                  
.word     USART6_IRQHandler                 /* USART6                       */                   
.word     I2C3_EV_IRQHandler                /* I2C3 event                   */                         
.word     I2C3_ER_IRQHandler                /* I2C3 error                   */                         
.word     OTG_HS_EP1_OUT_IRQHandler         /* USB OTG HS End Point 1 Out   */                  
.word     OTG_HS_EP1_IN_IRQHandler          /* USB OTG HS End Point 1 In    */                  
.word     OTG_HS_WKUP_IRQHandler            /* USB OTG HS Wakeup through EXTI */                        
.word     OTG_HS_IRQHandler                 /* USB OTG HS                   */                  
.word     DCMI_IRQHandler                   /* DCMI                         */                  
.word     CRYP_IRQHandler                   /* CRYP crypto                  */                  
.word     HASH_RNG_IRQHandler               /* Hash and Rng                 */
.word     FPU_IRQHandler                    /* FPU                          */
.word     TTS_IRQHandler                    /* 070813 - TTS IRQ Handler     */ < - the new one , his id will be 82

Also added weak aliasing just in case :

.weak      OTG_HS_EP1_IN_IRQHandler           
.thumb_set OTG_HS_EP1_IN_IRQHandler,Default_Handler
             
.weak      OTG_HS_WKUP_IRQHandler        
.thumb_set OTG_HS_WKUP_IRQHandler,Default_Handler
          
.weak      OTG_HS_IRQHandler     
.thumb_set OTG_HS_IRQHandler,Default_Handler
                
.weak      DCMI_IRQHandler           
.thumb_set DCMI_IRQHandler,Default_Handler
                   
.weak      CRYP_IRQHandler           
.thumb_set CRYP_IRQHandler,Default_Handler
             
.weak      HASH_RNG_IRQHandler                 
.thumb_set HASH_RNG_IRQHandler,Default_Handler  
 
.weak      FPU_IRQHandler
.thumb_set FPU_IRQHandler,Default_Handler

.weak      TTS_IRQHandler
.thumb_set TTS_IRQHandler,Default_Handler

And offcourse added a function that will handle the interrupt :

void TTS_IRQHandler(void)
{
 
}

Then from main i do the following steps :

NVIC_SetPriority(82,100);
NVIC_EnableIRQ(82);
NVIC_SetPendingIRQ(82);

And nothing happens , but doing the same thing on one of previously defined interrupt handler (for example : FPU_IRQHandler ) , i really do receive the interrupt as expected , what i am missing here ?

Thanks
Michael

Outcomes