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

Support boards without APLL #94

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

aliask
Copy link

@aliask aliask commented Jul 27, 2024

I'm currently working with an STM32 S3 board and I've run into a number of problems, including the lack of APLL support on the I2S interface.

  1. I2S_CLK_SRC_APLL is hard-coded:
    .clk_src = I2S_CLK_SRC_APLL,
  2. adjust_apll() calls rtc_clk_apll_coeff_set() which does not exist in my setup, breaking compilation:
    rtc_clk_apll_coeff_set(o_div, sdm0, sdm1, sdm2);

I've implemented a working solution by replacing CONFIG_USE_SAMPLE_INSERTION with CONFIG_USE_APLL.
Doing it this way defaults to a "safe" configuration, and only gives you the option if the underlying hardware supports the feature.

⚠️ However, sdkconfig would not be backwards-compatible - I'm not sure if that's a dealbreaker.

@CarlosDerSeher
Copy link
Owner

Couldn't we keep backward compatibility by only changing those apll related things and keep sample stuffing the default setting?

@aliask
Copy link
Author

aliask commented Jul 28, 2024

I wasn't sure what the behaviour was when setting default true on a board which doesn't support it. Luckily it looks like the feature stays disabled due to the SOC_I2S_SUPPORTS_APLL in my testing 😄

@CarlosDerSeher
Copy link
Owner

I meant using sample stuffing as default sync implementation as apll tuning has issues with some DACs.

@aliask
Copy link
Author

aliask commented Aug 3, 2024

Sample insertion is already the default today. The problem is that the APLL functions/symbols are referenced even when you're using sample stuffing, which is a problem for boards which don't have that feature. The project won't compile.

Or do you mean that we should go back to using CONFIG_USE_SAMPLE_INSERTION instead of CONFIG_USE_APLL (and ditch the depends on flag in Kconfig)? That should keep backwards compatibility, but with the disadvantage that it's possible for a user to select an invalid configuration. I can update the PR to do this if you prefer.

@CarlosDerSeher
Copy link
Owner

I'd prefer to keep backward compatibility as I think I'll ditch the APLL stuff at some point anyway.

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 this pull request may close these issues.

2 participants