Skip to content

Commit ca780b8

Browse files
jhleekrfpistm
andcommitted
Add Aurora One Variant
https://www.bfy.kr/aurora-one/ Supersede stm32duino#1176 Signed-off-by: JongHyeon Lee <[email protected]> Co-authored-by: Frederic.Pillon <[email protected]>
1 parent 1cb1989 commit ca780b8

File tree

4 files changed

+249
-0
lines changed

4 files changed

+249
-0
lines changed

Diff for: README.md

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

213213
| Status | Device(s) | Name | Release | Notes |
214214
| :----: | :-------: | ---- | :-----: | :---- |
215+
| :yellow_heart: | STM32G030K8 | [Aurora One](https://www.bfy.kr/aurora-one/) | **2.0.0** |
215216
| :yellow_heart: | STM32G030K6<br>STM32G030K8 | Generic Board | **2.0.0** | |
216217
| :yellow_heart: | STM32G031J4<br>STM32G031J6 | Generic Board | **2.0.0** | |
217218
| :yellow_heart: | STM32G041J6 | Generic Board | **2.0.0** | |

Diff for: boards.txt

+9
Original file line numberDiff line numberDiff line change
@@ -1691,6 +1691,15 @@ GenG0.build.series=STM32G0xx
16911691
GenG0.build.cmsis_lib_gcc=arm_cortexM0l_math
16921692
GenG0.build.extra_flags=-D{build.product_line} {build.enable_usb} {build.xSerial} -D__CORTEX_SC=0
16931693

1694+
# Aurora One G030K8
1695+
GenG0.menu.pnum.AURORA_ONE=Aurora One
1696+
GenG0.menu.pnum.AURORA_ONE.upload.maximum_size=65536
1697+
GenG0.menu.pnum.AURORA_ONE.upload.maximum_data_size=8192
1698+
GenG0.menu.pnum.AURORA_ONE.build.board=AURORA_ONE
1699+
GenG0.menu.pnum.AURORA_ONE.build.product_line=STM32G030xx
1700+
GenG0.menu.pnum.AURORA_ONE.build.variant=STM32G0xx/G030K(6-8)T
1701+
GenG0.menu.pnum.AURORA_ONE.build.variant_h=variant_{build.board}.h
1702+
16941703
# Generic G030K6Tx
16951704
GenG0.menu.pnum.GENERIC_G030K6TX=Generic G030K6Tx
16961705
GenG0.menu.pnum.GENERIC_G030K6TX.upload.maximum_size=32768
+119
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
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+
// Digital PinName array
17+
const PinName digitalPin[] = {
18+
PA_10, //D0
19+
PA_9, //D1
20+
PA_6, //D2/A6
21+
PA_7, //D3/A7
22+
PA_8, //D4
23+
PC_6, //D5
24+
PA_11, //D6/A10
25+
PA_12, //D7/A11
26+
PB_2, //D8/A12
27+
PB_1, //D9/A9
28+
PB_0, //D10/A8
29+
PB_5, //D11
30+
PB_4, //D12
31+
PB_3, //D13/LED
32+
PB_7, //D14/A13
33+
PB_6, //D15
34+
PB_9, //D16/MAINSL
35+
PB_8, //D17/MAINSL
36+
PA_15, //D18/MAINSL
37+
PA_14, //D19/A14/SWCLK
38+
PA_13, //D20/A15/SWDIO
39+
PA_0, //D21/A0
40+
PA_1, //D22/A1
41+
PA_2, //D23/A2
42+
PA_3, //D24/A3
43+
PA_4, //D25/A4
44+
PA_5, //D26/A5
45+
PA_9_R, //D27
46+
PA_10_R //D28
47+
};
48+
49+
// Analog (Ax) pin number array
50+
const uint32_t analogInputPin[] = {
51+
21, //A0
52+
22, //A1
53+
23, //A2
54+
24, //A3
55+
25, //A4
56+
26, //A5
57+
2, //A6
58+
3, //A7
59+
10, //A8
60+
9, //A9
61+
6, //A10
62+
7, //A11
63+
8, //A12
64+
14, //A13
65+
19, //A14
66+
20 //A15
67+
};
68+
69+
// ----------------------------------------------------------------------------
70+
71+
#ifdef __cplusplus
72+
extern "C" {
73+
#endif
74+
75+
/**
76+
* @brief System Clock Configuration
77+
* @param None
78+
* @retval None
79+
*/
80+
WEAK void SystemClock_Config(void)
81+
{
82+
RCC_OscInitTypeDef RCC_OscInitStruct = {};
83+
RCC_ClkInitTypeDef RCC_ClkInitStruct = {};
84+
85+
/* Configure the main internal regulator output voltage */
86+
HAL_PWREx_ControlVoltageScaling(PWR_REGULATOR_VOLTAGE_SCALE1);
87+
/*
88+
* Initializes the RCC Oscillators according to the specified parameters
89+
* in the RCC_OscInitTypeDef structure.
90+
*/
91+
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
92+
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
93+
RCC_OscInitStruct.HSIDiv = RCC_HSI_DIV1;
94+
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
95+
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
96+
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
97+
RCC_OscInitStruct.PLL.PLLM = RCC_PLLM_DIV1;
98+
RCC_OscInitStruct.PLL.PLLN = 8;
99+
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
100+
RCC_OscInitStruct.PLL.PLLR = RCC_PLLR_DIV2;
101+
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
102+
Error_Handler();
103+
}
104+
/* Initializes the CPU, AHB and APB buses clocks */
105+
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK
106+
| RCC_CLOCKTYPE_PCLK1;
107+
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
108+
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
109+
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
110+
111+
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK) {
112+
Error_Handler();
113+
}
114+
}
115+
116+
#ifdef __cplusplus
117+
}
118+
#endif
119+
#endif /* ARDUINO_AURORA_ONE */

