Skip to content

Commit be61f9b

Browse files
committed
boards/arm: add nucleo-c092rc support
add nucleo-c092rc support Signed-off-by: raiden00pl <[email protected]>
1 parent 0de4bd7 commit be61f9b

File tree

19 files changed

+1438
-0
lines changed

19 files changed

+1438
-0
lines changed

Documentation/platforms/arm/stm32c0/boards/nucleo-c071rb/index.rst

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ ST Nucleo C071RB
44

55
The Nucleo C071RB is a member of the Nucleo-64 board family.
66

7+
USB not supported yet.
8+
79
Buttons
810
=======
911

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
================
2+
ST Nucleo C092RC
3+
================
4+
5+
The Nucleo C092RC is a member of the Nucleo-64 board family.
6+
7+
CANFD not supported yet.
8+
9+
Buttons
10+
=======
11+
12+
B1 USER: the user button is connected to the I/O PC13 of the STM32
13+
microcontroller.
14+
15+
Serial Console
16+
==============
17+
18+
At default USART2 connected to "Virtual COM Port" is used as serial console.
19+
20+
Configurations
21+
==============
22+
23+
jumbo
24+
-----
25+
26+
This configuration enables many Apache NuttX features. This is
27+
mostly to help provide additional code coverage in CI, but also
28+
allows for a users to see a wide range of features that are
29+
supported by the OS.
30+
31+
Enabled features:
32+
33+
- NSH
34+
35+
- ADC with DMA enabled using A0 and A1 pins
36+
37+
- button with software debouncing enabled (no RC filter on the board)

boards/Kconfig

+13
Original file line numberDiff line numberDiff line change
@@ -2692,6 +2692,15 @@ config ARCH_BOARD_NUCLEO_C071RB
26922692
---help---
26932693
STMicro NUCLEO C071RB board based on the STMicro STM32C071RB MCU.
26942694

