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

SDRAM speed always defaults to 166kHz #9

Open
kethort opened this issue Nov 29, 2022 · 0 comments
Open

SDRAM speed always defaults to 166kHz #9

kethort opened this issue Nov 29, 2022 · 0 comments

Comments

@kethort
Copy link

kethort commented Nov 29, 2022

The speed data type in the SdramInfo struct should be uint32_t.

If it's an int data type, the value of memClock in calcClocks is "negative" after this calculation:

uint32_t memClock = m_sdramInfo->speed * 1000;

And that forces memClock to default to 166000 no matter what value the speed is set to in the SdramInfo struct.

if (memClock > 166000)
     memClock = 166000;

Serial monitor before data type change:

Starting up...
memClock : 4294956224
memClock : 166000
Requested kHz: -11072
Actual kHz : 165000
PLL k : 1
PLL n : 32

Serial monitor after data type change:

Starting up...
memClock : 120000
memClock : 120000
Requested kHz: 120000
Actual kHz : 120000
PLL k : 1
PLL n : 23

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

No branches or pull requests

1 participant