Skip to content

Commit 7701979

Browse files
aviscontinashif
authored andcommitted
board: 96b_argonkey: Add on-board MP34DT05 microphone support in BSP
This commit is taking care of following stuff: 1. pinmux: STM32F4 micro is using I2S5_CK and I2S_SD to interface with on-board microphone. 2. default configuration: - enable I2S5 and configure PLLI2S properly to generate I2SxCLK = 128MHz. - enable DMA Note: As stated in issue #9028 we needed to take care of a known SPI/I2S bug implementing the following two actions: A. APB2 clock has been slowed down to 42MHz. B. The SPI/I2S clock gpio speed has been set to very_high_speed. Signed-off-by: Armando Visconti <[email protected]>
1 parent cfa04c3 commit 7701979

File tree

5 files changed

+50
-6
lines changed

5 files changed

+50
-6
lines changed

boards/arm/96b_argonkey/96b_argonkey.dts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@
6868
};
6969
};
7070

71+
&i2s5 {
72+
status = "ok";
73+
};
74+
7175
&i2c1 {
7276
status = "ok";
7377
clock-frequency = <I2C_BITRATE_FAST>;

boards/arm/96b_argonkey/96b_argonkey_defconfig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ CONFIG_CLOCK_STM32_PLL_Q_DIVISOR=8
3434
CONFIG_CLOCK_STM32_AHB_PRESCALER=1
3535

3636
# APB1 clock must not exceed 50MHz limit
37+
# APB2 clock is fixed at 42MHz to prevent known SPI/I2S bug
3738
CONFIG_CLOCK_STM32_APB1_PRESCALER=2
38-
CONFIG_CLOCK_STM32_APB2_PRESCALER=1
39+
CONFIG_CLOCK_STM32_APB2_PRESCALER=2
3940

4041
# console
4142
CONFIG_CONSOLE=y

boards/arm/96b_argonkey/Kconfig.defconfig

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,36 @@ config SPI_STM32_INTERRUPT
4646

4747
endif # SPI
4848

49+
if I2S
50+
51+
config I2S_STM32
52+
def_bool y
53+
54+
# configure PLLI2S to generate a I2SxCLK=128MHz
55+
config I2S_STM32_USE_PLLI2S_ENABLE
56+
def_bool y
57+
58+
config I2S_STM32_PLLI2S_PLLM
59+
default 8
60+
61+
config I2S_STM32_PLLI2S_PLLN
62+
default 192
63+
64+
config I2S_STM32_PLLI2S_PLLR
65+
default 3
66+
67+
config I2S_5
68+
def_bool y
69+
70+
endif # I2S
71+
72+
if DMA
73+
74+
config DMA_STM32F4X
75+
def_bool y
76+
77+
endif # DMA
78+
4979
if LSM6DSL
5080

5181
choice LSM6DSL_BUS_TYPE

boards/arm/96b_argonkey/doc/96b_argonkey.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ System Clock
102102
96Boards Argonkey can be driven by an internal oscillator as well as the main
103103
PLL clock. In default board configuration, the 16MHz external oscillator is
104104
used to drive the main PLL clock to generate a System Clock (SYSCLK) at 84MHz.
105-
On the bus side, AHB and APB2 clock runs at 84MHz, while APB1 runs at 42MHz.
105+
On the bus side, AHB clock runs at 84MHz, while APB1/APB2 clock runs at 42MHz.
106106

107107
Serial Port
108108
===========

boards/arm/96b_argonkey/pinmux.c

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,26 @@ static const struct pin_config pinconf[] = {
3131
{STM32_PIN_PB4, STM32F4_PINMUX_FUNC_PB4_I2C3_SDA},
3232
#endif /* CONFIG_I2C_3 */
3333
#ifdef CONFIG_SPI_1
34-
{STM32_PIN_PA4, STM32F4_PINMUX_FUNC_PA4_SPI1_NSS},
35-
{STM32_PIN_PA5, STM32F4_PINMUX_FUNC_PA5_SPI1_SCK},
34+
{STM32_PIN_PA4, STM32F4_PINMUX_FUNC_PA4_SPI1_NSS |
35+
STM32_OSPEEDR_VERY_HIGH_SPEED},
36+
{STM32_PIN_PA5, STM32F4_PINMUX_FUNC_PA5_SPI1_SCK |
37+
STM32_OSPEEDR_VERY_HIGH_SPEED},
3638
{STM32_PIN_PA6, STM32F4_PINMUX_FUNC_PA6_SPI1_MISO},
3739
{STM32_PIN_PA7, STM32F4_PINMUX_FUNC_PA7_SPI1_MOSI},
3840
#endif /* CONFIG_SPI_1 */
3941
#ifdef CONFIG_SPI_2
40-
{STM32_PIN_PB12, STM32F4_PINMUX_FUNC_PB12_SPI2_NSS},
41-
{STM32_PIN_PB13, STM32F4_PINMUX_FUNC_PB13_SPI2_SCK},
42+
{STM32_PIN_PB12, STM32F4_PINMUX_FUNC_PB12_SPI2_NSS |
43+
STM32_OSPEEDR_VERY_HIGH_SPEED},
44+
{STM32_PIN_PB13, STM32F4_PINMUX_FUNC_PB13_SPI2_SCK |
45+
STM32_OSPEEDR_VERY_HIGH_SPEED},
4246
{STM32_PIN_PB14, STM32F4_PINMUX_FUNC_PB14_SPI2_MISO},
4347
{STM32_PIN_PB15, STM32F4_PINMUX_FUNC_PB15_SPI2_MOSI},
4448
#endif /* CONFIG_SPI_2 */
49+
#ifdef CONFIG_I2S_5
50+
{STM32_PIN_PB0, STM32F4_PINMUX_FUNC_PB0_I2S5_CK |
51+
STM32_OSPEEDR_VERY_HIGH_SPEED},
52+
{STM32_PIN_PB8, STM32F4_PINMUX_FUNC_PB8_I2S5_SD},
53+
#endif /* CONFIG_I2S_5 */
4554
};
4655

4756
static int pinmux_stm32_init(struct device *port)

0 commit comments

Comments
 (0)