Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit d92741a

Browse files
committedMay 12, 2017
Add NULCEO-L476RG variant
Signed-off-by: Frederic.Pillon <[email protected]>
1 parent c58275b commit d92741a

File tree

12 files changed

+1672
-6
lines changed

12 files changed

+1672
-6
lines changed
 

‎boards.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,22 @@ Nucleo_64.menu.Nucleo_64_board.NUCLEO_L053R8.build.cmsis_lib_gcc=arm_cortexM0l_m
108108
#To enable HID (keyboard and mouse support) add also '-DUSBD_USE_HID_COMPOSITE'
109109
Nucleo_64.menu.Nucleo_64_board.NUCLEO_L053R8.build.extra_flags=-DSTM32L053xx -D__CORTEX_SC=0 {build.usb_flags}
110110

111+
# NUCLEO_L476RG board
112+
113+
Nucleo_64.menu.Nucleo_64_board.NUCLEO_L476RG=Nucleo L476RG
114+
Nucleo_64.menu.Nucleo_64_board.NUCLEO_L476RG.node=NODE_L476RG
115+
Nucleo_64.menu.Nucleo_64_board.NUCLEO_L476RG.upload.maximum_size=1048576
116+
Nucleo_64.menu.Nucleo_64_board.NUCLEO_L476RG.upload.maximum_data_size=131072
117+
Nucleo_64.menu.Nucleo_64_board.NUCLEO_L476RG.build.mcu=cortex-m4
118+
Nucleo_64.menu.Nucleo_64_board.NUCLEO_L476RG.build.f_cpu=4000000L
119+
Nucleo_64.menu.Nucleo_64_board.NUCLEO_L476RG.build.usb_product="NUCLEO-L476RG"
120+
Nucleo_64.menu.Nucleo_64_board.NUCLEO_L476RG.build.board=NUCLEO_L476RG
121+
Nucleo_64.menu.Nucleo_64_board.NUCLEO_L476RG.build.series=STM32L4xx
122+
Nucleo_64.menu.Nucleo_64_board.NUCLEO_L476RG.build.variant=NUCLEO_L476RG
123+
Nucleo_64.menu.Nucleo_64_board.NUCLEO_L476RG.build.cmsis_lib_gcc=arm_cortexM4l_math
124+
#To enable USB add '-DUSBCON'
125+
#To enable HID (keyboard and mouse support) add also '-DUSBD_USE_HID_COMPOSITE'
126+
Nucleo_64.menu.Nucleo_64_board.NUCLEO_L476RG.build.extra_flags=-DSTM32L476xx {build.usb_flags}
111127

112128
Nucleo_64.menu.upload_method.MassStorageMethod=Mass Storage
113129
Nucleo_64.menu.upload_method.MassStorageMethod.upload.protocol=

‎cores/arduino/stm32/analog.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,13 +421,25 @@ void HAL_ADC_MspInit(ADC_HandleTypeDef *hadc)
421421
}
422422
#endif
423423

424+
#ifdef __HAL_RCC_ADC_CLK_ENABLE
425+
__HAL_RCC_ADC_CLK_ENABLE();
426+
#endif
427+
#ifdef __HAL_RCC_ADC_CONFIG
428+
/* ADC Periph interface clock configuration */
429+
__HAL_RCC_ADC_CONFIG(RCC_ADCCLKSOURCE_SYSCLK);
430+
#endif
431+
424432
/* Enable GPIO clock ****************************************/
425433
port = set_GPIO_Port_Clock(STM_PORT(g_current_pin));
426434

427435
/*##-2- Configure peripheral GPIO ##########################################*/
428436
/* ADC Channel GPIO pin configuration */
429437
GPIO_InitStruct.Pin = STM_GPIO_PIN(g_current_pin);
438+
#ifdef GPIO_MODE_ANALOG_ADC_CONTROL
439+
GPIO_InitStruct.Mode = GPIO_MODE_ANALOG_ADC_CONTROL;
440+
#else
430441
GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
442+
#endif
431443
GPIO_InitStruct.Pull = GPIO_NOPULL;
432444
HAL_GPIO_Init(port, &GPIO_InitStruct);
433445
}
@@ -573,7 +585,11 @@ uint16_t adc_read_value(PinName pin)
573585
}
574586

575587
AdcChannelConf.Channel = get_adc_channel(pin); /* Specifies the channel to configure into ADC */
588+
#ifdef STM32L4xx
589+
if (!IS_ADC_CHANNEL(&AdcHandle, AdcChannelConf.Channel)) return 0;
590+
#else
576591
if (!IS_ADC_CHANNEL(AdcChannelConf.Channel)) return 0;
592+
#endif
577593
AdcChannelConf.Rank = ADC_REGULAR_RANK_1; /* Specifies the rank in the regular group sequencer */
578594
#ifndef STM32L0xx
579595
AdcChannelConf.SamplingTime = SAMPLINGTIME; /* Sampling time value to be set for the selected channel */
@@ -585,7 +601,7 @@ uint16_t adc_read_value(PinName pin)
585601
return 0;
586602
}
587603

