MPC5604C CAN driver configuration

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

MPC5604C CAN driver configuration

3,197 Views
jacst
Contributor II

Hi, I use EB to configure the CAN driver of MPC5604, I configure a receiving mailbox HOH, use BASIC type, ID is 0X700, mask is 0X700, expect to receive CAN messages from 0x700-0x7ff.

1.PNG

2.PNG

But only 0x700 can be received in CanIf_RxIndication, No other CAN IDs are allowed.am I missing something? can anyone help me, thanks

3.PNG

0 Kudos
Reply
17 Replies

3,172 Views
nxf78987
NXP Employee
NXP Employee

Hello jacst,

what is the package's name you are using?

Could you send me your configuration and project?

Best regards,

Dan

0 Kudos
Reply

3,156 Views
jacst
Contributor II

hi,I use EB 14 MCAL version V1.0.1RTM to configure the driver, I configured 2 BASIC type CAN HOH, expect to receive message range 0x400-0x47f, and 0x700-0x7Ff, but found that no matter the undefined message CANID, Such as 0x355 can be received, hoh is 2, it seems that no filtering is performed, can you give me some help? The attachment is EB and S32 project, looking forward to help!

1.PNG

2.PNG

3.PNG

  

0 Kudos
Reply

3,129 Views
nxf78987
NXP Employee
NXP Employee

Hi jacst,

I checked your configuration.

The first one, with Can1FilterMask_700 = 0x700 is correctly. I didn't why your error (only filter ID = 0x700) has occurred. At the moment, I have not a board mpc5604 to debug your code. In the next week, I will debug your code and inform you as soon as possible.

The second, you configured the Can1FilterMask_480 = 0x47F is wrong. If you want to filter from    0x400->0x47F, you must change Can1FilterMask_480 = 0x780 because:

(id_filter & id_mask) == (id_comming & id_mask)

Best regards,

Dan

0 Kudos
Reply

3,106 Views
jacst
Contributor II

Thanks, Can1FilterMask_480 is wrong. I have corrected it, but the problem still exists. 0x700 is only accepted in HOH1, and other message are received in HOH2.

Many thanks!I look forward to reply!

1.PNG

2.PNG

  

0 Kudos
Reply

3,084 Views
nxf78987
NXP Employee
NXP Employee

Hi jacst,

I have a suggestion to test: you will remove the Can_RxHandle = 2 (Rx_0x400) in your configuration and generate code again. After that, you will run the code and check that Can_RxHandle = 1 (Rx_0x700) has received the ID = 0x701?

nxf78987_0-1656299995604.png

Best regards,

Dan

 

0 Kudos
Reply

3,076 Views
jacst
Contributor II

hi,

According to what you said, I changed the 0x400  to the full mode, leaving only 0x700 as the basic mode.

1.PNG

4.PNG

The retest found that only 0x700 message could be received, and 0x701 message could not be received by the program

2.PNG

3.PNG

0 Kudos
Reply

3,052 Views
nxf78987
NXP Employee
NXP Employee

Hi jacst,

Could you send me the images that were dumped values from the Flex_Can_B registers?

Best regards,

Dan

0 Kudos
Reply

3,042 Views
jacst
Contributor II

Hi, I did some tests and found that undefined messages, such as 0x301, also entered hoh1. It seems that there are some problems with basic type filtering. I have obtained the pictures and logs of the process. Please help me to have a look. thank you very much indeed

0 Kudos
Reply

3,033 Views
nxf78987
NXP Employee
NXP Employee

Dear jacst,

Could you help me check again this register? I saw that the RXIMR1 = 0x00000000, but If right, it must be 0x00000700.

nxf78987_0-1656664591454.png

nxf78987_0-1656664873181.png

Best regards,

Dan

0 Kudos
Reply

3,009 Views
jacst
Contributor II

Hello, I compared another correct project (5748g) and found that in the current 5604 project, when can initialization is completed, canrximr is 0x00000000, which should be wrong. The attachment is the test data flow.Looking forward to your reply.

0 Kudos
Reply

2,994 Views
nxf78987
NXP Employee
NXP Employee

Hi jacst,

I think that you should change the value of the RXIMR1 register to 0x700 after you called the Can_Init(); function. After that, Could you test again and let me know the results?

Best regards,

Dan

0 Kudos
Reply

2,797 Views
jacst
Contributor II

hi, am I doing this right? But the result is also wrong, looking forward to reply.

CASE1.PNG

捕获.PNG

0 Kudos
Reply

2,784 Views
nxf78987
NXP Employee
NXP Employee

Hi jacst,

Sorry, but the correct value you must write to RXIMR1 is (0x700 << 18).

Could you try again this?

Best regards,

Dan

0 Kudos
Reply

2,769 Views
jacst
Contributor II

hi,I have corrected and re-tested, but the result is still not OK, looking forward to reply

1.PNG

2.PNG

 

0 Kudos
Reply

2,684 Views
nxf78987
NXP Employee
NXP Employee

Hi jacst,

I asked my colleagues and I knew that this driver didn't support the ECUC_Can_00325 requirement.

Maybe, this driver only supports the single Can ID Filter.

Could you change the "Can ID Message Type" of all "CanHardwareObject" to "FULL"?

After that, Could you check the filer mask operate OK?

Best regards,

Dan

0 Kudos
Reply

2,670 Views
jacst
Contributor II

hi Dan,
 If I configure FULL, the result can only receive 0x700, and other ID

1.PNG

2.PNG

s cannot be received.  

0 Kudos
Reply

2,657 Views
nxf78987
NXP Employee
NXP Employee

Hi jacst,

My mean is the configuration as the below image and you should remove this statement: CAN_1.RXIMR[1].R = (0x700 << 18);

nxf78987_0-1659870304302.png

After that, could you test again? (If you only receive the IDs: 0x140, 0x700, and 0x400 => This driver only supports the single Can ID Filter and didn't support the range Can ID Filter).

Best regards,

Dan

0 Kudos
Reply