My design is actually to use PC to send a CAN message to a controller and once it receives correctly, it will send another CAN frame back to PC. This demo code is just to test CAN Rx, Tx module. On PC, we can use the CANking software to send a frame, and for the Tx module, I did some modification on the default one, since the default Tx module will send frame periodically. In this example, I let it send only when receiving is right. So, the Tx module here just helps to debug the receiving, and Tx can be working separately.
In this example, if I change the extended input to False, and change the ID to, for example, 0x100, it can receive any standard 11-bit frame, because the mask is 0. If I set the mask to be 0x1FF. It can only receive message with ID 0x100.
I just don't know why when I change the extended input to TRUE, and I can not receive anything, even the mask is still 0.