Example usage CMU_FM_1 (without using MCAL)

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

Example usage CMU_FM_1 (without using MCAL)

跳至解决方案
1,481 次查看
abemat
Contributor III

I would like to enable CMU_FM_1 to monitor the FIRC_CLK frequency, but have a hard time.

Could someone point me to a tutorial or a step by step method to enable the meter? Ideally using RTD 3.0.0 function calls, but direct register accesses may be done as well.

标记 (5)
0 项奖励
回复
1 解答
1,456 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @abemat,

The full version of SAF has API for CMU_FM.

https://www.nxp.com/design/design-center/software/functional-safety-software/s32-safety-software-fra...

 

sCheck/srs/sCheck_CmuFmTest.c

danielmartynek_0-1736425611448.png

 

It is not present in the evaluation version.

 

We have also some non-RTD baremetal code that I can share with you privately.

 

Regards,

Daniel

在原帖中查看解决方案

2 回复数
1,191 次查看
narimanelashkar
Contributor I
I tried to enable CMU_FM_1 to monitor the FIRC_CLK frequency and enable the interrupt FMCIE from IER register to be fired after the measurement is completed by these steps:

IP_CMU_1->RCCR = CMU_FM_RCCR_REF_CNT(50);
IP_CMU_1->IER |= CMU_FM_IER_FMCIE_MASK;
IP_CMU_1->GCR |= CMU_FM_GCR_FME_MASK;

But I faced the following behavior that the interrupt was not fired after the completed window and went to power on reset.

Did you face this behavior or something similar like this?
1,457 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @abemat,

The full version of SAF has API for CMU_FM.

https://www.nxp.com/design/design-center/software/functional-safety-software/s32-safety-software-fra...

 

sCheck/srs/sCheck_CmuFmTest.c

danielmartynek_0-1736425611448.png

 

It is not present in the evaluation version.

 

We have also some non-RTD baremetal code that I can share with you privately.

 

Regards,

Daniel

%3CLINGO-SUB%20id%3D%22lingo-sub-2023968%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ECMU_FM_1%20%E4%BD%BF%E7%94%A8%E7%A4%BA%E4%BE%8B%EF%BC%88%E4%B8%8D%E4%BD%BF%E7%94%A8%20MCAL%EF%BC%89%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2023968%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E6%88%91%E6%83%B3%E5%90%AF%E7%94%A8%20CMU_FM_1%20%E6%9D%A5%E7%9B%91%E6%8E%A7%20FIRC_CLK%20%E9%A2%91%E7%8E%87%EF%BC%8C%E4%BD%86%E6%98%AF%E5%BE%88%E5%9B%B0%E9%9A%BE%E3%80%82%3C%2FP%3E%3CP%3E%E6%9C%89%E4%BA%BA%E5%8F%AF%E4%BB%A5%E7%BB%99%E6%88%91%E6%8F%90%E4%BE%9B%E4%B8%80%E4%BA%9B%E6%95%99%E7%A8%8B%E6%88%96%E9%80%90%E6%AD%A5%E6%96%B9%E6%B3%95%E6%9D%A5%E5%90%AF%E7%94%A8%E4%BB%AA%E8%A1%A8%E5%90%97%EF%BC%9F%E7%90%86%E6%83%B3%E6%83%85%E5%86%B5%E4%B8%8B%E4%BD%BF%E7%94%A8%20RTD%203.0.0%E5%87%BD%E6%95%B0%E8%B0%83%E7%94%A8%EF%BC%8C%E4%BD%86%E4%B9%9F%E5%8F%AF%E4%BB%A5%E7%9B%B4%E6%8E%A5%E8%AE%BF%E9%97%AE%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-2042688%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9ACMU_FM_1%20%E4%BD%BF%E7%94%A8%E7%A4%BA%E4%BE%8B%EF%BC%88%E4%B8%8D%E4%BD%BF%E7%94%A8%20MCAL%EF%BC%89%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2042688%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E6%88%91%E5%B0%9D%E8%AF%95%E5%90%AF%E7%94%A8%20CMU_FM_1%20%E6%9D%A5%E7%9B%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