Closed leonardoBolzonella closed 3 years ago
try setting msg.flags.extended to 1 standard frames are 11bit extended frames are 29bit
no need to cast it to 16bit, just set it
msg.id = 0x901; msg.flags.extended = 1;
Thanks for the quick reply! Should it set it in the frame being sent or is it a setting for the CAN receiver code? Sorry if this sounds like an obvious question but this is my first time using CAN protocol.
sending
Worked, thank you!
Hello, I have been testing FlexCAN using a Teensy3.6 to send data to a custom ECU that uses a custom can code. I have changed the header file so that the msg.id is of type uint16_t, in order to match the custom can code. When a message is sent from the ECU with identifier 0x901 (1001 0000 0001), the teensy is reading id = 0x101 (001 0000 0001). I tried reverting to its original type (uint32_t) but nothing changed. Any idea why only 11 bits are being read in the id, instead of the 12 I was expecting?
I hope the question is clear, Cheers, Leo