STM32F401 I2S not starting up Topic is solved

Report here problems in any of ChibiOS components. This forum is NOT for support.
elagil
Posts: 92
Joined: Tue Sep 19, 2017 7:38 am
Has thanked: 8 times
Been thanked: 7 times

STM32F401 I2S not starting up  Topic is solved

Postby elagil » Fri Mar 24, 2023 10:57 pm

In trying to use the STM32F401 I2S in TX MASTER mode, I have the following problem on ChibiOs (git master, commit hash 3101ad3eb5091329d2ac71d58b516a90d15541ca from 26.01.2023, equally for stable version 21.11.x)

The clocks for STM32F401 I2S PLL are not starting up. I had a look at the RCC_PLLI2SCFGR register and - interestingly - the values for PLLI2SN and PLLI2SR were not set as in my mcuconf.h.

After further investigation, I found that the I2S PLL is not enabled in the stm32_registry.h for the STM32F401! Why is that?
I propose this fix, which makes my board finally play sound in TX MASTER mode.

See this git diff

Code: Select all

diff --git a/os/hal/ports/STM32/STM32F4xx/stm32_registry.h b/os/hal/ports/STM32/STM32F4xx/stm32_registry.h
index 56ca20a33..5dde2681d 100644
--- a/os/hal/ports/STM32/STM32F4xx/stm32_registry.h
+++ b/os/hal/ports/STM32/STM32F4xx/stm32_registry.h
@@ -2894,10 +2894,10 @@
 
 /* Clock tree attributes.*/
 #define STM32_HAS_RCC_PLLSAI                FALSE
-#define STM32_HAS_RCC_PLLI2S                FALSE
+#define STM32_HAS_RCC_PLLI2S                TRUE
 #define STM32_HAS_RCC_DCKCFGR               TRUE
 #define STM32_HAS_RCC_DCKCFGR2              FALSE
-#define STM32_HAS_RCC_I2SSRC                FALSE
+#define STM32_HAS_RCC_I2SSRC                TRUE
 #define STM32_HAS_RCC_I2SPLLSRC             FALSE
 #define STM32_HAS_RCC_CK48MSEL              FALSE
 #define STM32_RCC_CK48MSEL_USES_I2S         FALSE
 


Additionally, the mcuconf.h should include a setting for the I2S PLL source, e.g.

Code: Select all

#define STM32_I2SSRC STM32_I2SSRC_PLLI2S
 
Last edited by elagil on Fri Mar 24, 2023 11:29 pm, edited 1 time in total.

elagil
Posts: 92
Joined: Tue Sep 19, 2017 7:38 am
Has thanked: 8 times
Been thanked: 7 times

Re: STM32F401 I2S not starting up

Postby elagil » Fri Mar 24, 2023 11:00 pm

Maybe somehow related?
viewtopic.php?f=35&t=5701

elagil
Posts: 92
Joined: Tue Sep 19, 2017 7:38 am
Has thanked: 8 times
Been thanked: 7 times

Re: STM32F401 I2S not starting up

Postby elagil » Mon Mar 27, 2023 10:34 pm

If it helps, I have a commit on my git fork that applies the changes:
https://github.com/elagil/ChibiOS/commi ... a04ccdf7d4

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: STM32F401 I2S not starting up

Postby Giovanni » Tue Mar 28, 2023 7:27 am

Hi,

Yes, it helps, I will apply it on the next bug fixes pass.

Giovanni


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 8 guests