STM32 HAL CAN RX
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2016-03-02 4:05 AM
Posted on March 02, 2016 at 13:05
Hello
I am having trouble with the CAN_RX_MSG structure. As the struct contains both StdId and ExtId fields I have seen incorrect data being received in my ISR when both fields are populated.if (CAN_RX_MSG.Ext_Id == 0x11111111) { //gather CAN data }The above statement can evaluate as true when the CAN_RX_MSG structure contains a Std_Id message and its data and leads to the Std_Id data being populated into the program incorrectly.Can anyone advise as to how I can avoid this issue? Is the IDE parameter required?Advice is much appreciated.ThanksDan #can #hal #std_id #ext_id
Labels:
- Labels:
-
CAN
-
STM32Cube MCU Packages
This discussion is locked. Please start a new topic to ask your question.
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2016-03-04 7:00 AM
Posted on March 04, 2016 at 16:00
Hi,
use the IDE, if (CAN_RX_MSG.IDE == CAN_ID_EXT) { if (CAN_RX_MSG.Ext_Id == 0x11111111) { //gather CAN data } { .... PetrOptions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2016-03-14 4:42 AM
Posted on March 14, 2016 at 12:42
Thanks very much Petr!
Dan