Skip to content

Commit ec71a4f

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 b2d4adb commit ec71a4f

File tree

6 files changed

+264
-2
lines changed

6 files changed

+264
-2
lines changed

Diff for: README.md

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

211211
| Status | Device(s) | Name | Release | Notes |
212212
| :----: | :-------: | ---- | :-----: | :---- |
213+
| :yellow_heart: | STM32G030K8 | [Aurora One](https://www.bfykorea.com/aurora-one) | **2.0.0** |
213214
| :yellow_heart: | STM32G031K6<br>STM32G030K8 | Generic Board | **2.0.0** | |
214215
| :yellow_heart: | STM32G031J4<br>STM32G031J6 | Generic Board | **2.0.0** | |
215216
| :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
@@ -1660,6 +1660,14 @@ GenG0.menu.pnum.GENERIC_G030K8.build.board=GENERIC_G030K8
16601660
GenG0.menu.pnum.GENERIC_G030K8.build.product_line=STM32G030xx
16611661
GenG0.menu.pnum.GENERIC_G030K8.build.variant=STM32G0xx/Generic_G030Kx
16621662

1663+
# Aurora One G030K8
1664+
GenG0.menu.pnum.AURORA_ONE=Aurora One
1665+
GenG0.menu.pnum.AURORA_ONE.upload.maximum_size=65536
1666+
GenG0.menu.pnum.AURORA_ONE.upload.maximum_data_size=16384
1667+
GenG0.menu.pnum.AURORA_ONE.build.board=AURORA_ONE
1668+
GenG0.menu.pnum.AURORA_ONE.build.product_line=STM32G030xx
1669+
GenG0.menu.pnum.AURORA_ONE.build.variant=STM32G0xx/Generic_G030Kx
1670+
16631671
# Generic G031J4
16641672
GenG0.menu.pnum.GENERIC_G031J4=Generic G031J4
16651673
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
@@ -171,3 +171,4 @@ WEAK void SystemClock_Config(void)
171171
#ifdef __cplusplus
172172
} // extern "C"
173173
#endif
174+
#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
@@ -160,3 +163,4 @@ extern "C" {
160163
#endif
161164

162165
#endif /* _VARIANT_ARDUINO_STM32_ */
166+
#endif /* ARDUINO_GENERIC_* */
+127
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
/*
2+
*******************************************************************************
3+
* Copyright (c) 2021, 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_R, //D27
50+
PA_10_R //D28
51+
};
52+
53+
// Analog (Ax) pin number array
54+
const uint32_t analogInputPin[] = {
55+
21, //A0
56+
22, //A1
57+
23, //A2
58+
24, //A3
59+
25, //A4
60+
26, //A5
61+
2, //A6
62+
3, //A7
63+
10, //A8
64+
9, //A9
65+
6, //A10
66+
7, //A11
67+
8, //A12
68+
14, //A13
69+
19, //A14
70+
20 //A15
71+
};
72+
73+
#ifdef __cplusplus
74+
}
75+
#endif
76+
77+
// ----------------------------------------------------------------------------
78+
79+
#ifdef __cplusplus
80+
extern "C" {
81+
#endif
82+
83+
/**
84+
* @brief System Clock Configuration
85+
* @param None
86+
* @retval None
87+
*/
88+
WEAK void SystemClock_Config(void)
89+
{
90+
RCC_OscInitTypeDef RCC_OscInitStruct = {};
91+
RCC_ClkInitTypeDef RCC_ClkInitStruct = {};
92+
93+
/* Configure the main internal regulator output voltage */
94+
HAL_PWREx_ControlVoltageScaling(PWR_REGULATOR_VOLTAGE_SCALE1);
95+
/*
96+
* Initializes the RCC Oscillators according to the specified parameters
97+
* in the RCC_OscInitTypeDef structure.
98+
*/
99+
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
100+
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
101+
RCC_OscInitStruct.HSIDiv = RCC_HSI_DIV1;
102+
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
103+
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
104+
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
105+
RCC_OscInitStruct.PLL.PLLM = RCC_PLLM_DIV1;
106+
RCC_OscInitStruct.PLL.PLLN = 8;
107+
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
108+
RCC_OscInitStruct.PLL.PLLR = RCC_PLLR_DIV2;
109+
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
110+
Error_Handler();
111+
}
112+
/* Initializes the CPU, AHB and APB buses clocks */
113+
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK
114+
| RCC_CLOCKTYPE_PCLK1;
115+
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
116+
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
117+
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
118+
119+
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK) {
120+
Error_Handler();
121+
}
122+
}
123+
124+
#ifdef __cplusplus
125+
}
126+
#endif
127+
#endif /* ARDUINO_AURORA_ONE */
+121
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
/*
2+
*******************************************************************************
3+
* Copyright (c) 2021, 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_R 27
52+
#define PA10_R 28
53+
// #define PC14 29 // OSC32IN
54+
// #define PC15 30 // OSC32OUT
55+
56+
// Alternate pins number
57+
#define PA6_ALT0 (PA6 | ALT0)
58+
#define PA7_ALT0 (PA7 | ALT0)
59+
#define PA7_ALT1 (PA7 | ALT1)
60+
#define PA7_ALT2 (PA7 | ALT2)
61+
#define PB0_ALT0 (PB0 | ALT0)
62+
#define PB1_ALT0 (PB1 | ALT0)
63+
#define PB1_ALT1 (PB1 | ALT1)
64+
#define PB6_ALT0 (PB6 | ALT0)
65+
66+
#define NUM_DIGITAL_PINS 29
67+
#define NUM_ALTERNATE_PINS 8
68+
#define NUM_REMAP_PINS 2
69+
#define NUM_ANALOG_INPUTS 16
70+
71+
// On-board LED pin number
72+
#define LED_BUILTIN PB3
73+
#define LED_GREEN LED_BUILTIN
74+
75+
// Timer Definitions
76+
// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin
77+
#ifndef TIMER_TONE
78+
#define TIMER_TONE TIM14
79+
#endif
80+
#ifndef TIMER_SERVO
81+
#define TIMER_SERVO TIM16
82+
#endif
83+
84+
// UART Definitions
85+
#define SERIAL_UART_INSTANCE 2 //Connected to Aurora Connect Lite
86+
87+
// Default pin used for 'Serial' instance (ex: ST-Link)
88+
// Mandatory for Firmata
89+
#define PIN_SERIAL_RX PA10
90+
#define PIN_SERIAL_TX PA9
91+
92+
#ifdef __cplusplus
93+
} // extern "C"
94+
#endif
95+
96+
/*----------------------------------------------------------------------------
97+
* Arduino objects - C++ only
98+
*----------------------------------------------------------------------------*/
99+
100+
#ifdef __cplusplus
101+
// These serial port names are intended to allow libraries and architecture-neutral
102+
// sketches to automatically default to the correct port name for a particular type
103+
// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
104+
// the first hardware serial port whose RX/TX pins are not dedicated to another use.
105+
//
106+
// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
107+
//
108+
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
109+
//
110+
// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
111+
//
112+
// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
113+
//
114+
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
115+
// pins are NOT connected to anything by default.
116+
#define SERIAL_PORT_MONITOR Serial
117+
#define SERIAL_PORT_HARDWARE Serial2
118+
#endif
119+
120+
#endif /* _VARIANT_ARDUINO_STM32_ */
121+
#endif /* ARDUINO_AURORA_ONE */

0 commit comments

Comments
 (0)