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

MIMXRT105x family deep sleep code needs help #188

Open
multiplemonomials opened this issue Sep 29, 2023 · 2 comments
Open

MIMXRT105x family deep sleep code needs help #188

multiplemonomials opened this issue Sep 29, 2023 · 2 comments
Labels
Bug Dis is broken

Comments

@multiplemonomials
Copy link
Collaborator

multiplemonomials commented Sep 29, 2023

The current version of the deep sleep code is based on the "lpm.c" example from MCUXpresso SDK, modified to work with Mbed's clock setup. It mostly works, but it has some issues. Namely, the SwitchSystemClocks() function has to clear the I-cache whenever it executes, or we get hard faults when coming out of sleep. Additionally, the mbed-hal-lp-ticker and mbed-hal-rtc tests experience some sort of wonky stack corruption (I think...) when coming out of deep sleep. I don't seen an obvious smoking gun for this, and I'm unsure if it's related to FlexSPI being weird or if it's something else entirely.

Also not helping is the fact that the official AN12085 app note seems to say that you can't change the FlexSPI clock at all when doing XiP, so maybe it's just impossible?

Anyway, I think that someone needs to go through and do a more detailed look at how the deep sleep / low power code is set up and whether it's the right way to do it. Then, we need to look into debugging those tests and debugging why the I-cache clear is needed. See #187 for the last time I worked on deep sleep stuff...

@multiplemonomials multiplemonomials added the Bug Dis is broken label Sep 29, 2023
@multiplemonomials
Copy link
Collaborator Author

Note: I tried both disabling the SEMC RAM and also disabling overdrive mode, no effect on these issues.

@multiplemonomials
Copy link
Collaborator Author

Another thing to work out is what to do about the other PLLs. Some of them can probably be turned off permanently. Others probably can be turned off (in deep sleep and from boot) but have to be turned back on if certain features (e.g. Ethernet) are using them.
image

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

No branches or pull requests

1 participant