possible "read modify write" issue in flexcan_drv

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

possible "read modify write" issue in flexcan_drv

1,753 次查看
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,695 次查看
liguangyu02
Contributor II

Thank you Petr,

I'll do some investigation on RTD.

BR, Guangyu

0 项奖励
回复

1,737 次查看
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,715 次查看
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 项奖励
回复