s32k1 AIPS-Lite error message location

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

s32k1 AIPS-Lite error message location

1,160 次查看
baichuan
Contributor II

Hello

I have restricted access to some registers through AIPS-Lite. My understanding is that if there is an unauthorized access to these registers, the system will enter the HardFault interrupt.

Now, I want to record these unauthorized access attempts. How should I do this? I did not see any related registers in the S32K-RM.pdf for AIPS-Lite to store this error information.

0 项奖励
回复
3 回复数

988 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @baichuan,

As you mentioned, there is no dedicated AIPS error status register.
When an access violation occurs, the core signals a BusFault exception.
You can read the stacked Program Counter (PC) value as described in this NXP document:

https://community.nxp.com/t5/S32K-Knowledge-Base/Fault-handling-on-S32K14x/ta-p/1114447

However, if the exception is Imprecise (indicated by CFSR[IMPRECISERR]), the stacked PC does not correspond to the actual instruction that caused the fault. This happens because the fault was detected after the write buffer committed the access.
To obtain precise fault information, you would need to disable the write buffer, but doing so will reduce system performance.

 

Regards,

Daniel

0 项奖励
回复

961 次查看
baichuan
Contributor II

Hello @danielmartynek 

    Thank you very much for your patient explanations. Perhaps I didn't express myself clearly. What I actually want to do is log this unauthorized access attempt within the BusFault handler. For example: `pflash:0x00001a74 failed to access peripheral[CAN0]:0x40024000`. Based on your description, the PC pointer can indeed provide the address in pflash, but how can I retrieve the destination address it attempted to access?

0 项奖励
回复

950 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @baichuan,

It was clear to me from the start.
Unfortunately, the BusFault is imprecise, which means the BFAR register is invalid.
If the fault were precise, BFAR would contain the address of the peripheral register that caused the access violation.
When the BusFault is imprecise, the PC value saved on the stack is also not the exact instruction that triggered the fault.
In such cases, the only option is to retrieve the stacked PC and then analyze the preceding instructions to identify the most recent load or store operation and extract the target address.

 

BR, Daniel

