[5744P]FlexCAN example code problem

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

[5744P]FlexCAN example code problem

2,067 Views
erichsu
Contributor I

I'm using the MPC5744P now. I use GHS MULTI IDE and P&E MULTILINK and EVB is KIT33908MBEVBE+KITMPC5744DBEVM.

But the CAN0 ( FlexCAN module) can not work well. And the program is always suspending in the below line.

 

while ( (CAN_0.IFLAG1.B.BUF31TO8I & 1) == 0) { } // wait until the tx is completed.

 

Could someone give me advice about the CAN0, please? It would be better if you can share me the example code of  FlexCAN.

Thanks a lot.

Original Attachment has been moved to: Example-MPC5744P-FlexCAN-simpleTXRX-v1_0-GHS614.zip

Labels (1)
0 Kudos
Reply
7 Replies

1,478 Views
xiaoyefang
Contributor I

Hi,Hsu

       Did you have sovled your problem?I meet the same problem as you.I think there is something wrong with the example code.Since I find the program is always suspending in the below line.

while ( (CAN_0.IFLAG1.B.BUF31TO8I & 1) == 0) { } // wait until the tx is completed.

     The development board I use is MPC5744P EVB ,without MC33908.

Look forward for your response.

0 Kudos
Reply

1,478 Views
erichsu
Contributor I

Hi Petr

Yes, I modify SBC Init form demo code because the demo code is GHS project.

Could you provide  FlexCAN sample code for S32 DS project or get me advice how to modify, please?

Thanks a lot.

0 Kudos
Reply

1,478 Views
lmonologue
Contributor I

Hi,hsu

      Did you have solved your problem? I also use GHS MULTI IDE  and EVB is KIT33908MBEVBE+KITMPC5744DBEVM .Now, the CAN0 ( FlexCAN module) can not work well,too.  Is it must  that the SBC chip be initialized and CAN transceiver enabled by codes?Because as we know,when JP112 is set,the CAN transceiver  is in normal mode.Look forward to your reply!

Thanks a lot.

0 Kudos
Reply

1,478 Views
erichsu
Contributor I

Hi Petr,

I modify MPC5744P-MPC33908 demo code in test2 project, and I confirm the CAN transceiver is in normal mode.

I set KIT33908MBEVBE in debug mode(set jp112), but CAN date frame does not be send. Could you help me check, please?

pastedImage_1.png

pastedImage_2.png

0 Kudos
Reply

1,478 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi Eric,

The demo example works properly on my board, but your Eclipse port does not. Seems you also modify the SBC driver, or not? Anyway it does not go through SBC Init on my side.

BR, Petr

0 Kudos
Reply

1,478 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

this example was written for and tested on the MPC5744P EVB and it works well on this EVB.

With your demo board this example cannot work as the SBC CAN transceiver is used on the motherboard (KIT33908MBEVBE). The SBC chip must be initialized and CAN transceiver enabled.

 

You can refer to the demo code for this board; https://www.nxp.com/webapp/Download?colCode=MPC5744P-MC33907-MC33908-DEMO. It does the SCB init as well as simple CAN transmit.

BR, Petr

0 Kudos
Reply

1,478 Views
xiaoyefang
Contributor I

Hi Petr,

I use this example code and tested on the MPC5744P EVB,but it cannot work.Everytime it stops at this words:

while ( (CAN_0.IFLAG1.B.BUF31TO8I & 1) == 0) { } // wait until the tx is completed.

I locate TransmitMsg() into PIT0_ISR,then the PIT cannot work;When I mask this words,the PIT works well.So I think there is something wrong with it.Can you help me?Thanks very much.

0 Kudos
Reply