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
Add x_nucleo_cca02m1 microphone shield #17140
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,6 +40,14 @@ static const struct pin_config pinconf[] = { | |
{STM32_PIN_PA6, STM32F4_PINMUX_FUNC_PA6_SPI1_MISO}, | ||
{STM32_PIN_PA7, STM32F4_PINMUX_FUNC_PA7_SPI1_MOSI}, | ||
#endif /* CONFIG_SPI_1 */ | ||
#ifdef CONFIG_I2S_1 | ||
{STM32_PIN_PA4, STM32F4_PINMUX_FUNC_PA4_I2S1_WS}, | ||
{STM32_PIN_PA5, STM32F4_PINMUX_FUNC_PA5_I2S1_CK}, | ||
{STM32_PIN_PA7, STM32F4_PINMUX_FUNC_PA7_I2S1_SD}, | ||
#endif /* CONFIG_I2S_1 */ | ||
/* TBD ???? */ | ||
{STM32_PIN_PB4, (STM32_PINMUX_ALT_FUNC_2 | STM32_PUSHPULL_NOPULL | STM32_OSPEEDR_VERY_HIGH_SPEED)}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What are you trying to do here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @erwango Basically, to make the x_nucleo_cca02m1 shield working fine (and in both mono and The shield needs:
In this file the PB4 and PB5 are the pins where a 2x clock is generated using timer as explained I guess this part should be either in board/sheilds or in sample/shields. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
What about using gpio map and do this configuration inside the sample code?
Then, in sample code, use gpio-d2 generated define to do the gpio configuration? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @avisconti , did you checked above proposal? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @erwango, no, not yet. |
||
{STM32_PIN_PB5, (STM32_PINMUX_ALT_FUNC_2 | STM32_PUSHPULL_NOPULL | STM32_OSPEEDR_VERY_HIGH_SPEED)}, | ||
}; | ||
|
||
static int pinmux_stm32_init(struct device *port) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
.. _x-nucleo-cca02m1: | ||
|
||
X-NUCLEO-CCA02M1: Digital MEMS microphones shield for STM32 Nucleo | ||
################################################################## | ||
|
||
Overview | ||
******** | ||
The X-NUCLEO-CCA02M1 is an evaluation board based on digital MEMS microphones | ||
compatible with the ST morpho connector layout. | ||
It has two microphones soldered onto the board and is compatible with digital microphone | ||
coupon boards such as STEVAL-MKI129Vx and STEVAL-MKI155Vx. | ||
|
||
The X-NUCLEO-CCA02M1 allows synchronized acquisition and streaming of up to 4 | ||
microphones through I2S, SPI or DFSDM peripherals. | ||
|
||
.. image:: img/x-nucleo-cca02m1.jpg | ||
:width: 340px | ||
:height: 410px | ||
:align: center | ||
:alt: X-NUCLEO-CCA02M1 | ||
|
||
For more information about the board, see the `X-NUCLEO-CCA02M1 website`_ | ||
|
||
Hardware | ||
******** | ||
|
||
X-NUCLEO-CCA02M1 provides the following key features: | ||
|
||
- 2 x MP34DT01 on-board microphones | ||
- 4 x header (3x2) to connect up to 4 external microphones | ||
- Equipped with ST morpho connector | ||
- Equipped with Arduino UNO R3 connector | ||
- RoHS compliant | ||
|
||
|
||
For more information about this shield, see the `X-NUCLEO-CCA02M1 data brief`_ | ||
|
||
Programming | ||
*********** | ||
|
||
The X-NUCLEO-CCA02M1 can be connected to the SoC through I2S, SPI, or DFSDM peripherals, | ||
but only I2S has been tested in Zephyr using a nucleo_f411re board. | ||
|
||
References | ||
********** | ||
|
||
.. target-notes:: | ||
|
||
.. _X-NUCLEO-CCA02M1 website: | ||
https://www.st.com/en/ecosystems/x-nucleo-cca02m1.html | ||
|
||
.. _X-NUCLEO-CCA02M1 data brief: | ||
https://www.st.com/resource/en/data_brief/x-nucleo-cca02m1.pdf | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* Copyright (c) 2019 STMicroelectronics | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
&arduino_i2s { | ||
mp34dt01@0 { | ||
compatible = "st,mpxxdtyy"; | ||
reg = <0>; | ||
label = "MP34DT01"; | ||
}; | ||
|
||
mp34dt01@1 { | ||
compatible = "st,mpxxdtyy"; | ||
reg = <1>; | ||
label = "MP34DT01"; | ||
}; | ||
}; |
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.
If required, this should not be there.
A path like
boards/shields/wnc_m14a2a/boards/frdm_k64f.conf
would be best suitedThere 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.
I guess you mean something like that:
CONFIG_I2S_STM32=y
CONFIG_I2S_STM32_USE_PLLI2S_ENABLE=y
CONFIG_I2S_STM32_PLLI2S_PLLM=8
CONFIG_I2S_STM32_PLLI2S_PLLN=192
CONFIG_I2S_STM32_PLLI2S_PLLR=3
CONFIG_I2S_1=y
CONFIG_USE_STM32_LL_TIM=y
CONFIG_DMA_STM32F4X=y
I tried but there is one problem, i.e. CONFIG_USE_STM32_LL_TIM is a symbole with no
prompt, which means that can be set ONLY in a defconfig file. But I think that in shield it is not
possible to have defconfig, right?
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.
As reported in sample file, main issue is that code proposed in sample is not using zephyr API and tries to access directly cube HAL.
Otherwise, most of this should be done in shield Kconfig.defconfig (which misses today and should be re-instantiated)