AnsweredAssumed Answered

twr-k20d72m and can

Question asked by christos on Feb 14, 2013
Latest reply on Feb 19, 2013 by christos

Hello all,

 

   I am using a twr-k20d72m board and started to try the flexCAN example with MQX 3.8.1 and CW 10.2.

 

   CW builds the example successfully but I can not see any activity on PTA12 pin 42 on the PK20DX256VLL7 using an oscilloscope. The terminal output is:

 

*********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                                          
Data transmit: 3                                                                
FLEXCAN tx update message. result: 0x0                                          
Data transmit: 4                                                                
FLEXCAN tx update message. result: 0x0    

When I configure the CAN in loopback mode it seems to work but still I can not see any activity on the pins with the oscillosope. For the loopback I use the code from another forum post. Re: Flexcan example on tower K60

*********FLEXCAN TEST PROGRAM.*********                                         
   Message format: Standard (11 bit id)                                         
   Message buffer 0 used for Tx and Rxion. 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                                                                
Received data: 0x0                                                              
ID is: 0x123                                                                    
DLC is: 0x1                                                                     
                                                                                
Data transmit: 1                                                                
FLEXCAN tx update message. result: 0x0                                          
Received data: 0x1                                                              
ID is: 0x123                                                                    
DLC is: 0x1 

 

Any help much appreciated.

 

Best regards,

Christos

Outcomes