nxp-mcuxpresso / mcux-sdk

MCUXpresso SDK
BSD 3-Clause "New" or "Revised" License
323 stars 142 forks source link

[BUG] MIMXRT1176 CLOCK_GetRootClockFreq returns wrong frequency when post divider is 1 #86

Closed ChristianMosbach closed 2 years ago

ChristianMosbach commented 2 years ago

Describe the bug CLOCK_GetRootClockFreq returns wrong frequency when post divider is set to divide by 1 (0b11)

To Reproduce

Expected behavior SystemCoreClock should be 600000000

Screenshots and console output image

Additional context CLOCK_GetPllFreq(kCLOCK_PllArm) does not calculate the post divider correctly. if post divider is 1, the register holds 0x3. fsl_clock.c line 1442 shifts postDiv to 0x10, But the divider for the calculation should be 1.

mcuxsusan commented 2 years ago

Thanks for reporting the issue, the bug fix will be available soon.

mcuxsusan commented 2 years ago

Hi @ChristianMosbach, please check the fix in latest main https://github.com/NXPmicro/mcux-sdk/commit/1389627cb281fc5515d37fe9f4e05522518ca925