588-
#ifdef STM32F3xx
604+
#if defined (STM32F3xx) || defined (STM32L4xx)
589605
/*##-2.1- Calibrate ADC then Start the conversion process ####################*/
590606
if (HAL_ADCEx_Calibration_Start(&AdcHandle, ADC_SINGLE_ENDED) != HAL_OK)
591607
{

‎cores/arduino/stm32/stm32_def_build.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
#define CMSIS_STARTUP_FILE "startup_stm32f429xx.s"
3333
#elif defined(STM32L053xx)
3434
#define CMSIS_STARTUP_FILE "startup_stm32l053xx.s"
35+
#elif defined(STM32L476xx)
36+
#define CMSIS_STARTUP_FILE "startup_stm32l476xx.s"
3537
#else
3638
#error UNKNOWN CHIP
3739
#endif

‎cores/arduino/stm32/stm32_eeprom.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@
8080
#define FLASH_DATA_SECTOR 15
8181
#elif defined (STM32L0xx)
8282
#define FLASH_BASE_ADDRESS ((uint32_t)(DATA_EEPROM_BASE)) /* 0x08080000 */
83+
#elif defined (STM32L4xx)
84+
// Flash base address (Bank2, page 256)
85+
#define FLASH_BASE_ADDRESS 0x080FF800
86+
#define FLASH_PAGE_NUMBER 255
8387
#endif
8488

8589
/**
@@ -162,20 +166,27 @@ void set_data_to_flash(void)
162166
uint32_t offset = 0;
163167
uint32_t address = FLASH_BASE_ADDRESS;
164168
uint32_t address_end = FLASH_BASE_ADDRESS + E2END;
165-
#if defined (STM32F0xx) || defined (STM32F3xx) || defined (STM32L0xx)
169+
#if defined (STM32F0xx) || defined (STM32F3xx) || defined (STM32L0xx) || defined(STM32L4xx)
166170
uint32_t pageError = 0;
167171
uint64_t data = 0;
168172

169173
// ERASING page
170174
EraseInitStruct.TypeErase = FLASH_TYPEERASE_PAGES;
175+
#ifdef STM32L4xx
176+
EraseInitStruct.Banks = FLASH_BANK_2;
177+
EraseInitStruct.Page = FLASH_PAGE_NUMBER;
178+
#else
171179
EraseInitStruct.PageAddress = FLASH_BASE_ADDRESS;
172180
EraseInitStruct.NbPages = 1;
181+
#endif
173182

174183
if(HAL_FLASH_Unlock() == HAL_OK) {
175184
#ifdef STM32L0xx
176185
__HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_EOP|FLASH_FLAG_WRPERR|FLASH_FLAG_PGAERR|\
177186
FLASH_FLAG_SIZERR|FLASH_FLAG_OPTVERR|FLASH_FLAG_RDERR|\
178187
FLASH_FLAG_FWWERR|FLASH_FLAG_NOTZEROERR);
188+
#elif defined (STM32L4xx)
189+
__HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_ALL_ERRORS);
179190
#else
180191
__HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_EOP|FLASH_FLAG_WRPERR|FLASH_FLAG_PGERR);
181192
#endif

‎cores/arduino/stm32/twi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ void i2c_custom_init(i2c_t *obj, i2c_timing_e timing, uint32_t addressingMode, u
225225
HAL_GPIO_Init(port, &GPIO_InitStruct);
226226

227227
handle->Instance = obj->i2c;
228-
#if defined (STM32F0xx) || defined (STM32F3xx) || defined (STM32L0xx)
228+
#if defined (STM32F0xx) || defined (STM32F3xx) || defined (STM32L0xx) || defined (STM32L4xx)
229229
handle->Init.Timing = timing;
230230
#else
231231
handle->Init.ClockSpeed = timing;
@@ -280,7 +280,7 @@ void i2c_setTiming(i2c_t *obj, uint32_t frequency)
280280
else if(frequency <= 400000)
281281
f = I2C_400KHz;
282282

283-
#if defined (STM32F0xx) || defined (STM32F3xx) || defined (STM32L0xx)
283+
#if defined (STM32F0xx) || defined (STM32F3xx) || defined (STM32L0xx) || defined (STM32L4xx)
284284
obj->handle.Init.Timing = f;
285285
#else
286286
obj->handle.Init.ClockSpeed = f;

‎cores/arduino/stm32/twi.h

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ typedef enum {
8383
}i2c_status_e;
8484

8585
typedef enum {
86-
#if defined (STM32F0xx) || defined (STM32F3xx)
86+
#if defined (STM32F0xx) || defined (STM32F3xx) || defined (STM32L0xx)
8787
//calculated with SYSCLK = 64MHz at
8888
/*https://www.google.fr/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&cad=rja&uact=8&ved=0ahUKEwiC4q6O7ojMAhWCOhoKHYlyBtIQFggmMAE&url=http%3A%2F%2Fuglyduck.ath.cx%2FPDF%2FSTMicro%2FARM%2FSTM32F0%2FI2C_Timing_Configuration_V1.0.1.xls&usg=AFQjCNGGjPSUAzVUdbUqMUxPub8Ojzhh9w&sig2=4YgzXFixj15GhqkAzVS4tA*/
8989
I2C_10KHz = 0xE010A9FF,
@@ -94,7 +94,16 @@ typedef enum {
9494
I2C_600KHz = 0x00900E50,
9595
I2C_800KHz = 0x00900E35,
9696
I2C_1000KHz = 0x00900E25
97-
#else
97+
#elif defined (STM32L4xx)
98+
I2C_10KHz = 0xF010F3FE,
99+
I2C_50KHz = 0x30608CFF,
100+
I2C_100KHz = 0x10D0A4E4,
101+
I2C_200KHz = 0x00F082FF,
102+
I2C_400KHz = 0x00F02E8B,
103+
I2C_600KHz = 0x00B01265,
104+
I2C_800KHz = 0x00B01243,
105+
I2C_1000KHz = 0x00B0122F
106+
#else //STM32F4xx
98107
I2C_10KHz = 10000,
99108
I2C_50KHz = 50000,
100109
I2C_100KHz = 100000,

‎system/STM32L4xx/system_stm32l4xx.c

Lines changed: 354 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,354 @@
1+
/**
2+
******************************************************************************
3+
* @file system_stm32l4xx.c
4+
* @author MCD Application Team
5+
* @version V1.3.0
6+
* @date 17-February-2017
7+
* @brief CMSIS Cortex-M4 Device Peripheral Access Layer System Source File
8+
*
9+
* This file provides two functions and one global variable to be called from
10+
* user application:
11+
* - SystemInit(): This function is called at startup just after reset and
12+
* before branch to main program. This call is made inside
13+
* the "startup_stm32l4xx.s" file.
14+
*
15+
* - SystemCoreClock variable: Contains the core clock (HCLK), it can be used
16+
* by the user application to setup the SysTick
17+
* timer or configure other parameters.
18+
*
19+
* - SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must
20+
* be called whenever the core clock is changed
21+
* during program execution.
22+
*
23+
* After each device reset the MSI (4 MHz) is used as system clock source.
24+
* Then SystemInit() function is called, in "startup_stm32l4xx.s" file, to
25+
* configure the system clock before to branch to main program.
26+
*
27+
* This file configures the system clock as follows:
28+
*=============================================================================
29+
*-----------------------------------------------------------------------------
30+
* System Clock source | MSI
31+
*-----------------------------------------------------------------------------
32+
* SYSCLK(Hz) | 4000000
33+
*-----------------------------------------------------------------------------
34+
* HCLK(Hz) | 4000000
35+
*-----------------------------------------------------------------------------
36+
* AHB Prescaler | 1
37+
*-----------------------------------------------------------------------------
38+
* APB1 Prescaler | 1
39+
*-----------------------------------------------------------------------------
40+
* APB2 Prescaler | 1
41+
*-----------------------------------------------------------------------------
42+
* PLL_M | 1
43+
*-----------------------------------------------------------------------------
44+
* PLL_N | 8
45+
*-----------------------------------------------------------------------------
46+
* PLL_P | 7
47+
*-----------------------------------------------------------------------------
48+
* PLL_Q | 2
49+
*-----------------------------------------------------------------------------
50+
* PLL_R | 2
51+
*-----------------------------------------------------------------------------
52+
* PLLSAI1_P | NA
53+
*-----------------------------------------------------------------------------
54+
* PLLSAI1_Q | NA
55+
*-----------------------------------------------------------------------------
56+
* PLLSAI1_R | NA
57+
*-----------------------------------------------------------------------------
58+
* PLLSAI2_P | NA
59+
*-----------------------------------------------------------------------------
60+
* PLLSAI2_Q | NA
61+
*-----------------------------------------------------------------------------
62+
* PLLSAI2_R | NA
63+
*-----------------------------------------------------------------------------
64+
* Require 48MHz for USB OTG FS, | Disabled
65+
* SDIO and RNG clock |
66+
*-----------------------------------------------------------------------------
67+
*=============================================================================
68+
******************************************************************************
69+
* @attention
70+
*
71+
* <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
72+
*
73+
* Redistribution and use in source and binary forms, with or without modification,
74+
* are permitted provided that the following conditions are met:
75+
* 1. Redistributions of source code must retain the above copyright notice,
76+
* this list of conditions and the following disclaimer.
77+
* 2. Redistributions in binary form must reproduce the above copyright notice,
78+
* this list of conditions and the following disclaimer in the documentation
79+
* and/or other materials provided with the distribution.
80+
* 3. Neither the name of STMicroelectronics nor the names of its contributors
81+
* may be used to endorse or promote products derived from this software
82+
* without specific prior written permission.
83+
*
84+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
85+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
86+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
87+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
88+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
89+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
90+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
91+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
92+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
93+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
94+
*
95+
******************************************************************************
96+
*/
97+
98+
/** @addtogroup CMSIS
99+
* @{
100+
*/
101+
102+
/** @addtogroup stm32l4xx_system
103+
* @{
104+
*/
105+
106+
/** @addtogroup STM32L4xx_System_Private_Includes
107+
* @{
108+
*/
109+
110+
#include "stm32l4xx.h"
111+
112+
#if !defined (HSE_VALUE)
113+
#define HSE_VALUE ((uint32_t)8000000) /*!< Value of the External oscillator in Hz */
114+
#endif /* HSE_VALUE */
115+
116+
#if !defined (MSI_VALUE)
117+
#define MSI_VALUE ((uint32_t)4000000) /*!< Value of the Internal oscillator in Hz*/
118+
#endif /* MSI_VALUE */
119+
120+
#if !defined (HSI_VALUE)
121+
#define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/
122+
#endif /* HSI_VALUE */
123+
124+
/**
125+
* @}
126+
*/
127+
128+
/** @addtogroup STM32L4xx_System_Private_TypesDefinitions
129+
* @{
130+
*/
131+
132+
/**
133+
* @}
134+
*/
135+
136+
/** @addtogroup STM32L4xx_System_Private_Defines
137+
* @{
138+
*/
139+
140+
/************************* Miscellaneous Configuration ************************/
141+
/*!< Uncomment the following line if you need to relocate your vector Table in
142+
Internal SRAM. */
143+
/* #define VECT_TAB_SRAM */
144+
#define VECT_TAB_OFFSET 0x00 /*!< Vector Table base offset field.
145+
This value must be a multiple of 0x200. */
146+
/******************************************************************************/
147+
/**
148+
* @}
149+
*/
150+
151+
/** @addtogroup STM32L4xx_System_Private_Macros
152+
* @{
153+
*/
154+
155+
/**
156+
* @}
157+
*/
158+
159+
/** @addtogroup STM32L4xx_System_Private_Variables
160+
* @{
161+
*/
162+
/* The SystemCoreClock variable is updated in three ways:
163+
1) by calling CMSIS function SystemCoreClockUpdate()
164+
2) by calling HAL API function HAL_RCC_GetHCLKFreq()
165+
3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency
166+
Note: If you use this function to configure the system clock; then there
167+
is no need to call the 2 first functions listed above, since SystemCoreClock
168+
variable is updated automatically.
169+
*/
170+
uint32_t SystemCoreClock = F_CPU;
171+
172+
const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9};
173+
const uint8_t APBPrescTable[8] = {0, 0, 0, 0, 1, 2, 3, 4};
174+
const uint32_t MSIRangeTable[12] = {100000, 200000, 400000, 800000, 1000000, 2000000, \
175+
4000000, 8000000, 16000000, 24000000, 32000000, 48000000};
176+
/**
177+
* @}
178+
*/
179+
180+
/** @addtogroup STM32L4xx_System_Private_FunctionPrototypes
181+
* @{
182+
*/
183+
184+
/**
185+
* @}
186+
*/
187+
188+
/** @addtogroup STM32L4xx_System_Private_Functions
189+
* @{
190+
*/
191+
192+
/**
193+
* @brief Setup the microcontroller system.
194+
* @param None
195+
* @retval None
196+
*/
197+
198+
void SystemInit(void)
199+
{
200+
/* FPU settings ------------------------------------------------------------*/
201+
#if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
202+
SCB->CPACR |= ((3UL << 10*2)|(3UL << 11*2)); /* set CP10 and CP11 Full Access */
203+
#endif
204+
/* Reset the RCC clock configuration to the default reset state ------------*/
205+
/* Set MSION bit */
206+
RCC->CR |= RCC_CR_MSION;
207+
208+
/* Reset CFGR register */
209+
RCC->CFGR = 0x00000000;
210+
211+
/* Reset HSEON, CSSON , HSION, and PLLON bits */
212+
RCC->CR &= (uint32_t)0xEAF6FFFF;
213+
214+
/* Reset PLLCFGR register */
215+
RCC->PLLCFGR = 0x00001000;
216+
217+
/* Reset HSEBYP bit */
218+
RCC->CR &= (uint32_t)0xFFFBFFFF;
219+
220+
/* Disable all interrupts */
221+
RCC->CIER = 0x00000000;
222+
223+
/* Configure the Vector Table location add offset address ------------------*/
224+
#ifdef VECT_TAB_SRAM
225+
SCB->VTOR = SRAM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */
226+
#else
227+
SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */
228+
#endif
229+
}
230+
231+
/**
232+
* @brief Update SystemCoreClock variable according to Clock Register Values.
233+
* The SystemCoreClock variable contains the core clock (HCLK), it can
234+
* be used by the user application to setup the SysTick timer or configure
235+
* other parameters.
236+
*
237+
* @note Each time the core clock (HCLK) changes, this function must be called
238+
* to update SystemCoreClock variable value. Otherwise, any configuration
239+
* based on this variable will be incorrect.
240+
*
241+
* @note - The system frequency computed by this function is not the real
242+
* frequency in the chip. It is calculated based on the predefined
243+
* constant and the selected clock source:
244+
*
245+
* - If SYSCLK source is MSI, SystemCoreClock will contain the MSI_VALUE(*)
246+
*
247+
* - If SYSCLK source is HSI, SystemCoreClock will contain the HSI_VALUE(**)
248+
*
249+
* - If SYSCLK source is HSE, SystemCoreClock will contain the HSE_VALUE(***)
250+
*
251+
* - If SYSCLK source is PLL, SystemCoreClock will contain the HSE_VALUE(***)
252+
* or HSI_VALUE(*) or MSI_VALUE(*) multiplied/divided by the PLL factors.
253+
*
254+
* (*) MSI_VALUE is a constant defined in stm32l4xx_hal.h file (default value
255+
* 4 MHz) but the real value may vary depending on the variations
256+
* in voltage and temperature.
257+
*
258+
* (**) HSI_VALUE is a constant defined in stm32l4xx_hal.h file (default value
259+
* 16 MHz) but the real value may vary depending on the variations
260+
* in voltage and temperature.
261+
*
262+
* (***) HSE_VALUE is a constant defined in stm32l4xx_hal.h file (default value
263+
* 8 MHz), user has to ensure that HSE_VALUE is same as the real
264+
* frequency of the crystal used. Otherwise, this function may
265+
* have wrong result.
266+
*
267+
* - The result of this function could be not correct when using fractional
268+
* value for HSE crystal.
269+
*
270+
* @param None
271+
* @retval None
272+
*/
273+
void SystemCoreClockUpdate(void)
274+
{
275+
uint32_t tmp = 0, msirange = 0, pllvco = 0, pllr = 2, pllsource = 0, pllm = 2;
276+
277+
/* Get MSI Range frequency--------------------------------------------------*/
278+
if((RCC->CR & RCC_CR_MSIRGSEL) == RESET)
279+
{ /* MSISRANGE from RCC_CSR applies */
280+
msirange = (RCC->CSR & RCC_CSR_MSISRANGE) >> 8;
281+
}
282+
else
283+
{ /* MSIRANGE from RCC_CR applies */
284+
msirange = (RCC->CR & RCC_CR_MSIRANGE) >> 4;
285+
}
286+
/*MSI frequency range in HZ*/
287+
msirange = MSIRangeTable[msirange];
288+
289+
/* Get SYSCLK source -------------------------------------------------------*/
290+
switch (RCC->CFGR & RCC_CFGR_SWS)
291+
{
292+
case 0x00: /* MSI used as system clock source */
293+
SystemCoreClock = msirange;
294+
break;
295+
296+
case 0x04: /* HSI used as system clock source */
297+
SystemCoreClock = HSI_VALUE;
298+
break;
299+
300+
case 0x08: /* HSE used as system clock source */
301+
SystemCoreClock = HSE_VALUE;
302+
break;
303+
304+
case 0x0C: /* PLL used as system clock source */
305+
/* PLL_VCO = (HSE_VALUE or HSI_VALUE or MSI_VALUE/ PLLM) * PLLN
306+
SYSCLK = PLL_VCO / PLLR
307+
*/
308+
pllsource = (RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC);
309+
pllm = ((RCC->PLLCFGR & RCC_PLLCFGR_PLLM) >> 4) + 1 ;
310+
311+
switch (pllsource)
312+
{
313+
case 0x02: /* HSI used as PLL clock source */
314+
pllvco = (HSI_VALUE / pllm);
315+
break;
316+
317+
case 0x03: /* HSE used as PLL clock source */
318+
pllvco = (HSE_VALUE / pllm);
319+
break;
320+
321+
default: /* MSI used as PLL clock source */
322+
pllvco = (msirange / pllm);
323+
break;
324+
}
325+
pllvco = pllvco * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> 8);
326+
pllr = (((RCC->PLLCFGR & RCC_PLLCFGR_PLLR) >> 25) + 1) * 2;
327+
SystemCoreClock = pllvco/pllr;
328+
break;
329+
330+
default:
331+
SystemCoreClock = msirange;
332+
break;
333+
}
334+
/* Compute HCLK clock frequency --------------------------------------------*/
335+
/* Get HCLK prescaler */
336+
tmp = AHBPrescTable[((RCC->CFGR & RCC_CFGR_HPRE) >> 4)];
337+
/* HCLK clock frequency */
338+
SystemCoreClock >>= tmp;
339+
}
340+
341+
342+
/**
343+
* @}
344+
*/
345+
346+
/**
347+
* @}
348+
*/
349+
350+
/**
351+
* @}
352+
*/
353+
354+
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

