Skip to content

Commit 1070737

Browse files
JongHyeon Leefpistm
JongHyeon Lee
andcommitted
Add Aurora One Variant
https://www.bfykorea.com/aurora-one/ Supersede stm32duino#1176 Signed-off-by: JongHyeon Lee <[email protected]> Co-authored-by: Frederic.Pillon <[email protected]>
1 parent 46158a3 commit 1070737

File tree

7 files changed

+419
-2
lines changed

7 files changed

+419
-2
lines changed

Diff for: README.md

+1
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ User can add a STM32 based board following this [wiki](https://github.com/stm32d
209209

210210
| Status | Device(s) | Name | Release | Notes |
211211
| :----: | :-------: | ---- | :-----: | :---- |
212+
| :yellow_heart: | STM32G030K8 | [Aurora One](https://www.bfykorea.com/aurora-one) | **2.0.0** |
212213
| :yellow_heart: | STM32G031K6<br>STM32G030K8 | Generic Board | **2.0.0** | |
213214
| :yellow_heart: | STM32G031J4<br>STM32G031J6 | Generic Board | **2.0.0** | |
214215
| :yellow_heart: | STM32G071R6<br>STM32G071R8<br>STM32G071RB | Generic Board | **2.0.0** | |

Diff for: boards.txt

+8
Original file line numberDiff line numberDiff line change
@@ -1661,6 +1661,14 @@ GenG0.menu.pnum.Generic_G030K8.build.board=GENERIC_G030K8
16611661
GenG0.menu.pnum.Generic_G030K8.build.product_line=STM32G030xx
16621662
GenG0.menu.pnum.Generic_G030K8.build.variant=STM32G0xx/Generic_G030Kx
16631663

1664+
# Aurora One G030K8
1665+
GenG0.menu.pnum.AURORA_ONE=Aurora One
1666+
GenG0.menu.pnum.AURORA_ONE.upload.maximum_size=65536
1667+
GenG0.menu.pnum.AURORA_ONE.upload.maximum_data_size=16384
1668+
GenG0.menu.pnum.AURORA_ONE.build.board=Aurora_One
1669+
GenG0.menu.pnum.AURORA_ONE.build.product_line=STM32G030xx
1670+
GenG0.menu.pnum.AURORA_ONE.build.variant=STM32G0xx/Generic_G030Kx
1671+
16641672
# Generic G031J4
16651673
GenG0.menu.pnum.Generic_G031J4=Generic G031J4
16661674
GenG0.menu.pnum.Generic_G031J4.upload.maximum_size=16384

Diff for: variants/Aurora_One_G030K8/PeripheralPins.c

+156
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
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+
* Automatically generated from STM32G030K(6-8)Tx.xml
13+
*/
14+
#include "Arduino.h"
15+
#include "PeripheralPins.h"
16+
17+
/* =====
18+
* Note: Commented lines are alternative possibilities which are not used per default.
19+
* If you change them, you will have to know what you do
20+
* =====
21+
*/
22+
23+
//*** ADC ***
24+
25+
#ifdef HAL_ADC_MODULE_ENABLED
26+
WEAK const PinMap PinMap_ADC[] = {
27+
{PA_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0, 0)}, // ADC1_IN0
28+
{PA_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC1_IN1
29+
{PA_2, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC1_IN2
30+
{PA_3, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC1_IN3
31+
{PA_4, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC1_IN4
32+
{PA_5, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC1_IN5
33+
{PA_6, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC1_IN6
34+
{PA_7, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC1_IN7
35+
{PB_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC1_IN8
36+
{PB_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC1_IN9
37+
{NC, NP, 0}
38+
};
39+
#endif
40+
41+
//*** No DAC ***
42+
43+
//*** I2C ***
44+
45+
#ifdef HAL_I2C_MODULE_ENABLED
46+
WEAK const PinMap PinMap_I2C_SDA[] = {
47+
{PA_12, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF6_I2C2)},
48+
{PB_7, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF6_I2C1)},
49+
{NC, NP, 0}
50+
};
51+
#endif
52+
53+
#ifdef HAL_I2C_MODULE_ENABLED
54+
WEAK const PinMap PinMap_I2C_SCL[] = {
55+
{PA_11, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF6_I2C2)},
56+
{PB_6, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF6_I2C1)},
57+
{NC, NP, 0}
58+
};
59+
#endif
60+
61+
//*** PWM ***
62+
63+
#ifdef HAL_TIM_MODULE_ENABLED
64+
WEAK const PinMap PinMap_PWM[] = {
65+
{PA_6, TIM16, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM16, 1, 0)}, // TIM16_CH1
66+
{PA_7, TIM14, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM14, 1, 0)}, // TIM14_CH1
67+
{PA_8, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM1, 1, 0)}, // TIM1_CH1
68+
{PA_10, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM1, 3, 0)}, // TIM1_CH3
69+
{PA_11, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM1, 4, 0)}, // TIM1_CH4
70+
{PB_0, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM3, 3, 0)}, // TIM3_CH3
71+
{PB_1, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM3, 4, 0)}, // TIM3_CH4
72+
{PB_3, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 0)}, // TIM1_CH2
73+
{PB_4, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM3, 1, 0)}, // TIM3_CH1
74+
{PB_5, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM3, 2, 0)}, // TIM3_CH2
75+
{PB_9, TIM17, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM17, 1, 0)}, // TIM17_CH1
76+
{NC, NP, 0}
77+
};
78+
#endif
79+
80+
//*** SERIAL ***
81+
82+
#ifdef HAL_UART_MODULE_ENABLED
83+
WEAK const PinMap PinMap_UART_TX[] = {
84+
{PA_2, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_USART2)},
85+
{PA_9, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_USART1)},
86+
{NC, NP, 0}
87+
};
88+
#endif
89+
90+
#ifdef HAL_UART_MODULE_ENABLED
91+
WEAK const PinMap PinMap_UART_RX[] = {
92+
{PA_3, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_USART2)},
93+
{PA_10, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_USART1)},
94+
{NC, NP, 0}
95+
};
96+
#endif
97+
98+
#ifdef HAL_UART_MODULE_ENABLED
99+
WEAK const PinMap PinMap_UART_RTS[] = {
100+
{PA_1, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_USART2)},
101+
{PB_3, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART1)},
102+
{NC, NP, 0}
103+
};
104+
#endif
105+
106+
#ifdef HAL_UART_MODULE_ENABLED
107+
WEAK const PinMap PinMap_UART_CTS[] = {
108+
{PA_0, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_USART2)},
109+
{PB_4, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART1)},
110+
{NC, NP, 0}
111+
};
112+
#endif
113+
114+
//*** SPI ***
115+
116+
#ifdef HAL_SPI_MODULE_ENABLED
117+
WEAK const PinMap PinMap_SPI_MOSI[] = {
118+
{PB_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)},
119+
{PB_7, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_SPI2)},
120+
{NC, NP, 0}
121+
};
122+
#endif
123+
124+
#ifdef HAL_SPI_MODULE_ENABLED
125+
WEAK const PinMap PinMap_SPI_MISO[] = {
126+
{PA_6, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)},
127+
{PB_2, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_SPI2)},
128+
{NC, NP, 0}
129+
};
130+
#endif
131+
132+
#ifdef HAL_SPI_MODULE_ENABLED
133+
WEAK const PinMap PinMap_SPI_SCLK[] = {
134+
{PA_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)},
135+
{PB_8, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_SPI2)},
136+
{NC, NP, 0}
137+
};
138+
#endif
139+
140+
#ifdef HAL_SPI_MODULE_ENABLED
141+
WEAK const PinMap PinMap_SPI_SSEL[] = {
142+
{PA_8, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_SPI2)},
143+
{PA_15, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)},
144+
{NC, NP, 0}
145+
};
146+
#endif
147+
148+
//*** No CAN ***
149+
150+
//*** No ETHERNET ***
151+
152+
//*** No QUADSPI ***
153+
154+
//*** No USB ***
155+
156+
//*** No SD ***

