Skip to content

Commit 330e6ae

Browse files
committed
feat: Add variant NUCLEO-C071RB
Fixes stm32duino#2537
1 parent 7a2786a commit 330e6ae

File tree

4 files changed

+386
-0
lines changed

4 files changed

+386
-0
lines changed

Diff for: README.md

+1
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ User can add a STM32 based board following this [wiki](https://github.com/stm32d
125125
| Status | Device(s) | Name | Release | Notes |
126126
| :----: | :-------: | ---- | :-----: | :---- |
127127
| :green_heart: | STM32C031C6 | [Nucleo C031C6](https://www.st.com/en/evaluation-tools/nucleo-c031c6.html) | *2.5.0* | |
128+
| :yellow_heart: | STM32C071RB | [Nucleo C071RB](https://www.st.com/en/evaluation-tools/nucleo-c071rb.html) | **2.9.0** | |
128129
| :green_heart: | STM32F030R8 | [Nucleo F030R8](http://www.st.com/en/evaluation-tools/nucleo-f030r8.html) | *0.2.0* | |
129130
| :green_heart: | STM32F070RB | [Nucleo F070RB](http://www.st.com/en/evaluation-tools/nucleo-f070rb.html) | *2.0.0* | |
130131
| :green_heart: | STM32F072RB | [Nucleo F072RB](http://www.st.com/en/evaluation-tools/nucleo-f072rb.html) | *1.9.0* | |

Diff for: boards.txt

+12
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,18 @@ Nucleo_64.menu.pnum.NUCLEO_C031C6.build.st_extra_flags=-D{build.product_line} {b
439439
Nucleo_64.menu.pnum.NUCLEO_C031C6.openocd.target=stm32c0x
440440
Nucleo_64.menu.pnum.NUCLEO_C031C6.debug.svd_file={runtime.tools.STM32_SVD.path}/svd/STM32C0xx/STM32C031.svd
441441

442+
# NUCLEO_C071RB board
443+
Nucleo_64.menu.pnum.NUCLEO_C071RB=Nucleo C071RB
444+
Nucleo_64.menu.pnum.NUCLEO_C071RB.node="NOD_C071RB"
445+
Nucleo_64.menu.pnum.NUCLEO_C071RB.upload.maximum_size=131072
446+
Nucleo_64.menu.pnum.NUCLEO_C071RB.upload.maximum_data_size=24576
447+
Nucleo_64.menu.pnum.NUCLEO_C071RB.build.mcu=cortex-m0plus
448+
Nucleo_64.menu.pnum.NUCLEO_C071RB.build.board=NUCLEO_C071RB
449+
Nucleo_64.menu.pnum.NUCLEO_C071RB.build.series=STM32C0xx
450+
Nucleo_64.menu.pnum.NUCLEO_C071RB.build.product_line=STM32C071xx
451+
Nucleo_64.menu.pnum.NUCLEO_C071RB.build.variant=STM32C0xx/C071R(8-B)T
452+
Nucleo_64.menu.pnum.NUCLEO_C071RB.build.st_extra_flags=-D{build.product_line} {build.xSerial} -D__CORTEX_SC=0
453+
442454
# NUCLEO_F030R8 board
443455
Nucleo_64.menu.pnum.NUCLEO_F030R8=Nucleo F030R8
444456
Nucleo_64.menu.pnum.NUCLEO_F030R8.node="NODE_F030R8,NUCLEO"
+151
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
/*
2+
*******************************************************************************
3+
* Copyright (c) 2020, STMicroelectronics
4+
* All rights reserved.
5+
*
6+
* This software component is licensed by ST under BSD 3-Clause license,
7+
* the "License"; You may not use this file except in compliance with the
8+
* License. You may obtain a copy of the License at:
9+
* opensource.org/licenses/BSD-3-Clause
10+
*
11+
*******************************************************************************
12+
*/
13+
#if defined(ARDUINO_NUCLEO_G071RB)
14+
#include "pins_arduino.h"
15+
#include "stm32yyxx_ll_utils.h"
16+
17+
// Digital PinName array
18+
const PinName digitalPin[] = {
19+
PA_0, // D0/A0
20+
PA_1, // D1/A1
21+
PA_2, // D2/A2
22+
PA_3, // D3/A3
23+
PA_4, // D4/A4
24+
PA_5, // D5/A5
25+
PA_6, // D6/A6
26+
PA_7, // D7/A7
27+
PA_8, // D8/A8
28+
PA_9, // D9
29+
PA_10, // D10
30+
PA_11, // D11
31+
PA_12, // D12
32+
PA_13, // D13/A9
33+
PA_14, // D14/A10
34+
PA_15, // D15
35+
PB_0, // D16/A11
36+
PB_1, // D17/A12
37+
PB_2, // D18/A13
38+
PB_3, // D19
39+
PB_4, // D20
40+
PB_5, // D21
41+
PB_6, // D22
42+
PB_7, // D23
43+
PB_8, // D24
44+
PB_9, // D25
45+
PB_10, // D26/A14
46+
PB_11, // D27/A15
47+
PB_12, // D28/A16
48+
PB_13, // D29
49+
PB_14, // D30
50+
PB_15, // D31
51+
PC_0, // D32
52+
PC_1, // D33
53+
PC_2, // D34
54+
PC_3, // D35
55+
PC_4, // D36/A17
56+
PC_5, // D37/A18
57+
PC_6, // D38
58+
PC_7, // D39
59+
PC_8, // D40
60+
PC_9, // D41
61+
PC_10, // D42
62+
PC_11, // D43
63+
PC_12, // D44
64+
PC_13, // D45
65+
PC_14, // D46
66+
PC_15, // D47
67+
PD_0, // D48
68+
PD_1, // D49
69+
PD_2, // D50
70+
PD_3, // D51
71+
PD_4, // D52
72+
PD_5, // D53
73+
PD_6, // D54
74+
PD_8, // D55
75+
PD_9, // D56
76+
PF_0, // D57
77+
PF_1, // D58
78+
PF_2, // D59
79+
PF_3 // D60
80+
};
81+
82+
// Analog (Ax) pin number array
83+
const uint32_t analogInputPin[] = {
84+
0, // A0, PA0
85+
1, // A1, PA1
86+
2, // A2, PA2
87+
3, // A3, PA3
88+
4, // A4, PA4
89+
5, // A5, PA5
90+
6, // A6, PA6
91+
7, // A7, PA7
92+
8, // A8, PA8
93+
13, // A9, PA13
94+
14, // A10, PA14
95+
16, // A11, PB0
96+
17, // A12, PB1
97+
18, // A13, PB2
98+
26, // A14, PB10
99+
27, // A15, PB11
100+
28, // A16, PB12
101+
36, // A17, PC4
102+
37 // A18, PC5
103+
};
104+
105+
// ----------------------------------------------------------------------------
106+
#ifdef __cplusplus
107+
extern "C" {
108+
#endif
109+
110+
/**
111+
* @brief System Clock Configuration
112+
* @param None
113+
* @retval None
114+
*/
115+
WEAK void SystemClock_Config(void)
116+
{
117+
LL_FLASH_SetLatency(LL_FLASH_LATENCY_1);
118+
119+
/* HSI configuration and activation */
120+
LL_RCC_HSI_Enable();
121+
while (LL_RCC_HSI_IsReady() != 1)
122+
{
123+
}
124+
125+
LL_RCC_HSI_SetCalibTrimming(64);
126+
LL_RCC_SetHSIDiv(LL_RCC_HSI_DIV_1);
127+
/* Set AHB prescaler*/
128+
LL_RCC_SetAHBPrescaler(LL_RCC_HCLK_DIV_1);
129+
130+
/* Sysclk activation on the HSI */
131+
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_HSI);
132+
while (LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_HSI)
133+
{
134+
}
135+
136+
/* Set APB1 prescaler*/
137+
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
138+
/* Update CMSIS variable (which can be updated also through SystemCoreClockUpdate function) */
139+
LL_SetSystemCoreClock(48000000);
140+
141+
/* Update the time base */
142+
if (HAL_InitTick(TICK_INT_PRIORITY) != HAL_OK)
143+
{
144+
Error_Handler();
145+
}
146+
}
147+
148+
#ifdef __cplusplus
149+
}
150+
#endif
151+
#endif /* ARDUINO_NUCLEO_G071RB */

0 commit comments

Comments
 (0)