‎variants/NUCLEO_L476RG/PeripheralPins.c

Lines changed: 300 additions & 0 deletions
Large diffs are not rendered by default.

‎variants/NUCLEO_L476RG/ldscript.ld

Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
/**
2+
******************************************************************************
3+
* @file STM32L476RG_FLASH.h
4+
* @author WI6LABS
5+
* @version V1.0.0
6+
* @date 15-February-2016
7+
* @brief Linker script for STM32L476RG Device with
8+
* 256KByte FLASH, 32KByte RAM
9+
*
10+
* Set heap size, stack size and stack location according
11+
* to application requirements.
12+
*
13+
* Set memory bank area and size if external memory is used.
14+
*
15+
******************************************************************************
16+
* @attention
17+
*
18+
* <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
19+
*
20+
* Redistribution and use in source and binary forms, with or without modification,
21+
* are permitted provided that the following conditions are met:
22+
* 1. Redistributions of source code must retain the above copyright notice,
23+
* this list of conditions and the following disclaimer.
24+
* 2. Redistributions in binary form must reproduce the above copyright notice,
25+
* this list of conditions and the following disclaimer in the documentation
26+
* and/or other materials provided with the distribution.
27+
* 3. Neither the name of STMicroelectronics nor the names of its contributors
28+
* may be used to endorse or promote products derived from this software
29+
* without specific prior written permission.
30+
*
31+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
32+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
33+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
34+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
35+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
37+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
38+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
39+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
40+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
41+
*
42+
******************************************************************************
43+
*/
44+
45+
/* Entry Point */
46+
ENTRY(Reset_Handler)
47+
48+
/* Highest address of the user mode stack */
49+
_estack = 0x20017FFF; /* end of RAM */
50+
/* Generate a link error if heap and stack don't fit into RAM */
51+
_Min_Heap_Size = 0x200;; /* required amount of heap */
52+
_Min_Stack_Size = 0x400;; /* required amount of stack */
53+
54+
/* Specify the memory areas */
55+
MEMORY
56+
{
57+
FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 1024K
58+
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 96K
59+
}
60+
61+
/* Define output sections */
62+
SECTIONS
63+
{
64+
/* The startup code goes first into FLASH */
65+
.isr_vector :
66+
{
67+
. = ALIGN(4);
68+
KEEP(*(.isr_vector)) /* Startup code */
69+
. = ALIGN(4);
70+
} >FLASH
71+
72+
/* The program code and other data goes into FLASH */
73+
.text :
74+
{
75+
. = ALIGN(4);
76+
*(.text) /* .text sections (code) */
77+
*(.text*) /* .text* sections (code) */
78+
*(.glue_7) /* glue arm to thumb code */
79+
*(.glue_7t) /* glue thumb to arm code */
80+
*(.eh_frame)
81+
82+
KEEP (*(.init))
83+
KEEP (*(.fini))
84+
85+
. = ALIGN(4);
86+
_etext = .; /* define a global symbols at end of code */
87+
} >FLASH
88+
89+
/* Constant data goes into FLASH */
90+
.rodata ALIGN(4) :
91+
{
92+
. = ALIGN(4);
93+
*(.rodata) /* .rodata sections (constants, strings, etc.) */
94+
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
95+
. = ALIGN(4);
96+
} >FLASH
97+
98+
.ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH
99+
.ARM : {
100+
__exidx_start = .;
101+
*(.ARM.exidx*)
102+
__exidx_end = .;
103+
} >FLASH
104+
105+
.preinit_array :
106+
{
107+
PROVIDE_HIDDEN (__preinit_array_start = .);
108+
KEEP (*(.preinit_array*))
109+
PROVIDE_HIDDEN (__preinit_array_end = .);
110+
} >FLASH
111+
.init_array :
112+
{
113+
PROVIDE_HIDDEN (__init_array_start = .);
114+
KEEP (*(SORT(.init_array.*)))
115+
KEEP (*(.init_array*))
116+
PROVIDE_HIDDEN (__init_array_end = .);
117+
} >FLASH
118+
.fini_array :
119+
{
120+
PROVIDE_HIDDEN (__fini_array_start = .);
121+
KEEP (*(SORT(.fini_array.*)))
122+
KEEP (*(.fini_array*))
123+
PROVIDE_HIDDEN (__fini_array_end = .);
124+
} >FLASH
125+
126+
/* used by the startup to initialize data */
127+
_sidata = LOADADDR(.data);
128+
129+
/* Initialized data sections goes into RAM, load LMA copy after code */
130+
.data :
131+
{
132+
. = ALIGN(4);
133+
_sdata = .; /* create a global symbol at data start */
134+
*(.data) /* .data sections */
135+
*(.data*) /* .data* sections */
136+
137+
. = ALIGN(4);
138+
_edata = .; /* define a global symbol at data end */
139+
} >RAM AT> FLASH
140+
141+
142+
/* Uninitialized data section */
143+
. = ALIGN(4);
144+
.bss :
145+
{
146+
/* This is used by the startup in order to initialize the .bss secion */
147+
_sbss = .; /* define a global symbol at bss start */
148+
__bss_start__ = _sbss;
149+
*(.bss)
150+
*(.bss*)
151+
*(COMMON)
152+
153+
. = ALIGN(4);
154+
_ebss = .; /* define a global symbol at bss end */
155+
__bss_end__ = _ebss;
156+
} >RAM
157+
158+
/* User_heap_stack section, used to check that there is enough RAM left */
159+
._user_heap_stack :
160+
{
161+
. = ALIGN(4);
162+
PROVIDE ( end = . );
163+
PROVIDE ( _end = . );
164+
. = . + _Min_Heap_Size;
165+
. = . + _Min_Stack_Size;
166+
. = ALIGN(4);
167+
} >RAM
168+
169+
170+
171+
/* Remove information from the standard libraries */
172+
/DISCARD/ :
173+
{
174+
libc.a ( * )
175+
libm.a ( * )
176+
libgcc.a ( * )
177+
}
178+
179+
.ARM.attributes 0 : { *(.ARM.attributes) }
180+
}

