FRDM-KEAZ128 CAN Issues

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

FRDM-KEAZ128 CAN Issues

2,219 Views
michaeljwilson
Contributor II

My Background with Kinetis: I have used Processor Expert in the past to setup the CAN component of the KE06Z controller and found it easy to use and customize (transmit buffers, ID filter masks, baud-rates, etc.). My current development is for the FRDM-KEAZ128 dev board. This board isn't preconfigured in any of KDS, CW, or S32 IDE's so I'm having a hard time setting it up for CAN.

 

My issue: I am having a real difficult time configuring the CAN component to send frames on this board. 

I have added the component and configured it as follows:

  • Rx Pin: PTC6
  • Tx Pin: PTC7
  • Msg Buffers: 2 (1 Rx, 1 Tx)
  • Bit-rate: 250kbit/s
  • Initialization: Auto-init, enabled
  • Interrupts: High Priority for Tx, Medium for Rx
  • Events: OnFreeTxBuffer & OnFullRxBuffer

 

I'm using CANAlyzer to monitor frames and configured it at the same bit-rate, no frames are seen on the bus. I tried with and without 120ohm terminating resistor. From reading this NXP thread https://community.nxp.com/thread/386975 , I learned that PE actually forgets to add the interrupt enable mask for transmitting frames. That explains why the debugger doesn't reach the event CAN1_OnFreeTxBuffer(). After adding the missing line to the end of the CAN1_Init() routine, the debugger shows that the MCU is stuck in the PE_ISR(CAN1_TxInterrupt) loop. This happens during PE_low_level_init() before any of my code is executed (actually setting up a data frame).

 

175363_175363.JPGCapture01.JPG

 

I have tried disabling autoinitialize components--so I call the CAN1_Init() function myself and then CAN_Enable() to see what's going on. I tried adding the highlighted line just before setting up the CAN frame doesn't work either. I'm not sure what to do here, I have also tried removing the line (no frames sent, no OnFreeTxBuffer event triggered). When I use loop-back mode, the event gets triggered and the MCU doesn't get stuck in the ISR function.


Can someone take a look at my attached CodeWarrior 10.6 project and look at the PE code as to why it wont send CAN frames? I'm not exactly sure where to go from here.

 

PS. I have tried Kinetis Design studio and the new S32 design studio, to my luck, the MSCAN LDD component is not included!!

 

Any help is greatly appreciated!

Original Attachment has been moved to: frdm-keaz128-can-test.zip

Labels (1)
3 Replies

1,204 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi

Please check below thread about KEA128 MSCAN demo based on KDS Processor Expert:

https://community.nxp.com/thread/379133?commentID=583263#comment-583263 

I also attached a CodeWarrior Processor Expert demo for your reference.


Wish it helps.

Have a great day,
Ma Hui
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

1,204 Views
michaeljwilson
Contributor II

Thank you very much for the response. I downloaded the KDS example and programmed the FRDM-KEAZ128. Tomorrow I will test it on a real CAN bus with other nodes and CANAlyzer, then I will respond with the results.

0 Kudos
Reply

1,204 Views
ionut_chirilus
Contributor II

michaeljwilson, do you tell us if u could to transmit via CAN on KEAZ128?

0 Kudos
Reply