Skip to content

Commit 3ddd8b7

Browse files
committed
variant(wl3): add Nucleo-WL33CC1 support
Signed-off-by: Frederic Pillon <[email protected]>
1 parent cd2eb93 commit 3ddd8b7

File tree

4 files changed

+258
-0
lines changed

4 files changed

+258
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ User can add a STM32 based board following this [wiki](https://github.com/stm32d
165165
| :green_heart: | STM32WBA55CGU | Nucleo-WBA55CG | *2.8.0* | |
166166
| :green_heart: | STM32WB55RG | [P-Nucleo-WB55RG](https://www.st.com/en/evaluation-tools/p-nucleo-wb55.html) | *1.6.0* | BLE support with [STM32duinoBLE](https://github.com/stm32duino/STM32duinoBLE) |
167167
| :green_heart: | STM32WB55CG | [P-Nucleo-WB55 USB Dongle](https://www.st.com/en/evaluation-tools/p-nucleo-wb55.html) | *2.5.0* | BLE support with [STM32duinoBLE](https://github.com/stm32duino/STM32duinoBLE) |
168+
| :yellow_heart: | STM32WL3CCV | [Nucleo-WL33CC1](https://www.st.com/en/evaluation-tools/nucleo-wl33cc1.html) | **2.12.0** | |
168169
| :green_heart: | STM32WL55JC | [Nucleo WL55JC1](https://www.st.com/en/evaluation-tools/nucleo-wl55jc.html) | *2.1.0* | LoRa support not available |
169170

170171

boards.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -984,6 +984,23 @@ Nucleo_64.menu.pnum.NUCLEO_WBA55CG.build.variant=STM32WBAxx/WBA55C(E-G)U
984984
Nucleo_64.menu.pnum.NUCLEO_WBA55CG.openocd.target=stm32wbax
985985
Nucleo_64.menu.pnum.NUCLEO_WBA55CG.debug.svd_file={runtime.tools.STM32_SVD.path}/svd/STM32WBAxx/STM32WBA55.svd
986986

987+
# NUCLEO_WL3CC1 board
988+
Nucleo_64.menu.pnum.NUCLEO_WL33CC1=Nucleo WL33CC1
989+
Nucleo_64.menu.pnum.NUCLEO_WL33CC1.node="NOD_WL33CC"
990+
Nucleo_64.menu.pnum.NUCLEO_WL33CC1.upload.maximum_size=262144
991+
Nucleo_64.menu.pnum.NUCLEO_WL33CC1.upload.maximum_data_size=32768
992+
Nucleo_64.menu.pnum.NUCLEO_WL33CC1.build.mcu=cortex-m0plus
993+
Nucleo_64.menu.pnum.NUCLEO_WL33CC1.build.board=NUCLEO_WL33CC1
994+
Nucleo_64.menu.pnum.NUCLEO_WL33CC1.build.series=STM32WL3x
995+
Nucleo_64.menu.pnum.NUCLEO_WL33CC1.build.product_line=STM32WL3xx
996+
Nucleo_64.menu.pnum.NUCLEO_WL33CC1.build.variant=STM32WL3x/WL33C(8-B-C)Vx(X)
997+
Nucleo_64.menu.pnum.NUCLEO_WL33CC1.build.st_extra_flags=-D{build.product_line} {build.xSerial} -D__CORTEX_SC=0
998+
Nucleo_64.menu.pnum.NUCLEO_WL33CC1.openocd.target=stm32wl3x
999+
Nucleo_64.menu.pnum.NUCLEO_WL33CC1.debug.svd_file={runtime.tools.STM32_SVD.path}/svd/STM32WL3x/STM32WL33.svd
1000+
Nucleo_64.menu.pnum.NUCLEO_WL33CC1.upload.address=0x10040000
1001+
Nucleo_64.menu.pnum.NUCLEO_WL33CC1.upload.mode=hwRstPulse
1002+
Nucleo_64.menu.pnum.NUCLEO_WL33CC1.upload.start=0x10000000
1003+
9871004
# NUCLEO_WL55JC1 board
9881005
Nucleo_64.menu.pnum.NUCLEO_WL55JC1=Nucleo WL55JC1
9891006
Nucleo_64.menu.pnum.NUCLEO_WL55JC1.node="NOD_WL55JC"
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
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_NUCLEO_WL33CC1)
14+
#include "pins_arduino.h"
15+
16+
// Digital PinName array
17+
const PinName digitalPin[] = {
18+
PB_7, // D0
19+
PB_6, // D1
20+
PA_9, // D2
21+
PA_0, // D3
22+
PA_8, // D4
23+
PA_13, // D5
24+
PA_12, // D6
25+
PA_4, // D7
26+
PA_5, // D8
27+
PA_14, // D9
28+
PB_10, // D10
29+
PB_9, // D11
30+
PB_8, // D12
31+
PB_11, // D13
32+
PA_7, // D14
33+
PA_6, // D15
34+
PB_0, // D16
35+
PB_1, // D17/A0
36+
PB_2, // D18
37+
PB_3, // D19/A1
38+
PB_14, // D20
39+
PB_5, // D21/A2
40+
PA_1, // D22
41+
PA_15, // D23
42+
PB_4, // D24
43+
PB_15, // D25
44+
PA_2, // D26
45+
PA_3, // D27
46+
PA_10, // D28
47+
PA_11, // D29
48+
PB_12, // D30
49+
PB_13 // D31
50+
};
51+
52+
// Analog (Ax) pin number array
53+
const uint32_t analogInputPin[] = {
54+
17, // A0, PB1
55+
19, // A1, PB3
56+
21 // A2, PB5
57+
};
58+
59+
// ----------------------------------------------------------------------------
60+
#ifdef __cplusplus
61+
extern "C" {
62+
#endif
63+
64+
/**
65+
* @brief System Clock Configuration
66+
* @param None
67+
* @retval None
68+
*/
69+
WEAK void SystemClock_Config(void)
70+
{
71+
RCC_OscInitTypeDef RCC_OscInitStruct = {};
72+
RCC_ClkInitTypeDef RCC_ClkInitStruct = {};
73+
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {};
74+
75+
/** Initializes the RCC Oscillators according to the specified parameters
76+
* in the RCC_OscInitTypeDef structure.
77+
*/
78+
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
79+
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
80+
Error_Handler();
81+
}
82+
83+
/** Configure the SYSCLKSource and SYSCLKDivider
84+
*/
85+
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_HSI;
86+
RCC_ClkInitStruct.SYSCLKDivider = RCC_RC64MPLL_DIV1;
87+
88+
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_WAIT_STATES_1) != HAL_OK) {
89+
Error_Handler();
90+
}
91+
/** Initializes the peripherals clock
92+
*/
93+
PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_SMPS;
94+
PeriphClkInitStruct.SmpsDivSelection = RCC_SMPSCLK_DIV2;
95+
PeriphClkInitStruct.KRMRateMultiplier = 2;
96+
97+
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK) {
98+
Error_Handler();
99+
}
100+
}
101+
102+
#ifdef __cplusplus
103+
}
104+
#endif
105+
#endif /* ARDUINO_NUCLEO_WL33CC1 */
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
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+
#pragma once
14+
15+
/*----------------------------------------------------------------------------
16+
* STM32 pins number
17+
*----------------------------------------------------------------------------*/
18+
#define PB7 0
19+
#define PB6 1
20+
#define PA9 2
21+
#define PA0 3
22+
#define PA8 4
23+
#define PA13 5
24+
#define PA12 6
25+
#define PA4 7
26+
#define PA5 8
27+
#define PA14 9
28+
#define PB10 10
29+
#define PB9 11
30+
#define PB8 12
31+
#define PB11 13
32+
#define PA7 14
33+
#define PA6 15
34+
#define PB0 16
35+
#define PB1 PIN_A0
36+
#define PB2 18
37+
#define PB3 PIN_A1
38+
#define PB14 20
39+
#define PB5 PIN_A2
40+
#define PA1 22 // VCP RX
41+
#define PA15 23 // VCP TX
42+
#define PB4 24 // LD2
43+
#define PB15 25 // LD3
44+
#define PA2 26 // SWDIO
45+
#define PA3 27 // SWCLK
46+
#define PA10 28 // BOOT0
47+
#define PA11 29
48+
#define PB12 30 // OSC_32_OUT
49+
#define PB13 31 // OSC_32_IN
50+
51+
52+
// Alternate pins number
53+
#define PA2_ALT1 (PA2 | ALT1)
54+
#define PA3_ALT1 (PA3 | ALT1)
55+
56+
#define NUM_DIGITAL_PINS 32
57+
#define NUM_ANALOG_INPUTS 3
58+
59+
// On-board LED pin number
60+
#define LED_BLUE PA14
61+
#define LED_LD1 LED_BLUE
62+
#define LED_GREEN PB4
63+
#define LED_LD2 LED_GREEN
64+
#define LED_RED PB5
65+
#define LED_LD3 LED_RED
66+
#ifndef LED_BUILTIN
67+
#define LED_BUILTIN LED_BLUE
68+
#endif
69+
70+
// On-board user button
71+
#define USER_B1 PA0
72+
#define USER_B2 PB11
73+
#define USER_B3 PB15
74+
#ifndef USER_BTN
75+
#define USER_BTN USER_B1
76+
#endif
77+
78+
// Timer Definitions
79+
// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin
80+
#ifndef TIMER_TONE
81+
#define TIMER_TONE TIM16
82+
#endif
83+
#ifndef TIMER_SERVO
84+
#define TIMER_SERVO TIM2
85+
#endif
86+
87+
// UART Definitions
88+
#ifndef SERIAL_UART_INSTANCE
89+
#define SERIAL_UART_INSTANCE 1
90+
#endif
91+
92+
// Default pin used for generic 'Serial' instance
93+
// Mandatory for Firmata
94+
#ifndef PIN_SERIAL_RX
95+
#define PIN_SERIAL_RX PA15
96+
#endif
97+
#ifndef PIN_SERIAL_TX
98+
#define PIN_SERIAL_TX PA1
99+
#endif
100+
101+
// Extra HAL modules
102+
#if !defined(HAL_DAC_MODULE_DISABLED)
103+
#define HAL_DAC_MODULE_ENABLED
104+
#endif
105+
106+
// Alternate SYS_WKUP definition
107+
#define PWR_WAKEUP_PIN8_1
108+
109+
/*----------------------------------------------------------------------------
110+
* Arduino objects - C++ only
111+
*----------------------------------------------------------------------------*/
112+
113+
#ifdef __cplusplus
114+
// These serial port names are intended to allow libraries and architecture-neutral
115+
// sketches to automatically default to the correct port name for a particular type
116+
// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
117+
// the first hardware serial port whose RX/TX pins are not dedicated to another use.
118+
//
119+
// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
120+
//
121+
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
122+
//
123+
// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
124+
//
125+
// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
126+
//
127+
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
128+
// pins are NOT connected to anything by default.
129+
#ifndef SERIAL_PORT_MONITOR
130+
#define SERIAL_PORT_MONITOR Serial
131+
#endif
132+
#ifndef SERIAL_PORT_HARDWARE
133+
#define SERIAL_PORT_HARDWARE Serial
134+
#endif
135+
#endif

0 commit comments

Comments
 (0)