From e3bb78a88155c1d8db15779e4c60b559c97d8c90 Mon Sep 17 00:00:00 2001 From: Mateusz Szafoni Date: Sat, 28 Oct 2017 14:29:07 +0000 Subject: [PATCH] Merged in raiden00/nuttx (pull request #520) Master * stm32: add ADC DMA support to STM32F33 configuration * stm32f33xxx_adc.c: fix compilation if no DMA * nucleo-f334r8: eliminate warning * nucleo-f334r8: add highpri example configuration Approved-by: Gregory Nutt --- arch/arm/src/stm32/Kconfig | 2 + arch/arm/src/stm32/stm32f33xxx_adc.c | 3 +- configs/nucleo-f334r8/highpri/defconfig | 105 ++++++++++++++++++++++ configs/nucleo-f334r8/src/stm32_highpri.c | 2 + 4 files changed, 111 insertions(+), 1 deletion(-) create mode 100644 configs/nucleo-f334r8/highpri/defconfig diff --git a/arch/arm/src/stm32/Kconfig b/arch/arm/src/stm32/Kconfig index 33739acb22..123107416c 100644 --- a/arch/arm/src/stm32/Kconfig +++ b/arch/arm/src/stm32/Kconfig @@ -1494,6 +1494,8 @@ config STM32_STM32F33XX select STM32_HAVE_TIM16 select STM32_HAVE_TIM17 select STM32_HAVE_ADC2 + select STM32_HAVE_ADC1_DMA + select STM32_HAVE_ADC2_DMA select STM32_HAVE_CAN1 select STM32_HAVE_DAC1 select STM32_HAVE_DAC2 diff --git a/arch/arm/src/stm32/stm32f33xxx_adc.c b/arch/arm/src/stm32/stm32f33xxx_adc.c index ba0461fe25..81b5a671ae 100644 --- a/arch/arm/src/stm32/stm32f33xxx_adc.c +++ b/arch/arm/src/stm32/stm32f33xxx_adc.c @@ -2107,7 +2107,7 @@ static uint32_t adc_regget(FAR struct stm32_adc_dev_s *dev) /**************************************************************************** * Name: adc_regbufregister ****************************************************************************/ - +#ifdef ADC_HAVE_DMA static int adc_regbufregister(FAR struct stm32_adc_dev_s *dev, uint16_t *buffer, uint8_t len) { FAR struct stm32_dev_s *priv = (FAR struct stm32_dev_s *)dev; @@ -2124,6 +2124,7 @@ static int adc_regbufregister(FAR struct stm32_adc_dev_s *dev, uint16_t *buffer, return OK; } +#endif /**************************************************************************** * Name: adc_inj_get diff --git a/configs/nucleo-f334r8/highpri/defconfig b/configs/nucleo-f334r8/highpri/defconfig new file mode 100644 index 0000000000..6f17e7fcea --- /dev/null +++ b/configs/nucleo-f334r8/highpri/defconfig @@ -0,0 +1,105 @@ +CONFIG_ADC=y +CONFIG_ANALOG=y +CONFIG_ARCH="arm" +CONFIG_ARCH_BOARD="nucleo-f334r8" +CONFIG_ARCH_BOARD_NUCLEO_F334R8=y +CONFIG_ARCH_BUTTONS=y +CONFIG_ARCH_CHIP_STM32F334R8=y +CONFIG_ARCH_CHIP_STM32=y +CONFIG_ARCH_HIPRI_INTERRUPT=y +CONFIG_ARCH_RAMVECTORS=y +CONFIG_ARCH_STACKDUMP=y +CONFIG_BOARD_LOOPSPERMSEC=16717 +CONFIG_BUILTIN_PROXY_STACKSIZE=512 +CONFIG_BUILTIN=y +# CONFIG_DEV_NULL is not set +CONFIG_DISABLE_ENVIRON=y +CONFIG_DISABLE_MQUEUE=y +CONFIG_DISABLE_POLL=y +CONFIG_DISABLE_POSIX_TIMERS=y +CONFIG_EXAMPLES_NSH=y +CONFIG_FDCLONE_STDIO=y +CONFIG_INTELHEX_BINARY=y +CONFIG_LIBC_FLOATINGPOINT=y +# CONFIG_LIBC_LONG_LONG is not set +CONFIG_LIBM=y +CONFIG_MAX_TASKS=4 +CONFIG_MAX_WDOGPARMS=1 +CONFIG_NAME_MAX=16 +CONFIG_NFILE_DESCRIPTORS=8 +CONFIG_NFILE_STREAMS=8 +CONFIG_NSH_ARCHINIT=y +CONFIG_NSH_BUILTIN_APPS=y +CONFIG_NSH_DISABLE_BASENAME=y +CONFIG_NSH_DISABLE_CAT=y +CONFIG_NSH_DISABLE_CD=y +CONFIG_NSH_DISABLE_CMP=y +CONFIG_NSH_DISABLE_CP=y +CONFIG_NSH_DISABLE_DD=y +CONFIG_NSH_DISABLE_DF=y +CONFIG_NSH_DISABLE_DIRNAME=y +CONFIG_NSH_DISABLE_EXEC=y +CONFIG_NSH_DISABLE_EXIT=y +CONFIG_NSH_DISABLE_GET=y +CONFIG_NSH_DISABLE_HEXDUMP=y +CONFIG_NSH_DISABLE_KILL=y +CONFIG_NSH_DISABLE_LOSETUP=y +CONFIG_NSH_DISABLE_LS=y +CONFIG_NSH_DISABLE_MB=y +CONFIG_NSH_DISABLE_MH=y +CONFIG_NSH_DISABLE_MKDIR=y +CONFIG_NSH_DISABLE_MKRD=y +CONFIG_NSH_DISABLE_MOUNT=y +CONFIG_NSH_DISABLE_MV=y +CONFIG_NSH_DISABLE_MW=y +# CONFIG_NSH_DISABLE_PRINTF is not set +CONFIG_NSH_DISABLE_PUT=y +CONFIG_NSH_DISABLE_PWD=y +CONFIG_NSH_DISABLE_RMDIR=y +CONFIG_NSH_DISABLE_RM=y +CONFIG_NSH_DISABLE_SET=y +CONFIG_NSH_DISABLE_SH=y +CONFIG_NSH_DISABLE_SLEEP=y +CONFIG_NSH_DISABLE_TEST=y +CONFIG_NSH_DISABLE_TIME=y +CONFIG_NSH_DISABLE_UMOUNT=y +CONFIG_NSH_DISABLE_UNAME=y +CONFIG_NSH_DISABLE_UNSET=y +CONFIG_NSH_DISABLE_USLEEP=y +CONFIG_NSH_DISABLE_WGET=y +CONFIG_NSH_DISABLE_XD=y +CONFIG_NSH_FILEIOSIZE=256 +CONFIG_NSH_LINELEN=64 +CONFIG_NSH_READLINE=y +CONFIG_NUCLEOF334R8_HIGHPRI=y +CONFIG_POSIX_SPAWN_PROXY_STACKSIZE=512 +CONFIG_PREALLOC_TIMERS=2 +CONFIG_PREALLOC_WDOGS=1 +CONFIG_PTHREAD_STACK_DEFAULT=1024 +CONFIG_PTHREAD_STACK_MIN=1024 +CONFIG_RAM_SIZE=12288 +CONFIG_RAM_START=0x20000000 +CONFIG_RAW_BINARY=y +CONFIG_RR_INTERVAL=200 +CONFIG_SCHED_WAITPID=y +CONFIG_SDCLONE_DISABLE=y +CONFIG_START_DAY=6 +CONFIG_START_MONTH=12 +CONFIG_START_YEAR=2011 +CONFIG_STM32_ADC1_DMA=y +CONFIG_STM32_ADC1=y +CONFIG_STM32_ADC_NOIRQ=y +CONFIG_STM32_DMA1=y +CONFIG_STM32_HRTIM1=y +CONFIG_STM32_HRTIM_CLK_FROM_PLL=y +CONFIG_STM32_HRTIM_DISABLE_CHARDRV=y +CONFIG_STM32_HRTIM_TIMA=y +CONFIG_STM32_JTAG_SW_ENABLE=y +CONFIG_STM32_PWR=y +CONFIG_STM32_USART2=y +CONFIG_TASK_NAME_SIZE=0 +CONFIG_TASK_SPAWN_DEFAULT_STACKSIZE=512 +CONFIG_USART2_SERIAL_CONSOLE=y +CONFIG_USER_ENTRYPOINT="highpri_main" +CONFIG_USERMAIN_STACKSIZE=1024 +CONFIG_WDOG_INTRESERVE=0 diff --git a/configs/nucleo-f334r8/src/stm32_highpri.c b/configs/nucleo-f334r8/src/stm32_highpri.c index 003058f3be..5b94415a5f 100644 --- a/configs/nucleo-f334r8/src/stm32_highpri.c +++ b/configs/nucleo-f334r8/src/stm32_highpri.c @@ -250,7 +250,9 @@ void dma1ch1_handler(void) int highpri_main(int argc, char *argv[]) { +#ifdef CONFIG_STM32_ADC1_DMA FAR struct hrtim_dev_s *hrtim; +#endif FAR struct adc_dev_s *adc; FAR struct highpri_s *highpri; int ret;