Skip to content

Commit b792e3d

Browse files
committed
chore: update STM32_WPAN from Cube version v1.23.0
Signed-off-by: Frederic Pillon <[email protected]>
1 parent 4a1bf81 commit b792e3d

File tree

12 files changed

+252
-308
lines changed

12 files changed

+252
-308
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.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)
4+
[STMicroelectronics/STM32CubeWB Release v1.23.0](https://github.com/STMicroelectronics/STM32CubeWB/releases/tag/v1.23.0)
5+
- Application: [BLE_TransparentMode](https://github.com/STMicroelectronics/STM32CubeWB/tree/v1.23.0/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode)
66

src/utility/STM32_WPAN/app_conf_default.h

Lines changed: 27 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:
@@ -328,6 +273,13 @@
328273

329274
#define CFG_BLE_MAX_TX_POWER (6)
330275

276+
/**
277+
* BLE stack Maximum number of created Enhanced ATT bearers to be configured
278+
* in addition to the number of links
279+
* - Range: 0 .. 4
280+
*/
281+
#define CFG_BLE_MAX_ADD_EATT_BEARERS (4)
282+
331283
/**
332284
* BLE Rx model configuration flags to be configured with:
333285
* - SHCI_C2_BLE_INIT_RX_MODEL_AGC_RSSI_LEGACY
@@ -347,11 +299,7 @@
347299
* This parameter is considered by the CPU2 when CFG_BLE_OPTIONS has SHCI_C2_BLE_INIT_OPTIONS_EXT_ADV flag set
348300
*/
349301

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
302+
#define CFG_BLE_MAX_ADV_SET_NBR (8)
355303

356304
/* Maximum advertising data length (in bytes)
357305
* Range: 31 .. 1650 with limitation:
@@ -360,11 +308,7 @@
360308
* This parameter is considered by the CPU2 when CFG_BLE_OPTIONS has SHCI_C2_BLE_INIT_OPTIONS_EXT_ADV flag set
361309
*/
362310

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
311+
#define CFG_BLE_MAX_ADV_DATA_LEN (207)
368312

369313
/* RF TX Path Compensation Value (16-bit signed integer). Units: 0.1 dB.
370314
* Range: -1280 .. 1280
@@ -387,7 +331,6 @@
387331

388332
#define CFG_BLE_CORE_VERSION (SHCI_C2_BLE_INIT_BLE_CORE_5_4)
389333

390-
#if 0
391334
/******************************************************************************
392335
* Transport Layer
393336
******************************************************************************/
@@ -724,5 +667,4 @@ typedef enum
724667

725668
#define CFG_OTP_END_ADRESS OTP_AREA_END_ADDR
726669

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

src/utility/STM32_WPAN/ble_bufsize.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
#if (BEACON_ONLY != 0)
100100
#define BLE_FIXED_BUFFER_SIZE_BYTES 4200 /* Beacon only */
101101
#elif (LL_ONLY_BASIC != 0)
102-
#define BLE_FIXED_BUFFER_SIZE_BYTES 6040 /* LL only Basic*/
102+
#define BLE_FIXED_BUFFER_SIZE_BYTES 5960 /* LL only Basic*/
103103
#elif (LL_ONLY != 0)
104104
#define BLE_FIXED_BUFFER_SIZE_BYTES 6288 /* LL only Full */
105105
#elif (SLAVE_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 );

src/utility/STM32_WPAN/hw_ipcc.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@
1818
*/
1919
/* USER CODE END Header */
2020

21-
#if defined(STM32WBxx)
2221
/* Includes ------------------------------------------------------------------*/
23-
#include "hw.h"
22+
#include "app_common.h"
2423
#include "mbox_def.h"
2524
#include "utilities_conf.h"
2625

@@ -746,4 +745,3 @@ static void HW_IPCC_TRACES_EvtHandler( void )
746745
}
747746

748747
__weak void HW_IPCC_TRACES_EvtNot( void ){};
749-
#endif /* STM32WBxx */

src/utility/STM32_WPAN/shci.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
*/
1818

1919

20-
#if defined(STM32WBxx)
2120
/* Includes ------------------------------------------------------------------*/
2221
#include "stm32_wpan_common.h"
2322

@@ -760,4 +759,3 @@ SHCI_CmdStatus_t SHCI_GetWirelessFwInfo( WirelessFwInfo_t* pWirelessInfo )
760759

761760
return (SHCI_Success);
762761
}
763-
#endif /* STM32WBxx */

0 commit comments

Comments
 (0)