Skip to content

Commit 16217f4

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 16217f4

File tree

6 files changed

+263
-2
lines changed

6 files changed

+263
-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/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 */
+111
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
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+
#ifndef _VARIANT_ARDUINO_STM32_
15+
#define _VARIANT_ARDUINO_STM32_
16+
17+
#ifdef __cplusplus
18+
extern "C" {
19+
#endif // __cplusplus
20+
21+
/*----------------------------------------------------------------------------
22+
* STM32 pins number
23+
*----------------------------------------------------------------------------*/
24+
#define PA10 0
25+
#define PA9 1
26+
#define PA6 A6
27+
#define PA7 A7
28+
#define PA8 4
29+
#define PC6 5
30+
#define PA11 A10
31+
#define PA12 A11
32+
#define PB2 A12
33+
#define PB1 A9
34+
#define PB0 A8
35+
#define PB5 11
36+
#define PB4 12
37+
#define PB3 13 // LED
38+
#define PB7 A13
39+
#define PB6 15
40+
#define PB9 16
41+
#define PB8 17
42+
#define PA15 18
43+
#define PA14 A14 // SWD / BOOT0
44+
#define PA13 A15 // SWD
45+
#define PA0 A0
46+
#define PA1 A1
47+
#define PA2 A2
48+
#define PA3 A3
49+
#define PA4 A4
50+
#define PA5 A5
51+
#define PA9_ALTR 27
52+
#define PA10_ALTR 28
53+
#define PA6_ALT0 29
54+
#define PA7_ALT0 30
55+
#define PA7_ALT1 31
56+
#define PA7_ALT2 32
57+
#define PB0_ALT0 33
58+
#define PB1_ALT0 34
59+
#define PB1_ALT1 35
60+
#define PB6_ALT0 36
61+
// #define PC14 37 // OSC32IN
62+
// #define PC15 38 // OSC32OUT
63+
64+
// This must be a literal
65+
#define NUM_DIGITAL_PINS 37
66+
#define NUM_ALTERNATE_PINS 8
67+
#define NUM_REMAP_PINS 2
68+
#define NUM_ANALOG_INPUTS 16
69+
70+
// On-board LED pin number
71+
#define LED_BUILTIN PB3
72+
#define LED_GREEN LED_BUILTIN
73+
74+
// UART Definitions
75+
#define SERIAL_UART_INSTANCE 2 //Connected to Aurora Connect Lite
76+
77+
// Default pin used for 'Serial' instance (ex: ST-Link)
78+
// Mandatory for Firmata
79+
#define PIN_SERIAL_RX PA10
80+
#define PIN_SERIAL_TX PA9
81+
82+
#ifdef __cplusplus
83+
} // extern "C"
84+
#endif
85+
86+
/*----------------------------------------------------------------------------
87+
* Arduino objects - C++ only
88+
*----------------------------------------------------------------------------*/
89+
90+
#ifdef __cplusplus
91+
// These serial port names are intended to allow libraries and architecture-neutral
92+
// sketches to automatically default to the correct port name for a particular type
93+
// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
94+
// the first hardware serial port whose RX/TX pins are not dedicated to another use.
95+
//
96+
// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
97+
//
98+
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
99+
//
100+
// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
101+
//
102+
// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
103+
//
104+
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
105+
// pins are NOT connected to anything by default.
106+
#define SERIAL_PORT_MONITOR Serial
107+
#define SERIAL_PORT_HARDWARE Serial2
108+
#endif
109+
110+
#endif /* _VARIANT_ARDUINO_STM32_ */
111+
#endif /* ARDUINO_AURORA_ONE */

0 commit comments

Comments
 (0)