Secure CAN Trcv TJA115x in the S32K3xx EVB is not working well.

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

Secure CAN Trcv TJA115x in the S32K3xx EVB is not working well.

4,885 Views
najongmin
Contributor III

I bought an S32K3xx EVB and tried to FlexCAN communication with PCAN.

I configured the control pins of TJA115x such as EN, STB_N following as datasheet.

But, The INH pin was still Low-Active and CAN Communication is not working well.

 - In Normal mode, INH should be High-Active state

It occurred "Bus Heavy" error when I sent some messages by PCAN as 500kbps. (Of course, I did set a boud rate of FlexCAN0 as 500kbps too)

According to datasheet, It seems that I have to configure TJA via CAN BUS. Is this the cause of the problem?

Or If you have sample code related to CAN communication in normal mode for S32K3xx EVB, Please share for me.

 

Best Regards,

JM

0 Kudos
Reply
16 Replies

4,841 Views
najongmin
Contributor III

Hello Daniel,

Yes. You are right.

I have figured out by spoofing protection configuration (command 0x10).

As you mentioned, TJA1153 must be configured at least one passlist.

So I did configure CAN filter and mask same as 0x000&mask 0x1FF and 0x00000000&mask 0x1FFFFFFF.

(We will use the TJA1043 and TJA1052i instead of TJA1153 for our BMS, So I want to disable secure CAN function.)

Now, Transmission by host MCU is working well without error passive!!!

 

I think it is better to add a sequence diagram about initial configuration for beginner!!

 

Regards,

JM 

0 Kudos
Reply

4,854 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hello JM,

According to the datasheet, when no configuration is stored in non-volatile memory the TJA1153 does not allow the connected host
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'm currently looking for an example, I will update the case as soon as possible,

 

Regards,

Daniel

0 Kudos
Reply

1,811 Views
Kevin_Anjorin
Contributor I
Hello Daniel, 

how are you I hope everything is fine on your side.

I am currently working with CAN Trcv TJA115x on S32K3x4 EVB -T172 and wanted to ask if you still have the demo application for the configuration of the HS Can Trcv to leave Vanilla mode and enter normal operation? 

As mentioned in the Post: https://community.nxp.com/t5/S32K/Secure-CAN-Trcv-TJA115x-in-the-S32K3xx-EVB-is-not-working-well/m-p...


I am looking forward to hearing from you. 

Best regards

Kevin Anjorin

0 Kudos
Reply

1,803 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @Kevin_Anjorin,

I just sent you a private message with the example.

 

BR, Daniel

0 Kudos
Reply

4,664 Views
FlySinking
Contributor I

Hello,Daniel,

Did you find the TJA1153 example? I cannot make TJA1153 enter the Normal Mode.Hope you can help me.

 

 

BR!

WK

0 Kudos
Reply

4,651 Views
rahulM
Contributor IV

Hi Daniel,

Please share some example code for IMX8QM.

We are also using TJA1153 secure can transceiver for IMX8QM.

Thanks and Regards,

Subramanya N M

0 Kudos
Reply

4,648 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi Subramanya,

I don't support I.MX,

Please create a new thread:

https://community.nxp.com/t5/i-MX-Processors/bd-p/imx-processors

 

Thank you,

BR, Daniel

0 Kudos
Reply

4,645 Views
rahulM
Contributor IV

Hi Daniel,

Thanks for your reply.

Ok sure i will post in that group.

Thanks and Regards,

rahul

0 Kudos
Reply

4,655 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @FlySinking,

I just sent you a very simple example,

 

BR, Daniel

0 Kudos
Reply

1,871 Views
HarryQi
Contributor III

Hello, sir 

    I also need some help on initializating the TJA1153 on the MR-CANHUBK344 Evaluation Board with MBDT toolbox and S32  configuration tools  

0 Kudos
Reply

2,248 Views
liuzhi
Contributor I

Hi, Daniel

    Can you send me one,  I'm working on S32K358 EVK now, Thanks!

Best Regards!

Liuzhi

0 Kudos
Reply

2,905 Views
GKailas
Contributor I

Hello,

Can you please this example with me?

Is the EVB are shipped with TJA1153 in vanilla state or there is some configuration already present?

Regards,

Kailas

0 Kudos
Reply

3,774 Views
xxwalmac
Contributor I

Can You send this configuration also to me maciej.walczak@rimac-technology.com

4,442 Views
jacst
Contributor II

Hello, I am using S32K344 EVB, can you provide a drive reference for TJA1153? thanks@

0 Kudos
Reply

4,696 Views
rahulM
Contributor IV

Hi Daniel,

We have developed IMX8QM based custom board.

