From 4b48a27aeec7419d24af205f3be29ac0f2643d2a Mon Sep 17 00:00:00 2001 From: raiden00pl Date: Tue, 17 Jun 2025 09:51:46 +0200 Subject: [PATCH] boards/nucleo-c071rb: add adcscope example add adcscope example for nucleo-c071rb Signed-off-by: raiden00pl --- .../applications/logging/nxscope/index.rst | 4 ++ .../stm32c0/boards/nucleo-c071rb/index.rst | 49 ++++++++++++++ .../nucleo-c071rb/configs/adcscope/defconfig | 64 +++++++++++++++++++ 3 files changed, 117 insertions(+) create mode 100644 boards/arm/stm32f0l0g0/nucleo-c071rb/configs/adcscope/defconfig diff --git a/Documentation/applications/logging/nxscope/index.rst b/Documentation/applications/logging/nxscope/index.rst index bb661bb319f..b54b78e890a 100644 --- a/Documentation/applications/logging/nxscope/index.rst +++ b/Documentation/applications/logging/nxscope/index.rst @@ -120,6 +120,10 @@ Several board configurations in NuttX use the NxScope library: - **sim:nxscope**: A configuration for the NuttX simulator that allows for easy testing and development of NxScope-related features on a host PC. +- **nucleo-c071rb:adcscope**: Uses UART and ST-LINK VCOM with the + :doc:`adcscope <../../system/adcscope/index>` application to stream + data from ADC channels. + External Tools ============== diff --git a/Documentation/platforms/arm/stm32c0/boards/nucleo-c071rb/index.rst b/Documentation/platforms/arm/stm32c0/boards/nucleo-c071rb/index.rst index ea4af4179d4..3e83719bc25 100644 --- a/Documentation/platforms/arm/stm32c0/boards/nucleo-c071rb/index.rst +++ b/Documentation/platforms/arm/stm32c0/boards/nucleo-c071rb/index.rst @@ -44,3 +44,52 @@ Enabled features: - ADC with DMA enabled using A0 and A1 pins - button with software debouncing enabled (no RC filter on the board) + +analogscope +----------- + +Configuration demonstrating ADC data stream using NxScope over UART +connected to VCOM. + +See :doc:`/applications/system/adcscope/index` for more details. + +Device detection with ``nxscli`` client:: + + $ nxscli serial /dev/ttyACM0 pdevinfo + INFO:nxscli:enable (0, , {}) + INFO:nxscli:connecting to nxs device... + INFO:nxscli:connected! + INFO:nxscli:started + + Device Summary + Channels: 6 + Divider support: no + Ack support: no + Flags: 0x00 + RX padding: 0 + + Stream + Connected: yes + Started: no + Overflow count: 0 + Bitrate: 0.0 B/s + + Channel State + Applied enabled: none + Buffered enabled: none + + Channels + +----+-------+-------+-----+-------+----+-----+ + | ID | Name | Type | Dim | Valid | En | Div | + +====+=======+=======+=====+=======+====+=====+ + | 0 | chan0 | INT16 | 1 | yes | no | 0 | + | 1 | chan1 | INT16 | 1 | yes | no | 0 | + | 2 | chan2 | INT16 | 1 | yes | no | 0 | + | 3 | chan3 | INT16 | 1 | yes | no | 0 | + | 4 | chan4 | INT16 | 1 | yes | no | 0 | + | 5 | chan5 | INT16 | 1 | yes | no | 0 | + +----+-------+-------+-----+-------+----+-----+ + + closing... + INFO:nxscli:disconnecting from nxs device... + INFO:nxscli:disconnected! diff --git a/boards/arm/stm32f0l0g0/nucleo-c071rb/configs/adcscope/defconfig b/boards/arm/stm32f0l0g0/nucleo-c071rb/configs/adcscope/defconfig new file mode 100644 index 00000000000..7cd076409b3 --- /dev/null +++ b/boards/arm/stm32f0l0g0/nucleo-c071rb/configs/adcscope/defconfig @@ -0,0 +1,64 @@ +# +# This file is autogenerated: PLEASE DO NOT EDIT IT. +# +# You can use "make menuconfig" to make any modifications to the installed .config file. +# You can then do "make savedefconfig" to generate a new defconfig file that includes your +# modifications. +# +# CONFIG_DEV_CONSOLE is not set +# CONFIG_LIBC_LONG_LONG is not set +# CONFIG_STM32F0G0L0_USE_LEGACY_PINMAP is not set +# CONFIG_SYSTEM_DD is not set +CONFIG_ADC=y +CONFIG_ANALOG=y +CONFIG_ARCH="arm" +CONFIG_ARCH_BOARD="nucleo-c071rb" +CONFIG_ARCH_BOARD_NUCLEO_C071RB=y +CONFIG_ARCH_BUTTONS=y +CONFIG_ARCH_CHIP="stm32f0l0g0" +CONFIG_ARCH_CHIP_STM32C071RB=y +CONFIG_ARCH_CHIP_STM32C071XX=y +CONFIG_ARCH_CHIP_STM32C0=y +CONFIG_ARCH_IRQBUTTONS=y +CONFIG_ARCH_STACKDUMP=y +CONFIG_BOARDCTL=y +CONFIG_BOARDCTL_MKRD=y +CONFIG_BOARD_LATE_INITIALIZE=y +CONFIG_BOARD_LOOPSPERMSEC=3997 +CONFIG_BUILTIN=y +CONFIG_DEBUG_ASSERTIONS=y +CONFIG_DEBUG_ASSERTIONS_EXPRESSION=y +CONFIG_DEBUG_CUSTOMOPT=y +CONFIG_DEBUG_FEATURES=y +CONFIG_DEBUG_OPTLEVEL="-O1" +CONFIG_DEBUG_SYMBOLS=y +CONFIG_INIT_ENTRYPOINT="adcscope_main" +CONFIG_INTELHEX_BINARY=y +CONFIG_LINE_MAX=64 +CONFIG_LOGGING_NXSCOPE=y +CONFIG_LOGGING_NXSCOPE_INTF_SERIAL=y +CONFIG_NDEBUG=y +CONFIG_NFILE_DESCRIPTORS_PER_BLOCK=6 +CONFIG_NUNGET_CHARS=0 +CONFIG_PTHREAD_MUTEX_UNSAFE=y +CONFIG_RAM_SIZE=24576 +CONFIG_RAM_START=0x20000000 +CONFIG_RAW_BINARY=y +CONFIG_RR_INTERVAL=200 +CONFIG_SCHED_WAITPID=y +CONFIG_START_DAY=19 +CONFIG_START_MONTH=5 +CONFIG_START_YEAR=2013 +CONFIG_STM32F0L0G0_ADC1=y +CONFIG_STM32F0L0G0_ADC1_DMA=y +CONFIG_STM32F0L0G0_ADC1_DMA_CFG=1 +CONFIG_STM32F0L0G0_ADC1_SAMPLE_FREQUENCY=10 +CONFIG_STM32F0L0G0_ADC1_TIMTRIG=3 +CONFIG_STM32F0L0G0_DMA1=y +CONFIG_STM32F0L0G0_TIM1=y +CONFIG_STM32F0L0G0_TIM1_ADC=y +CONFIG_STM32F0L0G0_USART2=y +CONFIG_SYSTEM_ADCSCOPE=y +CONFIG_SYSTEM_ADCSCOPE_FETCH_INTERVAL=0 +CONFIG_SYSTEM_ADCSCOPE_SERIAL_PATH="/dev/ttyS0" +CONFIG_TASK_NAME_SIZE=32