Problems about FlexCAN of MPC5634M

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

Problems about FlexCAN of MPC5634M

837 Views
2039759305
Contributor I

I am working on MPC5634M and I written a code  develped from the example code about CAN_A to transmit and recive by CAN_C. I just changed CAN_A to CAN_C and Its pin number in original example code,but the new code doesn't run.Anybody can help me?

Here is the original code named CAN_A,the new code named CAN_C. 

Labels (1)
0 Kudos
5 Replies

691 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

the code looks normal. Open drain config for TX pin is not needed, but it depends on used PHY circuitry.

What does not work in fact? Do you see eny errors (check ESR, ECR registers)?

What is the other node on the bus?

BR, Petr

0 Kudos

692 Views
2039759305
Contributor I

Thanks,Petr.

When I debug the new code CAN_C,the code  loops at a certain location(from PC 00001000 to PC 0000203A) and cannot execute the application layer code,as the pictures show.

20190814202709.png20190814202744.png20190814202808.png

I only changed the channel from CAN_A to CAN_C,can you give some suggestions about it?

Thanks,Petr.

0 Kudos

692 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

I see, the CAN_C contains just 32MBs while CAN_A 64 MBs.

So on CAN_C the memory area corresponding to MBs 32–63 and Rx Individual Filters 32–63 are considered
reserved space, and you should not access it.

Modify your code to access just first 32MBs.

BR, Petr

0 Kudos

692 Views
2039759305
Contributor I

Hi,

Thanks,Petr.I modify the part of MB initialization,and it worked.The code can transmit messege well,but it can not recive messege .I checked the  Error and Status Register(CAN_ESR) ,I checked the value of each registers are showed in picture when it failed to recive messege.微信图片_20190816093959.png

I tried to set ERRMSK,RERNMSK,TWRNMSK in CAN_CR ,and WRNEN in CAN_MCR,Transmition can not funtion well,either.How can I solve this problem?

BR Justin

0 Kudos

692 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

it shows you got Bus off error. The reason could be wrong pin setting, incorrect bit timing, wrong transceiver or bus termination.

To check pin setting just disconnect transceiver and short TX/RX line. Do not use open drain config on TX line.

Send message, it should be repeated still and ACK error is detected.

Petr

0 Kudos