From b9b09c00fa54a97610e4023e6ba44c2de80c5963 Mon Sep 17 00:00:00 2001 From: krzysztof-cabaj Date: Sun, 24 Mar 2024 19:32:12 +0100 Subject: [PATCH 1/2] boards/nucleo-c031c6: fix ADC config --- boards/nucleo-c031c6/include/periph_conf.h | 24 ++++++++-------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/boards/nucleo-c031c6/include/periph_conf.h b/boards/nucleo-c031c6/include/periph_conf.h index 8baf472410a4..8388c7917735 100644 --- a/boards/nucleo-c031c6/include/periph_conf.h +++ b/boards/nucleo-c031c6/include/periph_conf.h @@ -88,9 +88,9 @@ static const uart_conf_t uart_config[] = { * @name ADC configuration * * Note that we do not configure all ADC channels, - * and not in the STM32G071 order. Instead, we + * and not in the STM32C031 order. Instead, we * just define 6 ADC channels, for the Nucleo - * Arduino header pins A0-A5 and the internal VBAT channel. + * Arduino header pins A0-A5. * * To find appropriate device and channel find in the * board manual, table showing pin assignments and @@ -100,29 +100,23 @@ static const uart_conf_t uart_config[] = { * [X] - describes used channel - indexed from 1, * for example ARD_A5_IN16 is channel 16 * - * For Nucleo-G071RB this information is in board manual, - * Table 12, page 30. + * For Nucleo-C031C6 this information is in board manual, + * Table 11, page 20. * - * VBAT is connected to an internal input and voltage divider - * is used, so that only 1/3 of the actual VBAT is measured. This - * allows for a supply voltage higher than the reference voltage. + * STM32C031C6 do not have internal channel for VBAT, more details provided + * in the MCU datasheet - section 3.14, page 20. * - * For Nucleo-G071RB more information is provided in MCU datasheet, - * in section 3.14.3 - Vbat battery voltage monitoring, page 26. - * @{ */ static const adc_conf_t adc_config[] = { { .pin = GPIO_PIN(PORT_A, 0), .dev = 0, .chan = 0 }, /* ARD_A0_IN0 */ { .pin = GPIO_PIN(PORT_A, 1), .dev = 0, .chan = 1 }, /* ARD_A1_IN1 */ { .pin = GPIO_PIN(PORT_A, 4), .dev = 0, .chan = 4 }, /* ARD_A2_IN4 */ - { .pin = GPIO_PIN(PORT_B, 1), .dev = 0, .chan = 9 }, /* ARD_A3_IN9 */ - { .pin = GPIO_PIN(PORT_B, 11), .dev = 0, .chan = 15 }, /* ARD_A4_IN15 */ - { .pin = GPIO_PIN(PORT_B, 12), .dev = 0, .chan = 16 }, /* ARD_A5_IN16 */ - { .pin = GPIO_UNDEF, .dev = 0, .chan = 14}, /* VBAT */ + { .pin = GPIO_PIN(PORT_B, 1), .dev = 0, .chan = 18 }, /* ARD_A3_IN18 */ + { .pin = GPIO_PIN(PORT_A, 11), .dev = 0, .chan = 11 }, /* ARD_A4_IN11 */ + { .pin = GPIO_PIN(PORT_A, 12), .dev = 0, .chan = 12 }, /* ARD_A5_IN12 */ }; -#define VBAT_ADC ADC_LINE(6) /**< VBAT ADC line */ #define ADC_NUMOF ARRAY_SIZE(adc_config) /** @} */ From 2a89402694a544afb1b71300011a74a29adf6b9a Mon Sep 17 00:00:00 2001 From: krzysztof-cabaj Date: Mon, 25 Mar 2024 15:07:13 +0100 Subject: [PATCH 2/2] boards/nucleo-c031c6: add MCU table to documentation page --- boards/nucleo-c031c6/doc.txt | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/boards/nucleo-c031c6/doc.txt b/boards/nucleo-c031c6/doc.txt index 8a1d92043665..76f97a44eb60 100644 --- a/boards/nucleo-c031c6/doc.txt +++ b/boards/nucleo-c031c6/doc.txt @@ -8,6 +8,28 @@ The Nucleo-C031C6 is a board from ST's Nucleo family supporting a ARM Cortex-M0+ STM32C031C6 microcontroller with 12KiB of RAM and 32KiB of Flash. +### MCU + +| MCU | STM32C031C6 | +|:---------- |:------------------- | +| Family | ARM Cortex-M0+ | +| Vendor | ST Microelectronics | +| RAM | 12KiB | +| Flash | 32KiB | +| Frequency | up to 48MHz | +| FPU | no | +| Timers | 12 (2x watchdog, 1 SysTick, 5x 16-bit) | +| ADCs | 1x 12-bit (up to 19 channels) | +| UARTs | 2 | +| SPIs | 1 | +| I2Cs | 1 | +| RTC | 1 | +| Vcc | 2.0V - 3.6V | +| Datasheet | [Datasheet](https://www.st.com/resource/en/datasheet/stm32c031c6.pdf) | +| Reference Manual | [Reference Manual](https://www.st.com/resource/en/reference_manual/rm0490-stm32c0x1-advanced-armbased-32bit-mcus-stmicroelectronics.pdf) | +| Programming Manual | [Programming Manual](https://www.st.com/resource/en/programming_manual/pm0223-stm32-cortexm0-mcus-programming-manual-stmicroelectronics.pdf) | +| Board Manual | [Board Manual](https://www.st.com/resource/en/user_manual/um2953-stm32-nucleo64-board-mb1717-stmicroelectronics.pdf) | + ## Flashing the Board Using ST-LINK Removable Media On-board ST-LINK programmer provides via composite USB device removable media.