-
Notifications
You must be signed in to change notification settings - Fork 7.5k
I2S: Revert changes done in STM32cube and fix the i2s driver instead #12637
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
Conversation
Revert 71ba2de: ext: stm32cube: stm32f4xx: shift I2SR field in PLLI2SCFGR register (ST Bug tracker ID: 50086) Revert 9a89320: ext: stm32cube: stm32f7xx: shift I2SR field in PLLI2SCFGR register (ST Bug tracker ID: 50108) This two commits were introduced to shift the PLLR parameter according to the PLL register field position. After analysis, it appears that function is actually correct, and issue was actually in parameters provided that didn't match the API. (see PR zephyrproject-rtos#12609) Signed-off-by: Armando Visconti <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #12637 +/- ##
==========================================
+ Coverage 48.31% 53.94% +5.62%
==========================================
Files 280 242 -38
Lines 43348 27654 -15694
Branches 10380 6717 -3663
==========================================
- Hits 20945 14917 -6028
+ Misses 18251 9932 -8319
+ Partials 4152 2805 -1347
Continue to review full report at Codecov.
|
drivers/i2s/i2s_ll_stm32.c
Outdated
@@ -109,6 +109,34 @@ static int i2s_stm32_enable_clock(struct device *dev) | |||
#ifdef CONFIG_I2S_STM32_USE_PLLI2S_ENABLE | |||
#define PLLI2S_MAX_MS_TIME 1 /* PLLI2S lock time is 300us max */ | |||
static u16_t plli2s_ms_count; | |||
|
|||
static u32_t shift_pllr(u8_t pllr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since CONFIG_I2S_STM32_PLLI2S_PLLR is defined at compile time, it would be legit use a pre-processor macro as done in clock controller and save some code:
#define _pllr(v) LL_RCC_PLLI2SR_DIV ## v
#define pllr(v) _pllr(v)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, it seems really smart!
The PLLR parameter in LL_RCC_PLLI2S_ConfigDomain_I2S() API should be selected among the following list of (already shifted) values: * @arg @ref LL_RCC_PLLI2SR_DIV_2 * @arg @ref LL_RCC_PLLI2SR_DIV_3 * @arg @ref LL_RCC_PLLI2SR_DIV_4 * @arg @ref LL_RCC_PLLI2SR_DIV_5 * @arg @ref LL_RCC_PLLI2SR_DIV_6 * @arg @ref LL_RCC_PLLI2SR_DIV_7 This commit fixes PR zephyrproject-rtos#12609. Signed-off-by: Armando Visconti <[email protected]>
@erwango |
Fix PR #12609.
Tested on ArgonKey board using microphone sample.