IMXRT1021 flexCAN not receiving after physical CAN bus issue

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

IMXRT1021 flexCAN not receiving after physical CAN bus issue

ソリューションへジャンプ
744件の閲覧回数
PeteA
Contributor I

Hi,

I am using an IMXRT1021 with flexCAN on a 1mbit CAN bus (existing product that has had CAN added in a recent edition).

This mostly works well, and CAN is sending and receiving without issue.

However if there is a physical event on the CAN bus (such as a large noise spike, or the CAN bus lines being shorted) the CAN module seems to get stuck, not being able to send or receive. If this happens it is mostly in CAN_STATE_ERROR_PASSIVE, but sometimes can be CAN_STATE_ERROR_BUS_OFF.

When this happens, the scoping the CAN bus shows it is idle, and the registers are as follows:

the CAN status to our CAN callback is 0x14be (kStatus_FLEXCAN_ErrorStatus)

FLEXCAN_GetStatusFlags() gives 0x40118 (ERROR_PASSIVE | RX_WRN | SYNCH)

CAN_PERIPHERAL->IFLAG1 = 0

CAN_PERIPHERAL->ESR2 0x6000 (same as before it goes into this state)

CAN_PERIPHERAL->DBG1 = 0x2000032 (counting through 0x1000032, 0x2000032, 0x4000032 etc)

CAN_PERIPHERAL->DBG2 = 0x3e (same as before the issue)

a DeInit and ReInit of the CAN peripheral doesn't fix this, and most concerningly nor does a soft reset of the processor. Only a power cycle recovers things.

After a soft reset, the state is :

the CAN status to our CAN callback is 0x0

FLEXCAN_GetStatusFlags() gives 0x0

CAN_PERIPHERAL->IFLAG1 = 0

CAN_PERIPHERAL->ESR2 0x6000 

CAN_PERIPHERAL->DBG1 = 1000001

CAN_PERIPHERAL->DBG2 cycles through 0, 0xb700, 0xa000, 0x9000

This is using a MAX33015EATB CAN transceiver, and the bus is terminated with split-y termination 120 ohms at both physical ends of the bus.

 

Please ask if any more details are needed.

I would very much appreciate some help with this.

Thank you

 

ラベル(1)
タグ(1)
0 件の賞賛
返信
1 解決策
670件の閲覧回数
Kan_Li
NXP TechSupport
NXP TechSupport

Hi @PeteA ,

 

Thanks for the information! You may put the CAN PHY reset code in the ISR to handle the event of CAN_STATE_ERROR_PASSIVE or CAN_STATE_ERROR_BUS_OFF, and you may change the pin mux of  CAN tx line to set up a toggling on it.

 

Have a great day,
Kan


-------------------------------------------------------------------------------
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 件の賞賛
返信
3 返答(返信)
681件の閲覧回数
PeteA
Contributor I

It doesn't unfortunately.

However I have established that the CAN transceiver (MAX33015EATB ) has fault management, and can go into an error state if it detects an error condition. 

This is very likely to be the cause (unfortunately the fault pin is not broken out so it is difficult to scope to check, but in my attempts at testing it appeared to be asserted).

This can be reset by toggling the CAN tx line, but I've just got to work out how to do this

Thank you for the help

0 件の賞賛
返信
671件の閲覧回数
Kan_Li
NXP TechSupport
NXP TechSupport

Hi @PeteA ,

 

Thanks for the information! You may put the CAN PHY reset code in the ISR to handle the event of CAN_STATE_ERROR_PASSIVE or CAN_STATE_ERROR_BUS_OFF, and you may change the pin mux of  CAN tx line to set up a toggling on it.

 

Have a great day,
Kan


-------------------------------------------------------------------------------
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 件の賞賛
返信
709件の閲覧回数
Kan_Li
NXP TechSupport
NXP TechSupport

Hi @PeteA ,

 

Will the device go back to error active state after some time?

 

Have a great day,
Kan


-------------------------------------------------------------------------------
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 件の賞賛
返信