Getting some issue in CAN communication with MSCAN driver on KEA128.

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

Getting some issue in CAN communication with MSCAN driver on KEA128.

4,142 Views
hemantsindkar
Contributor III

Hi,

 

I am using MSCAN driver for KEA128. I am just modified 

void Transmit_DataFrame(void) and

void Receive_DataFrame(void)  functions.

 

I configured CAN for 250kbps.

 

My program works fine transmission from KEA to PC. But some time receive "Form Error,Rx,Acknowledge delimiter,RxErr=1,TxErr=0" when I transmit from KEA to PC.

 

When I send message from PC to KEA getting BUSOFF error after TxErr counter reaches 256.

Original Attachment has been moved to: MSCAN_KEA128.zip

Labels (1)
Tags (1)
12 Replies

3,359 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi hemantsindkar,

  Please check my project on your side, this project is also 250Kbps baudrate for MSCAN, it is working ok on my TRK-KEA128 board.

  I check it with the CAN test tool, and send data to PC, none TX error happens.

  This is the test result:

75.jpg

  The codewarrior project is in the attachment.

Wish it helps you!

If you still have problem, please let me know!


Have a great day,
Jingjing

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

3,359 Views
hemantsindkar
Contributor III

Hi Jingjing,

Thanks for sharing code.

You code works fine on my board. So from this it is clear there is no hardware issue.

As I am using MSCAN_KEA128 drivers available from NXP I am not understand whats wrong with those drivers.

Kinetis KEA128 StarterTRAK CAN Applications|NXP

pastedImage_1.png

Thanks & Regards

Hemant Sindkar

0 Kudos
Reply

3,359 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi hemantsindkar,

    Sorry for my later reply!

    I have check your CAN initialization, it is no problem for 250Khz baud rate, I test it on my side, it also have no problem.

    I think it may relate to your main function code, you can try add some delay between each transmit calling.

    I call it like this:

for(;;)
{
for(j=0;j<10;j++) for(i=0;i<65535;i++);
TEST_CASE_FUNC(Demo_Transmit_DataFrame);//set different parameter to choose other test case to run
}

  The CAN test tool can receive all the data.

  Besides, you all can use my code which I give you before, that is from KE series.


Have a great day,
Jingjing

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

3,359 Views
peter308
Contributor II

I test TEST_CASE_FUNC(Demo_Transmit_DataFrame)is OK.

I use TEST_CASE_FUNC(Demo_Receive_DataFrame) and set break point on here to test receive.

No interrupt be happen.

Have a nice day.

Peter

 pastedImage_1.png

0 Kudos
Reply

3,359 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Do you send the CAN data to this Can node?


Have a great day,
Kerry

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply

3,359 Views
peter308
Contributor II

Hi Kerry: 

Thanks, I sure send CAN data by the device.

pastedImage_1.png

0 Kudos
Reply

3,359 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Peter Wang,

   It's better to create a new question post about your own question, don't just follow other's closed question.

   After you create the new question post, we will help you in your own post.

   When you create the question post, please let us know the chip part number, the board, the detail question, then question test result pictures.etc.

   Thanks a lot for your understanding.


Have a great day,
Kerry

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply

3,359 Views
peter308
Contributor II

Hi Kerry:

I'm sorry my can device connect has a mistake. It's can receive data when I solve it.

Have a nice day.

Peter

0 Kudos
Reply

3,359 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Peter,

    Thank you for your updated information.

   And it's very good to hear you find the root hardware problem.

 Next time, if you have the question, please create the new question post, don't follow others solved post, it maybe ignored.


Have a great day,
Kerry

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply

3,359 Views
egoodii
Senior Contributor III

I think we can assume there is nothing 'wrong' with the drivers, but more the context or configuration.

So what about that clock setup?

To see where we are going, you might look at:

K60 CAN Broadcast Issue

0 Kudos
Reply

3,359 Views
egoodii
Senior Contributor III

Sounds like a 'small' error in bit-rate.  What is your clock source, and what do you divide it down to (Tq to get 250kbps)?

0 Kudos
Reply

3,359 Views
hemantsindkar
Contributor III

Hi Earl,

My clock source is BUSCLK.

I am using MSCAN_KEA128 drivers available from NXP.

Kinetis KEA128 StarterTRAK CAN Applications|NXP

pastedImage_0.png

Thanks & Regards

Hemant Sindkar

0 Kudos
Reply