possible "read modify write" issue in flexcan_drv

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

possible "read modify write" issue in flexcan_drv

1,761件の閲覧回数
liguangyu02
Contributor II

Dear community,

My platofrm information is S32K144 with S32DS + RTM3.03. 

A fault is reported twice that an TX CANID is missing but other TX CANID is fine. After check my code, I'm sure it caused by function "FLEXCAN_DRV_Send" retuen busy. 

Further more, function "FLEXCAN_SetMsgBuffIntCmd" was noticed: it was called in both ISR and normal routine. However, it's not thread safe as there contain RMW operation like" (base->IMASK1) = ((base ->IMASK1) | (temp));".

So is this RMW operation the root cause of my ID-missing issue?

If so, is there officical patch to fix this issue?

I have checked RTM4.02 and no change on this.

Best Regards,

Guangyu

0 件の賞賛
返信
3 返答(返信)

1,703件の閲覧回数
liguangyu02
Contributor II

Thank you Petr,

I'll do some investigation on RTD.

BR, Guangyu

0 件の賞賛
返信

1,745件の閲覧回数
liguangyu02
Contributor II

This issue was fixed by disable interrupt when doing RMW operation.

liguangyu02_0-1650340184562.png

However, official suggestion is needed.

Thanks!

0 件の賞賛
返信

1,723件の閲覧回数
PetrS
NXP TechSupport
NXP TechSupport

Hi,

let me reuse words I got from SDK team some time ago....

the SDK driver never was tested as safe thread product. The user if is calling functions that impact shared resources or ReadModifyWrite operations should some how make that safe from perspective of thread call, in RTD this is done by Exclusive Areas in SDK is not the case.

BR, Petr

0 件の賞賛
返信