Skip to content

Commit f7ca0a2

Browse files
committed
chore: update STM32_WPAN from Cube version v1.22.0
Signed-off-by: Frederic Pillon <[email protected]>
1 parent 4339998 commit f7ca0a2

File tree

11 files changed

+178
-141
lines changed

11 files changed

+178
-141
lines changed

src/utility/STM32_WPAN/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
## Source
33

4-
[STMicroelectronics/STM32CubeWB Release v1.21.0](https://github.com/STMicroelectronics/STM32CubeWB/releases/tag/v1.21.0)
5-
- Application: [BLE_TransparentMode](https://github.com/STMicroelectronics/STM32CubeWB/tree/v1.21.0/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode)
4+
[STMicroelectronics/STM32CubeWB Release v1.22.0](https://github.com/STMicroelectronics/STM32CubeWB/releases/tag/v1.22.0)
5+
- Application: [BLE_TransparentMode](https://github.com/STMicroelectronics/STM32CubeWB/tree/v1.22.0/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode)
66

src/utility/STM32_WPAN/app_conf_default.h

Lines changed: 20 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/* USER CODE BEGIN Header */
22
/**
33
******************************************************************************
4-
* @file app_conf_default.h
4+
* @file app_conf.h
55
* @author MCD Application Team
6-
* @brief Default application configuration file for STM32WPAN Middleware.
6+
* @brief Application configuration file for STM32WPAN Middleware.
77
******************************************************************************
88
* @attention
99
*
@@ -19,42 +19,18 @@
1919
/* USER CODE END Header */
2020

2121
/* Define to prevent recursive inclusion -------------------------------------*/
22-
#ifndef APP_CONF_DEFAULT_H
23-
#define APP_CONF_DEFAULT_H
22+
#ifndef APP_CONF_H
23+
#define APP_CONF_H
2424

25-
#if 0
2625
#include "hw.h"
2726
#include "hw_conf.h"
2827
#include "hw_if.h"
2928
#include "ble_bufsize.h"
30-
#endif
3129

3230
/******************************************************************************
3331
* Application Config
3432
******************************************************************************/
3533

36-
/**< generic parameters ******************************************************/
37-
/* HCI related defines */
38-
39-
#define ACI_HAL_SET_TX_POWER_LEVEL 0xFC0F
40-
#define ACI_WRITE_CONFIG_DATA_OPCODE 0xFC0C
41-
#define ACI_READ_CONFIG_DATA_OPCODE 0xFC0D
42-
#define MAX_HCI_ACL_PACKET_SIZE (sizeof(TL_PacketHeader_t) + 5 + 251)
43-
#define HCI_RESET 0x0C03
44-
45-
#ifndef BLE_SHARED_MEM_BYTE_ORDER
46-
#define BLE_SHARED_MEM_BYTE_ORDER MSBFIRST
47-
#endif
48-
#define BLE_MODULE_SHARED_MEM_BUFFER_SIZE 128
49-
50-
/**
51-
* Define Tx Power
52-
*/
53-
#ifndef CFG_TX_POWER
54-
#define CFG_TX_POWER (0x18) /* -0.15dBm */
55-
#endif
56-
57-
#if 0
5834
/**
5935
* Define Secure Connections Support
6036
*/
@@ -128,7 +104,6 @@
128104
#define CFG_FW_SUBVERSION (1)
129105
#define CFG_FW_BRANCH (0)
130106
#define CFG_FW_BUILD (0)
131-
#endif
132107

133108
/******************************************************************************
134109
* BLE Stack
@@ -137,25 +112,13 @@
137112
* Maximum number of simultaneous connections that the device will support.
138113
* Valid values are from 1 to 8
139114
*/
140-
#ifndef CFG_BLE_NUM_LINK
141-
#ifdef STM32WB15xx
142-
#define CFG_BLE_NUM_LINK 3
143-
#else
144-
#define CFG_BLE_NUM_LINK 8
145-
#endif
146-
#endif
115+
#define CFG_BLE_NUM_LINK 8
147116

148117
/**
149118
* Maximum number of Services that can be stored in the GATT database.
150119
* Note that the GAP and GATT services are automatically added so this parameter should be 2 plus the number of user services
151120
*/
152-
#ifndef CFG_BLE_NUM_GATT_SERVICES
153-
#ifdef STM32WB15xx
154-
#define CFG_BLE_NUM_GATT_SERVICES 4
155-
#else
156-
#define CFG_BLE_NUM_GATT_SERVICES 8
157-
#endif
158-
#endif
121+
#define CFG_BLE_NUM_GATT_SERVICES 8
159122

160123
/**
161124
* Maximum number of Attributes
@@ -164,13 +127,7 @@
164127
* Note that certain characteristics and relative descriptors are added automatically during device initialization
165128
* so this parameters should be 9 plus the number of user Attributes
166129
*/
167-
#ifndef CFG_BLE_NUM_GATT_ATTRIBUTES
168-
#ifdef STM32WB15xx
169-
#define CFG_BLE_NUM_GATT_ATTRIBUTES 30
170-
#else
171-
#define CFG_BLE_NUM_GATT_ATTRIBUTES 68
172-
#endif
173-
#endif
130+
#define CFG_BLE_NUM_GATT_ATTRIBUTES 68
174131

175132
/**
176133
* Maximum supported ATT_MTU size
@@ -206,16 +163,12 @@
206163
/**
207164
* Enable or disable the Extended Packet length feature. Valid values are 0 or 1.
208165
*/
209-
#ifndef CFG_BLE_DATA_LENGTH_EXTENSION
210-
#define CFG_BLE_DATA_LENGTH_EXTENSION 1
211-
#endif
166+
#define CFG_BLE_DATA_LENGTH_EXTENSION 1
212167

213168
/**
214169
* Sleep clock accuracy in Peripheral mode (ppm value)
215170
*/
216-
#ifndef CFG_BLE_PERIPHERAL_SCA
217-
#define CFG_BLE_PERIPHERAL_SCA 500
218-
#endif
171+
#define CFG_BLE_PERIPHERAL_SCA 500
219172

220173
/**
221174
* Sleep clock accuracy in Central mode
@@ -228,9 +181,7 @@
228181
* 6 : 21 ppm to 30 ppm
229182
* 7 : 0 ppm to 20 ppm
230183
*/
231-
#ifndef CFG_BLE_CENTRAL_SCA
232-
#define CFG_BLE_CENTRAL_SCA 0
233-
#endif
184+
#define CFG_BLE_CENTRAL_SCA 0
234185

235186
/**
236187
* LsSource
@@ -239,27 +190,21 @@
239190
* - bit 1: 1: STM32WB5M Module device 0: Other devices as STM32WBxx SOC, STM32WB1M module
240191
* - bit 2: 1: HSE/1024 Clock config 0: LSE Clock config
241192
*/
242-
#ifndef CFG_BLE_LS_SOURCE
243-
#if defined(STM32WB5Mxx)
244-
#define CFG_BLE_LS_SOURCE (SHCI_C2_BLE_INIT_CFG_BLE_LS_NOCALIB | SHCI_C2_BLE_INIT_CFG_BLE_LS_MOD5MM_DEV | SHCI_C2_BLE_INIT_CFG_BLE_LS_CLK_LSE)
245-
#else
246-
#define CFG_BLE_LS_SOURCE (SHCI_C2_BLE_INIT_CFG_BLE_LS_NOCALIB | SHCI_C2_BLE_INIT_CFG_BLE_LS_OTHER_DEV | SHCI_C2_BLE_INIT_CFG_BLE_LS_CLK_LSE)
247-
#endif
193+
#if defined(STM32WB5Mxx)
194+
#define CFG_BLE_LS_SOURCE (SHCI_C2_BLE_INIT_CFG_BLE_LS_NOCALIB | SHCI_C2_BLE_INIT_CFG_BLE_LS_MOD5MM_DEV | SHCI_C2_BLE_INIT_CFG_BLE_LS_CLK_LSE)
195+
#else
196+
#define CFG_BLE_LS_SOURCE (SHCI_C2_BLE_INIT_CFG_BLE_LS_NOCALIB | SHCI_C2_BLE_INIT_CFG_BLE_LS_OTHER_DEV | SHCI_C2_BLE_INIT_CFG_BLE_LS_CLK_LSE)
248197
#endif
249198

250199
/**
251200
* Start up time of the high speed (16 or 32 MHz) crystal oscillator in units of 625/256 us (~2.44 us)
252201
*/
253-
#ifndef CFG_BLE_HSE_STARTUP_TIME
254-
#define CFG_BLE_HSE_STARTUP_TIME 0x148
255-
#endif
202+
#define CFG_BLE_HSE_STARTUP_TIME 0x148
256203

257204
/**
258205
* Maximum duration of the connection event when the device is in Peripheral mode in units of 625/256 us (~2.44 us)
259206
*/
260-
#ifndef CFG_BLE_MAX_CONN_EVENT_LENGTH
261-
#define CFG_BLE_MAX_CONN_EVENT_LENGTH (0xFFFFFFFF)
262-
#endif
207+
#define CFG_BLE_MAX_CONN_EVENT_LENGTH (0xFFFFFFFF)
263208

264209
/**
265210
* Viterbi Mode
@@ -305,7 +250,7 @@
305250
* 0: LE Power Class 2-3
306251
* other bits: complete with Options_extension flag
307252
*/
308-
#define CFG_BLE_OPTIONS (SHCI_C2_BLE_INIT_OPTIONS_LL_ONLY | SHCI_C2_BLE_INIT_OPTIONS_WITH_SVC_CHANGE_DESC | SHCI_C2_BLE_INIT_OPTIONS_DEVICE_NAME_RW | SHCI_C2_BLE_INIT_OPTIONS_EXT_ADV | SHCI_C2_BLE_INIT_OPTIONS_CS_ALGO2 | SHCI_C2_BLE_INIT_OPTIONS_FULL_GATTDB_NVM | SHCI_C2_BLE_INIT_OPTIONS_GATT_CACHING_NOTUSED | SHCI_C2_BLE_INIT_OPTIONS_POWER_CLASS_2_3)
253+
#define CFG_BLE_OPTIONS (SHCI_C2_BLE_INIT_OPTIONS_LL_HOST | SHCI_C2_BLE_INIT_OPTIONS_WITH_SVC_CHANGE_DESC | SHCI_C2_BLE_INIT_OPTIONS_DEVICE_NAME_RW | SHCI_C2_BLE_INIT_OPTIONS_EXT_ADV | SHCI_C2_BLE_INIT_OPTIONS_CS_ALGO2 | SHCI_C2_BLE_INIT_OPTIONS_FULL_GATTDB_NVM | SHCI_C2_BLE_INIT_OPTIONS_GATT_CACHING_NOTUSED | SHCI_C2_BLE_INIT_OPTIONS_POWER_CLASS_2_3)
309254

310255
/**
311256
* BLE stack Options_extension flags to be configured with:
@@ -347,11 +292,7 @@
347292
* This parameter is considered by the CPU2 when CFG_BLE_OPTIONS has SHCI_C2_BLE_INIT_OPTIONS_EXT_ADV flag set
348293
*/
349294

350-
#if defined(STM32WB15xx)
351-
#define CFG_BLE_MAX_ADV_SET_NBR (3)
352-
#else
353-
#define CFG_BLE_MAX_ADV_SET_NBR (8)
354-
#endif
295+
#define CFG_BLE_MAX_ADV_SET_NBR (8)
355296

356297
/* Maximum advertising data length (in bytes)
357298
* Range: 31 .. 1650 with limitation:
@@ -360,11 +301,7 @@
360301
* This parameter is considered by the CPU2 when CFG_BLE_OPTIONS has SHCI_C2_BLE_INIT_OPTIONS_EXT_ADV flag set
361302
*/
362303

363-
#if defined(STM32WB15xx)
364-
#define CFG_BLE_MAX_ADV_DATA_LEN (414)
365-
#else
366-
#define CFG_BLE_MAX_ADV_DATA_LEN (207)
367-
#endif
304+
#define CFG_BLE_MAX_ADV_DATA_LEN (207)
368305

369306
/* RF TX Path Compensation Value (16-bit signed integer). Units: 0.1 dB.
370307
* Range: -1280 .. 1280
@@ -387,7 +324,6 @@
387324

388325
#define CFG_BLE_CORE_VERSION (SHCI_C2_BLE_INIT_BLE_CORE_5_4)
389326

390-
#if 0
391327
/******************************************************************************
392328
* Transport Layer
393329
******************************************************************************/
@@ -724,5 +660,4 @@ typedef enum
724660

725661
#define CFG_OTP_END_ADRESS OTP_AREA_END_ADDR
726662

727-
#endif
728-
#endif /*APP_CONF_DEFAULT_H */
663+
#endif /*APP_CONF_H */

src/utility/STM32_WPAN/ble_bufsize.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*****************************************************************************
66
* @attention
77
*
8-
* Copyright (c) 2018-2024 STMicroelectronics.
8+
* Copyright (c) 2018-2025 STMicroelectronics.
99
* All rights reserved.
1010
*
1111
* This software is licensed under terms that can be found in the LICENSE file
@@ -97,7 +97,7 @@
9797
* mentioned parameters.
9898
*/
9999
#if (BEACON_ONLY != 0)
100-
#define BLE_FIXED_BUFFER_SIZE_BYTES 4100 /* Beacon only */
100+
#define BLE_FIXED_BUFFER_SIZE_BYTES 4200 /* Beacon only */
101101
#elif (LL_ONLY_BASIC != 0)
102102
#define BLE_FIXED_BUFFER_SIZE_BYTES 6040 /* LL only Basic*/
103103
#elif (LL_ONLY != 0)
@@ -114,7 +114,7 @@
114114
* BLE_PER_LINK_SIZE_BYTES: additional memory size used per link
115115
*/
116116
#if (BEACON_ONLY != 0)
117-
#define BLE_PER_LINK_SIZE_BYTES 108 /* Beacon only */
117+
#define BLE_PER_LINK_SIZE_BYTES 76 /* Beacon only */
118118
#elif (LL_ONLY_BASIC != 0)
119119
#define BLE_PER_LINK_SIZE_BYTES 244 /* LL only Basic */
120120
#elif (LL_ONLY != 0)

src/utility/STM32_WPAN/hw.h

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,14 @@ extern "C" {
2626
#endif
2727

2828
/* Includes ------------------------------------------------------------------*/
29-
#include "stm32_def.h"
30-
#include "stm32wbxx_ll_bus.h"
31-
#include "stm32wbxx_ll_exti.h"
32-
#include "stm32wbxx_ll_system.h"
33-
#include "stm32wbxx_ll_rcc.h"
34-
#include "stm32wbxx_ll_ipcc.h"
35-
#include "stm32wbxx_ll_cortex.h"
36-
#include "stm32wbxx_ll_utils.h"
37-
#include "stm32wbxx_ll_pwr.h"
3829

3930
/******************************************************************************
4031
* HW IPCC
4132
******************************************************************************/
4233
void HW_IPCC_Enable( void );
4334
void HW_IPCC_Init( void );
44-
#define HW_IPCC_Rx_Handler IPCC_C1_RX_IRQHandler
45-
#define HW_IPCC_Tx_Handler IPCC_C1_TX_IRQHandler
35+
void HW_IPCC_Rx_Handler( void );
36+
void HW_IPCC_Tx_Handler( void );
4637

4738
void HW_IPCC_BLE_Init( void );
4839
void HW_IPCC_BLE_SendCmd( void );

0 commit comments

Comments
 (0)