Diff for: variants/STM32G0xx/Generic_G030Kx/variant.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
*******************************************************************************
1212
*/
13-
13+
#if defined(ARDUINO_GENERIC_G030K6) || defined(ARDUINO_GENERIC_G030K8)
1414
#include "pins_arduino.h"
1515

1616
#ifdef __cplusplus
@@ -179,3 +179,4 @@ WEAK void SystemClock_Config(void)
179179
#ifdef __cplusplus
180180
} // extern "C"
181181
#endif
182+
#endif /* ARDUINO_GENERIC_* */

Diff for: variants/STM32G0xx/Generic_G030Kx/variant.h

+5-1
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,12 @@
1010
*
1111
*******************************************************************************
1212
*/
13-
13+
#if !defined(ARDUINO_GENERIC_G030K6) && !defined(ARDUINO_GENERIC_G030K8)
14+
#include "variant_Aurora_One.h"
15+
#else
1416
#ifndef _VARIANT_ARDUINO_STM32_
1517
#define _VARIANT_ARDUINO_STM32_
18+
1619
#ifdef __cplusplus
1720
extern "C" {
1821
#endif // __cplusplus
@@ -158,3 +161,4 @@ extern "C" {
158161
#endif
159162

160163
#endif /* _VARIANT_ARDUINO_STM32_ */
164+
#endif /* ARDUINO_GENERIC_* */
+136
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
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_AURORA_ONE)
14+
#include "pins_arduino.h"
15+
16+
#ifdef __cplusplus
17+
extern "C" {
18+
#endif
19+
20+
// Digital PinName array
21+
const PinName digitalPin[] = {
22+
PA_10, //D0
23+
PA_9, //D1
24+
PA_6, //D2/A6
25+
PA_7, //D3/A7
26+
PA_8, //D4
27+
PC_6, //D5
28+
PA_11, //D6/A10
29+
PA_12, //D7/A11
30+
PB_2, //D8/A12
31+
PB_1, //D9/A9
32+
PB_0, //D10/A8
33+
PB_5, //D11
34+
PB_4, //D12
35+
PB_3, //D13/LED
36+
PB_7, //D14/A13
37+
PB_6, //D15
38+
PB_9, //D16/MAINSL
39+
PB_8, //D17/MAINSL
40+
PA_15, //D18/MAINSL
41+
PA_14, //D19/A14/SWCLK
42+
PA_13, //D20/A15/SWDIO
43+
PA_0, //D21/A0
44+
PA_1, //D22/A1
45+
PA_2, //D23/A2
46+
PA_3, //D24/A3
47+
PA_4, //D25/A4
48+
PA_5, //D26/A5
49+
PA_9_ALTR, //D27
50+
PA_10_ALTR, //D28
51+
PA_6_ALT0, //D29
52+
PA_7_ALT0, //D30
53+
PA_7_ALT1, //D31
54+
PA_7_ALT2, //D32
55+
PB_0_ALT0, //D33
56+
PB_1_ALT0, //D34
57+
PB_1_ALT1, //D35
58+
PB_6_ALT0 //D36
59+
};
60+
61+
// Analog (Ax) pin number array
62+
const uint32_t analogInputPin[] = {
63+
21, //A0
64+
22, //A1
65+
23, //A2
66+
24, //A3
67+
25, //A4
68+
26, //A5
69+
2, //A6
70+
3, //A7
71+
10, //A8
72+
9, //A9
73+
6, //A10
74+
7, //A11
75+
8, //A12
76+
14, //A13
77+
19, //A14
78+
20 //A15
79+
};
80+
81+
#ifdef __cplusplus
82+
}
83+
#endif
84+
85+
// ----------------------------------------------------------------------------
86+
87+
#ifdef __cplusplus
88+
extern "C" {
89+
#endif
90+
91+
/**
92+
* @brief System Clock Configuration
93+
* @param None
94+
* @retval None
95+
*/
96+
WEAK void SystemClock_Config(void)
97+
{
98+
RCC_OscInitTypeDef RCC_OscInitStruct = {};
99+
RCC_ClkInitTypeDef RCC_ClkInitStruct = {};
100+
RCC_PeriphCLKInitTypeDef PeriphClkInit = {};
101+
102+
/* Configure the main internal regulator output voltage */
103+
HAL_PWREx_ControlVoltageScaling(PWR_REGULATOR_VOLTAGE_SCALE1);
104+
/*
105+
* Initializes the RCC Oscillators according to the specified parameters
106+
* in the RCC_OscInitTypeDef structure.
107+
*/
108+
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
109+
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
110+
RCC_OscInitStruct.HSIDiv = RCC_HSI_DIV1;
111+
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
112+
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
113+
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
114+
RCC_OscInitStruct.PLL.PLLM = RCC_PLLM_DIV1;
115+
RCC_OscInitStruct.PLL.PLLN = 8;
116+
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
117+
RCC_OscInitStruct.PLL.PLLR = RCC_PLLR_DIV2;
118+
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
119+
Error_Handler();
120+
}
121+
/* Initializes the CPU, AHB and APB buses clocks */
122+
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK
123+
| RCC_CLOCKTYPE_PCLK1;
124+
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
125+
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
126+
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
127+
128+
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK) {
129+
Error_Handler();
130+
}
131+
}
132+
133+
#ifdef __cplusplus
134+
}
135+
#endif
136+
#endif /* ARDUINO_AURORA_ONE */

0 commit comments

Comments
 (0)