Help with KEA128 working as an ECU into CAN Bus.

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

Help with KEA128 working as an ECU into CAN Bus.

Jump to solution
3,658 Views
omarzamacona
Contributor II

Hello, how are you guys?

 

In my previous questions I was asking about how to work with my board as a CAN device.

For now looks its working as a Loopback mode, but my real intention is to integrate this board into a CAN network.

 

So, a general question,

¿is there a Guide or reference of how to Setup, Synchronize a CAN network and how to watch (sent and received) Frames?

 

Very specific questions

  1. 1.- How can I see the frames transmitted (TX/RX) on the bus? a Console, Terminal, Saint Bus Monitor?
  2. 2.- If CAN_LDD component is not visible as a Component in Components View, is there a file to set Loopback = Yes/No?
  3. 3.- Where Do I need to configure the baudrate for the board? (I´m working with 500,000 in two other devices)
  4. 4. -In others post, I saw this: What does it means, and how to configure it?

Gateway(TRK-KEA128) ------------------ECU CAN Tx----------->------CAN Rx Console<--------CANRx----------<--------CAN Tx

  1. 5.-Printf() is not working on my bench, I have been read and implementing a guide on the MCUoneclipse.com but still no printing anything, No errors get when compiling it. This is the guide:

http://mcuoneclipse.com/2013/02/07/tutorial-printf-with-and-without-processor-expert/

 

This is what I have:

Hardware:

- 2 SAINT2 devices, harness, and USB cables, these devices are sending and receiving frames into the CAN bus--OK

-1 TRK KEA 128 - MCU PKEAZ128MLK, working in Loopback mode--OK

Software:

-SAINT Bus Engine, to control the ports (open/close) on the guest PC.

-SAINT Bus monitor, to watch the frames on the bus

-Codewarrior 10.6.4

 

Also I attached a CAN project that I´m using.

Original Attachment has been moved to: KEAZ128_CAN_Network.zip

0 Kudos
Reply
1 Solution
2,617 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Add, after you add the code i mentioned , please select the "Don't write generated component modules", or when you click the generate code button, the code

will be disappear .

pastedImage_0.png

Hope it helps

Alice

View solution in original post

0 Kudos
Reply
8 Replies
2,618 Views
omarzamacona
Contributor II

Thanks, now is working!

0 Kudos
Reply
2,618 Views
tonymor90
Contributor I

Omar What did you do to make it work? I used the attachment  she uploaded but I cannot step after the "PE_LDD_RegisterDeviceStructure(PE_LDD_COMPONENT_CAN1_ID, DeviceDataPrv);" the code gets stuck, and I havent changed anything in here code. but does not run, loop mode already worked for me

0 Kudos
Reply
2,618 Views
weijiezhang
Contributor II

Hi Hugo,

   Have you made the project work? I am facing the same codition as you, can you give me some advice?

0 Kudos
Reply
2,618 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello omar,

1. One method you can use a can-usb convetor , then check the data which CAN send on the PC terminal ;

    Another method you can use the logic analyzer , or simple oscilloscope ( this only can check whether it can signal).

2. There is the  option that disable or enable the loopback mode :

pastedImage_0.png

you also can use the register :

pastedImage_1.png

3. Configure the baud rate at here :

pastedImage_3.png

4. which post ?

5. If you use the TRK-KEA128 board, please select the UART2, not UART0.

pastedImage_5.png

Hope it helps


Have a great day,
Alice Yang

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

0 Kudos
Reply
2,618 Views
omarzamacona
Contributor II

Hello again.

4.- This is the post where I saw this: Gateway(TRK-KEA128) ------------------ECU CAN Tx----------->------CAN Rx Console<--------CANRx----------<--------CAN Tx

CAN loop back not working in TRK KEA 128

I was trying to debug my project with no success, I change some few things according to the help Components for CAN_LDD, like Loopmode=NO and Bit Rate.

Could you please review my attached project  to see if it is really sending/receiving a Frame for NOT Loop mode mode?

Nice day.

0 Kudos
Reply
2,618 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello omar,

I have not received your new project , so i change it on the first project

your  attached.

First change the loop mode to"no" , then i can see the transmit data from the oscilloscope:

pastedImage_0.png

you can also test it on your side . while at this time it not run to the Tx interrupt.

Second , there is a bug on the PE code , it have not enable the CAN Tx interrupt , please add

this code at the CAN1_Init() function:

pastedImage_1.png

then you can see it can run to the interrupt function of TX .

I attach the project , hope it helps


Have a great day,
Alice Yang

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

0 Kudos
Reply
2,618 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Add, after you add the code i mentioned , please select the "Don't write generated component modules", or when you click the generate code button, the code

will be disappear .

pastedImage_0.png

Hope it helps

Alice

0 Kudos
Reply
2,618 Views
tonymor90
Contributor I

Hello Alice, I was trying to run your example code, but the implementation does not continue  "PE_LLDD_RegisterDeviceStructure( PE_LDD_COMPONENT_CAN1_ID, DeviceDataPrv);

TxIssue.PNG

0 Kudos
Reply