‎variants/NUCLEO_L476RG/stm32l4xx_hal_conf.h

Lines changed: 408 additions & 0 deletions
Large diffs are not rendered by default.

‎variants/NUCLEO_L476RG/variant.cpp

Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
1+
/*
2+
Copyright (c) 2011 Arduino. All right reserved.
3+
4+
This library is free software; you can redistribute it and/or
5+
modify it under the terms of the GNU Lesser General Public
6+
License as published by the Free Software Foundation; either
7+
version 2.1 of the License, or (at your option) any later version.
8+
9+
This library is distributed in the hope that it will be useful,
10+
but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12+
See the GNU Lesser General Public License for more details.
13+
14+
You should have received a copy of the GNU Lesser General Public
15+
License along with this library; if not, write to the Free Software
16+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17+
*/
18+
19+
#include "variant.h"
20+
21+
#ifdef __cplusplus
22+
extern "C" {
23+
#endif
24+
25+
// Pin number
26+
const PinName digital_arduino[] = {
27+
PA3, //D0
28+
PA2, //D1
29+
PA10, //D2
30+
PB3, //D3
31+
PB5, //D4
32+
PB4, //D5
33+
PB10, //D6
34+
PA8, //D7
35+
PA9, //D8
36+
PC7, //D9
37+
PB6, //D10
38+
PA7, //D11
39+
PA6, //D12
40+
PA5, //D13
41+
PB9, //D14
42+
PB8, //D15
43+
// ST Morpho
44+
// CN7 Left Side
45+
PC10, //D16
46+
PC12, //D17
47+
NC, //D18 - BOOT0
48+
PA13, //D19 - SWD
49+
PA14, //D20 - SWD
50+
PA15, //D21
51+
PB7, //D22
52+
PC13, //D23
53+
PC14, //D24
54+
PC15, //D25
55+
PH0, //D26
56+
PH1, //D27
57+
PC2, //D28
58+
PC3, //D29
59+
// CN7 Right Side
60+
PC11, //D30
61+
PD2, //D31
62+
// CN10 Left Side
63+
PC9, //D32
64+
// CN10 Right side
65+
PC8, //D33
66+
PC6, //D34
67+
PC5, //D35
68+
PA12, //D36
69+
PA11, //D37
70+
PB12, //D38
71+
PB11, //D39
72+
PB2, //D40
73+
PB1, //D41
74+
PB15, //D42
75+
PB14, //D43
76+
PB13, //D44
77+
PC4, //D45
78+
PA0, //D46/A0
79+
PA1, //D47/A1
80+
PA4, //D48/A2
81+
PB0, //D49/A3
82+
PC1, //D50/A4
83+
PC0, //D51/A5
84+
};
85+
86+
#ifdef __cplusplus
87+
}
88+
#endif
89+
90+
/*
91+
* UART objects
92+
*/
93+
HardwareSerial Serial(PA3, PA2); //Connected to ST-Link
94+
HardwareSerial Serial1(PA10, PA9);
95+
96+
void serialEvent() __attribute__((weak));
97+
void serialEvent() { }
98+
void serialEvent1() __attribute__((weak));
99+
void serialEvent1() { }
100+
101+
void serialEventRun(void)
102+
{
103+
if (Serial.available()) serialEvent();
104+
if (Serial1.available()) serialEvent1();
105+
}
106+
107+
// ----------------------------------------------------------------------------
108+
109+
#ifdef __cplusplus
110+
extern "C" {
111+
#endif
112+
113+
void __libc_init_array(void);
114+
115+
uint32_t pinNametoPinNumber(PinName p)
116+
{
117+
uint32_t i = 0;
118+
for(i = 0; i < NUM_DIGITAL_PINS; i++) {
119+
if (digital_arduino[i] == p)
120+
break;
121+
}
122+
return i;
123+
}
124+
125+
void init( void )
126+
{
127+
hw_config_init();
128+
}
129+
130+
/**
131+
* @brief System Clock Configuration
132+
* The system Clock is configured as follows :
133+
* System Clock source = PLL (MSI)
134+
* SYSCLK(Hz) = 80000000
135+
* HCLK(Hz) = 80000000
136+
* AHB Prescaler = 1
137+
* APB1 Prescaler = 1
138+
* APB2 Prescaler = 1
139+
* MSI Frequency(Hz) = 4000000
140+
* PLL_M = 1
141+
* PLL_N = 40
142+
* PLL_R = 2
143+
* PLL_P = 7
144+
* PLL_Q = 4
145+
* Flash Latency(WS) = 4
146+
* @param None
147+
* @retval None
148+
*/
149+
void SystemClock_Config(void)
150+
{
151+
RCC_OscInitTypeDef RCC_OscInitStruct = {};
152+
RCC_ClkInitTypeDef RCC_ClkInitStruct = {};
153+
RCC_PeriphCLKInitTypeDef PeriphClkInit;
154+
155+
156+
/* MSI is enabled after System reset, activate PLL with MSI as source */
157+
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_MSI;
158+
RCC_OscInitStruct.MSIState = RCC_MSI_ON;
159+
160+
RCC_OscInitStruct.MSIClockRange = RCC_MSIRANGE_6;
161+
RCC_OscInitStruct.MSICalibrationValue = RCC_MSICALIBRATION_DEFAULT;
162+
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
163+
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_MSI;
164+
RCC_OscInitStruct.PLL.PLLM = 1;
165+
RCC_OscInitStruct.PLL.PLLN = 40;
166+
RCC_OscInitStruct.PLL.PLLR = 2;
167+
RCC_OscInitStruct.PLL.PLLP = 7;
168+
RCC_OscInitStruct.PLL.PLLQ = 4;
169+
170+
if(HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
171+
{
172+
/* Initialization Error */
173+
while(1);
174+
}
175+
176+
/* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2
177+
clocks dividers */
178+
RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2);
179+
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
180+
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
181+
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
182+
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
183+
if(HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_4) != HAL_OK)
184+
{
185+
/* Initialization Error */
186+
while(1);
187+
}
188+
}
189+
190+
#ifdef __cplusplus
191+
}
192+
#endif

