lwjtutu wrote:
Afrer reset, the TXE is 1 and it means that an interrupt could happen. So when the function " _EI()" has been executed, the cpu enters into the interrupt routine immediately. But I haven't put the data into the transmit buffer yet. I don't want to enter into the interrupt.
Again, TXE ==1 means TX buffer is empty and TX interrupt will be called if corresponding TXEIE bit is set in CANTIER register. When you have nothing to send, you should disable CAN TX interrupt by clearing all TXEIE bits. Yes, after reset all TX buffers are empty and all TXE flags should be set.
You say that receiver received the data but RXF *) bit is still 0. It doesn't make sense. We know that receiver received something only if RXF is 1. If you saw something changing in CAN registers, well, it doesn't mean receiver received something. Message could not pass acceptance filters and and RXF won't set.
(* Please note again, you used bad name, RFLG instead of RXF!)