i.MXRT1062 FlexCAN Flooding with ERROR

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

i.MXRT1062 FlexCAN Flooding with ERROR

Jump to solution
826 Views
sunlong
Contributor II

FlexCAN TX pins was flooded with `can_error` messages and never stop after calling `FLEXCAN_TransferSendNonBlocking`

Steps to reproduces

1. Based on example flexcan_interrupt_transfer

2. change the FlexCAN pin config like this:

IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B0_02_FLEXCAN2_TX, 1U);
IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B0_03_FLEXCAN2_RX, 1U);
IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_B0_02_FLEXCAN2_TX, 0x10B0U);
IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_B0_03_FLEXCAN2_RX, 0x10B0U);

3. trim down other codes except CAN sending - FLEXCAN_TransferSendNonBlocking

4. add a status code print in CAN callback, like this:

static FLEXCAN_CALLBACK(flexcan_callback)
{
LOG_INFO("status code: %d\n", status);

...

 

problem:

1. after FLEXCAN_TransferSendNonBlocking gets called, the FLEXCAN_CALLBACK always gets called with error code 5311 and never stops

2. can_error signal was capture on CAN_TX_PIN(IOMUXC_GPIO_AD_B0_02_FLEXCAN2_TX), never stops, like this:

sunlong_0-1687154773137.png

 

PS, CAN peripheral part schematic is straightforward. and the CAN2_P and CAP2_N are not attached to a CAN twisted cable by now.

sunlong_1-1687154948101.png

 

PPS, seem there is no problem with the default pins of flexcan_interrupt_transfer example:

IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B0_14_FLEXCAN2_TX, 1U);
IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B0_15_FLEXCAN2_RX, 1U);
IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_B0_14_FLEXCAN2_TX, 0x10B0U);
IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_B0_15_FLEXCAN2_RX, 0x10B0U);

 

 

0 Kudos
Reply
1 Solution
793 Views
_Leo_
NXP TechSupport
NXP TechSupport

Hi,

Thank you so much for your interest in our products and for using our community.

As you mention, the evkbmimxrt1060_flexcan_interrupt_transfer example works with the default pinout.

Regarding your new configuration I see some hardware points that could be affecting:

The first is your schematic of the CAN peripheral, this differs greatly from the schematic of our EVK. I recommend basing your schematic on ours or on their respective datasheet.

The second is, assuming you are using the MIMXRT1060-EVKB, the GPIO_AD_B0_02 and GPIO_AD_B0_03 pins are also used for USB, so I recommend removing resistors R190 and R305 to make sure they are not distorting the signals even if you are not using USB.

Lastly, the lack of a CAN twisted cable could also be the problem.

Hope it helps you.

Have a nice day!

View solution in original post

2 Replies
794 Views
_Leo_
NXP TechSupport
NXP TechSupport

Hi,

Thank you so much for your interest in our products and for using our community.

As you mention, the evkbmimxrt1060_flexcan_interrupt_transfer example works with the default pinout.

Regarding your new configuration I see some hardware points that could be affecting:

The first is your schematic of the CAN peripheral, this differs greatly from the schematic of our EVK. I recommend basing your schematic on ours or on their respective datasheet.

The second is, assuming you are using the MIMXRT1060-EVKB, the GPIO_AD_B0_02 and GPIO_AD_B0_03 pins are also used for USB, so I recommend removing resistors R190 and R305 to make sure they are not distorting the signals even if you are not using USB.

Lastly, the lack of a CAN twisted cable could also be the problem.

Hope it helps you.

Have a nice day!

732 Views
sunlong
Contributor II

Turns out we mistakenly swapped TXD and RXD of the inputs.

0 Kudos
Reply