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
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!
-----------------------------------------------------------------------------------------------------------------------
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
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!
-----------------------------------------------------------------------------------------------------------------------