Skip to main content
MikeP
Associate III
November 7, 2019
Solved

CAN Bus Extid paramater is not transmitting

  • November 7, 2019
  • 8 replies
  • 2096 views

Hello,

I have setup the CAN bus to transmit and has been working fine. I now need a feature which requires the ExtID but this isn't getting transmitted.

I have debugged both and can see that the ExtId is getting transmitted but not received, I'm wondering if this is to do with my filter (but i think that I've set it to allow everything - unless I've misunderstood) I have used the STM example code as a base.

Any help would be appreciated,

Kind Regards,

Mike

/*** Transmit Parameters***//		
buttonPressedHeader.IDE = CAN_ID_STD;		
buttonPressedHeader.StdId = 0xC8; 	
buttonPressedHeader.ExtId = 0x01; 
buttonPressedHeader.RTR = CAN_RTR_DATA;	
buttonPressedHeader.DLC = 2;							
buttonPressedHeader.TransmitGlobalTime= DISABLE;
 
 
/*** Filter Parameters***//
sFilterConfig.FilterBank = 0;
sFilterConfig.FilterMode = CAN_FILTERMODE_IDMASK;
sFilterConfig.FilterScale = CAN_FILTERSCALE_32BIT;
sFilterConfig.FilterIdHigh = 0x0000;
sFilterConfig.FilterIdLow = 0x0000;
sFilterConfig.FilterMaskIdHigh = 0x0000;
sFilterConfig.FilterMaskIdLow = 0x0000;
sFilterConfig.FilterFIFOAssignment = CAN_RX_FIFO0;
sFilterConfig.FilterActivation = ENABLE;
sFilterConfig.SlaveStartFilterBank = 14;
		
HAL_CAN_ConfigFilter(&hcan, &sFilterConfig);	

0690X00000ArnH2QAJ.png0690X00000ArnGdQAJ.png

This topic has been closed for replies.
Best answer by Tesla DeLorean

Like I said, it is one or the other, there isn't this third ambiguous choice you seem to allude too.

They share common bits on the wire, the Std Id is 11 bits, the Ext Id is 29 bits, one is a SUBSET of the other.

The library encodes/decodes either StdId or ExtId structure values into the STID and EXID bits in the packet frame, along with the IDE bit to determine which is being communicated.

0690X00000AroXBQAZ.jpg

8 replies

Tesla DeLorean
Guru
November 7, 2019

Perhaps set IDE value appropriately?​

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
MikeP
MikePAuthor
Associate III
November 7, 2019

Hi,

Thank you for your reply, if i change the IDE to CAN_IDE_EXT then it doesnt receive the StdID value. is there a way to receive both?

Kind regards,

Mike

MikeP
MikePAuthor
Associate III
November 7, 2019

0690X00000ArnoGQAR.png