Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Bug 1668 v2 - Provide method to prevent init of SYS_CLK, when left on during 'lightsleep'#1672

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
mungewell wants to merge4 commits intoraspberrypi:develop
base:develop
Choose a base branch
Loading
frommungewell:bug_1668_v2

Conversation

mungewell
Copy link

During 'lightsleep' user may want to keep some clocks running (for example PIOs), but at present microPython calls 'clock-init()' causing the SYS_CLK to be reinitialized.

This patch allows microPython to provide the previously used 'sleep_en0 & sleep_en1' signifying which clocks stayed on. As most are dependant of SYS_CLK it can be inferred that this does NOT need to (/should NOT) be re-initialized.

…ing 'lightsleep'During 'lightsleep' user may want to keep some clocks running (for example PIOs),but at present microPython calls 'clock-init()' causing the SYS_CLK to be reinitialised.This patch allows microPython to provide the previously used 'sleep_en0 & sleep_en1'signifying which clocks stayed on. As most are dependant of SYS_CLK it can beinferred that this does NOT need to (/should NOT) be re-initilised.
@mungewell
Copy link
Author

Yes, should be a logical "&&".

I'll update PR and add some documentation. Thanks.

@mungewell
Copy link
Author

I removed the tabs.

Do you want the whole series resubmitted (_v3?) as a single patch/pull request?

@lurch
Copy link
Contributor

That's not my decision to make, so leave it as-is for now unless asked otherwise 🙂

@kilograham
Copy link
Contributor

fixes#1668

@kilograhamkilograham added this to the1.6.0 milestoneMay 19, 2024
Comment on lines 217 to 226
/// \tag::configure_clk_sys[]
// CLK SYS = PLL SYS (usually) 125MHz / 1 = 125MHz
clock_configure(clk_sys,
CLOCKS_CLK_SYS_CTRL_SRC_VALUE_CLKSRC_CLK_SYS_AUX,
CLOCKS_CLK_SYS_CTRL_AUXSRC_VALUE_CLKSRC_PLL_SYS,
SYS_CLK_KHZ * KHZ,
SYS_CLK_KHZ * KHZ);
if (init_sys_clock) {
clock_configure(clk_sys,
CLOCKS_CLK_SYS_CTRL_SRC_VALUE_CLKSRC_CLK_SYS_AUX,
CLOCKS_CLK_SYS_CTRL_AUXSRC_VALUE_CLKSRC_PLL_SYS,
SYS_CLK_KHZ * KHZ,
SYS_CLK_KHZ * KHZ);
}
/// \end::configure_clk_sys[]
Copy link
Contributor

Choose a reason for hiding this comment

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

This "tag" is used to auto-include this code snippet into page 191 ofhttps://datasheets.raspberrypi.com/rp2040/rp2040-datasheet.pdf
Screenshot from 2024-05-20 10-55-44

So in order not to clutter that example, it might make sense to move your newif check tooutside of the tag? i.e.

if (init_sys_clock) {/// \tag::configure_clk_sys[]// CLK SYS = PLL SYS (usually) 125MHz / 1 = 125MHzclock_configure(clk_sys,CLOCKS_CLK_SYS_CTRL_SRC_VALUE_CLKSRC_CLK_SYS_AUX,CLOCKS_CLK_SYS_CTRL_AUXSRC_VALUE_CLKSRC_PLL_SYS,SYS_CLK_KHZ*KHZ,SYS_CLK_KHZ*KHZ);/// \end::configure_clk_sys[]    }

@projectgus
Copy link

projectgus commentedJun 25, 2024
edited
Loading

If this patch was extended to also check and selectively init PLL_USB then it would also meet the use case in#1746. Looks like a good approach to reuse the sleep bits this way.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@lurchlurchlurch left review comments

At least 1 approving review is required to merge this pull request.

Projects
None yet
Milestone
2.2.0
Development

Successfully merging this pull request may close these issues.

5 participants
@mungewell@lurch@kilograham@projectgus@peterharperuk

[8]ページ先頭

©2009-2025 Movatter.jp