RT1064EVK board, CANFD with FLEXCAN_ErrorStatus

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

RT1064EVK board, CANFD with FLEXCAN_ErrorStatus

1,231 Views
likeandhate
Contributor I

The CANFD function of the RT1064EVK board USES the evkmimxrt1064_canfd_interrupt_transfer example in SDK2.7. J11 on the board is not connected to anything else. After the program runs, the callback function keeps reporting the status of kStatus_FLEXCAN_ErrorStatus.In the fsl_flexcan.c file:

void FLEXCAN_TransferHandleIRQ(CAN_Type *base, flexcan_handle_t *handle)
{
/* Assertion. */
assert(NULL != handle);

status_t status;
uint32_t result = 0xFFU;
uint32_t EsrStatus = 0U;

do
{
/* Get Current FlexCAN Module Error and Status. */
EsrStatus = FLEXCAN_GetStatusFlags(base);

/* To handle FlexCAN Error and Status Interrupt first. */
if (0U != (EsrStatus & ((uint32_t)kFLEXCAN_TxWarningIntFlag | (uint32_t)kFLEXCAN_RxWarningIntFlag |
(uint32_t)kFLEXCAN_BusOffIntFlag | (uint32_t)kFLEXCAN_ErrorIntFlag)))
{
status = kStatus_FLEXCAN_ErrorStatus;
/* Clear FlexCAN Error and Status Interrupt. */
FLEXCAN_ClearStatusFlags(base, (uint32_t)kFLEXCAN_TxWarningIntFlag | (uint32_t)kFLEXCAN_RxWarningIntFlag |
(uint32_t)kFLEXCAN_BusOffIntFlag | (uint32_t)kFLEXCAN_ErrorIntFlag);
}
else if (0U != (EsrStatus & (uint32_t)kFLEXCAN_WakeUpIntFlag))

CANFD cannot operate normally. What is the reason?

Labels (1)
0 Kudos
8 Replies

493 Views
sunlong
Contributor II

have the same problem with the CANFD example on MIMXRT1062 EVK.

the weird part is this problem only happens on some specific pins such as `IOMUXC_GPIO_EMC_36_FLEXCAN3_TX` and `IOMUXC_GPIO_EMC_37_FLEXCAN3_RX`.

with the default pins(IOMUXC_GPIO_AD_B0_14_FLEXCAN3_TX and IOMUXC_GPIO_AD_B0_15_FLEXCAN3_RX) from the original example, there is no such error report in the callback function. 

There are no other devices attached to either default pins or my customized pins. so I doubt it was caused by non-complete bus cables as in previous answers in this thread.

0 Kudos

1,066 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi 何 春虎 ,

   Thanks for your interest in the NXP MIMXRT product, I would like to provide serivce for you.

   Your main problem is caused by this: J11 on the board is not connected to anything else

    If you connect nothing in the CAN bus, how can one CAN node work? So your error is caused by no other CAN node to do the CAN communication. You  need to connect another CAN node.

    Please also read the readme in your project:

Board settings
==============
The example requires 2 sets of boards, each of them are mounted with the base board. Using a male to male CAN
cable to connect the CAN2 instance (J11) between the 2 base boards.

Wish it helps you!

Have a great day,
Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
------------------------------------------------------------------------------

0 Kudos

1,066 Views
likeandhate
Contributor I

Hi Kerry Zhou:

Thanks for your reply.I now use a board that send CAN FD packages, which is connected by RT1064EVK borad. In the project, I chose "B". My other board is: 500kps and 2Mbps, and it always send CAN FD packages.

I set FLEXCAN_SetRxIndividualMask(EXAMPLE_CAN, RX_MESSAGE_BUFFER_NUM, 0);

it can received all id packs.

But kStatus_FLEXCAN_ErrorStatus is still wrong.

why?

0 Kudos

1,066 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi 春虎,

Do you following this information:

Running the demo
================
After connecting the two boards, these instructions display on each terminal window.
One board must be chosen as node A and the other board as node B. (Note: Node B should start first)
Data is sent continuously between the node A and the node B.

You need to set one node as B at first, then start the A.

Have a great day,
Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
------------------------------------------------------------------------------

0 Kudos

1,066 Views
likeandhate
Contributor I

Hi Kerry Zhou:

Thanks for your reply.

I only have one RT1064 board, so I'll test it on another board.This board has a CANFD module that sends the CANFD package all the time.CAN speed is 500kbps, CANFD speed is 2Mbps.But the CAN FD of the RT1064 board keeps reporting the error: kStatus_FLEXCAN_ErrorStatus

why??

0 Kudos

1,066 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi 何 春虎,

  Do you have the CANFD analyzer tool? And set as the receive B node.

  Please modify your CAN and CANFD speed like this:

pastedImage_1.png

Then check it again.

Have a great day,
Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
------------------------------------------------------------------------------

0 Kudos

1,066 Views
likeandhate
Contributor I

Hi Kerry Zhou:

Thanks for your reply.

The CAN rate of both boards is the same, both are flexcanconfig. baudRate=500000U;FlexcanConfig. BaudRateFD = 2000000 u;

Can you think of any other reasons?Why does this happen?

0 Kudos

1,066 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi 何 春虎,

  Do you modify evkmimxrt1064_canfd_interrupt_transfer project flexcanconfig. baudRate=500000U; right?

  Where you modify it?
  Do you check the CAN bus wave, whether your related baud is correct or not?

  Due to the novel coronavirus, we still working at home, so I don't have the CANFD tool on my home, when I back to the office, I will help you to test it.

Have a great day,
Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
------------------------------------------------------------------------------

0 Kudos