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

stm32h7.c hardcodes PLL_BASE to 5 MHz causing timing errors #147

Closed
calithameridi opened this issue Feb 7, 2024 · 3 comments · Fixed by #148 · May be fixed by calithameridi/danger-klipper#1
Closed

stm32h7.c hardcodes PLL_BASE to 5 MHz causing timing errors #147

calithameridi opened this issue Feb 7, 2024 · 3 comments · Fixed by #148 · May be fixed by calithameridi/danger-klipper#1

Comments

@calithameridi
Copy link
Contributor

calithameridi commented Feb 7, 2024

Clock configuration on stm32h7 hardcodes a PLL_BASE of 5 MHz due to an implicit assumption that HSE is a 25 MHz crystal oscillator, which works for BTT Octopus Pro and Kraken boards. Unfortunately this breaks timing on boards without 25 MHz (e.g. Corevus-G v0.4 with a 12 MHz on HSE) — for example, all moves execute at 20% greater velocity, and more critically a clock frequency above 2^(32) / (10 s) = 429 MHz causes integer overflow errors.

image

@calithameridi calithameridi changed the title stm32h7.c hardcodes stm32h7.c hardcodes PLL_BASE to 5 MHz causing timing errors Feb 7, 2024
@calithameridi
Copy link
Contributor Author

I find that bodging the value of pll_base to 4 MHz allows me to successfully build an image with 400 MHz clock. Obviously this is not a permanent fix although it may suffice in providing pre-built firmware images to Corevus beta-testers

image
image

@Fisheiyy
Copy link
Contributor

Fisheiyy commented Feb 8, 2024

This would also be good to PR into mainline klipper and fix it for EVERYONE, not just DK

@calithameridi
Copy link
Contributor Author

This would also be good to PR into mainline klipper and fix it for EVERYONE, not just DK

yeah but they don't have a convenient way of reporting issues

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 a pull request may close this issue.

2 participants