0 项奖励
回复
%3CLINGO-SUB%20id%3D%22lingo-sub-2270354%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3Es32k1%20AIPS-Lite%20%E9%94%99%E8%AF%AF%E4%BF%A1%E6%81%AF%E4%BD%8D%E7%BD%AE%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2270354%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%3C%2FP%3E%3CP%3E%E6%88%91%E9%80%9A%E8%BF%87%20AIPS-Lite%20%E5%AF%B9%E6%9F%90%E4%BA%9B%E5%AF%84%E5%AD%98%E5%99%A8%E7%9A%84%E8%AE%BF%E9%97%AE%E8%BF%9B%E8%A1%8C%E4%BA%86%E9%99%90%E5%88%B6%E3%80%82%E6%88%91%E7%9A%84%E7%90%86%E8%A7%A3%E6%98%AF%EF%BC%8C%E5%A6%82%E6%9E%9C%E6%9C%AA%E7%BB%8F%E6%8E%88%E6%9D%83%E8%AE%BF%E9%97%AE%E8%BF%99%E4%BA%9B%E5%AF%84%E5%AD%98%E5%99%A8%EF%BC%8C%E7%B3%BB%E7%BB%9F%E5%B0%86%E8%BF%9B%E5%85%A5%20HardFault%20%E4%B8%AD%E6%96%AD%E3%80%82%3C%2FP%3E%3CP%3E%E7%8E%B0%E5%9C%A8%EF%BC%8C%E6%88%91%E6%83%B3%E8%AE%B0%E5%BD%95%E8%BF%99%E4%BA%9B%E6%9C%AA%E7%BB%8F%E6%8E%88%E6%9D%83%E7%9A%84%E8%AE%BF%E9%97%AE%E5%B0%9D%E8%AF%95%E3%80%82%E6%88%91%E8%AF%A5%E6%80%8E%E4%B9%88%E5%81%9A%EF%BC%9F%E6%88%91%E5%9C%A8%20S32K-RM.pdf%20%E4%B8%AD%E6%B2%A1%E6%9C%89%E7%9C%8B%E5%88%B0%20AIPS-Lite%20%E7%94%A8%E4%BA%8E%E5%AD%98%E5%82%A8%E6%AD%A4%E9%94%99%E8%AF%AF%E4%BF%A1%E6%81%AF%E7%9A%84%E7%9B%B8%E5%85%B3%E5%AF%84%E5%AD%98%E5%99%A8%E3%80%82%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2288855%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20s32k1%20AIPS-Lite%20error%20message%20location%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2288855%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E4%BD%A0%E5%A5%BD%EF%BC%8C%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F206941%22%20target%3D%22_blank%22%3E%40%E7%99%BD%E5%B7%9D%3C%2FA%3E%E3%80%81%3C%2FP%3E%0A%3CP%3E%E6%AD%A3%E5%A6%82%E4%BD%A0%E6%89%80%E6%8F%90%E5%88%B0%E7%9A%84%EF%BC%8C%E6%B2%A1%E6%9C%89%E4%B8%93%E7%94%A8%E7%9A%84AIPS%E9%94%99%E8%AF%AF%E7%8A%B6%E6%80%81%E5%AF%84%E5%AD%98%E5%99%A8%E3%80%82%3CBR%20%2F%3E%E5%8F%91%E7%94%9F%E8%BF%9D%E8%A7%84%E8%AE%BF%E9%97%AE%E6%97%B6%EF%BC%8C%E5%86%85%E6%A0%B8%E4%BC%9A%E5%8F%91%E5%87%BA%E6%80%BB%E7%BA%BF%E6%95%85%E9%9A%9C%E5%BC%82%E5%B8%B8%E4%BF%A1%E5%8F%B7%E3%80%82%3CBR%20%2F%3E%E6%82%A8%E5%8F%AF%E4%BB%A5%E6%8C%89%E7%85%A7%20NXP%20%E6%96%87%E6%A1%A3%E4%B8%AD%E7%9A%84%E8%AF%B4%E6%98%8E%E8%AF%BB%E5%8F%96%E5%A0%86%E5%8F%A0%E7%9A%84%E7%A8%8B%E5%BA%8F%E8%AE%A1%E6%95%B0%E5%99%A8%20(PC)%20%E5%80%BC%EF%BC%9A%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2FS32K-Knowledge-Base%2FFault-handling-on-S32K14x%2Fta-p%2F1114447%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Fcommunity.nxp.com%2Ft5%2FS32K-Knowledge-Base%2FFault-handling-on-S32K14x%2Fta-p%2F1114447%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%E4%BD%86%E6%98%AF%EF%BC%8C%E5%A6%82%E6%9E%9C%E5%BC%82%E5%B8%B8%E6%98%AF%E4%B8%8D%E7%B2%BE%E7%A1%AE%E7%9A%84%EF%BC%88%E7%94%A8%20CFSR%5BIMPRECISERR%5D%20%E8%A1%A8%E7%A4%BA%EF%BC%89%EF%BC%8C%E5%88%99%E5%A0%86%E5%8F%A0%E7%9A%84%20PC%20%E4%B8%8E%E5%AF%BC%E8%87%B4%E6%95%85%E9%9A%9C%E7%9A%84%E5%AE%9E%E9%99%85%E6%8C%87%E4%BB%A4%E4%B8%8D%E4%B8%80%E8%87%B4%E3%80%82%E5%87%BA%E7%8E%B0%E8%BF%99%E7%A7%8D%E6%83%85%E5%86%B5%E6%98%AF%E5%9B%A0%E4%B8%BA%E6%95%85%E9%9A%9C%E6%98%AF%E5%9C%A8%E5%86%99%E7%BC%93%E5%86%B2%E5%8C%BA%E6%8F%90%E4%BA%A4%E8%AE%BF%E9%97%AE%E5%90%8E%E6%A3%80%E6%B5%8B%E5%88%B0%E7%9A%84%E3%80%82%3CBR%20%2F%3E%E8%A6%81%E8%8E%B7%E5%BE%97%E7%B2%BE%E7%A1%AE%E7%9A%84%E6%95%85%E9%9A%9C%E4%BF%A1%E6%81%AF%EF%BC%8C%E9%9C%80%E8%A6%81%E7%A6%81%E7%94%A8%E5%86%99%E7%BC%93%E5%86%B2%E5%8C%BA%EF%BC%8C%E4%BD%86%E8%BF%99%E6%A0%B7%E5%81%9A%E4%BC%9A%E9%99%8D%E4%BD%8E%E7%B3%BB%E7%BB%9F%E6%80%A7%E8%83%BD%E3%80%82%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%E6%AD%A4%E8%87%B4%EF%BC%8C%3C%2FP%3E%0A%3CP%3E%E4%B8%B9%E5%B0%BC%E5%B0%94%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2289282%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20s32k1%20AIPS-Lite%20error%20message%20location%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2289282%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E4%BD%A0%E5%A5%BD%EF%BC%8C%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F206941%22%20target%3D%22_blank%22%3E%40%E7%99%BD%E5%B7%9D%3C%2FA%3E%E3%80%81%3C%2FP%3E%0A%3CP%3E%E6%88%91%E4%BB%8E%E4%B8%80%E5%BC%80%E5%A7%8B%E5%B0%B1%E5%BE%88%E6%B8%85%E6%A5%9A%E3%80%82%3CBR%20%2F%3E%E9%81%97%E6%86%BE%E7%9A%84%E6%98%AF%EF%BC%8CBusFault%20%E5%B9%B6%E4%B8%8D%E7%B2%BE%E7%A1%AE%EF%BC%8C%E8%BF%99%E6%84%8F%E5%91%B3%E7%9D%80%20BFAR%20%E5%AF%84%E5%AD%98%E5%99%A8%E6%97%A0%E6%95%88%E3%80%82%3CBR%20%2F%3E%E5%A6%82%E6%9E%9C%E6%95%85%E9%9A%9C%E6%98%AF%E7%B2%BE%E7%A1%AE%E7%9A%84%EF%BC%8CBFAR%20%E5%B0%86%E5%8C%85%E5%90%AB%E5%AF%BC%E8%87%B4%E8%BF%9D%E8%A7%84%E8%AE%BF%E9%97%AE%E7%9A%84%E5%A4%96%E8%AE%BE%E5%AF%84%E5%AD%98%E5%99%A8%E5%9C%B0%E5%9D%80%E3%80%82%3CBR%20%2F%3E%E5%BD%93%20BusFault%20%E4%B8%8D%E7%B2%BE%E7%A1%AE%E6%97%B6%EF%BC%8C%E4%BF%9D%E5%AD%98%E5%9C%A8%E5%A0%86%E6%A0%88%E4%B8%8A%E7%9A%84%20PC%20%E5%80%BC%E4%B9%9F%E4%B8%8D%E6%98%AF%E8%A7%A6%E5%8F%91%E6%95%85%E9%9A%9C%E7%9A%84%E7%A1%AE%E5%88%87%E6%8C%87%E4%BB%A4%E3%80%82%3CBR%20%2F%3E%E5%9C%A8%E8%BF%99%E7%A7%8D%E6%83%85%E5%86%B5%E4%B8%8B%EF%BC%8C%E5%94%AF%E4%B8%80%E7%9A%84%E9%80%89%E6%8B%A9%E6%98%AF%E6%A3%80%E7%B4%A2%E5%A0%86%E6%A0%88%20PC%EF%BC%8C%E7%84%B6%E5%90%8E%E5%88%86%E6%9E%90%E5%89%8D%E9%9D%A2%E7%9A%84%E6%8C%87%E4%BB%A4%EF%BC%8C%E6%89%BE%E5%87%BA%E6%9C%80%E8%BF%91%E7%9A%84%E5%8A%A0%E8%BD%BD%E6%88%96%E5%AD%98%E5%82%A8%E6%93%8D%E4%BD%9C%EF%BC%8C%E5%B9%B6%E6%8F%90%E5%8F%96%E7%9B%AE%E6%A0%87%E5%9C%B0%E5%9D%80%E3%80%82%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EBR%EF%BC%8C%E4%B8%B9%E5%B0%BC%E5%B0%94%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2289150%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20s32k1%20AIPS-Lite%20error%20message%20location%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2289150%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E4%BD%A0%E5%A5%BD%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F160001%22%20target%3D%22_blank%22%3E%40danielmartynek%3C%2FA%3E%3C%2FP%3E%3CP%3E%20%20%20%20%E9%9D%9E%E5%B8%B8%E6%84%9F%E8%B0%A2%E4%BD%A0%E7%9A%84%E8%80%90%E5%BF%83%E8%A7%A3%E9%87%8A%E3%80%82%E4%B9%9F%E8%AE%B8%E6%88%91%E6%B2%A1%E6%9C%89%E8%A1%A8%E8%BE%BE%E6%B8%85%E6%A5%9A%E3%80%82%E5%AE%9E%E9%99%85%E4%B8%8A%EF%BC%8C%E6%88%91%E6%83%B3%E5%81%9A%E7%9A%84%E6%98%AF%E5%9C%A8%20BusFault%20%E5%A4%84%E7%90%86%E7%A8%8B%E5%BA%8F%E4%B8%AD%E8%AE%B0%E5%BD%95%E8%BF%99%E7%A7%8D%E6%9C%AA%E7%BB%8F%E6%8E%88%E6%9D%83%E7%9A%84%E8%AE%BF%E9%97%AE%E5%B0%9D%E8%AF%95%E3%80%82%E4%BE%8B%E5%A6%82%EF%BC%9A%60pflash%3A0x00001a74%20%E8%AE%BF%E9%97%AE%20peripheral%5BCAN0%5D%3A0x40024000%60%20%E5%A4%B1%E8%B4%A5%E3%80%82%E6%A0%B9%E6%8D%AE%E6%82%A8%E7%9A%84%E6%8F%8F%E8%BF%B0%EF%BC%8CPC%20%E6%8C%87%E9%92%88%E7%A1%AE%E5%AE%9E%E5%8F%AF%E4%BB%A5%E6%8F%90%E4%BE%9B%20pflash%20%E4%B8%AD%E7%9A%84%E5%9C%B0%E5%9D%80%EF%BC%8C%E4%BD%86%E6%88%91%E5%A6%82%E4%BD%95%E6%89%8D%E8%83%BD%E6%A3%80%E7%B4%A2%E5%88%B0%E5%AE%83%E8%AF%95%E5%9B%BE%E8%AE%BF%E9%97%AE%E7%9A%84%E7%9B%AE%E6%A0%87%E5%9C%B0%E5%9D%80%E5%91%A2%EF%BC%9F%3C%2FP%3E%3C%2FLINGO-BODY%3E