‎variants/NUCLEO_L476RG/variant.h

Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
/*
2+
Copyright (c) 2011 Arduino. All right reserved.
3+
4+
This library is free software; you can redistribute it and/or
5+
modify it under the terms of the GNU Lesser General Public
6+
License as published by the Free Software Foundation; either
7+
version 2.1 of the License, or (at your option) any later version.
8+
9+
This library is distributed in the hope that it will be useful,
10+
but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12+
See the GNU Lesser General Public License for more details.
13+
14+
You should have received a copy of the GNU Lesser General Public
15+
License along with this library; if not, write to the Free Software
16+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17+
*/
18+
19+
#ifndef _VARIANT_ARDUINO_STM32_
20+
#define _VARIANT_ARDUINO_STM32_
21+
22+
/*----------------------------------------------------------------------------
23+
* Definitions
24+
*----------------------------------------------------------------------------*/
25+
26+
/** Frequency of the board main oscillator */
27+
//#define VARIANT_MAINOSC 12000000
28+
29+
/** Master clock frequency */
30+
//#define VARIANT_MCK 84000000
31+
32+
/*----------------------------------------------------------------------------
33+
* Headers
34+
*----------------------------------------------------------------------------*/
35+
36+
#include "Arduino.h"
37+
38+
#ifdef __cplusplus
39+
extern "C"{
40+
#endif // __cplusplus
41+
42+
/**
43+
* Libc porting layers
44+
*/
45+
#if defined ( __GNUC__ ) /* GCC CS3 */
46+
# include <syscalls.h> /** RedHat Newlib minimal stub */
47+
#endif
48+
49+
/*----------------------------------------------------------------------------
50+
* Pins
51+
*----------------------------------------------------------------------------*/
52+
#include "PeripheralPins.h"
53+
54+
extern const PinName digital_arduino[];
55+
56+
enum {
57+
D0, D1, D2, D3, D4, D5, D6, D7, D8, D9,
58+
D10, D11, D12, D13, D14, D15, D16, D17, D18, D19,
59+
D20, D21, D22, D23, D24, D25, D26, D27, D28, D29,
60+
D30, D31, D32, D33, D34, D35, D36, D37, D38, D39,
61+
D40, D41, D42, D43, D44, D45, D46, D47, D48, D49,
62+
D50, D51,
63+
DEND
64+
};
65+
66+
//Analog pins
67+
#define A0 46
68+
#define A1 (A0+1)
69+
#define A2 (A0+2)
70+
#define A3 (A0+3)
71+
#define A4 (A0+4)
72+
#define A5 (A0+5)
73+
74+
#define NUM_DIGITAL_PINS DEND
75+
#define NUM_ANALOG_INPUTS (sizeof(PinMap_ADC)/sizeof(PinMap))
76+
#define MAX_DIGITAL_IOS NUM_DIGITAL_PINS
77+
#define MAX_ANALOG_IOS NUM_ANALOG_INPUTS
78+
79+
// Convert a digital pin number Dxx to a PinName Pxy
80+
#define digitalToPinName(p) ((p < NUM_DIGITAL_PINS) ? digital_arduino[p] : (STM_VALID_PINNAME(p))? (PinName)p : NC)
81+
// Convert an analog pin number Axx to a PinName Pxy
82+
#define analogToPinName(p) ((p < 6) ? digitalToPinName(p+46) : digitalToPinName(p))
83+
// Convert an analog pin number to a digital pin number
84+
#define analogToDigital(p) ((p < 6) ? (p+46) : p)
85+
// Convert a PinName Pxy to a pin number
86+
uint32_t pinNametoPinNumber(PinName p);
87+
88+
#define digitalPinToPort(p) ( get_GPIO_Port(digitalToPinName(p)) )
89+
#define digitalPinToBitMask(p) ( STM_GPIO_PIN(digitalToPinName(p)) )
90+
91+
//ADC resolution is 12bits
92+
#define ADC_RESOLUTION 12
93+
#define DACC_RESOLUTION 12
94+
95+
//PWR resolution
96+
#define PWM_RESOLUTION 8
97+
#define PWM_FREQUENCY 1000
98+
#define PWM_MAX_DUTY_CYCLE 255
99+
100+
//On-board LED pin number
101+
#define LED_BUILTIN 13
102+
#define LED_GREEN LED_BUILTIN
103+
104+
//On-board user button
105+
#define USER_BTN 23
106+
107+
108+
//SPI definitions
109+
//define 16 channels. As many channel as digital IOs
110+
#define SPI_CHANNELS_NUM 16
111+
112+
//default chip salect pin
113+
#define BOARD_SPI_DEFAULT_SS 10
114+
115+
//In case SPI CS channel is not used we define a default one
116+
#define BOARD_SPI_OWN_SS SPI_CHANNELS_NUM
117+
118+
#define SS BOARD_SPI_DEFAULT_SS
119+
#define SS1 4
120+
#define SS2 7
121+
#define SS3 8
122+
#define MOSI 11
123+
#define MISO 12
124+
#define SCLK 13
125+
#define SCK SCLK
126+
127+
//I2C Definitions
128+
#define SDA 14
129+
#define SCL 15
130+
131+
//Timer Definitions
132+
//Do not use timer used by PWM pins when possible. See PinMap_PWM.
133+
#define TIMER_TONE TIM6
134+
#define TIMER_UART_EMULATED TIM7
135+
136+
//Do not use basic timer: OC is required
137+
#define TIMER_SERVO TIM2 //TODO: advanced-control timers don't work
138+
139+
#define DEBUG_UART ((USART_TypeDef *) USART2)
140+
141+
// UART Emulation
142+
#define UART_EMUL_RX PB13
143+
#define UART_EMUL_TX PB14
144+
145+
//Enable Firmata
146+
#define STM32 1
147+
148+
#ifdef __cplusplus
149+
} // extern "C"
150+
#endif
151+
/*----------------------------------------------------------------------------
152+
* Arduino objects - C++ only
153+
*----------------------------------------------------------------------------*/
154+
155+
#ifdef __cplusplus
156+
extern HardwareSerial Serial;
157+
extern HardwareSerial Serial1;
158+
159+
// These serial port names are intended to allow libraries and architecture-neutral
160+
// sketches to automatically default to the correct port name for a particular type
161+
// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
162+
// the first hardware serial port whose RX/TX pins are not dedicated to another use.
163+
//
164+
// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
165+
//
166+
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
167+
//
168+
// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
169+
//
170+
// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
171+
//
172+
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
173+
// pins are NOT connected to anything by default.
174+
#define SERIAL_PORT_MONITOR Serial
175+
#define SERIAL_PORT_HARDWARE Serial
176+
#endif
177+
178+
#endif /* _VARIANT_ARDUINO_STM32_ */

0 commit comments

Comments
 (0)
Please sign in to comment.