Hardfault occurred with AUTOSAR GPT module for STM Timer in S32K344

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Hardfault occurred with AUTOSAR GPT module for STM Timer in S32K344

Jump to solution
1,674 Views
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  

Tags (2)
0 Kudos
Reply
1 Solution
1,354 Views
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 

View solution in original post

0 Kudos
Reply
5 Replies
1,611 Views
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 Kudos
Reply
1,588 Views
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 Kudos
Reply
1,479 Views
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 Kudos
Reply
1,465 Views
a1g1
Contributor II
Hi @VaneB,

Let me check this and see. Thanks!

BR
@a1g1
0 Kudos
Reply
1,355 Views
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 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2364026%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EHardfault%20occurred%20with%20AUTOSAR%20GPT%20module%20for%20STM%20Timer%20in%20S32K344%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2364026%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20NXP%2C%26nbsp%3B%3C%2FP%3E%3CP%3EI%20tried%20to%20utilize%20the%20STM%20Timer%20with%20AUTOSAR's%20GPT%20Module%20(on%20S32%20Design%20Studio).%20Despite%20multiple%20attempts%20of%20changing%20the%20configuration%20by%20changing%20the%20clock%20source%2C%20removing%20the%20notification%20callbacks%20etc.%2C%20but%20hardfaults%20always%20occurs.%20It%20occurs%20while%20the%20Stm_Ip_DebugMode()%20is%20getting%20executed%20and%20it%20is%20calling%20the%20API%20to%20enter%20the%20SchM%20Exclusive%20Area%20for%20the%20GPT.%20Please%20provide%20your%20support%20to%20resolve%20this%20issue.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%26nbsp%3B%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%26nbsp%3B%26nbsp%3B%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%3EHello%26nbsp%3B%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%26nbsp%3B%2C%3CBR%20%2F%3E%3CBR%20%2F%3EI%20am%20using%20the%206.0.0%20version%20of%20the%20Real%20time%20drivers%20which%20supports%20AUTOSAR%204.7%20standards.%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%3EHi%26nbsp%3B%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%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIt%20seems%20you%20might%20be%20using%20an%20older%20RTD%20version.%20We%20generally%20recommend%20using%20the%20latest%20RTD%20release%2C%20as%20it%20includes%20bug%20fixes%2C%20improvements%2C%20and%20new%20features.%3C%2FP%3E%0A%3CP%3ECould%20you%20please%20try%20with%20the%20latest%20version%20and%20let%20me%20know%20if%20the%20issue%20still%20persists%3F%3C%2FP%3E%0A%3CP%3EIn%20the%20meantime%2C%20it%20would%20also%20help%20if%20you%20could%20share%20the%20exact%20RTD%20version%20you%20are%20currently%20using%20so%20we%20can%20better%20analyze%20the%20situation.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EBR%2C%20VaneB%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%3EHi%26nbsp%3B%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%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThank%20you%20for%20the%20clarification%2C%20and%20I%20apologize%20for%20the%20previous%20confusion.%3C%2FP%3E%0A%3CP%3EI%20have%20reviewed%20the%20.mex%20file%20you%20shared%20and%20have%20a%20few%20observations%3A%3C%2FP%3E%0A%3CUL%20class%3D%22lia-list-style-type-circle%22%3E%0A%3CLI%3EIn%20the%20MCU%20driver%2C%20the%20peripheral%20clock%20is%20not%20enabled.%20This%20should%20be%20configured%20under%20MCU%20Driver%20%E2%86%92%20McuModuleConfiguration%20%E2%86%92%20McuModeSettingConf%20%E2%86%92%20McuPeripheral%3C%2FLI%3E%0A%3CLI%3EIn%20the%20Clock%20Tool%2C%20you%20selected%20FIRC_CLK%20as%20the%20STM0%20clock%20source.%20However%2C%20in%20MCU%20Driver%20%E2%86%92%20McuModuleConfiguration%20%E2%86%92%20McuClockSettingConfig%20%E2%86%92%20McuClockReferencePoint%2C%20there%20is%20only%20one%20reference%20defined%20(AIPS_SLOW_CLK).%20Please%20add%20a%20new%20clock%20reference%20using%20FIRC_CLK%2C%20and%20then%20select%20it%20as%20the%20GptClockReferencePoint%20in%20Gpt%20Driver%20%E2%86%92%20GptDriverConfiguration%20%E2%86%92%20GptClockReferencePoint.%3C%2FLI%3E%0A%3CLI%3EIn%20the%20GPT%20driver%2C%20no%20GptNotification%20has%20been%20configured.%20Additionally%2C%20the%20code%20is%20still%20using%20a%20notification%20function%20with%20a%20PIT-related%20name%20(Gpt_PitNotification)%2C%20which%20should%20be%20updated.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EFor%20ease%20of%20reference%2C%20I%20am%20attaching%20the%20main%20file%20and%20the%20.mex%20configuration%20I%20used%2C%20so%20you%20can%20compare%20them%20on%20your%20side.%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%3EHi%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%2C%3CBR%20%2F%3E%3CBR%20%2F%3ELet%20me%20check%20this%20and%20see.%20Thanks!%3CBR%20%2F%3E%3CBR%20%2F%3EBR%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%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%3EHello%26nbsp%3B%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%26nbsp%3B%2C%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EThank%20you%20for%20your%20support.%20It%20is%20working%20now.%20After%20taking%20the%20configuration%20changes%20you%20had%20suggested%2C%20I%20went%20thru%20your%20code%20and%20found%20that%20I%20hadn't%20been%20calling%20that%20Mcu_SetMode%20API.%20This%20prevented%20the%20code%20from%20going%20into%20hardfault.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EThanks%20and%20Best%20Regards%2C%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%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E