单片机是GD32F105VCT6,官方程序,用CAN接口卡监视,定时发送能收到数据,但是错误寄存器的第0位和第2位被置1。接入到系统中,总线出现大量错误帧,影响别的节点的正常发送,哪位老兄遇到过。波特率250K
rcu_periph_clock_enable(RCU_CAN0);
can_struct_para_init(CAN_INIT_STRUCT, &can_parameter);
can_struct_para_init(CAN_FILTER_STRUCT, &can_filter);
can_struct_para_init(CAN_TX_MESSAGE_STRUCT, &transmit_message);
can_deinit(CAN0);
while(!can_working_mode_set(CAN0,CAN_MODE_INITIALIZE));
can_parameter.time_triggered = DISABLE;
can_parameter.auto_bus_off_recovery = ENABLE;
can_parameter.auto_wake_up = DISABLE;
can_parameter.no_auto_retrans = ENABLE;
can_parameter.rec_fifo_overwrite = DISABLE;
can_parameter.trans_fifo_order = DISABLE;
can_parameter.working_mode = CAN_NORMAL_MODE;
can_parameter.resync_jump_width = CAN_BT_SJW_1TQ;
can_parameter.time_segment_1 = CAN_BT_BS1_2TQ;
can_parameter.time_segment_2 = CAN_BT_BS2_1TQ;
while(!can_init(CAN0, &can_parameter));
while(!can_working_mode_set(CAN0,CAN_MODE_NORMAL));
can_interrupt_enable(CAN0,CAN_INT_RFNE0);
|