S32K3 MCAL CANFD mask setting bug

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S32K3 MCAL CANFD mask setting bug

Jump to solution
2,049 Views
wuxianlong
Senior Contributor I

Hi, All

The EDF bit the standard CANFD should be bit 14.but now it is 30. Is it a bug ? and it still exists in rtd5.0.0.

In the MCAL code, if you want to send a CANFD frame, you need to have the FDF byte of the CANFD message ID of the incoming parameter to be 1, that is, the Bit14 of the CANFD standard frame is 1. There is a Bug. According to the CANFD frame format CAN_43_FLEXCAN_FD_FRAME_U32 should mask bit 14. Now it is set to bit 30.

BRs,
xianlong

Tags (1)
0 Kudos
Reply
1 Solution
2,010 Views
wuxianlong
Senior Contributor I
Hi,
Sorry, I took a closer look. This is not a BUG, it is a software design. The CANFD_ID transmission parameter requires the user to fill in the maximum two bits of 32U.

/**
* @{
* @brief Can_IdType
* @details Represents the Identifier of an L-PDU. The two most significant bits specify theframe type:
* -00 CAN message with Standard CAN ID
* -01 CAN FD frame with Standard CAN ID
* -10 CAN message with Extended CAN ID
* -11 CAN FD frame with Extended CAN ID
* @implements Can_IdType_type
*/

/* Can_CreatePduInfo(id | CAN Can_IdType_type, swPduHandle,length, sdu) */
Can_PduInfo = Can_CreatePduInfo(0U | CAN_43_FLEXCAN_FD_FRAME_U32, 0U, 16U, Can_au8Sdu8bytes);

View solution in original post

0 Kudos
Reply
3 Replies
2,011 Views
wuxianlong
Senior Contributor I
Hi,
Sorry, I took a closer look. This is not a BUG, it is a software design. The CANFD_ID transmission parameter requires the user to fill in the maximum two bits of 32U.

/**
* @{
* @brief Can_IdType
* @details Represents the Identifier of an L-PDU. The two most significant bits specify theframe type:
* -00 CAN message with Standard CAN ID
* -01 CAN FD frame with Standard CAN ID
* -10 CAN message with Extended CAN ID
* -11 CAN FD frame with Extended CAN ID
* @implements Can_IdType_type
*/

/* Can_CreatePduInfo(id | CAN Can_IdType_type, swPduHandle,length, sdu) */
Can_PduInfo = Can_CreatePduInfo(0U | CAN_43_FLEXCAN_FD_FRAME_U32, 0U, 16U, Can_au8Sdu8bytes);
0 Kudos
Reply
1,997 Views
Senlent
NXP TechSupport
NXP TechSupport
0 Kudos
Reply
2,040 Views
wuxianlong
Senior Contributor I
DataInfo.fd_enable = ((PduInfo->id & CAN_43_FLEXCAN_FD_FRAME_U32) != 0U) ? TRUE : FALSE;
0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2000477%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ES32K3%20MCAL%20CANFD%20mask%20setting%20bug%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2000477%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%3CSPAN%3EHi%2C%20All%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EThe%20EDF%20bit%20the%20standard%20CANFD%20should%20be%20bit%2014.but%20now%20it%20is%2030.%20Is%20it%20a%20bug%20%3F%20and%20it%20still%20exists%20in%20rtd5.0.0.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EIn%20the%20MCAL%20code%2C%20if%20you%20want%20to%20send%20a%20CANFD%20frame%2C%20you%20need%20to%20have%20the%20FDF%20byte%20of%20the%20CANFD%20message%20ID%20of%20the%20incoming%20parameter%20to%20be%201%2C%20that%20is%2C%20the%20Bit14%20of%20the%20CANFD%20standard%20frame%20is%201.%20There%20is%20a%20Bug.%20According%20to%20the%20CANFD%20frame%20format%20CAN_43_FLEXCAN_FD_FRAME_U32%20should%20mask%20bit%2014.%20Now%20it%20is%20set%20to%20bit%2030.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EBRs%2C%3CBR%20%2F%3Exianlong%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2000959%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20S32K3%20MCAL%20CANFD%20mask%20setting%20bug%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2000959%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%40%3CSPAN%3Ewuxianlong%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EPlease%20refer%20to%20this%20post.%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fnxp.lightning.force.com%2Flightning%2Fr%2FCase%2F500KA0000039pXzYAI%2Fview%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2Fcommunity.nxp.com%2Ft5%2FS32K%2FUse-S32K358-flexcan-to-sent-extended-ID%2Ftd-p%2F1993198https%3A%2F%2Fnxp.lightning.force.com%2Flightning%2Fr%2FCase%2F500KA0000039pXzYAI%2Fview%3C%2FA%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2000773%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20S32K3%20MCAL%20CANFD%20mask%20setting%20bug%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2000773%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EHi%2C%3CBR%20%2F%3ESorry%2C%20I%20took%20a%20closer%20look.%20This%20is%20not%20a%20BUG%2C%20it%20is%20a%20software%20design.%20The%20CANFD_ID%20transmission%20parameter%20requires%20the%20user%20to%20fill%20in%20the%20maximum%20two%20bits%20of%2032U.%3CBR%20%2F%3E%3CBR%20%2F%3E%2F**%3CBR%20%2F%3E*%20%40%7B%3CBR%20%2F%3E*%20%40brief%20Can_IdType%3CBR%20%2F%3E*%20%40details%20Represents%20the%20Identifier%20of%20an%20L-PDU.%20The%20two%20most%20significant%20bits%20specify%20theframe%20type%3A%3CBR%20%2F%3E*%20-00%20CAN%20message%20with%20Standard%20CAN%20ID%3CBR%20%2F%3E*%20-01%20CAN%20FD%20frame%20with%20Standard%20CAN%20ID%3CBR%20%2F%3E*%20-10%20CAN%20message%20with%20Extended%20CAN%20ID%3CBR%20%2F%3E*%20-11%20CAN%20FD%20frame%20with%20Extended%20CAN%20ID%3CBR%20%2F%3E*%20%40implements%20Can_IdType_type%3CBR%20%2F%3E*%2F%3CBR%20%2F%3E%3CBR%20%2F%3E%2F*%20Can_CreatePduInfo(id%20%7C%20CAN%20Can_IdType_type%2C%20swPduHandle%2Clength%2C%20sdu)%20*%2F%3CBR%20%2F%3ECan_PduInfo%20%3D%20Can_CreatePduInfo(0U%20%7C%20CAN_43_FLEXCAN_FD_FRAME_U32%2C%200U%2C%2016U%2C%20Can_au8Sdu8bytes)%3B%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2000487%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20S32K3%20MCAL%20CANFD%20mask%20setting%20bug%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2000487%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EDataInfo.fd_enable%20%3D%20((PduInfo-%26gt%3Bid%20%26amp%3B%20CAN_43_FLEXCAN_FD_FRAME_U32)%20!%3D%200U)%20%3F%20TRUE%20%3A%20FALSE%3B%3C%2FLINGO-BODY%3E