CLOCK_GetSysPfdFreq does not return correct frequency for bypassed pll clock

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

CLOCK_GetSysPfdFreq does not return correct frequency for bypassed pll clock

1,120件の閲覧回数
lh_dan
Contributor III

SDK_2_12_1_MIMXRT1064xxxxA fsl_clock.c

In the function CLOCK_GetSysPfdFreq(clock_pfd_t pfd) when CLOCK_GetPllFreq() returns the frequency of the Bypass Reference Clock, the returned frequency is divided by the pfd clock divider and multiplied by 18U. For the bypass clock, this should not occur. 

uint32_t CLOCK_GetSysPfdFreq(clock_pfd_t pfd)
{
uint32_t freq = CLOCK_GetPllFreq(kCLOCK_PllSys);

switch (pfd)
{
case kCLOCK_Pfd0:
freq /= ((CCM_ANALOG->PFD_528 & CCM_ANALOG_PFD_528_PFD0_FRAC_MASK) >> CCM_ANALOG_PFD_528_PFD0_FRAC_SHIFT);
break;

case kCLOCK_Pfd1:
freq /= ((CCM_ANALOG->PFD_528 & CCM_ANALOG_PFD_528_PFD1_FRAC_MASK) >> CCM_ANALOG_PFD_528_PFD1_FRAC_SHIFT);
break;

case kCLOCK_Pfd2:
freq /= ((CCM_ANALOG->PFD_528 & CCM_ANALOG_PFD_528_PFD2_FRAC_MASK) >> CCM_ANALOG_PFD_528_PFD2_FRAC_SHIFT);
break;

case kCLOCK_Pfd3:
freq /= ((CCM_ANALOG->PFD_528 & CCM_ANALOG_PFD_528_PFD3_FRAC_MASK) >> CCM_ANALOG_PFD_528_PFD3_FRAC_SHIFT);
break;

default:
freq = 0U;
break;
}
freq *= 18U;

return freq;
}

Clock tool reference example:

lh_dan_0-1668613443289.png

 

0 件の賞賛
返信
1 返信

1,096件の閲覧回数
EdwinHz
NXP TechSupport
NXP TechSupport

Hi @lh_dan,

I believe you are correct. I will pass this insight to the SDK team so they can do the adequate changes on a future release.

Thank you for reporting this issue.

 

BR,

Edwin.

0 件の賞賛
返信