AnsweredAssumed Answered

SDIO IRQ does not work with GPIO interrupt

Question asked by karpavicius.linas on Apr 28, 2017
Latest reply on Jul 31, 2017 by David Henretty

Hello, writing support library for my dev board, and i run into the problem.

 

I have simple txt file generated by Print_SD() function.
If this function is called from mains, it does produce TEST.TXT file, no problems

 

But if i map this function to GPIO interrupt, and call Print_SD() function from IRQ program, it simply hangs. It looks like it is preventing functions to be executed:
void SDIO_IRQHandler(void);
void SD_SDIO_DMA_IRQHANDLER(void);

 

How can i fix this ? SDIO does have higher priority, so why it should hang ?

 

void NVIC_Config(void) //SDIO
{
  NVIC_InitTypeDef NVIC_InitStructure;
  /* Configure the NVIC Preemption Priority Bits */
  NVIC_PriorityGroupConfig(NVIC_PriorityGroup_1);
  NVIC_InitStructure.NVIC_IRQChannel = SDIO_IRQn;
  NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0;
  NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
  NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
  NVIC_Init(&NVIC_InitStructure);
  NVIC_InitStructure.NVIC_IRQChannel = SD_SDIO_DMA_IRQn;
  NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 1;
  NVIC_Init(&NVIC_InitStructure);  
}

 

void Button_IRQ_Config(void)
{
  /* SW1 PJ5 | SW2 PB10 */
 

  EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt;
  EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Falling;  
  EXTI_InitStructure.EXTI_LineCmd = ENABLE;
 
  EXTI_InitStructure.EXTI_Line = EXTI_Line5;
  EXTI_Init(&EXTI_InitStructure);
  EXTI_InitStructure.EXTI_Line = EXTI_Line10;
  EXTI_Init(&EXTI_InitStructure);
 
  NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0xF;
  NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0xF;
  NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
 
  NVIC_InitStructure.NVIC_IRQChannel = EXTI15_10_IRQn;
  NVIC_Init(&NVIC_InitStructure);
 
  NVIC_InitStructure.NVIC_IRQChannel = EXTI9_5_IRQn;
  NVIC_Init(&NVIC_InitStructure);
}

Outcomes