2695+
config ARCH_BOARD_NUCLEO_C092RC
2696+
bool "STMicro Nucleo C092RC board"
2697+
depends on ARCH_CHIP_STM32C092RC
2698+
select ARCH_HAVE_LEDS
2699+
select ARCH_HAVE_BUTTONS
2700+
select ARCH_HAVE_IRQBUTTONS
2701+
---help---
2702+
STMicro NUCLEO C092RC board based on the STMicro STM32C092RC MCU.
2703+
26952704
config ARCH_BOARD_STM32F3_DISCOVERY
26962705
bool "STMicro STM32F3-Discovery board"
26972706
depends on ARCH_CHIP_STM32F303VC
@@ -3647,6 +3656,7 @@ config ARCH_BOARD
36473656
default "stm32f051-discovery" if ARCH_BOARD_STM32F051_DISCOVERY
36483657
default "stm32f072-discovery" if ARCH_BOARD_STM32F072_DISCOVERY
36493658
default "nucleo-c071rb" if ARCH_BOARD_NUCLEO_C071RB
3659+
default "nucleo-c092rc" if ARCH_BOARD_NUCLEO_C092RC
36503660
default "stm32f103-minimum" if ARCH_BOARD_STM32F103_MINIMUM
36513661
default "stm32f411-minimum" if ARCH_BOARD_STM32F411_MINIMUM
36523662
default "stm3210e-eval" if ARCH_BOARD_STM3210E_EVAL
@@ -4200,6 +4210,9 @@ endif
42004210
if ARCH_BOARD_NUCLEO_C071RB
42014211
source "boards/arm/stm32f0l0g0/nucleo-c071rb/Kconfig"
42024212
endif
4213+
if ARCH_BOARD_NUCLEO_C092RC
4214+
source "boards/arm/stm32f0l0g0/nucleo-c092rc/Kconfig"
4215+
endif
42034216
if ARCH_BOARD_NUCLEO_F722ZE
42044217
source "boards/arm/stm32f7/nucleo-f722ze/Kconfig"
42054218
endif
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# ##############################################################################
2+
# boards/arm/stm32f0l0g0/nucleo-c092rc/CMakeLists.txt
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
7+
# license agreements. See the NOTICE file distributed with this work for
8+
# additional information regarding copyright ownership. The ASF licenses this
9+
# file to you under the Apache License, Version 2.0 (the "License"); you may not
10+
# use this file except in compliance with the License. You may obtain a copy of
11+
# the License at
12+
#
13+
# http://www.apache.org/licenses/LICENSE-2.0
14+
#
15+
# Unless required by applicable law or agreed to in writing, software
16+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
17+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
18+
# License for the specific language governing permissions and limitations under
19+
# the License.
20+
#
21+
# ##############################################################################
22+
23+
add_subdirectory(src)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#
2+
# For a description of the syntax of this configuration file,
3+
# see the file kconfig-language.txt in the NuttX tools repository.
4+
#
5+
6+
if ARCH_BOARD_NUCLEO_C092RC
7+
8+
endif
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
#
2+
# This file is autogenerated: PLEASE DO NOT EDIT IT.
3+
#
4+
# You can use "make menuconfig" to make any modifications to the installed .config file.
5+
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
6+
# modifications.
7+
#
8+
# CONFIG_LIBC_LONG_LONG is not set
9+
# CONFIG_NSH_ARGCAT is not set
10+
# CONFIG_STM32F0G0L0_USE_LEGACY_PINMAP is not set
11+
CONFIG_ADC=y
12+
CONFIG_ANALOG=y
13+
CONFIG_ARCH="arm"
14+
CONFIG_ARCH_BOARD="nucleo-c092rc"
15+
CONFIG_ARCH_BOARD_NUCLEO_C092RC=y
16+
CONFIG_ARCH_BUTTONS=y
17+
CONFIG_ARCH_CHIP="stm32f0l0g0"
18+
CONFIG_ARCH_CHIP_STM32C092RC=y
19+
CONFIG_ARCH_CHIP_STM32C092XX=y
20+
CONFIG_ARCH_CHIP_STM32C0=y
21+
CONFIG_ARCH_IRQBUTTONS=y
22+
CONFIG_ARCH_STACKDUMP=y
23+
CONFIG_BOARDCTL=y
24+
CONFIG_BOARD_LATE_INITIALIZE=y
25+
CONFIG_BOARD_LOOPSPERMSEC=3997
26+
CONFIG_BUILTIN=y
27+
CONFIG_DEBUG_FEATURES=y
28+
CONFIG_DEBUG_FULLOPT=y
29+
CONFIG_DEBUG_SYMBOLS=y
30+
CONFIG_DEV_GPIO=y
31+
CONFIG_DISABLE_ENVIRON=y
32+
CONFIG_DISABLE_MOUNTPOINT=y
33+
CONFIG_DISABLE_MQUEUE=y
34+
CONFIG_DISABLE_POSIX_TIMERS=y
35+
CONFIG_DISABLE_PSEUDOFS_OPERATIONS=y
36+
CONFIG_EXAMPLES_ADC=y
37+
CONFIG_EXAMPLES_ADC_GROUPSIZE=2
38+
CONFIG_EXAMPLES_ADC_SWTRIG=y
39+
CONFIG_EXAMPLES_BUTTONS=y
40+
CONFIG_EXAMPLES_HELLO=y
41+
CONFIG_EXAMPLES_WATCHDOG=y
42+
CONFIG_INIT_ENTRYPOINT="nsh_main"
43+
CONFIG_INIT_STACKSIZE=1536
44+
CONFIG_INPUT=y
45+
CONFIG_INPUT_BUTTONS=y
46+
CONFIG_INPUT_BUTTONS_DEBOUNCE_DELAY=10
47+
CONFIG_INPUT_BUTTONS_LOWER=y
48+
CONFIG_INTELHEX_BINARY=y
49+
CONFIG_LINE_MAX=64
50+
CONFIG_NFILE_DESCRIPTORS_PER_BLOCK=6
51+
CONFIG_NSH_BUILTIN_APPS=y
52+
CONFIG_NSH_FILEIOSIZE=64
53+
CONFIG_NSH_READLINE=y
54+
CONFIG_NUNGET_CHARS=0
55+
CONFIG_POSIX_SPAWN_DEFAULT_STACKSIZE=1536
56+
CONFIG_PTHREAD_MUTEX_UNSAFE=y
57+
CONFIG_PTHREAD_STACK_DEFAULT=1536
58+
CONFIG_RAM_SIZE=30720
59+
CONFIG_RAM_START=0x20000000
60+
CONFIG_RAW_BINARY=y
61+
CONFIG_RR_INTERVAL=200
62+
CONFIG_SCHED_WAITPID=y
63+
CONFIG_START_DAY=19
64+
CONFIG_START_MONTH=5
65+
CONFIG_START_YEAR=2013
66+
CONFIG_STDIO_DISABLE_BUFFERING=y
67+
CONFIG_STM32F0L0G0_ADC1=y
68+
CONFIG_STM32F0L0G0_DMA1=y
69+
CONFIG_STM32F0L0G0_IWDG=y
70+
CONFIG_STM32F0L0G0_USART2=y
71+
CONFIG_STM32F0L0G0_WWDG=y
72+
CONFIG_SYSTEM_NSH=y
73+
CONFIG_TASK_NAME_SIZE=0
74+
CONFIG_USART2_SERIAL_CONSOLE=y
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
/****************************************************************************
2+
* boards/arm/stm32f0l0g0/nucleo-c092rc/include/board.h
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*
6+
* Licensed to the Apache Software Foundation (ASF) under one or more
7+
* contributor license agreements. See the NOTICE file distributed with
8+
* this work for additional information regarding copyright ownership. The
9+
* ASF licenses this file to you under the Apache License, Version 2.0 (the
10+
* "License"); you may not use this file except in compliance with the
11+
* License. You may obtain a copy of the License at
12+
*
13+
* http://www.apache.org/licenses/LICENSE-2.0
14+
*
15+
* Unless required by applicable law or agreed to in writing, software
16+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
17+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
18+
* License for the specific language governing permissions and limitations
19+
* under the License.
20+
*
21+
****************************************************************************/
22+
23+
#ifndef __BOARDS_ARM_STM32F0L0G0_NUCLEO_C092RC_INCLUDE_BOARD_H
24+
#define __BOARDS_ARM_STM32F0L0G0_NUCLEO_C092RC_INCLUDE_BOARD_H
25+
26+
/****************************************************************************
27+
* Included Files
28+
****************************************************************************/
29+
30+
#include <nuttx/config.h>
31+
32+
#ifndef __ASSEMBLY__
33+
# include <stdint.h>
34+
#endif
35+
36+
/****************************************************************************
37+
* Pre-processor Definitions
38+
****************************************************************************/
39+
40+
/* Clocking *****************************************************************/
41+
42+
/* HSI - Internal 48 MHz RC Oscillator
43+
* LSI - 32 KHz RC
44+
* HSE - 8 MHz from MCO output of ST-LINK (disabled by default)
45+
* LSE - 32.768 kHz
46+
*/
47+
48+
#define STM32_BOARD_XTAL 8000000ul /* 8MHz */
49+
50+
#define STM32_HSI_FREQUENCY 48000000ul /* 48MHz */
51+
#define STM32_LSI_FREQUENCY 32000 /* Between 30kHz and 60kHz */
52+
#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL
53+
#define STM32_LSE_FREQUENCY 32768 /* X2 on board */
54+
55+
/* Configure HSI48 clock division factor (48 MHz) */
56+
57+
#define STM32_RCC_HSIDIV RCC_CR_HSIDIV_HSI
58+
59+
/* Use the HSI as SYSCLK source (48 MHz) */
60+
61+
#define STM32_SYSCLK_SW RCC_CFGR_SW_HSI
62+
#define STM32_SYSCLK_SWS RCC_CFGR_SWS_HSI
63+
#define STM32_SYSCLK_FREQUENCY (STM32_HSI_FREQUENCY)
64+
65+
/* AHB clock (HCLK) is SYSCLK (48 MHz) */
66+
67+
#define STM32_RCC_CFGR_HPRE RCC_CFGR_HPRE_SYSCLK
68+
#define STM32_HCLK_FREQUENCY STM32_SYSCLK_FREQUENCY
69+
70+
/* APB1 clock (PCLK) is HCLK (48 MHz) */
71+
72+
#define STM32_RCC_CFGR_PPRE RCC_CFGR_PPRE_HCLK
73+
#define STM32_PCLK1_FREQUENCY STM32_HCLK_FREQUENCY
74+
75+
/* LED definitions **********************************************************/
76+
77+
/* LED index values for use with board_userled() */
78+
79+
#define BOARD_LED1 0 /* User LD1 */
80+
#define BOARD_LED2 1 /* User LD2 */
81+
#define BOARD_NLEDS 2
82+
83+
/* LED bits for use with board_userled_all() */
84+
85+
#define BOARD_LED1_BIT (1 << BOARD_LED1)
86+
#define BOARD_LED2_BIT (1 << BOARD_LED2)
87+
88+
/* If CONFIG_ARCH_LEDs is defined, then NuttX will control the LED on the
89+
* board. The following definitions describe how NuttX controls
90+
* the LED:
91+
*
92+
* SYMBOL Meaning LED1 state
93+
* ------------------ ----------------------- ----------
94+
* LED_STARTED NuttX has been started OFF
95+
* LED_HEAPALLOCATE Heap has been allocated OFF
96+
* LED_IRQSENABLED Interrupts enabled OFF
97+
* LED_STACKCREATED Idle stack created ON
98+
* LED_INIRQ In an interrupt No change
99+
* LED_SIGNAL In a signal handler No change
100+
* LED_ASSERTION An assertion failed No change
101+
* LED_PANIC The system has crashed Blinking
102+
* LED_IDLE STM32 is is sleep mode Not used
103+
*/
104+
105+
#define LED_STARTED 0
106+
#define LED_HEAPALLOCATE 0
107+
#define LED_IRQSENABLED 0
108+
#define LED_STACKCREATED 1
109+
#define LED_INIRQ 2
110+
#define LED_SIGNAL 2
111+
#define LED_ASSERTION 2
112+
#define LED_PANIC 1
113+
114+
/* Button definitions *******************************************************/
115+
116+
/* Nucleo C092RC board supports two buttons; only one button is controllable
117+
* by software:
118+
*
119+
* B1 USER: user button connected to STM32 I/O PC13.
120+
* B2 RESET: push button connected to NRST; used to RESET the MCU.
121+
*/
122+
123+
#define BUTTON_USER 0 /* User B1 */
124+
#define NUM_BUTTONS 1
125+
126+
#define BUTTON_USER_BIT (1 << BUTTON_USER)
127+
128+
/* Alternate function pin selections ****************************************/
129+
130+
/* USART */
131+
132+
/* USART1 at arduino D0/D1:
133+
* USART1_RX - PB6
134+
* USART1_TX - PB7
135+
*/
136+
137+
#define GPIO_USART1_RX (GPIO_USART2_RX_2|GPIO_SPEED_HIGH) /* PB6 */
138+
#define GPIO_USART1_TX (GPIO_USART2_TX_2|GPIO_SPEED_HIGH) /* PB7 */
139+
140+
/* USART1 RS485_DIR - PA8 (arduino D7)
141+
* (compatible with RS485 Waveshare shield)
142+
*/
143+
144+
#define GPIO_USART1_RS485_DIR (GPIO_OUTPUT | GPIO_PUSHPULL | \
145+
GPIO_SPEED_HIGH | GPIO_OUTPUT_CLEAR | \
146+
GPIO_PORTA | GPIO_PIN8)
147+
148+
/* By default the USART2 is connected to STLINK Virtual COM Port:
149+
* USART2_RX - PA3
150+
* USART2_TX - PA2
151+
*/
152+
153+
#define GPIO_USART2_RX (GPIO_USART2_RX_1|GPIO_SPEED_HIGH) /* PA3 */
154+
#define GPIO_USART2_TX (GPIO_USART2_TX_1|GPIO_SPEED_HIGH) /* PA2 */
155+
156+
/* DMA channels *************************************************************/
157+
158+
/* ADC */
159+
160+
#define ADC1_DMA_CHAN DMAMAP_DMA1_ADC1 /* DMA1 */
161+
162+
#endif /* __BOARDS_ARM_STM32F0L0G0_NUCLEO_C092RC_INCLUDE_BOARD_H */
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
############################################################################
2+
# boards/arm/stm32f0l0g0/nucleo-c092rc/scripts/Make.defs
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
# Licensed to the Apache Software Foundation (ASF) under one or more
7+
# contributor license agreements. See the NOTICE file distributed with
8+
# this work for additional information regarding copyright ownership. The
9+
# ASF licenses this file to you under the Apache License, Version 2.0 (the
10+
# "License"); you may not use this file except in compliance with the
11+
# License. You may obtain a copy of the License at
12+
#
13+
# http://www.apache.org/licenses/LICENSE-2.0
14+
#
15+
# Unless required by applicable law or agreed to in writing, software
16+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
17+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
18+
# License for the specific language governing permissions and limitations
19+
# under the License.
20+
#
21+
############################################################################
22+
23+
include $(TOPDIR)/.config
24+
include $(TOPDIR)/tools/Config.mk
25+
include $(TOPDIR)/arch/arm/src/armv6-m/Toolchain.defs
26+
27+
LDSCRIPT = flash.ld
28+
ARCHSCRIPT += $(BOARD_DIR)$(DELIM)scripts$(DELIM)$(LDSCRIPT)
29+
30+
ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10
31+
32+
CFLAGS := $(ARCHCFLAGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS)
33+
CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS)
34+
CXXFLAGS := $(ARCHCXXFLAGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS)
35+
CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS)
36+
CPPFLAGS := $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS)
37+
AFLAGS := $(CFLAGS) -D__ASSEMBLY__
38+
39+
NXFLATLDFLAGS1 = -r -d -warn-common
40+
NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
41+
LDNXFLATFLAGS = -e main -s 2048

0 commit comments

Comments
 (0)