K60 FlexCAN demo problem

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

K60 FlexCAN demo problem

Jump to solution
3,451 Views
UniversalTroope
Contributor III

I'm trying to run the FlexCAN demo on a Tower K60 board, with serial board. (MQX 3.7 and IAR EW-ARM 6.20)

 

It doesn't seem to work - data is apparently transmitted, but nothing is received. Also, I can't measure any activity on the CAN RX/TX pins in tower connector. I checked pin mux is ok. Also, I tried to fix for the e2583 errata, which seems to work.

 

// e2583

OSC_CR |= 0x01<<OSC_CR_ERCLKEN_SHIFT;

 

Any ideas? Can you successfully run the FlexCAN demo?

 

This is my output:

...

Data transmit: 155
FLEXCAN tx update message. result: 0x0
Data transmit: 156
FLEXCAN tx update message. result: 0x0
Data transmit: 157
FLEXCAN tx update message. result: 0x0

...

0 Kudos
1 Solution
1,654 Views
UniversalTroope
Contributor III

A Freescale FAE has resolved the problem as a hardware issue with the CAN bus on my tower kit. The CAN bus works fine on my new kit.

View solution in original post

0 Kudos
9 Replies
1,654 Views
UniversalTroope
Contributor III

New Kinetis board, same problem... Any ideas please?

0 Kudos
1,654 Views
jpa
Contributor IV

I don't have much to add except: yes, I do have the Flexcan demo running (although I'm using Codewarrior 10.1) and note that the terminal output doesn't seem to tell us much.  I just tried disconnecting the receiver from the CAN bus altogether and the terminal output keeps chirping away with the same message.

 

But with the receiver connected, I can see the messages coming in at a regular pace and can send a message to ID 0x123 and it is received by the K60 and printed to the terminal.  

 

I know this is all obvious, but check to see that your frequencies match and that you've got the 3 pin connector on the TWR-SER wired up correctly.   Note that the DB9 is for RS232, and doesn't get re-wired for CAN as it does with many Freescale development kits.   I believe my hand-wired adapter goes J7 pin 1 to DB9 pin 7, J7 pin 2 to DB9 pin 3, and J7 pin 3 to DB9 pin 2.  

 

JPA

0 Kudos
1,654 Views
UniversalTroope
Contributor III

Thanks for the replies. I can't measure any activity on the CAN TX/RX pins in the tower connector (the white PCI-like connector), so I think it might be a hardware issue.

0 Kudos
1,655 Views
UniversalTroope
Contributor III

A Freescale FAE has resolved the problem as a hardware issue with the CAN bus on my tower kit. The CAN bus works fine on my new kit.

0 Kudos
1,654 Views
Abhitechmania
Contributor IV

Hello, 

 

I am also facing the same problem. The demo is running fine but I dont see any activity on J7 pins. What hardware changes have been suggested or can you tell me the version of the kit you are using now. 

Regards,

Abhinav

0 Kudos
1,654 Views
amish_M4
Contributor I

Can someone explain the problem with the board? I think I am having the same issue here.

0 Kudos
1,654 Views
unmannedrussery
Contributor II

*BUMP*

 

Does anyone (Freescale folks?!?!) have any further info on this? I'm having exactly the same problem. I would have expected the FlexCAN demo to work out of the box on the TWR K60N512, but I haven't been able to get it to communicate. Like previous posters, the terminal output says that everything is working fine:

 

*********FLEXCAN TEST PROGRAM.*********
Message format: Standard (11 bit id)
Message buffer 0 used for Tx and Rx.
Interrupt Mode: Enabled
Operation Mode: TX and RX --> Normal
***************************************

selected frequency (Kbps) is: 125
Data length: 1
FLEXCAN reset. result: 0x0
FLEXCAN initilization. result: 0x0
FLEXCAN mode selected. result: 0x0
FLEXCAN global mask. result: 0x0
FLEXCAN Error ISR install, result: 0x0
FLEXCAN Bus off ISR install, result: 0x0
FLEXCAN error interrupt enable. result: 0x0
FLEXCAN rx remote mailbox initialization. result: 0x0
FLEXCAN rx mailbox initialization. result: 0x0
FLEXCAN mailbox activation. result: 0x0
FLEXCAN RX ISR install. result: 0x0
FLEXCAN RX remote ISR install. result: 0x0
FLEXCAN tx remote mailbox initialization. result: 0x0
FLEXCAN tx mailbox initialization. result: 0x0
FLEXCAN tx mailbox activation. result: 0x0
FLEXCAN TX ISR install. result: 0x0
FLEXCAN TX remote ISR install. result: 0x0
FLEXCAN started. result: 0x0
Data transmit: 0
Data transmit: 1
FLEXCAN tx update message. result: 0x0
Data transmit: 2
FLEXCAN tx update message. result: 0x0

 

I've tried probing the CAN pins on the A Expansion Port, and the TX (pin 42) is just floating high with no data on it. I've stimulated pins 1 and 3 on TWR SER J7 with CAN data at 125kbps, and was able to view the data on Pin 41 using a logic analyzer, so at least my TWR SER must be configured correctly.

 

Additionally, I used the Memory viewer in my debugger to check the TX mailbox (memory location 0x400A4098), and am able to see the data value increment in sync with the one spit out on the terminal. However, the CANbus remains dead.

 

Any thoughts? I've spent the whole day messing with this, and would love to get this demo working!

 

Regards,

Robert

0 Kudos
1,654 Views
unmannedrussery
Contributor II

Update... FIXED!

 

The problem is with the TWR SER jumper setup specified in TWRSERUM.pdf (or at least my interpretation of that setup). The table for J5 says shorting pins 1-2 "Put[s] CAN transceiver into sleep mode". This is actually incorrect.

 

Installing this jumper connects the "S" pin on the transceiver to ground, which puts the transceiver into normal operation or high speed mode (see pg. 4 of the datasheet http://www.nxp.com/documents/data_sheet/TJA1050.pdf).

 

So for this demo to work, you must short pins 1-2 of J5 on the TWR SER board. I had tried this earlier, but was doing it with a loose piece of wire (I'm short on 0.1" jumpers), and must not have had the two pins shorted effectively.

 

Regards,

-Robert

0 Kudos
1,653 Views
konrada_anton
Contributor III

What's your hardware setup? Is there another piece of CAN hardware you communicate with?

0 Kudos