Problems about FlexCAN of MPC5634M

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Problems about FlexCAN of MPC5634M

841 次查看
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. 

标签 (1)
0 项奖励
5 回复数

695 次查看
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 项奖励

696 次查看
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 项奖励

696 次查看
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 项奖励

696 次查看
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 项奖励

696 次查看
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 项奖励