使用串口中断接收数据,单独的一个中断时接收正常。
if (USART_GetITStatus(EVAL_COM2, USART_IT_RXNE) != RESET)//发生接收中断
{
uint8_t RxData=0;
//RxData= EVAL_COM2_ReceiveChar();
/* received data */
while( EVAL_COM2_ReceiveChar()!=0x55);
USART_Rx_Buffer[0] = 0x55;
while(ByteCount <= 12)
{
USART_Rx_Buffer[i++] = EVAL_COM2_ReceiveChar(); //接收
ByteCount++;
}
USART_ClearITPendingBit(EVAL_COM2, USART_IT_RXNE); //清除中断标志
}
但是加上以太网中断以后就会出现串口中断只接收一次数据的情况,放置断电调试时会碰到Failed to set breakpoint at 0x08009E04(out of hardware breakpoints),后面接着运行还有at 0xFFFFFFF8(this area does not support hardware breakpoints)
NVIC_InitStructure.NVIC_IRQChannel = ETH_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 1;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 2;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
/*串口中断优先级pre-emption priority ,子优先级 */
NVIC_InitStructure.NVIC_IRQChannel = EVAL_COM2_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 2;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 2;
//NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
中断都开启了,不知道是什么原因造成的,大家有没有碰到过,给点意见?谢谢
使用的107芯片,两天了木有进展 |