Movatterモバイル変換


[0]ホーム

URL:


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

Commitceb3beb

Browse files
committed
variant(WB): add P-Nucleo WB55 USB Dongle
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
1 parent5a3f412 commitceb3beb

File tree

4 files changed

+331
-1
lines changed

4 files changed

+331
-1
lines changed

‎README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,8 @@ User can add a STM32 based board following this [wiki](https://github.com/stm32d
130130
|:green_heart:| STM32L452RE-P|[Nucleo L452RE-P](http://www.st.com/en/evaluation-tools/nucleo-l452re-p.html)|*1.8.0*||
131131
|:green_heart:| STM32L476RG|[Nucleo L476RG](http://www.st.com/en/evaluation-tools/nucleo-l476rg.html)|*0.1.0*||
132132
|:yellow_heart:| STM32WB15CCU|[Nucleo-WB15CC](https://www.st.com/en/evaluation-tools/nucleo-wb15cc.html)|**2.5.0**||
133-
|: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)|
133+
|: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)|
134+
|:yellow_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)|
134135
|:green_heart:| STM32WL55JC|[Nucleo WL55JC1](https://www.st.com/en/evaluation-tools/nucleo-wl55jc.html)|*2.1.0*| LoRa support not available|
135136

136137

‎boards.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,20 @@ Nucleo_64.menu.pnum.P_NUCLEO_WB55RG.build.product_line=STM32WB55xx
627627
Nucleo_64.menu.pnum.P_NUCLEO_WB55RG.build.variant=STM32WBxx/WB55R(C-E-G)V
628628
Nucleo_64.menu.pnum.P_NUCLEO_WB55RG.build.cmsis_lib_gcc=arm_cortexM4lf_math
629629

630+
# P_NUCLEO_WB55 USB Dongle
631+
Nucleo_64.menu.pnum.P_NUCLEO_WB55_USB_DONGLE=P-Nucleo WB55 USB Dongle
632+
Nucleo_64.menu.pnum.P_NUCLEO_WB55_USB_DONGLE.node="No_mass_storage_for_this_board_Use_STLink_upload_method"
633+
Nucleo_64.menu.pnum.P_NUCLEO_WB55_USB_DONGLE.upload.maximum_size=524288
634+
Nucleo_64.menu.pnum.P_NUCLEO_WB55_USB_DONGLE.upload.maximum_data_size=196608
635+
Nucleo_64.menu.pnum.P_NUCLEO_WB55_USB_DONGLE.build.mcu=cortex-m4
636+
Nucleo_64.menu.pnum.P_NUCLEO_WB55_USB_DONGLE.build.fpu=-mfpu=fpv4-sp-d16
637+
Nucleo_64.menu.pnum.P_NUCLEO_WB55_USB_DONGLE.build.float-abi=-mfloat-abi=hard
638+
Nucleo_64.menu.pnum.P_NUCLEO_WB55_USB_DONGLE.build.board=P_NUCLEO_WB55_USB_DONGLE
639+
Nucleo_64.menu.pnum.P_NUCLEO_WB55_USB_DONGLE.build.series=STM32WBxx
640+
Nucleo_64.menu.pnum.P_NUCLEO_WB55_USB_DONGLE.build.product_line=STM32WB55xx
641+
Nucleo_64.menu.pnum.P_NUCLEO_WB55_USB_DONGLE.build.variant=STM32WBxx/WB35C(C-E)UxA_WB55C(C-E-G)U
642+
Nucleo_64.menu.pnum.P_NUCLEO_WB55_USB_DONGLE.build.cmsis_lib_gcc=arm_cortexM4lf_math
643+
630644
# NUCLEO_WL55JC1 board
631645
Nucleo_64.menu.pnum.NUCLEO_WL55JC1=Nucleo WL55JC1
632646
Nucleo_64.menu.pnum.NUCLEO_WL55JC1.node="NOD_WL55JC"
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
/*
2+
*******************************************************************************
3+
* Copyright (c) 2023, 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_P_NUCLEO_WB55_USB_DONGLE)
14+
#include"pins_arduino.h"
15+
#include"lock_resource.h"
16+
17+
// Digital PinName array
18+
const PinName digitalPin[] = {
19+
// CN1
20+
PA_13,
21+
PA_14,
22+
PB_3,
23+
PB_2,
24+
PA_5,
25+
PA_6,
26+
PA_7,
27+
// CN2
28+
PB_8,
29+
PB_9,
30+
PA_0,
31+
PA_2,
32+
PA_3,
33+
PB_6,
34+
PA_9,
35+
PA_8,
36+
PA_1,
37+
PB_7,
38+
// Specific
39+
PC_14,
40+
PC_15,
41+
PH_3,
42+
PA_4,
43+
PB_0,
44+
PB_1,
45+
PA_10,
46+
PA_11,
47+
PA_12
48+
};
49+
50+
// Analog (Ax) pin number array
51+
constuint32_t analogInputPin[] = {
52+
4,// A0
53+
5,// A1
54+
6,// A2
55+
9,// A3
56+
10,// A4
57+
11,// A5
58+
13,// A6
59+
14,// A7
60+
15// A8
61+
};
62+
63+
// ----------------------------------------------------------------------------
64+
#ifdef __cplusplus
65+
extern"C" {
66+
#endif
67+
68+
/**
69+
* @brief System Clock Configuration
70+
* @param None
71+
* @retval None
72+
*/
73+
WEAKvoidSystemClock_Config(void)
74+
{
75+
RCC_OscInitTypeDef RCC_OscInitStruct = {};
76+
RCC_ClkInitTypeDef RCC_ClkInitStruct = {};
77+
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {};
78+
79+
/* This prevents concurrent access to RCC registers by CPU2 (M0+)*/
80+
hsem_lock(CFG_HW_RCC_SEMID, HSEM_LOCK_DEFAULT_RETRY);
81+
82+
/* Macro to configure the PLL multiplication factor*/
83+
__HAL_RCC_PLL_PLLM_CONFIG(RCC_PLLM_DIV2);
84+
85+
/* Macro to configure the PLL clock source*/
86+
__HAL_RCC_PLL_PLLSOURCE_CONFIG(RCC_PLLSOURCE_HSE);
87+
88+
__HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_MEDIUMHIGH);
89+
/* Configure the main internal regulator output voltage*/
90+
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
91+
92+
/* This prevents the CPU2 (M0+) to disable the HSI48 oscillator*/
93+
hsem_lock(CFG_HW_CLK48_CONFIG_SEMID, HSEM_LOCK_DEFAULT_RETRY);
94+
95+
/* Initializes the CPU, AHB and APB busses clocks*/
96+
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI48 | RCC_OSCILLATORTYPE_HSI
97+
| RCC_OSCILLATORTYPE_HSE | RCC_OSCILLATORTYPE_LSE;
98+
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
99+
RCC_OscInitStruct.LSEState = RCC_LSE_ON;
100+
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
101+
RCC_OscInitStruct.HSI48State = RCC_HSI48_ON;
102+
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
103+
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
104+
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
105+
Error_Handler();
106+
}
107+
108+
/* Configure the SYSCLKSource, HCLK, PCLK1 and PCLK2 clocks dividers*/
109+
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK4 | RCC_CLOCKTYPE_HCLK2
110+
| RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK
111+
| RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2;
112+
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_HSE;
113+
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
114+
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
115+
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
116+
RCC_ClkInitStruct.AHBCLK2Divider = RCC_SYSCLK_DIV1;
117+
RCC_ClkInitStruct.AHBCLK4Divider = RCC_SYSCLK_DIV1;
118+
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_1) != HAL_OK) {
119+
Error_Handler();
120+
}
121+
122+
/* Initializes the peripherals clocks*/
123+
/* RNG needs to be configured like in M0 core, i.e. with HSI48*/
124+
PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_SMPS | RCC_PERIPHCLK_RFWAKEUP
125+
| RCC_PERIPHCLK_RNG | RCC_PERIPHCLK_USB;
126+
PeriphClkInitStruct.RFWakeUpClockSelection = RCC_RFWKPCLKSOURCE_LSE;
127+
PeriphClkInitStruct.RngClockSelection = RCC_RNGCLKSOURCE_HSI48;
128+
PeriphClkInitStruct.SmpsClockSelection = RCC_SMPSCLKSOURCE_HSE;
129+
PeriphClkInitStruct.SmpsDivSelection = RCC_SMPSCLKDIV_RANGE0;
130+
PeriphClkInitStruct.UsbClockSelection = RCC_USBCLKSOURCE_HSI48;
131+
132+
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK) {
133+
Error_Handler();
134+
}
135+
136+
LL_PWR_SMPS_SetStartupCurrent(LL_PWR_SMPS_STARTUP_CURRENT_80MA);
137+
LL_PWR_SMPS_SetOutputVoltageLevel(LL_PWR_SMPS_OUTPUT_VOLTAGE_1V40);
138+
LL_PWR_SMPS_Enable();
139+
140+
/* Select HSI as system clock source after Wake Up from Stop mode*/
141+
LL_RCC_SetClkAfterWakeFromStop(LL_RCC_STOP_WAKEUPCLOCK_HSI);
142+
143+
hsem_unlock(CFG_HW_RCC_SEMID);
144+
}
145+
146+
#ifdef __cplusplus
147+
}
148+
#endif
149+
#endif/* ARDUINO_P_NUCLEO_WB55_USB_DONGLE**/
Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
/*
2+
*******************************************************************************
3+
* Copyright (c) 2023, 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+
// CN1
19+
#definePA13 0 // SWDIO
20+
#definePA14 1 // SWCLK
21+
#definePB3 2 // SWO
22+
#definePB2 3 // SPI1 NSS
23+
#definePA5 PIN_A0 // SPI1 SCK
24+
#definePA6 PIN_A1 // SPI1 MISO
25+
#definePA7 PIN_A2 // SPI1 MOSI
26+
// CN2
27+
#definePB8 7 // I2C1 SCL
28+
#definePB9 8 // I2C1 SDA
29+
#definePA0 PIN_A3 // WKUP
30+
#definePA2 PIN_A4 // LPUART1 TX
31+
#definePA3 PIN_A5 // LPUART1 RX
32+
#definePB6 12
33+
#definePA9 PIN_A6 // SB2 close/SB6 open (default)
34+
#definePA8 PIN_A7
35+
#definePA1 PIN_A8
36+
// Same position than PA9 on CN2
37+
#definePB7 16 // SB2 open/SB6 close
38+
// Specific
39+
#definePC14 17 // OSC32-IN
40+
#definePC15 18 // OSC32-OUT
41+
#definePH3 19 // BOOT0
42+
#definePA4 20 // LED1 BLUE
43+
#definePB0 21 // LED2 GREEN
44+
#definePB1 22 // LED3 RED
45+
#definePA10 23 // USER_BTN
46+
#definePA11 24 // USB_DM
47+
#definePA12 25 // USB_DP
48+
49+
// Not connected
50+
// PA15
51+
// PB4
52+
// PB5
53+
// PE4
54+
55+
// Alternate pins number
56+
#definePA7_ALT1 (PA7 | ALT1)
57+
#definePB8_ALT1 (PB8 | ALT1)
58+
#definePB9_ALT1 (PB9 | ALT1)
59+
60+
#defineNUM_DIGITAL_PINS 26
61+
#defineNUM_ANALOG_INPUTS 9
62+
63+
// On-board LED pin number
64+
#defineLED1 PA4
65+
#defineLED2 PB0
66+
#defineLED3 PB1
67+
#ifndefLED_BUILTIN
68+
#defineLED_BUILTIN LED1
69+
#endif
70+
#defineLED_BLUE LED1
71+
#defineLED_GREEN LED2
72+
#defineLED_RED LED3
73+
74+
// On-board user button
75+
// Note: use '_BTN' for SW1 as it is a register name of M24SR64-Y
76+
#defineSW1_BTN PA10
77+
#ifndefUSER_BTN
78+
#defineUSER_BTN SW1_BTN
79+
#endif
80+
81+
// SPI definitions
82+
#ifndefPIN_SPI_SS
83+
#definePIN_SPI_SS PB2
84+
#endif
85+
#ifndefPIN_SPI_SS1
86+
#definePIN_SPI_SS1 PB6
87+
#endif
88+
#ifndefPIN_SPI_SS2
89+
#definePIN_SPI_SS2 PA8
90+
#endif
91+
#ifndefPIN_SPI_SS3
92+
#definePIN_SPI_SS3 PNUM_NOT_DEFINED
93+
#endif
94+
#ifndefPIN_SPI_MOSI
95+
#definePIN_SPI_MOSI PA7
96+
#endif
97+
#ifndefPIN_SPI_MISO
98+
#definePIN_SPI_MISO PA6
99+
#endif
100+
#ifndefPIN_SPI_SCK
101+
#definePIN_SPI_SCK PA5
102+
#endif
103+
104+
// I2C definitions
105+
#ifndefPIN_WIRE_SDA
106+
#definePIN_WIRE_SDA PB9
107+
#endif
108+
#ifndefPIN_WIRE_SCL
109+
#definePIN_WIRE_SCL PB8
110+
#endif
111+
112+
// Timer Definitions
113+
// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin
114+
#ifndefTIMER_TONE
115+
#defineTIMER_TONE TIM16
116+
#endif
117+
#ifndefTIMER_SERVO
118+
#defineTIMER_SERVO TIM17
119+
#endif
120+
121+
// UART Definitions
122+
#ifndefSERIAL_UART_INSTANCE
123+
#defineSERIAL_UART_INSTANCE 101
124+
#endif
125+
126+
// Default pin used for generic 'Serial' instance
127+
// Mandatory for Firmata
128+
#ifndefPIN_SERIAL_RX
129+
#definePIN_SERIAL_RX PA3
130+
#endif
131+
#ifndefPIN_SERIAL_TX
132+
#definePIN_SERIAL_TX PA2
133+
#endif
134+
135+
// Extra HAL modules
136+
#if !defined(HAL_QSPI_MODULE_DISABLED)
137+
#defineHAL_QSPI_MODULE_ENABLED
138+
#endif
139+
140+
/*----------------------------------------------------------------------------
141+
* Arduino objects - C++ only
142+
*----------------------------------------------------------------------------*/
143+
144+
#ifdef__cplusplus
145+
// These serial port names are intended to allow libraries and architecture-neutral
146+
// sketches to automatically default to the correct port name for a particular type
147+
// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
148+
// the first hardware serial port whose RX/TX pins are not dedicated to another use.
149+
//
150+
// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
151+
//
152+
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
153+
//
154+
// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
155+
//
156+
// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
157+
//
158+
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
159+
// pins are NOT connected to anything by default.
160+
#ifndefSERIAL_PORT_MONITOR
161+
#defineSERIAL_PORT_MONITOR Serial
162+
#endif
163+
#ifndefSERIAL_PORT_HARDWARE
164+
#defineSERIAL_PORT_HARDWARE Serial
165+
#endif
166+
#endif

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp