This is an automated email from the ASF dual-hosted git repository.
acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new b37e8ecf3c boards/nucleo-f446re: fix adc example
b37e8ecf3c is described below
commit b37e8ecf3cb7ec0d1e3a22ae8d48ad5ddfa03bd2
Author: raiden00pl <[email protected]>
AuthorDate: Fri Jun 13 13:53:26 2025 +0200
boards/nucleo-f446re: fix adc example
fix adc example for nucleo-f446re:
- the second ADC channel should be different from first channel
- enable ADC SCAN mode so we get convertion on CH0 and CH1
- disable software trigger from application, we use hardware triggering
from timer
Signed-off-by: raiden00pl <[email protected]>
---
boards/arm/stm32/nucleo-f446re/configs/adc/defconfig | 3 +--
boards/arm/stm32/nucleo-f446re/src/stm32_adc.c | 2 +-
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/boards/arm/stm32/nucleo-f446re/configs/adc/defconfig
b/boards/arm/stm32/nucleo-f446re/configs/adc/defconfig
index 96796fc4f5..4af6275c0e 100644
--- a/boards/arm/stm32/nucleo-f446re/configs/adc/defconfig
+++ b/boards/arm/stm32/nucleo-f446re/configs/adc/defconfig
@@ -10,7 +10,6 @@
# CONFIG_NSH_CMDOPT_HEXDUMP is not set
# CONFIG_NSH_DISABLE_IFCONFIG is not set
# CONFIG_NSH_DISABLE_PS is not set
-# CONFIG_STM32_ADC1_SCAN is not set
# CONFIG_STM32_FLASH_PREFETCH is not set
CONFIG_ADC=y
CONFIG_ANALOG=y
@@ -27,7 +26,6 @@ CONFIG_BOARD_LOOPSPERMSEC=8499
CONFIG_BUILTIN=y
CONFIG_EXAMPLES_ADC=y
CONFIG_EXAMPLES_ADC_GROUPSIZE=2
-CONFIG_EXAMPLES_ADC_SWTRIG=y
CONFIG_HAVE_CXX=y
CONFIG_HAVE_CXXINITIALIZE=y
CONFIG_INIT_ENTRYPOINT="nsh_main"
@@ -48,6 +46,7 @@ CONFIG_START_MONTH=10
CONFIG_START_YEAR=2014
CONFIG_STM32_ADC1=y
CONFIG_STM32_ADC1_DMA=y
+CONFIG_STM32_ADC1_SAMPLE_FREQUENCY=1
CONFIG_STM32_DMA2=y
CONFIG_STM32_JTAG_SW_ENABLE=y
CONFIG_STM32_TIM1=y
diff --git a/boards/arm/stm32/nucleo-f446re/src/stm32_adc.c
b/boards/arm/stm32/nucleo-f446re/src/stm32_adc.c
index 5ac70d77a4..6bfcfee975 100644
--- a/boards/arm/stm32/nucleo-f446re/src/stm32_adc.c
+++ b/boards/arm/stm32/nucleo-f446re/src/stm32_adc.c
@@ -71,7 +71,7 @@ static const uint8_t g_adc1_chanlist[ADC1_NCHANNELS] =
static const uint32_t g_adc1_pinlist[ADC1_NCHANNELS] =
{
GPIO_ADC1_IN0,
- GPIO_ADC1_IN0
+ GPIO_ADC1_IN1
};
#else