Which is having 2secure CAN transceiver TJA1153 and other one is normal can driver.

Normal can driver is working fine, but secure can is not working.

#ifconfig -a

i am able to list can0(normal can driver) can1 and can2 
I am using TJA1153 secure CAN.
I used msgid:0x555 data:0x7202030405060708

i am still getting bus error, not able to transmit data.

can you please help me on this, how to configure TJA1153 secure CAN transceiver.

I kept STB_N=H and send above frame from bus master and STB_N=L from host sent #cansend can2 0x555#7202030405060708 to configure.

I am not able to configure.

Please find below schematic

rahulM_1-1628166808653.png

 

rahulM_0-1628166727183.png

 

Please find below device tree entry

I am controlling gpio for can2_stb and can2_en same for can1 from /sys/class/gpio

reg_can1_en: regulator-can1-gen {
compatible = "regulator-fixed", "fsl,imx8qm-flexcan";
regulator-name = "can1-en";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
//gpio = <&lsio_gpio0 18 GPIO_ACTIVE_HIGH>;
enable-active-high;
};

reg_can2_en: regulator-can2-gen {
compatible = "regulator-fixed", "fsl,imx8qm-flexcan";
regulator-name = "can2-en";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
//gpio = <&lsio_gpio0 4 GPIO_ACTIVE_HIGH>;
//enable-active-high;
};

reg_can0_stby: regulator-can0-stby {
compatible = "regulator-fixed", "fsl,imx8qm-flexcan";
regulator-name = "can0-stby";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
//gpio = <&lsio_gpio1 3 GPIO_ACTIVE_HIGH>;
//enable-active-high;
//vin-supply = <&reg_can01_en>;
};

reg_can1_stby: regulator-can01-stby {
compatible = "regulator-fixed", "fsl,imx8qm-flexcan";
regulator-name = "can1-stby";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
//gpio = <&lsio_gpio0 13 GPIO_ACTIVE_HIGH>;
//enable-active-high;
//vin-supply = <&reg_can01_en>;
};

reg_can2_stby: regulator-can2-stby {
compatible = "regulator-fixed", "fsl,imx8qm-flexcan";
regulator-name = "can2-stby";
regulator-min-microvolt = <3300000>;

regulator-max-microvolt = <3300000>;
//gpio = <&lsio_gpio0 3 GPIO_ACTIVE_HIGH>;
//enable-active-high;
};

&flexcan1 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_flexcan1>;
xceiver-supply = <&reg_can0_stby>;
status = "okay";
};

&flexcan2 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_flexcan2>, <&pinctrl_can1>;
xceiver-supply = <&reg_can1_stby>;
status = "okay";
};

&flexcan3 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_flexcan3>, <&pinctrl_can2>;
xceiver-supply = <&reg_can2_stby>;
status = "okay";
};

pinctrl_flexcan1: flexcan0grp {
fsl,pins = <
IMX8QM_FLEXCAN0_TX_DMA_FLEXCAN0_TX 0x21
IMX8QM_FLEXCAN0_RX_DMA_FLEXCAN0_RX 0x21
IMX8QM_SCU_GPIO0_07_SCU_GPIO0_IO07 0x23 //can0_stb
>;
};

pinctrl_flexcan2: flexcan1grp {
fsl,pins = <
IMX8QM_FLEXCAN1_TX_DMA_FLEXCAN1_TX 0x21
IMX8QM_FLEXCAN1_RX_DMA_FLEXCAN1_RX 0x21
>;
};

pinctrl_flexcan3: flexcan3grp {
fsl,pins = <
IMX8QM_FLEXCAN2_TX_DMA_FLEXCAN2_TX 0x21
IMX8QM_FLEXCAN2_RX_DMA_FLEXCAN2_RX 0x21
>;
};

pinctrl_can1: can1grp {
fsl,pins = <
IMX8QM_GPT1_CAPTURE_LSIO_GPIO0_IO18 0x00000020 //can1_en
IMX8QM_M41_GPIO0_01_LSIO_GPIO0_IO13 0x00000020 //can1_stb
IMX8QM_SIM0_RST_LSIO_GPIO0_IO01 0x00000020 //can1_wake
>;
};

pinctrl_can2: can2grp {
fsl,pins = <
IMX8QM_SIM0_POWER_EN_LSIO_GPIO0_IO04 0x00000020 //can2_en
IMX8QM_SIM0_PD_LSIO_GPIO0_IO03 0x00000020 //can2_stb
IMX8QM_SIM0_GPIO0_00_LSIO_GPIO0_IO05 0x00000020 //can2_wake
>;
};

Please help me how to enable secure can.

Thanks and Regards,

Subramanya N  M

0 Kudos
Reply

