CAN发送成功了,就是接收不成功。
我用另外一个板子发送,并且在示波器上看到一个ACK的高峰确认,说明已经成功。
程序仿真时一直卡在while((CAN_MessagePending(CAN1,CAN_FIFO0) < 1));
说明是过滤器把帧筛掉了。可是:
CAN_FilterInitTypeDef CAN_FilterInitStructure;
CAN_FilterInitStructure.CAN_FilterNumber=0;
CAN_FilterInitStructure.CAN_FilterMode=CAN_FilterMode_IdMask;
CAN_FilterInitStructure.CAN_FilterScale=CAN_FilterScale_32bit;
CAN_FilterInitStructure.CAN_FilterIdHigh= 0x0000;
CAN_FilterInitStructure.CAN_FilterIdLow= 0x0000;
CAN_FilterInitStructure.CAN_FilterMaskIdHigh= 0x0000;
CAN_FilterInitStructure.CAN_FilterMaskIdLow= 0x0000;
CAN_FilterInitStructure.CAN_FilterFIFOAssignment=CAN_Filter_FIFO0 ;
CAN_FilterInitStructure.CAN_FilterActivation=ENABLE;
CAN_FilterInit(&CAN_FilterInitStructure);
如上,我的过滤器设置为不过滤ID的啊,怎么还是被晒掉了呢? |