Skip to content

Commit 65091a9

Browse files
committed
chore: update STM32_WPAN from Cube version v1.20.0
Signed-off-by: Frederic Pillon <[email protected]>
1 parent da08a10 commit 65091a9

File tree

11 files changed

+37
-141
lines changed

11 files changed

+37
-141
lines changed

src/utility/STM32_WPAN/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
## Source
33

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

src/utility/STM32_WPAN/app_conf_default.h

+20-85
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
******************************************************************************/
@@ -723,5 +659,4 @@ typedef enum
723659

724660
#define CFG_OTP_END_ADRESS OTP_AREA_END_ADDR
725661

726-
#endif
727-
#endif /*APP_CONF_DEFAULT_H */
662+
#endif /*APP_CONF_H */

src/utility/STM32_WPAN/ble_bufsize.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*****************************************************************************
22
* @file ble_bufsize.h
3-
* @author MDG
3+
*
44
* @brief Definition of BLE stack buffers size
55
*****************************************************************************
66
* @attention
@@ -49,7 +49,7 @@
4949
*/
5050
#define BLE_MEM_BLOCK_SIZE 32
5151

52-
#if (SLAVE_ONLY != 0) ||(BASIC_FEATURES != 0)
52+
#if (SLAVE_ONLY != 0) || (BASIC_FEATURES != 0)
5353
#define BLE_MEM_BLOCK_X_PTX(n_link) 0
5454
#else
5555
#define BLE_MEM_BLOCK_X_PTX(n_link) (n_link)

src/utility/STM32_WPAN/hw.h

+2-11
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

+1-3
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

2625
/* Global variables ---------------------------------------------------------*/
@@ -668,4 +667,3 @@ static void HW_IPCC_TRACES_EvtHandler( void )
668667
}
669668

670669
__weak void HW_IPCC_TRACES_EvtNot( void ){};
671-
#endif /* STM32WBxx */

src/utility/STM32_WPAN/shci.c

-2
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 */

src/utility/STM32_WPAN/shci.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -882,6 +882,7 @@ extern "C" {
882882
#define SHCI_C2_CONFIG_CONFIG1_BIT0_BLE_NVM_DATA_TO_SRAM (1<<0)
883883
#define SHCI_C2_CONFIG_CONFIG1_BIT1_THREAD_NVM_DATA_TO_INTERNAL_FLASH (0<<1)
884884
#define SHCI_C2_CONFIG_CONFIG1_BIT1_THREAD_NVM_DATA_TO_SRAM (1<<1)
885+
#define SHCI_C2_CONFIG_CONFIG1_BIT2_SET_EUI64_FORMAT (1<<2)
885886

886887
/**
887888
* EvtMask1
@@ -1340,7 +1341,9 @@ typedef struct {
13401341
* 1 - BLE NVM Data are written in SRAM cache pointed by BleNvmRamAddress
13411342
* - bit1 : 0 - THREAD NVM Data data are flushed in internal secure flash
13421343
* 1 - THREAD NVM Data are written in SRAM cache pointed by ThreadNvmRamAddress
1343-
* - bit2 to bit7 : Unused, shall be set to 0
1344+
* - bit2 : 0 - Thread EUI64 is set to new (and current) format
1345+
* 1 - Thread EUI64 is set to old format
1346+
* - bit3 to bit7 : Unused, shall be set to 0
13441347
* uint8_t EvtMask1 :
13451348
* When a bit is set to 0, the event is not reported
13461349
* bit0 : Asynchronous Event with Sub Evt Code 0x9201 (= SHCI_SUB_EVT_ERROR_NOTIF)

src/utility/STM32_WPAN/shci_tl.c

+4-23
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,11 @@
1717
*/
1818

1919

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

2423
#include "stm_list.h"
2524
#include "shci_tl.h"
26-
#include "stm32_def.h"
27-
#include "wiring_time.h"
2825

2926
/* Private typedef -----------------------------------------------------------*/
3027
typedef enum
@@ -171,20 +168,6 @@ void shci_send( uint16_t cmd_code, uint8_t len_cmd_payload, uint8_t * p_cmd_payl
171168
return;
172169
}
173170

174-
void shci_notify_asynch_evt(void *pdata)
175-
{
176-
UNUSED(pdata);
177-
/* Need to parse data in future version */
178-
shci_user_evt_proc();
179-
}
180-
181-
void shci_register_io_bus(tSHciIO *fops)
182-
{
183-
/* Register IO bus services */
184-
fops->Init = TL_SYS_Init;
185-
fops->Send = TL_SYS_SendCmd;
186-
}
187-
188171
/* Private functions ---------------------------------------------------------*/
189172
static void TlInit( TL_CmdPacket_t * p_cmdbuffer )
190173
{
@@ -252,11 +235,10 @@ static void TlUserEvtReceived(TL_EvtPacket_t *shcievt)
252235
/* Weak implementation ----------------------------------------------------------------*/
253236
__WEAK void shci_cmd_resp_wait(uint32_t timeout)
254237
{
255-
for (unsigned long start = millis(); (millis() - start) < timeout;) {
256-
if (CmdRspStatusFlag == SHCI_TL_CMD_RESP_RELEASE) {
257-
break;
258-
}
259-
}
238+
(void)timeout;
239+
240+
while(CmdRspStatusFlag != SHCI_TL_CMD_RESP_RELEASE);
241+
260242
return;
261243
}
262244

@@ -268,4 +250,3 @@ __WEAK void shci_cmd_resp_release(uint32_t flag)
268250

269251
return;
270252
}
271-
#endif /* STM32WBxx */

src/utility/STM32_WPAN/stm_list.c

+1-5
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,10 @@
1717
*/
1818

1919

20-
#if defined(STM32WBxx)
2120
/******************************************************************************
2221
* Include Files
2322
******************************************************************************/
24-
#include "stdint.h"
25-
#include "cmsis_gcc.h"
26-
#include "stm32_wpan_common.h"
23+
#include "utilities_common.h"
2724

2825
#include "stm_list.h"
2926

@@ -207,4 +204,3 @@ void LST_get_prev_node (tListNode * ref_node, tListNode ** node)
207204

208205
__set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
209206
}
210-
#endif /* STM32WBxx */

0 commit comments

Comments
 (0)