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

RT118x clock initialization #185

Merged
merged 3 commits into from
Jan 15, 2025

Conversation

glaeqen
Copy link
Contributor

@glaeqen glaeqen commented Jan 7, 2025

No description provided.

Copy link
Member

@mciantyre mciantyre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not doing a detailed review of this feature, but let me know if there's anything you'd like specific feedback on. The root clocks affected by the init routine LGTM at first glance; I shared my measurements.

Requesting changes around the unconditional use of defmt in ccm_118x.rs. See inline comments.

&mut CCM,
&mut DCDC,
&mut PHY_LDO,
);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The table shows my root clock measurements after this call returns. I took these measurements using the debugger. These frequencies LGTM.

                          Name | Current (Hz) |     Min (Hz) |     Max (Hz) | Max-Min (Hz)
------------------------------------------------------------------------------------------
             FLEXSPI1_CLK_ROOT |    132934656 |    132934656 |    132935168 |          512
                  M33_CLK_ROOT |    240020992 |    240020992 |    240021504 |          512
                   OSC_24M_OUT |     24002048 |     24002048 |     24002048 |            0
                    OSC_RC_24M |     24113152 |     24112640 |     24114176 |         1536
                   OSC_RC_400M |    399403008 |    399403008 |    399549952 |       146944
                  PLL_480_DIV2 |    240020480 |    240020480 |    240021504 |         1024
                   PLL_480_OUT |    480041984 |    480040960 |    480043008 |         2048
                  PLL_480_PFD0 |    664673792 |    664672768 |    664675328 |         2560
                  PLL_480_PFD1 |            0 |          ??? |            0 |          ???
                  PLL_480_PFD2 |            0 |          ??? |            0 |          ???
                  PLL_480_PFD3 |            0 |          ??? |            0 |          ???

Here is the tool for folks who want to reproduce this test.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty nice, that means that my diag module is kind of redundant. It should be at least hidden behind a defmt feature flag because as of now it's useless without it anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed that with changes from cd76df105fe0f1056efca8f37b89ef2485515222 my diag module stopped working after the write to TRDC1.MDA_W0_2_DFMT1 (thus TODO comment). Did not investigate further but probably I violate some invariants.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious: Does stop working mean that the TRDC blocked the CPU's access to the CCM observation registers? Or, were the CCM observation measurements erroneous after writing to TRDC1.MDA_W0_2_DFMT1?

Manipulating TRDC1.MDA_W0_2_DFMT1 doesn't seem to affect the debugger's access to the CCM's observation registers. I merged cd76df105 into this branch, generating mciantyre@b3b004e. Examples still worked, and I could still generate that table from above.

@glaeqen glaeqen force-pushed the rt1180-clocks-to-upstream branch from 551813f to c994564 Compare January 13, 2025 07:50
@mciantyre mciantyre merged commit 0e274f4 into imxrt-rs:main Jan 15, 2025
40 checks passed
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.

2 participants