Hardfault occurred with AUTOSAR GPT module for STM Timer in S32K344

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

Hardfault occurred with AUTOSAR GPT module for STM Timer in S32K344

跳至解决方案
1,575 次查看
a1g1
Contributor II

Hi NXP, 

I tried to utilize the STM Timer with AUTOSAR's GPT Module (on S32 Design Studio). Despite multiple attempts of changing the configuration by changing the clock source, removing the notification callbacks etc., but hardfaults always occurs. It occurs while the Stm_Ip_DebugMode() is getting executed and it is calling the API to enter the SchM Exclusive Area for the GPT. Please provide your support to resolve this issue.

 

 S32K344-WB  

标记 (2)
0 项奖励
回复
1 解答
1,255 次查看
a1g1
Contributor II

Hello @VaneB ,

 

Thank you for your support. It is working now. After taking the configuration changes you had suggested, I went thru your code and found that I hadn't been calling that Mcu_SetMode API. This prevented the code from going into hardfault.

 

Thanks and Best Regards,

@a1g1 

在原帖中查看解决方案

0 项奖励
回复
5 回复数
1,512 次查看
VaneB
NXP TechSupport
NXP TechSupport

Hi @a1g1 

It seems you might be using an older RTD version. We generally recommend using the latest RTD release, as it includes bug fixes, improvements, and new features.

Could you please try with the latest version and let me know if the issue still persists?

In the meantime, it would also help if you could share the exact RTD version you are currently using so we can better analyze the situation.

 

BR, VaneB

0 项奖励
回复
1,489 次查看
a1g1
Contributor II

Hello @VaneB ,

I am using the 6.0.0 version of the Real time drivers which supports AUTOSAR 4.7 standards.

 

0 项奖励
回复
1,380 次查看
VaneB
NXP TechSupport
NXP TechSupport

Hi @a1g1 

Thank you for the clarification, and I apologize for the previous confusion.

I have reviewed the .mex file you shared and have a few observations:

  • In the MCU driver, the peripheral clock is not enabled. This should be configured under MCU Driver → McuModuleConfiguration → McuModeSettingConf → McuPeripheral
  • In the Clock Tool, you selected FIRC_CLK as the STM0 clock source. However, in MCU Driver → McuModuleConfiguration → McuClockSettingConfig → McuClockReferencePoint, there is only one reference defined (AIPS_SLOW_CLK). Please add a new clock reference using FIRC_CLK, and then select it as the GptClockReferencePoint in Gpt Driver → GptDriverConfiguration → GptClockReferencePoint.
  • In the GPT driver, no GptNotification has been configured. Additionally, the code is still using a notification function with a PIT-related name (Gpt_PitNotification), which should be updated.

For ease of reference, I am attaching the main file and the .mex configuration I used, so you can compare them on your side.

0 项奖励
回复
1,366 次查看
a1g1
Contributor II
Hi @VaneB,

Let me check this and see. Thanks!

BR
@a1g1
0 项奖励
回复
1,256 次查看
a1g1
Contributor II

Hello @VaneB ,

 

Thank you for your support. It is working now. After taking the configuration changes you had suggested, I went thru your code and found that I hadn't been calling that Mcu_SetMode API. This prevented the code from going into hardfault.

 

Thanks and Best Regards,

@a1g1 

0 项奖励
回复
%3CLINGO-SUB%20id%3D%22lingo-sub-2364026%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ES32K344%20%E4%B8%AD%E7%94%A8%E4%BA%8E%20STM%20%E5%AE%9A%E6%97%B6%E5%99%A8%E7%9A%84%20AUTOSAR%20GPT%20%E6%A8%A1%E5%9D%97%E5%87%BA%E7%8E%B0%E7%A1%AC%E6%95%85%E9%9A%9C%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2364026%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E4%BD%A0%E5%A5%BD%EF%BC%8C%E6%81%A9%E6%99%BA%E6%B5%A6%E3%80%81%20%3C%2FP%3E%3CP%3E%E6%88%91%E5%B0%9D%E8%AF%95%E4%BD%BF%E7%94%A8%20STM%20%E5%AE%9A%E6%97%B6%E5%99%A8%E5%92%8C%20AUTOSAR%20%E7%9A%84%20GPT%20%E6%A8%A1%E5%9D%97%EF%BC%88%E5%9C%A8%20S32%20Design%20Studio%20%E4%B8%8A%EF%BC%89%E3%80%82%E5%B0%BD%E7%AE%A1%E5%A4%9A%E6%AC%A1%E5%B0%9D%E8%AF%95%E9%80%9A%E8%BF%87%E6%9B%B4%E6%94%B9%E6%97%B6%E9%92%9F%E6%BA%90%E3%80%81%E7%A7%BB%E9%99%A4%E9%80%9A%E7%9F%A5%E5%9B%9E%E8%B0%83%E7%AD%89%E6%96%B9%E5%BC%8F%E6%9D%A5%E6%9B%B4%E6%94%B9%E9%85%8D%E7%BD%AE%EF%BC%8C%E4%BD%86%E7%A1%AC%E6%95%85%E9%9A%9C%E6%80%BB%E6%98%AF%E5%8F%91%E7%94%9F%E3%80%82%E5%9C%A8%E6%89%A7%E8%A1%8C%20Stm_Ip_DebugMode()%E3%80%81%E8%B0%83%E7%94%A8%20API%20%E8%BF%9B%E5%85%A5%20GPT%20%E7%9A%84%20SchM%20Exclusive%20Area%20%E6%97%B6%E5%87%BA%E7%8E%B0%E4%BA%86%E8%BF%99%E7%A7%8D%E6%83%85%E5%86%B5%E3%80%82%E8%AF%B7%E6%8F%90%E4%BE%9B%E6%94%AF%E6%8C%81%E4%BB%A5%E8%A7%A3%E5%86%B3%E6%AD%A4%E9%97%AE%E9%A2%98%E3%80%82%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fc-pwmxy87654%2FS32K344-WB%2Fpd-p%2FS32K344-WB%22%20class%3D%22lia-product-mention%22%20data-product%3D%223494-1%22%20target%3D%22_blank%22%3ES32K344-WB%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2364465%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Hardfault%20occurred%20with%20AUTOSAR%20GPT%20module%20for%20STM%20Timer%20in%20S32K344%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2364465%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E4%BD%A0%E5%A5%BD%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F201913%22%20target%3D%22_blank%22%3E%40VaneB%3C%2FA%3E%EF%BC%8C%3CBR%20%2F%3E%3CBR%20%2F%3E%E6%88%91%E4%BD%BF%E7%94%A8%E7%9A%84%E6%98%AF%E6%94%AF%E6%8C%81%20AUTOSAR%204.7%20%E6%A0%87%E5%87%86%E7%9A%84%206.0.0%20%E7%89%88%E6%9C%AC%E7%9A%84%E5%AE%9E%E6%97%B6%E9%A9%B1%E5%8A%A8%E7%A8%8B%E5%BA%8F%E3%80%82%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2364313%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Hardfault%20occurred%20with%20AUTOSAR%20GPT%20module%20for%20STM%20Timer%20in%20S32K344%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2364313%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%2F261169%22%20target%3D%22_blank%22%3E%40a1g1%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%E7%9C%8B%E6%9D%A5%E6%82%A8%E4%BD%BF%E7%94%A8%E7%9A%84%E5%8F%AF%E8%83%BD%E6%98%AF%E6%97%A7%E7%89%88%E6%9C%AC%E7%9A%84%20RTD%E3%80%82%E6%88%91%E4%BB%AC%E9%80%9A%E5%B8%B8%E5%BB%BA%E8%AE%AE%E4%BD%BF%E7%94%A8%E6%9C%80%E6%96%B0%E7%9A%84%20RTD%20%E7%89%88%E6%9C%AC%EF%BC%8C%E5%9B%A0%E4%B8%BA%E5%AE%83%E5%8C%85%E6%8B%AC%E9%94%99%E8%AF%AF%E4%BF%AE%E5%A4%8D%E3%80%81%E6%94%B9%E8%BF%9B%E5%92%8C%E6%96%B0%E5%8A%9F%E8%83%BD%E3%80%82%3C%2FP%3E%0A%3CP%3E%E8%AF%B7%E5%B0%9D%E8%AF%95%E4%BD%BF%E7%94%A8%E6%9C%80%E6%96%B0%E7%89%88%E6%9C%AC%EF%BC%8C%E5%A6%82%E6%9E%9C%E9%97%AE%E9%A2%98%E4%BB%8D%E7%84%B6%E5%AD%98%E5%9C%A8%EF%BC%8C%E8%AF%B7%E5%91%8A%E8%AF%89%E6%88%91%E3%80%82%3C%2FP%3E%0A%3CP%3E%E4%B8%8E%E6%AD%A4%E5%90%8C%E6%97%B6%EF%BC%8C%E5%A6%82%E6%9E%9C%E6%82%A8%E8%83%BD%E6%8F%90%E4%BE%9B%E5%BD%93%E5%89%8D%E4%BD%BF%E7%94%A8%E7%9A%84%20RTD%20%E7%89%88%E6%9C%AC%EF%BC%8C%E6%88%91%E4%BB%AC%E4%B9%9F%E8%83%BD%E6%9B%B4%E5%A5%BD%E5%9C%B0%E5%88%86%E6%9E%90%E6%83%85%E5%86%B5%E3%80%82%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EBR%E3%80%81VaneB%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2365106%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Hardfault%20occurred%20with%20AUTOSAR%20GPT%20module%20for%20STM%20Timer%20in%20S32K344%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2365106%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%2F261169%22%20target%3D%22_blank%22%3E%40a1g1%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%E6%84%9F%E8%B0%A2%E6%82%A8%E7%9A%84%E6%BE%84%E6%B8%85%EF%BC%8C%E6%88%91%E5%AF%B9%E4%B9%8B%E5%89%8D%E7%9A%84%E6%B7%B7%E6%B7%86%E8%A1%A8%E7%A4%BA%E6%AD%89%E6%84%8F%E3%80%82%3C%2FP%3E%0A%3CP%3E%E6%88%91%E5%AE%A1%E6%9F%A5%E4%BA%86%20.mex%E6%88%91%E5%AF%B9%E6%82%A8%E5%88%86%E4%BA%AB%E7%9A%84%E6%96%87%E4%BB%B6%E6%9C%89%E4%B8%80%E4%BA%9B%E7%9C%8B%E6%B3%95%EF%BC%9A%3C%2FP%3E%0A%3CUL%20class%3D%22lia-list-style-type-circle%22%3E%0A%3CLI%3E%E5%9C%A8%20MCU%20%E9%A9%B1%E5%8A%A8%E7%A8%8B%E5%BA%8F%E4%B8%AD%EF%BC%8C%E5%A4%96%E8%AE%BE%E6%97%B6%E9%92%9F%E6%9C%AA%E5%90%AF%E7%94%A8%E3%80%82%E5%BA%94%E5%9C%A8%20MCU%20%E9%A9%B1%E5%8A%A8%E7%A8%8B%E5%BA%8F%20%E2%86%92%20McuModuleConfiguration%20%E2%86%92%20McuModeSettingConf%20%E2%86%92%20McuPeripheral%20%E4%B8%8B%E8%BF%9B%E8%A1%8C%E9%85%8D%E7%BD%AE%E3%80%82%3C%2FLI%3E%0A%3CLI%3E%E5%9C%A8%E6%97%B6%E9%92%9F%E5%B7%A5%E5%85%B7%E4%B8%AD%EF%BC%8C%E6%82%A8%E9%80%89%E6%8B%A9%20FIRC_CLK%20%E4%BD%9C%E4%B8%BA%20STM0%20%E6%97%B6%E9%92%9F%E6%BA%90%E3%80%82%E4%BD%86%E6%98%AF%EF%BC%8C%E5%9C%A8%20MCU%20%E9%A9%B1%E5%8A%A8%E7%A8%8B%E5%BA%8F%20%E2%86%92%20MCU%E6%A8%A1%E5%9D%97%E9%85%8D%E7%BD%AE%20%E2%86%92%20mcuClockSettingConfig%20%E2%86%92%20mcuClockReferencePoint%20%E4%B8%AD%EF%BC%8C%E5%8F%AA%E5%AE%9A%E4%B9%89%E4%BA%86%E4%B8%80%E4%B8%AA%E5%BC%95%E7%94%A8%20(AIPS_SLOW_CLK)%E3%80%82%E8%AF%B7%E4%BD%BF%E7%94%A8%20FIRC_CLK%20%E6%B7%BB%E5%8A%A0%E6%96%B0%E7%9A%84%E6%97%B6%E9%92%9F%E5%8F%82%E8%80%83%EF%BC%8C%E7%84%B6%E5%90%8E%E5%9C%A8%20Gpt%20%E9%A9%B1%E5%8A%A8%E7%A8%8B%E5%BA%8F%20%E2%86%92%20GptDriverConfiguration%20%E2%86%92%20gptClockReferencePoint%20%E4%B8%AD%E9%80%89%E6%8B%A9%E5%AE%83%E4%BD%9C%E4%B8%BA%20GptClockReferencePoint%E3%80%82%3C%2FLI%3E%0A%3CLI%3E%E5%9C%A8%20GPT%20%E9%A9%B1%E5%8A%A8%E7%A8%8B%E5%BA%8F%E4%B8%AD%EF%BC%8C%E6%B2%A1%E6%9C%89%E9%85%8D%E7%BD%AE%20GptNotification%E3%80%82%E6%AD%A4%E5%A4%96%EF%BC%8C%E8%AF%A5%E4%BB%A3%E7%A0%81%E4%BB%8D%E5%9C%A8%E4%BD%BF%E7%94%A8%E4%B8%80%E4%B8%AA%E5%90%8D%E7%A7%B0%E4%B8%8E%20PIT%20%E7%9B%B8%E5%85%B3%E7%9A%84%E9%80%9A%E7%9F%A5%E5%87%BD%E6%95%B0%EF%BC%88Gpt_PitNotification%EF%BC%89%EF%BC%8C%E5%BA%94%E4%BA%88%E4%BB%A5%E6%9B%B4%E6%96%B0%E3%80%82%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%E4%B8%BA%E4%BA%86%E4%BE%BF%E4%BA%8E%E5%8F%82%E8%80%83%EF%BC%8C%E6%88%91%E9%99%84%E4%B8%8A%E4%BA%86%E4%B8%BB%E6%96%87%E4%BB%B6%E5%92%8C%20.mex%E6%88%91%E4%BD%BF%E7%94%A8%E7%9A%84%E9%85%8D%E7%BD%AE%EF%BC%8C%E4%BD%A0%E5%8F%AF%E4%BB%A5%E5%9C%A8%E8%87%AA%E5%B7%B1%E8%BF%99%E8%BE%B9%E8%BF%9B%E8%A1%8C%E6%AF%94%E8%BE%83%E3%80%82%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2365213%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Hardfault%20occurred%20with%20AUTOSAR%20GPT%20module%20for%20STM%20Timer%20in%20S32K344%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2365213%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%97%A8%EF%BC%8C%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F201913%22%20target%3D%22_blank%22%3E%40VaneB%3C%2FA%3E%EF%BC%8C%3CBR%20%2F%3E%3CBR%20%2F%3E%EF%BC%8C%E8%AE%A9%E6%88%91%E6%A3%80%E6%9F%A5%E4%B8%80%E4%B8%8B%E3%80%82%E8%B0%A2%E8%B0%A2%EF%BC%81%3CBR%20%2F%3E%3CBR%20%2F%3E%20BR%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F261169%22%20target%3D%22_blank%22%3E%20%40a1g1%3C%2FA%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2365933%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Hardfault%20occurred%20with%20AUTOSAR%20GPT%20module%20for%20STM%20Timer%20in%20S32K344%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2365933%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%2F201913%22%20target%3D%22_blank%22%3E%40VaneB%3C%2FA%3E%E3%80%81%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%E6%84%9F%E8%B0%A2%E6%82%A8%E7%9A%84%E6%94%AF%E6%8C%81%E3%80%82%E7%8E%B0%E5%9C%A8%E5%8F%AF%E4%BB%A5%E7%94%A8%E4%BA%86%E3%80%82%E5%9C%A8%E6%8C%89%E7%85%A7%E4%BD%A0%E7%9A%84%E5%BB%BA%E8%AE%AE%E4%BF%AE%E6%94%B9%E9%85%8D%E7%BD%AE%E5%90%8E%EF%BC%8C%E6%88%91%E6%9F%A5%E7%9C%8B%E4%BA%86%E4%BD%A0%E7%9A%84%E4%BB%A3%E7%A0%81%EF%BC%8C%E5%8F%91%E7%8E%B0%E6%88%91%E6%B2%A1%E6%9C%89%E8%B0%83%E7%94%A8%20Mcu_SetMode%20API%E3%80%82%E8%BF%99%E6%A0%B7%EF%BC%8C%E4%BB%A3%E7%A0%81%E5%B0%B1%E4%B8%8D%E4%BC%9A%E5%87%BA%E7%8E%B0%E7%A1%AC%E6%95%85%E9%9A%9C%E3%80%82%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%E8%B0%A2%E8%B0%A2%EF%BC%8C%E5%B9%B6%E8%87%B4%E4%BB%A5%E6%9C%80%E5%B4%87%E9%AB%98%E7%9A%84%E6%95%AC%E6%84%8F%E3%80%81%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F261169%22%20target%3D%22_blank%22%3E%40a1g1%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E