Diff for: variants/STM32G0xx/G030K(6-8)T/variant_AURORA_ONE.h

+120
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
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+
#pragma once
14+
15+
/*----------------------------------------------------------------------------
16+
* STM32 pins number
17+
*----------------------------------------------------------------------------*/
18+
#define PA10 0
19+
#define PA9 1
20+
#define PA6 PIN_A6
21+
#define PA7 PIN_A7
22+
#define PA8 4
23+
#define PC6 5
24+
#define PA11 PIN_A10
25+
#define PA12 PIN_A11
26+
#define PB2 PIN_A12
27+
#define PB1 PIN_A9
28+
#define PB0 PIN_A8
29+
#define PB5 11
30+
#define PB4 12
31+
#define PB3 13 // LED
32+
#define PB7 PIN_A13
33+
#define PB6 15
34+
#define PB9 16
35+
#define PB8 17
36+
#define PA15 18
37+
#define PA14 PIN_A14 // SWD / BOOT0
38+
#define PA13 PIN_A15 // SWD
39+
#define PA0 PIN_A0
40+
#define PA1 PIN_A1
41+
#define PA2 PIN_A2
42+
#define PA3 PIN_A3
43+
#define PA4 PIN_A4
44+
#define PA5 PIN_A5
45+
#define PA9_R 27
46+
#define PA10_R 28
47+
// #define PC14 29 // OSC32IN
48+
// #define PC15 30 // OSC32OUT
49+
50+
// Alternate pins number
51+
#define PA6_ALT1 (PA6 | ALT1)
52+
#define PA7_ALT1 (PA7 | ALT1)
53+
#define PA7_ALT2 (PA7 | ALT2)
54+
#define PA7_ALT3 (PA7 | ALT3)
55+
#define PB0_ALT1 (PB0 | ALT1)
56+
#define PB1_ALT1 (PB1 | ALT1)
57+
#define PB1_ALT2 (PB1 | ALT2)
58+
#define PB6_ALT1 (PB6 | ALT1)
59+
60+
#define NUM_DIGITAL_PINS 29
61+
#define NUM_REMAP_PINS 2
62+
#define NUM_ANALOG_INPUTS 16
63+
64+
// On-board LED pin number
65+
#ifndef LED_BUILTIN
66+
#define LED_BUILTIN PB3
67+
#endif
68+
#define LED_GREEN LED_BUILTIN
69+
70+
// On-board user button
71+
#ifndef USER_BTN
72+
#define USER_BTN PA8
73+
#endif
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+
#ifndef SERIAL_UART_INSTANCE
86+
#define SERIAL_UART_INSTANCE 2 //Connected to Aurora Connect Lite
87+
#endif
88+
89+
// Default pin used for 'Serial' instance (ex: ST-Link)
90+
// Mandatory for Firmata
91+
#ifndef PIN_SERIAL_RX
92+
#define PIN_SERIAL_RX PA10
93+
#endif
94+
#ifndef PIN_SERIAL_TX
95+
#define PIN_SERIAL_TX PA9
96+
#endif
97+
98+
/*----------------------------------------------------------------------------
99+
* Arduino objects - C++ only
100+
*----------------------------------------------------------------------------*/
101+
102+
#ifdef __cplusplus
103+
// These serial port names are intended to allow libraries and architecture-neutral
104+
// sketches to automatically default to the correct port name for a particular type
105+
// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
106+
// the first hardware serial port whose RX/TX pins are not dedicated to another use.
107+
//
108+
// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
109+
//
110+
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
111+
//
112+
// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
113+
//
114+
// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
115+
//
116+
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
117+
// pins are NOT connected to anything by default.
118+
#define SERIAL_PORT_MONITOR Serial
119+
#define SERIAL_PORT_HARDWARE Serial2
120+
#endif

0 commit comments

Comments
 (0)