AnsweredAssumed Answered

k20 FLEXCAN example set to loopback, setup

Question asked by Robert Lewis on Oct 10, 2015
Latest reply on Oct 13, 2015 by Robert Lewis

Hi

 

I have been trying to get the flexcan example to run in loopback on our board without success. I have a 60 ohm resistor on each CAN-H and CAN-L pair and have tied CAN-H to CAN-L.

 

I looped the TCAN-H and CAN-L pins in order to follow the suggestion on this forum (twr-k20d72m and can) to allow the Tx line to toggle. I added a separate ISR for the Rx and Tx. What I need  to do is to check the HW functionality at this point using a single board and verify the signal levels.

 

I checked the init_gpio.c and we are using the default settings for the port pins PTA12 & PTA13 so no changes were needed. I didn't see any setting to enable the FLEXCAN modules in user_config.h. I can step through the init fcns for the CAN system and they do not return any error however I don't see any activity on the Tx line even when I set the code to loop transmitting the text string. I do get one single Tx interrupt but thats it.

 

So I am wondering if there is another setting somewhere I have missed. The k20dx256 is the same bsp as the k40dx256 so I used the example code for the k40.

 

I am trying to run this on MQX 4.01. Is loopback a reasonable mode to set the code to run in?

 

Can anyone tell me my error please. I can try the newer MQX 4.2 but would prefer to get this working under MQX 4.0.1 before expanding the project and potential problems.

 

Any advice would be appreciated.

 

Thanks

 

Robert

Outcomes