Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch RT1166 fsl_clock.h to fix PLL POST_DIV_SEL Constants #49

Conversation

danieldegrasse
Copy link
Contributor

Prerequisites

  • I have checked latest main branch and the issue still exists.
  • I did not see it is stated as known-issue in release notes.
  • No similar GitHub issue is related to this change.
  • My code follows the commit guidelines of this project.
  • I have performed a self-review of my own code.
  • My changes generate no new warnings.
  • I have added tests that prove my fix is effective or that my feature works.

Describe the pull request

Constants for field POST_DIV_SEL in ARM_PLL_CTRL_REGISTER were
incorrect, fix them.

Type of change:

  • Bug fix (non-breaking change which fixes an issue)

Constants for field POST_DIV_SEL in ARM_PLL_CTRL_REGISTER were
incorrect, fix them.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
@mcuxsusan
Copy link
Contributor

Thanks @danieldegrasse for the contribution, will sync to develop team for review.

@Albort12138
Copy link
Contributor

Hi @danieldegrasse, thanks for your contribution. I wonder if your application uses those constants? Have you tested it or measured the frequency of ARM_PLL?
From our designer's information, in RT1160 ARM_PLL[POST_DIV_SEL] shrinks to 1bit(0:div8, 1:div4) and another bit is reserved. So I think if set post divider to some unsupported value, the frequency of ARM_PLL is inaccurate.

@danieldegrasse
Copy link
Contributor Author

@Albort12138 I have been using the div 4 constant in my application, so the change does not affect it. I just tested the frequency using an LED blinking example, and it appears that setting POST_DIV_SEL to 0 results in a frequency of 300MHz on the CM7 core. I based my changes off of the RT1160 reference manual, so the section for POST_DIV_SEL likely needs to be updated to reflect this change. In addition, the CLOCK_GetRootClockFreq function returns the incorrect value of 1200MHz when called with POST_DIV_SEL set to 0.

@danieldegrasse
Copy link
Contributor Author

Closing this PR, as the issue appears to be one with the reference manual and CLOCK_GetRootClockFreq function, not with the header file itself

@danieldegrasse
Copy link
Contributor Author

@Albort12138 Just checking, are there any actions needed on my end to get the RT1160 reference manual updated, or will your team handle it?

@Albort12138
Copy link
Contributor

Albort12138 commented Nov 5, 2021

@danieldegrasse I have reported this issue to doc team.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants