Possible H/W error in s32k148 flexcan controller

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

Possible H/W error in s32k148 flexcan controller

ソリューションへジャンプ
1,424件の閲覧回数
freddy_ben-zeev
Contributor IV

I'm running an evaluation with CAN configured for FD at 1Mbps for arbitration phase and 2Mbps data phase. I'm generating traffic from PCAN-View on a PCN-USB X6 with 16 bytes data at 1msec intervals (at this rate some messages are dropped). Inside the IRQ handler it reads from the mailbox a DLC of 0 instead of 0xA, which I caught by adding an assert at that point. If during the assert I look at the MB register again it contains a correct value of 0xA.

Looks like the interrupt happens before the mailbox is up to date.

タグ(2)
0 件の賞賛
1 解決策
1,230件の閲覧回数
freddy_ben-zeev
Contributor IV

Thanks Petr & Alexandru. It does seem to be software related. Looks like the SDK driver for the flexcan does not do what Alexandru suggests above... The messages arrive asynchronously and if one arrives before the read is started it is not cleared by the read operation. I've solved it by clearing the MB read IRQ flag before enabling the new read interrupt.

元の投稿で解決策を見る

0 件の賞賛
5 返答(返信)
1,231件の閲覧回数
freddy_ben-zeev
Contributor IV

Thanks Petr & Alexandru. It does seem to be software related. Looks like the SDK driver for the flexcan does not do what Alexandru suggests above... The messages arrive asynchronously and if one arrives before the read is started it is not cleared by the read operation. I've solved it by clearing the MB read IRQ flag before enabling the new read interrupt.

0 件の賞賛
1,230件の閲覧回数
1515190497
Contributor II

Coud you tell me how to clear MB?

0 件の賞賛
1,230件の閲覧回数
freddy_ben-zeev
Contributor IV

In a couple of places I'm clearing the MB read IRQ flag (inside the flexcan_driver.c file in the SDK) by calling the function FLEXCAN_ClearMsgBuffIntStatusFlag before the call to FLEXCAN_SetMsgBuffIntCmd (that enables MB IRQ). I use a critical section around both calls.

0 件の賞賛
1,230件の閲覧回数
PetrS
NXP TechSupport
NXP TechSupport

Hi Freddy,

I am not aware of such HW error in FlexCAN module. It rather points to wrong SW handling as Alexandru wrote.

BR, Petr

0 件の賞賛
1,230件の閲覧回数
alexandrunan
NXP Employee
NXP Employee

Hello, did you use SDK for this issue ?

Second when you read the mb content before did it you check the busy bit from Code Status of the mb ? In case that flag is still asserted then the content of MB is incoherent ! But be aware polling Code and Status Word of the MB will lock the mb in some cases like Code FULL or OVERRUN which will prevent writing another message in the MB.

0 件の賞賛