CAN loop back not working in TRK KEA 128

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

CAN loop back not working in TRK KEA 128

1,330 Views
ddpd
Contributor III

I am not using internal loopback. I am using simple canTransmit and canRecive functions. , My communication flow is described below

                      Gateway(TRK-KEA128) ---------------------------ECU

                                                    CAN Tx-------------------->------CAN Rx

                       Console<--------CANRx--------------<-------------CAN Tx

  • Initially, I transmit data from Gateway (TRK-KEA128)
  • After receiving data in ECU, I am transmitting data back to Gateway. But after a certain time, I see no data in the console.
  • I could see that both Gateway and ECU microcontrollers are waiting in while loop to check for read data in debug mode.
  • How can I solve this issue?? Is it because of overload?
Labels (1)
0 Kudos
3 Replies

667 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Dino David,

      About the CAN loopback code for TRK-KEA128, please refer to these posts, I already share the code and the according test result in these posts:

I wonder how to get CAN to work with KDS's Processor Expert?

Re: CAN_LDD TRK_KEA128 sendFrame (NOT LOOPBACK)

Please refer to it at first.

Wish it helps you!

If you still have question, 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

665 Views
ddpd
Contributor III

Hi Jingjing,

I just went through some attachments and the previous blogs. However, it did not answer my question.

Please find attached my gateway code. I am using MSCAN libraries provided by nxp. Also, I am not using any interrupt as of now.

Everything is sequential i.e

1. Tx first.

2. Rx and print in console 3. repeat 1 & 2.

3. repeat 1 & 2.

Also how do I register an interrupt handler with EnableInterrupts ? I found this function call in the example code.

Please clear the doubts and correct me if I am making any mistake.

For reference, I have attached the project.

Thanks in advance

0 Kudos

665 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Dino David,

    About the sequential which you need, I still have another sample code, which send the CAN data at first, then receive the data, and send the received data to the console.

   That CAN communication baud is 100Kbps, please make sure your ECU have the same CAN baud.

   If you want to enable the MSCAN interrupt, you should enable the TX and RX interrupt, and enable the IRQ, then write the interrupt service code in the MSCAN interrupt code.

About the configuration, please refer to CAN_Init function which you can find it from the mscan.c in my attached project.

Wish it helps you!

If you still have question, please contact with me!

Have a great day,

Jingjing

-----------------------------------------------------------------------------------------------------------------------

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

-----------------------------------------------------------------------------------------------------------------------