S32K344 Evaluation Board FlexCan Example running

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

S32K344 Evaluation Board FlexCan Example running

7,772 Views
dsantxez
Contributor III

I am trying to run the Flexcan example with the evaluation board. The program compiles and runs as it should, however, never apears in the CAN interface.

I have added the IO configuration code line and checked that the CAN configuration is not in loopback mode and that the FlexCAN0 pins are the ones stated in the Evaluation Board PDF

S32K3X4EVB-Q257_HW-UM.pdf 

I have checked the CAN_L and CAN_H lines and 120Ohms are there, enough to get CAN communication with a short cable. The configuration of the EVAL board is at 500kbps and CanAnalyzer is setup to 500kbps as well.

 

Anyone could give me a hint to what is missing?

0 Kudos
Reply
14 Replies

4,225 Views
JonAnder_Amante
Contributor I

Hi Sir, 

I am trying to run the Flexcan programme but I have different errors in the board MR-CANHUBK344, I want send information from Can_0 and receive to Can_1. Firstly, when I realize the debugging I can`t receive the information in the array of rxdata. I checked the program with the mode of loopback and it`s correct but when I debug the program in normal mode I had problems. I have the same main as you and I think that the configuration of pins are well. About pins configuration I have configurated PTA6 as CAN0_rx, PTA7 as CAN0_tx, PTA22 as CAN1_rx and PTA23 as CAN1_tx. I send you mi program because I dont`t know what is my error. 

Thank you for all, 

0 Kudos
Reply

6,845 Views
fxn
Contributor II

Hi All,

I try your code but "CAN" still can't work, I can't measure the wave in can_tx.

Could you email sample code with IDE setting to me? Thanks a lot!

my email: jeff09051006@hotmail.com

Tags (1)
0 Kudos
Reply

6,834 Views
fxn
Contributor II

Hi Sir,

I attach my project for you easy checking. Thanks.

7,760 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

there is secure transceiver TJA1153 connected to the MCU on the board. When no configuration is stored in non-volatile memory of the TJA1153, it does not allow the MCU to communicate with the CAN bus. It awaits configuration. Depending on the STB_N level the configuration needs to be sent via the bus from remote or via pin TXD.
STB_N=L, then configuration must come from local host via the TXD pin
STB_N=H, then configuration must come from remote node via the CAN bus
I will sent you simple example showing basic transceiver init.

BR, Petr

0 Kudos
Reply

4,601 Views
ToHoangLinh
NXP Employee
NXP Employee

Hi @PetrS , I tried your code solution for CAN Transceiver on S32K3X4 EVB T172 board. 

It has an issue:

works - nonwork - works - nonwork - works - nonwork ......

Each time we reload the ELF file, the code becomes non-work (CAN0 not sync, bus off), but if we load again that ELF file, it works (and repeatedly)

We are not sure how to handle it for end-users. Can you please check?

7,744 Views
JoDo
Contributor III
Hello, @PetrS I have the same problem as @dsantxez can I also get the sample with working TJA1153

7,713 Views
dsantxez
Contributor III

Hi,

I have tried to convert the plain setup example in plain to Flex API. I send this the messages that appear in the example and control de pin that enables setup mode, but with no success.

Could you check to see what I am doing wrong?

Thank you in advance,

Denis

0 Kudos
Reply

7,698 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

you are controling wrong pin for STB_N and prepare payload incorrectly.
See attached main.c for changes.

BR, Petr

0 Kudos
Reply

7,666 Views
JoDo
Contributor III

Hello,

I tried to use an external transceiver for CAN0 and wanted to use other pins than PTA6/7 Rx/Tx. So I selected PTF21/20 Rx/Tx and genereated new code,but when I run the program there is no response to them. I checked the pin connection by using it as GPIO and blink test.

When I use PTA6/7, I can see the message with an oscilloscope and my external transceiver also sends the correct message.

Is there any other configuration that should be done?

0 Kudos
Reply

4,683 Views
Eason_L
Contributor III

Hi,

I have the same problem, but changing PTA7 to PTB1. Do you have the solution?

 

0 Kudos
Reply

7,614 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

did you set respective IMCR register for RX pin as well? That is IMCR[0]=5.

To test proper pin setting for FlexCAN, connect TX and RX pin together without transceiver and send a message. You should see message transmitted still.

BR, Petr

3,110 Views
Salomi
Contributor I

Hi , Could you please help me to configure the IMCR register in S32 Studio IDE ?

0 Kudos
Reply

3,795 Views
anakha
Contributor III

What do you mean connect Rx and Tx together (connect to each other physically?) and how could it work at that way?

0 Kudos
Reply

4,587 Views
Eason_L
Contributor III
Hi,
Connect TX and RX pin together solves the proplem, thanks.
0 Kudos
Reply