现在在移植freeRTOS,卡在了sdio读取过程
程序会一直卡在SD_WaitReadOperation的
while(((SDIO->STA & SDIO_FLAG_RXACT)) && (timeout > 0))
{
timeout--;
}
应该是标志位没清除,我检查SDIO的中断进了,DMA的中断没进所以没有清除标志位,
这是我的中断初始化
void NVIC_Configurationsd(void)
{
NVIC_InitTypeDef NVIC_InitStructure;
/* Configure the NVIC Preemption Priority Bits */
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_4);
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_PriorityGroupConfig(NVIC_PriorityGroup_4);
NVIC_InitStructure.NVIC_IRQChannel = DMA2_Stream3_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 1;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
}
这是我的中断
void SDIO_IRQHandler(void)
{
vTaskEnterCritical();
HAL_NVIC_ClearPendingIRQ(SDIO_IRQ_ISR);
SD_ProcessIRQSrc();
vTaskExitCritical();
}
void SD_SDIO_DMA_IRQHANDLER(void)
{
vTaskEnterCritical();
HAL_NVIC_ClearPendingIRQ(SIDO_DMA_IRQn_ISR);
SD_ProcessDMAIRQ();
vTaskExitCritical();
}
按理来说优先级0-7是不会被rtos给处理的才对,就是奇怪为什么DMA的中断不会进,造成传输没有完成 |