Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit edb6ff3

Browse files
committed
variant(wl3): add Nucleo-WL33CC1 support
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
1 parent dd667b2 commit edb6ff3

File tree

4 files changed

+268
-0
lines changed

4 files changed

+268
-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: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
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+
#include "pinmap.h"
16+
17+
// Digital PinName array
18+
const PinName digitalPin[] = {
19+
PB_7, // D0
20+
PB_6, // D1
21+
PA_9, // D2
22+
PA_0, // D3
23+
PA_8, // D4
24+
PA_13, // D5
25+
PA_12, // D6
26+
PA_4, // D7
27+
PA_5, // D8
28+
PA_14, // D9
29+
PB_10, // D10
30+
PB_9, // D11
31+
PB_8, // D12
32+
PB_11, // D13
33+
PA_7, // D14
34+
PA_6, // D15
35+
PB_0, // D16
36+
PB_1, // D17/A0
37+
PB_2, // D18
38+
PB_3, // D19/A1
39+
PB_14, // D20
40+
PB_5, // D21/A2
41+
PA_1, // D22
42+
PA_15, // D23
43+
PB_4, // D24
44+
PB_15, // D25
45+
PA_2, // D26
46+
PA_3, // D27
47+
PA_10, // D28
48+
PA_11, // D29
49+
PB_12, // D30
50+
PB_13 // D31
51+
};
52+
53+
// Analog (Ax) pin number array
54+
const uint32_t analogInputPin[] = {
55+
17, // A0, PB1
56+
19, // A1, PB3
57+
21 // A2, PB5
58+
};
59+
60+
// ----------------------------------------------------------------------------
61+
#ifdef __cplusplus
62+
extern "C" {
63+
#endif
64+
65+
/**
66+
* @brief System Clock Configuration
67+
* @param None
68+
* @retval None
69+
*/
70+
WEAK void SystemClock_Config(void)
71+
{
72+
RCC_OscInitTypeDef RCC_OscInitStruct = {};
73+
RCC_ClkInitTypeDef RCC_ClkInitStruct = {};
74+
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {};
75+
76+
/** Initializes the RCC Oscillators according to the specified parameters
77+
* in the RCC_OscInitTypeDef structure.
78+
*/
79+
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
80+
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
81+
Error_Handler();
82+
}
83+
84+
/** Configure the SYSCLKSource and SYSCLKDivider
85+
*/
86+
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_HSI;
87+
RCC_ClkInitStruct.SYSCLKDivider = RCC_RC64MPLL_DIV1;
88+
89+
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_WAIT_STATES_1) != HAL_OK) {
90+
Error_Handler();
91+
}
92+
/** Initializes the peripherals clock
93+
*/
94+
PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_SMPS;
95+
PeriphClkInitStruct.SmpsDivSelection = RCC_SMPSCLK_DIV2;
96+
PeriphClkInitStruct.KRMRateMultiplier = 2;
97+
98+
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK) {
99+
Error_Handler();
100+
}
101+
}
102+
103+
WEAK void initVariant(void)
104+
{
105+
pin_function(PA_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SWDIO));
106+
pin_function(PA_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLDOWN, GPIO_AF0_SWCLK));
107+
HAL_PWREx_EnableGPIOPullUp(PWR_GPIO_A, PWR_GPIO_BIT_2);
108+
HAL_PWREx_DisableGPIOPullUp(PWR_GPIO_A, PWR_GPIO_BIT_3);
109+
HAL_PWREx_DisableGPIOPullDown(PWR_GPIO_A, PWR_GPIO_BIT_3);
110+
}
111+
112+
#ifdef __cplusplus
113+
}
114+
#endif
115+
#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)

AltStyle によって変換されたページ (->オリジナル) /