Skip to content

Commit c89ce28

Browse files
committed
variant: WL: add Nucleo-WL55JC1
Signed-off-by: Frederic Pillon <[email protected]>
1 parent 303762e commit c89ce28

File tree

4 files changed

+306
-0
lines changed

4 files changed

+306
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ User can add a STM32 based board following this [wiki](https://github.com/stm32d
118118
| :green_heart: | STM32L452RE-P | [Nucleo L452RE-P](http://www.st.com/en/evaluation-tools/nucleo-l452re-p.html) | *1.8.0* | |
119119
| :green_heart: | STM32L476RG | [Nucleo L476RG](http://www.st.com/en/evaluation-tools/nucleo-l476rg.html) | *0.1.0* | |
120120
| :green_heart: | STM32WB55RG<br>STM32WB55CG | [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) |
121+
| :yellow_heart: | STM32WL55JC | [Nucleo WL55JC1](https://www.st.com/en/evaluation-tools/nucleo-wl55jc.html) | **2.1.0** | LoRa support not available |
122+
121123

122124
### [Nucleo 32](https://www.st.com/content/st_com/en/products/evaluation-tools/product-evaluation-tools/mcu-eval-tools/stm32-mcu-eval-tools/stm32-nucleo-boards.html) boards
123125

boards.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,19 @@ Nucleo_64.menu.pnum.P_NUCLEO_WB55RG.build.product_line=STM32WB55xx
502502
Nucleo_64.menu.pnum.P_NUCLEO_WB55RG.build.variant=STM32WBxx/WB55R(C-E-G)V
503503
Nucleo_64.menu.pnum.P_NUCLEO_WB55RG.build.cmsis_lib_gcc=arm_cortexM4lf_math
504504

505+
# NUCLEO_WL55JC1 board
506+
Nucleo_64.menu.pnum.NUCLEO_WL55JC1=Nucleo WL55JC1
507+
Nucleo_64.menu.pnum.NUCLEO_WL55JC1.node="NOD_WL55JC"
508+
Nucleo_64.menu.pnum.NUCLEO_WL55JC1.upload.maximum_size=262144
509+
Nucleo_64.menu.pnum.NUCLEO_WL55JC1.upload.maximum_data_size=65536
510+
Nucleo_64.menu.pnum.NUCLEO_WL55JC1.build.mcu=cortex-m4
511+
Nucleo_64.menu.pnum.NUCLEO_WL55JC1.build.board=NUCLEO_WL55JC1
512+
Nucleo_64.menu.pnum.NUCLEO_WL55JC1.build.series=STM32WLxx
513+
Nucleo_64.menu.pnum.NUCLEO_WL55JC1.build.product_line=STM32WLE5xx
514+
Nucleo_64.menu.pnum.NUCLEO_WL55JC1.build.variant=STM32WLxx/WL54JCI_WL55JCI_WLE4J(8-B-C)I_WLE5J(8-B-C)I
515+
Nucleo_64.menu.pnum.NUCLEO_WL55JC1.build.cmsis_lib_gcc=arm_cortexM4lf_math
516+
Nucleo_64.menu.pnum.NUCLEO_WL55JC1.build.extra_flags=-D{build.product_line} -DUSE_CM4_STARTUP_FILE {build.xSerial}
517+
505518
# Upload menu
506519
Nucleo_64.menu.upload_method.MassStorage=Mass Storage
507520
Nucleo_64.menu.upload_method.MassStorage.upload.protocol=
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
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_NUCLEO_WL55JC1)
14+
#include "pins_arduino.h"
15+
16+
// Digital PinName array
17+
const PinName digitalPin[] = {
18+
PB_7, // D0
19+
PB_6, // D1
20+
PB_12, // D2
21+
PB_3, // D3/A6
22+
PB_5, // D4
23+
PB_8, // D5
24+
PB_10, // D6
25+
PC_1, // D7
26+
PC_2, // D8
27+
PA_9, // D9
28+
PA_4, // D10
29+
PA_7, // D11
30+
PA_6, // D12
31+
PA_5, // D13
32+
PA_11, // D14/A7
33+
PA_12, // D15/A8
34+
PB_1, // D16/A0
35+
PB_2, // D17/A1
36+
PA_10, // D18/A2
37+
PB_4, // D19/A3
38+
PB_14, // D20/A4
39+
PB_13, // D21/A5
40+
PA_0, // D22
41+
PC_3, // D23
42+
PA_1, // D24
43+
PB_11, // D25
44+
PB_15, // D26
45+
PB_9, // D27
46+
PB_0, // D28
47+
PA_8, // D29
48+
PC_0, // D30
49+
PC_6, // D31
50+
PC_5, // D32
51+
PC_4, // D33
52+
PC_15, // D34
53+
PC_14, // D35
54+
PC_13, // D36
55+
PA_15, // D37/A9
56+
PA_14, // D38/A10
57+
PA_13, // D39/A11
58+
PA_2, // D40
59+
PA_3, // D41
60+
PH_3 // D42
61+
};
62+
63+
// Analog (Ax) pin number array
64+
const uint32_t analogInputPin[] = {
65+
16, // A0, PB1
66+
17, // A1, PB2
67+
18, // A2, PA10
68+
19, // A3, PB4
69+
20, // A4, PB14
70+
21, // A5, PB13
71+
3, // A6, PB3
72+
14, // A7, PA11
73+
15, // A8, PA12
74+
37, // A9, PA15
75+
38, // A10, PA14
76+
39 // A11, PA13
77+
};
78+
79+
// ----------------------------------------------------------------------------
80+
#ifdef __cplusplus
81+
extern "C" {
82+
#endif
83+
84+
/**
85+
* @brief System Clock Configuration
86+
* @param None
87+
* @retval None
88+
*/
89+
WEAK void SystemClock_Config(void)
90+
{
91+
RCC_OscInitTypeDef RCC_OscInitStruct = {};
92+
RCC_ClkInitTypeDef RCC_ClkInitStruct = {};
93+
94+
/** Configure LSE Drive Capability
95+
*/
96+
HAL_PWR_EnableBkUpAccess();
97+
__HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_LOW);
98+
/** Configure the main internal regulator output voltage
99+
*/
100+
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
101+
/** Initializes the CPU, AHB and APB busses clocks
102+
*/
103+
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSE | RCC_OSCILLATORTYPE_MSI;
104+
RCC_OscInitStruct.LSEState = RCC_LSE_ON;
105+
RCC_OscInitStruct.MSIState = RCC_MSI_ON;
106+
RCC_OscInitStruct.MSICalibrationValue = RCC_MSICALIBRATION_DEFAULT;
107+
RCC_OscInitStruct.MSIClockRange = RCC_MSIRANGE_11;
108+
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
109+
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
110+
Error_Handler();
111+
}
112+
/** Configure the SYSCLKSource, HCLK, PCLK1 and PCLK2 clocks dividers
113+
*/
114+
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK3 | RCC_CLOCKTYPE_HCLK
115+
| RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_PCLK1
116+
| RCC_CLOCKTYPE_PCLK2;
117+
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_MSI;
118+
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
119+
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
120+
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
121+
RCC_ClkInitStruct.AHBCLK3Divider = RCC_SYSCLK_DIV1;
122+
123+
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK) {
124+
Error_Handler();
125+
}
126+
}
127+
128+
#ifdef __cplusplus
129+
}
130+
#endif
131+
#endif /* ARDUINO_NUCLEO_WL55JC1 */
Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
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+
// Arduino UNO V3
19+
// CN9
20+
#define PB7 0
21+
#define PB6 1
22+
#define PB12 2
23+
#define PB3 PIN_A6
24+
#define PB5 4
25+
#define PB8 5
26+
#define PB10 6
27+
#define PC1 7
28+
// CN5
29+
#define PC2 8
30+
#define PA9 9
31+
#define PA4 10
32+
#define PA7 11
33+
#define PA6 12
34+
#define PA5 13
35+
#define PA11 PIN_A7
36+
#define PA12 PIN_A8
37+
// CN8
38+
#define PB1 PIN_A0
39+
#define PB2 PIN_A1
40+
#define PA10 PIN_A2
41+
#define PB4 PIN_A3
42+
#define PB14 PIN_A4
43+
#define PB13 PIN_A5
44+
// ST Morpho
45+
// CN10 Left Side
46+
#define PA0 22
47+
// CN10 Right Side
48+
#define PC3 23 // FE_CTRL3
49+
#define PA1 24
50+
#define PB11 25
51+
#define PB15 26
52+
#define PB9 27
53+
#define PB0 28 // VDD_TCXO Supply voltage of TCXO
54+
#define PA8 29
55+
#define PC0 30
56+
#define PC6 31
57+
#define PC5 32 // FE_CTRL2
58+
#define PC4 33 // FE_CTRL1
59+
// CN7 Left Side
60+
#define PC15 34 // OSC32_OUT - SB11 OFF not connected to ST Morpho
61+
#define PC14 35 // OSC32_IN - SB14 OFF not connected to ST Morpho
62+
#define PC13 36
63+
#define PA15 PIN_A9
64+
#define PA14 PIN_A10
65+
#define PA13 PIN_A11
66+
// Not on connectors
67+
#define PA2 40 // Could be on D1. See Solder bridge configuration.
68+
#define PA3 41 // Could be on D0. See Solder bridge configuration.
69+
#define PH3 42 // BOOT0 - JP3 - GND
70+
71+
// Alternate pins number
72+
#define PA1_ALT1 (PA1 | ALT1)
73+
#define PA2_ALT1 (PA2 | ALT1)
74+
#define PA3_ALT1 (PA3 | ALT1)
75+
#define PA7_ALT1 (PA7 | ALT1)
76+
#define PB8_ALT1 (PB8 | ALT1)
77+
#define PB9_ALT1 (PB9 | ALT1)
78+
79+
#define NUM_DIGITAL_PINS 43
80+
#define NUM_ANALOG_INPUTS 12
81+
82+
// On-board LED pin number
83+
#define LED1 PB15
84+
#define LED2 PB9
85+
#define LED3 PB11
86+
#ifndef LED_BUILTIN
87+
#define LED_BUILTIN LED1
88+
#endif
89+
#define LED_BLUE LED1
90+
#define LED_GREEN LED2
91+
#define LED_RED LED3
92+
93+
// On-board user button
94+
#define B1_BTN PA0 // PC13 (!SB16 SB15)
95+
#define B2_BTN PA1
96+
#define B3_BTN PC6
97+
#ifndef USER_BTN
98+
#define USER_BTN B1_BTN
99+
#endif
100+
101+
// Timer Definitions
102+
// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin
103+
#ifndef TIMER_TONE
104+
#define TIMER_TONE TIM16
105+
#endif
106+
#ifndef TIMER_SERVO
107+
#define TIMER_SERVO TIM17
108+
#endif
109+
110+
// UART Definitions
111+
#ifndef SERIAL_UART_INSTANCE
112+
#define SERIAL_UART_INSTANCE 101
113+
#endif
114+
115+
// Default pin used for generic 'Serial' instance
116+
// Mandatory for Firmata
117+
#ifndef PIN_SERIAL_RX
118+
#define PIN_SERIAL_RX PA3
119+
#endif
120+
#ifndef PIN_SERIAL_TX
121+
#define PIN_SERIAL_TX PA2
122+
#endif
123+
124+
#ifndef UART_WAKEUP_EXTI_LINE
125+
// For LPUART1
126+
#define UART_WAKEUP_EXTI_LINE LL_EXTI_LINE_28
127+
#endif
128+
129+
// Extra HAL modules
130+
#if !defined(HAL_DAC_MODULE_DISABLED)
131+
#define HAL_DAC_MODULE_ENABLED
132+
#endif
133+
134+
/*----------------------------------------------------------------------------
135+
* Arduino objects - C++ only
136+
*----------------------------------------------------------------------------*/
137+
138+
#ifdef __cplusplus
139+
// These serial port names are intended to allow libraries and architecture-neutral
140+
// sketches to automatically default to the correct port name for a particular type
141+
// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
142+
// the first hardware serial port whose RX/TX pins are not dedicated to another use.
143+
//
144+
// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
145+
//
146+
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
147+
//
148+
// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
149+
//
150+
// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
151+
//
152+
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
153+
// pins are NOT connected to anything by default.
154+
#ifndef SERIAL_PORT_MONITOR
155+
#define SERIAL_PORT_MONITOR Serial
156+
#endif
157+
#ifndef SERIAL_PORT_HARDWARE
158+
#define SERIAL_PORT_HARDWARE Serial
159+
#endif
160+
#endif

0 commit comments

Comments
 (0)