4,694 Views
rahulM
Contributor IV

Hi NXP,

I am using IMX8QM based custom board.

We are using 2CAN transceiver TJA1153 and 1 normal can transceiver.

In ifconfig -a i am able to see can0, can1 and can2. But CAN1 and CAN2 is showing bus error.

Normal mode operation (STB_N=H and STB_EN=H)

Since it is an secure CAN transceiver, we are using following command for configuration with STB_N=H and STB_EN=H from bus master sending msg_id:0x555 data:0x71 0x02 0x03 0x04 0x05 0x06 0x07 0x08

Even though i am getting bus error

also tried with STB_N=L using cansend can2 0x555#7102030405060708, even still i am getting bus error.

Please let me know how to configure secure can transceiver.

rahulM_1-1628163300345.png

rahulM_2-1628163328910.png

 

device tree

reg_can1_en: regulator-can1-gen {
compatible = "regulator-fixed", "fsl,imx8qm-flexcan";
regulator-name = "can1-en";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
//gpio = <&lsio_gpio0 18 GPIO_ACTIVE_HIGH>;
enable-active-high;
};

reg_can2_en: regulator-can2-gen {
compatible = "regulator-fixed", "fsl,imx8qm-flexcan";
regulator-name = "can2-en";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
//gpio = <&lsio_gpio0 4 GPIO_ACTIVE_HIGH>;
//enable-active-high;
};

reg_can0_stby: regulator-can0-stby {
compatible = "regulator-fixed", "fsl,imx8qm-flexcan";
regulator-name = "can0-stby";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
//gpio = <&lsio_gpio1 3 GPIO_ACTIVE_HIGH>;
//enable-active-high;
//vin-supply = <&reg_can01_en>;
};

reg_can1_stby: regulator-can01-stby {
compatible = "regulator-fixed", "fsl,imx8qm-flexcan";
regulator-name = "can1-stby";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
//gpio = <&lsio_gpio0 13 GPIO_ACTIVE_HIGH>;
//enable-active-high;
//vin-supply = <&reg_can01_en>;
};

reg_can2_stby: regulator-can2-stby {
compatible = "regulator-fixed", "fsl,imx8qm-flexcan";
regulator-name = "can2-stby";

//gpio = <&lsio_gpio0 3 GPIO_ACTIVE_HIGH>;
//enable-active-high;
};

&flexcan1 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_flexcan1>;
xceiver-supply = <&reg_can0_stby>;
status = "okay";
};

&flexcan2 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_flexcan2>, <&pinctrl_can1>;
xceiver-supply = <&reg_can1_stby>;
status = "okay";
};

&flexcan3 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_flexcan3>, <&pinctrl_can2>;
xceiver-supply = <&reg_can2_stby>;
status = "okay";
};

pinctrl_flexcan1: flexcan0grp {
fsl,pins = <
IMX8QM_FLEXCAN0_TX_DMA_FLEXCAN0_TX 0x21 
IMX8QM_FLEXCAN0_RX_DMA_FLEXCAN0_RX 0x21 
IMX8QM_SCU_GPIO0_07_SCU_GPIO0_IO07 0x23 
>;
};

pinctrl_flexcan2: flexcan1grp {
fsl,pins = <
IMX8QM_FLEXCAN1_TX_DMA_FLEXCAN1_TX 0x21
IMX8QM_FLEXCAN1_RX_DMA_FLEXCAN1_RX 0x21
>;
};

pinctrl_flexcan3: flexcan3grp {
fsl,pins = <
IMX8QM_FLEXCAN2_TX_DMA_FLEXCAN2_TX 0x21
IMX8QM_FLEXCAN2_RX_DMA_FLEXCAN2_RX 0x21
>;
};

pinctrl_can1: can1grp {
fsl,pins = <
IMX8QM_GPT1_CAPTURE_LSIO_GPIO0_IO18 0x00000020 //can1_en
IMX8QM_M41_GPIO0_01_LSIO_GPIO0_IO13 0x00000020 //can1_stb
IMX8QM_SIM0_RST_LSIO_GPIO0_IO01 0x00000020 //can1_wake
>;
};

pinctrl_can2: can2grp {
fsl,pins = <
IMX8QM_SIM0_POWER_EN_LSIO_GPIO0_IO04 0x00000020 //can2_en
IMX8QM_SIM0_PD_LSIO_GPIO0_IO03 0x00000020 //can2_stb
IMX8QM_SIM0_GPIO0_00_LSIO_GPIO0_IO05 0x00000020 //can2_wake
>;
};

Please let me know how to configure it and make it up.

How to write into non-volatile memory

Regards,

rahul

0 Kudos
Reply