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

SDIOSEL & CK48MSEL are applied to the wrong register for STM32F446xx (and perhaps similar chips) #3505

Open
Aissurteivos opened this issue Nov 5, 2024 · 1 comment

Comments

@Aissurteivos
Copy link

While debugging why USB wouldn't work when I used the SAI PLL to generate the 48MHz, I found out that the bits for CK48MSEL and SDIOSEL are assigned to register "DCKCFGR" instead of the correct one, "DCKCFGR2", resulting in the clock mux for 48Mhz to not be set correctly.

I do not know enough about how the code generation works for embassy to submit a fix for it myself, but I worked around it by doing the following in /embassy-stm32/src/rcc/f247.rs:

diff

I had to also keep the bits being assigned to the wrong register as well as the correction, because there is a check that causes a panic if they aren't set (so that check probably needs to be adjusted as well)
Luckily those bits effect a different mux I am not using.

@Aissurteivos
Copy link
Author

In addition, it seems PLLM is not set properly for the I2S and SAI PLL's, So I had to adjust the following also in f247.rs:

image

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