CAN_CANFD_MASK for Extened ID is wrong.

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

CAN_CANFD_MASK for Extened ID is wrong.

1,118 Views
Smin
Contributor II

My system uses CANFD with Extended ID mode.

So, I set 'CAN Extended ID Support' at the the Tresos MCAL CAN setting.

Smin_0-1694310764155.png

This makes CAN_FD_ID type as unit32.
But the other masks for CAN ID is not changed for Extended CAN ID.
Smin_1-1694310864170.png

Especially, CAN_CANFD_MASK is still for uint16. 
Is there any other mask for CANFD??
or does EB Tresos generate the wrong codes??

 

In my code,  canid is uint32. but the CAN_CANFD_MASK is for uint16. So, CANFD message is not recognised with that MASK.

 

0 Kudos
Reply
3 Replies

917 Views
CongDang
NXP Employee
NXP Employee

Which release package of MPC5xxx are you using?

The above questions are based on your observations on the source code? Did you get any issues when trying to transmit and receive with Extened ID?

0 Kudos
Reply

854 Views
Smin
Contributor II

Bold is your question. please check my following answers

 

Which release package of MPC5xxx are you using?
: NXP\AUTOSAR\MPC574XG_MCAL4_2_RTM_HF24_1_0_0

The above questions are based on your observations on the source code?
: Sure, that's based on the MCAL code - Can_GeneralTypes.h. You can find CAN_CANFD_MASK is unit16 type there. It looks like 'non-extended CANFD mask'.

That's why I ask where is the correct mask for 'Extended CANFD'.

Smin_0-1695276192104.png

 

Did you get any issues when trying to transmit and receive with Extended ID?
: Yes, there is a big problem with this.
my AUTOSAR configurator uses CAN_CANFD_MASK on checking the CAN_ID is CANFD or not and set the max DLC for CANFD.
the can_id is like 0x40000123 (0x123 + 0x40000000). But the CAN_CANFD_MASK is 0x4000 in MCAL. The sourcecode makes a judge the can_id is CANFD or not  by masking can_id with CAN_CANFD_MASK.  Because MASK is not uint32 (0x40000000), the masking value is always FALSE.
CAN_CANFD_MASK might be 0x40000000.
I manually change that value and it works well.

 

I suggest you simulate this on your bench. It must be easier and clearer than I explain to you.

 

0 Kudos
Reply

790 Views
CongDang
NXP Employee
NXP Employee

Looks like there's some problem here. I tried downloading MPC574XG_MCAL4_2_RTM_HF24_1_0_0 package and didn't see anything like your details.
The first, you say that CAN_CANFD_MASK is defined in Can_GeneralTypes.h. But I don't see that on my side. I also tried searching according to the information based on the image you sent below, but also did not find the same thing in my package:

CongDang_0-1695639353566.png

 

Checking in the package from my side, I see Can driver is using another definition and it is correct:

CongDang_1-1695639509634.png

 

So are you sure you are using MPC574XG_MCAL4_2_RTM_HF24_1_0_0? And is it original package by NXP or has there been any updates on it?

0 Kudos
Reply