1
- From 542e007fa5a1b53664d2efb5f01d67767123a357 Mon Sep 17 00:00:00 2001
1
+ From 140bed91f2c757239584d7b5caacef951b547141 Mon Sep 17 00:00:00 2001
2
2
From: Frederic Pillon <
[email protected] >
3
- Date: Thu, 13 Jul 2023 17:08:05 +0200
3
+ Date: Wed, 10 Jan 2024 18:16:01 +0100
4
4
Subject: [PATCH 1/4] chore: adapt STM32_WPAN sources
5
5
6
6
Signed-off-by: Frederic Pillon <
[email protected] >
7
7
---
8
- src/utility/STM32_WPAN/app_conf_default.h | 46 ++++++++++++++++-----
9
- src/utility/STM32_WPAN/ble_bufsize.h | 7 ++++
8
+ src/utility/STM32_WPAN/app_conf_default.h | 49 +++++++++++++++++++----
10
9
src/utility/STM32_WPAN/hw.h | 13 +++++-
11
- src/utility/STM32_WPAN/hw_ipcc.c | 5 + +-
12
- src/utility/STM32_WPAN/shci.c | 3 +-
13
- src/utility/STM32_WPAN/shci_tl.c | 18 +++++++-
14
- src/utility/STM32_WPAN/stm_list.c | 7 + ++-
15
- src/utility/STM32_WPAN/tl_mbox.c | 7 +++-
16
- 8 files changed, 86 insertions(+), 20 deletions(-)
10
+ src/utility/STM32_WPAN/hw_ipcc.c | 4 +-
11
+ src/utility/STM32_WPAN/shci.c | 2 +
12
+ src/utility/STM32_WPAN/shci_tl.c | 17 ++++++++
13
+ src/utility/STM32_WPAN/stm_list.c | 6 ++-
14
+ src/utility/STM32_WPAN/tl_mbox.c | 6 +++
15
+ 7 files changed, 85 insertions(+), 12 deletions(-)
17
16
18
17
diff --git a/src/utility/STM32_WPAN/app_conf_default.h b/src/utility/STM32_WPAN/app_conf_default.h
19
- index 51bd33a..1c6dd91 100644
18
+ index 846be3c..6c9beb3 100644
20
19
--- a/src/utility/STM32_WPAN/app_conf_default.h
21
20
+++ b/src/utility/STM32_WPAN/app_conf_default.h
22
21
@@ -1,9 +1,9 @@
@@ -31,22 +30,22 @@ index 51bd33a..1c6dd91 100644
31
30
******************************************************************************
32
31
* @attention
33
32
*
34
- @@ -19,18 +19,38 @@
33
+ @@ -19,18 +19,40 @@
35
34
/* USER CODE END Header */
36
35
37
36
/* Define to prevent recursive inclusion -------------------------------------*/
38
37
- #ifndef APP_CONF_H
39
38
- #define APP_CONF_H
40
- -
41
39
+ #ifndef APP_CONF_DEFAULT_H
42
40
+ #define APP_CONF_DEFAULT_H
41
+
43
42
+ #if 0
44
43
#include "hw.h"
45
44
#include "hw_conf.h"
46
45
#include "hw_if.h"
47
46
#include "ble_bufsize.h"
48
- -
49
47
+ #endif
48
+
50
49
/******************************************************************************
51
50
* Application Config
52
51
******************************************************************************/
@@ -74,75 +73,64 @@ index 51bd33a..1c6dd91 100644
74
73
/**
75
74
* Define Secure Connections Support
76
75
*/
77
- @@ -104,7 +124 ,7 @@
76
+ @@ -104,6 +126 ,7 @@
78
77
#define CFG_FW_SUBVERSION (1)
79
78
#define CFG_FW_BRANCH (0)
80
79
#define CFG_FW_BUILD (0)
81
- -
82
80
+ #endif
81
+
83
82
/******************************************************************************
84
83
* BLE Stack
85
- ******************************************************************************/
86
- @@ -152,13 +172,15 @@
87
- * Prepare Write List size in terms of number of packet
88
- * This parameter is ignored by the CPU2 when CFG_BLE_OPTIONS has SHCI_C2_BLE_INIT_OPTIONS_LL_ONLY flag set
89
- */
90
- - #define CFG_BLE_PREPARE_WRITE_LIST_SIZE BLE_PREP_WRITE_X_ATT(CFG_BLE_MAX_ATT_MTU)
91
- + // #define CFG_BLE_PREPARE_WRITE_LIST_SIZE BLE_PREP_WRITE_X_ATT(CFG_BLE_MAX_ATT_MTU)
92
- + #define CFG_BLE_PREPARE_WRITE_LIST_SIZE (0x3A)
93
-
94
- /**
95
- * Number of allocated memory blocks
96
- * This parameter is overwritten by the CPU2 with an hardcoded optimal value when the parameter CFG_BLE_OPTIONS has SHCI_C2_BLE_INIT_OPTIONS_LL_ONLY flag set
97
- */
98
- - #define CFG_BLE_MBLOCK_COUNT (BLE_MBLOCKS_CALC(CFG_BLE_PREPARE_WRITE_LIST_SIZE, CFG_BLE_MAX_ATT_MTU, CFG_BLE_NUM_LINK))
99
- + //#define CFG_BLE_MBLOCK_COUNT (BLE_MBLOCKS_CALC(CFG_BLE_PREPARE_WRITE_LIST_SIZE, CFG_BLE_MAX_ATT_MTU, CFG_BLE_NUM_LINK))
100
- + #define CFG_BLE_MBLOCK_COUNT (0x79)
101
-
102
- /**
103
- * Enable or disable the Extended Packet length feature. Valid values are 0 or 1.
104
- @@ -250,7 +272,7 @@
84
+ @@ -250,7 +273,7 @@
105
85
* 0: LE Power Class 2-3
106
86
* other bits: complete with Options_extension flag
107
87
*/
108
88
- #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)
109
- + #define CFG_BLE_OPTIONS (SHCI_C2_BLE_INIT_OPTIONS_LL_ONLY)
89
+ + #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 )
110
90
111
91
/**
112
92
* BLE stack Options_extension flags to be configured with:
113
- @@ -323,6 +345,7 @@
93
+ @@ -292,7 +315,11 @@
94
+ * This parameter is considered by the CPU2 when CFG_BLE_OPTIONS has SHCI_C2_BLE_INIT_OPTIONS_EXT_ADV flag set
95
+ */
114
96
115
- #define CFG_BLE_CORE_VERSION (SHCI_C2_BLE_INIT_BLE_CORE_5_3)
97
+ - #define CFG_BLE_MAX_ADV_SET_NBR (8)
98
+ + #if defined(STM32WB15xx)
99
+ + #define CFG_BLE_MAX_ADV_SET_NBR (3)
100
+ + #else
101
+ + #define CFG_BLE_MAX_ADV_SET_NBR (8)
102
+ + #endif
103
+
104
+ /* Maximum advertising data length (in bytes)
105
+ * Range: 31 .. 1650 with limitation:
106
+ @@ -301,7 +328,11 @@
107
+ * This parameter is considered by the CPU2 when CFG_BLE_OPTIONS has SHCI_C2_BLE_INIT_OPTIONS_EXT_ADV flag set
108
+ */
109
+
110
+ - #define CFG_BLE_MAX_ADV_DATA_LEN (207)
111
+ + #if defined(STM32WB15xx)
112
+ + #define CFG_BLE_MAX_ADV_DATA_LEN (414)
113
+ + #else
114
+ + #define CFG_BLE_MAX_ADV_DATA_LEN (207)
115
+ + #endif
116
+
117
+ /* RF TX Path Compensation Value (16-bit signed integer). Units: 0.1 dB.
118
+ * Range: -1280 .. 1280
119
+ @@ -324,6 +355,7 @@
120
+
121
+ #define CFG_BLE_CORE_VERSION (SHCI_C2_BLE_INIT_BLE_CORE_5_4)
116
122
117
123
+ #if 0
118
124
/******************************************************************************
119
125
* Transport Layer
120
126
******************************************************************************/
121
- @@ -658 ,4 +681 ,5 @@ typedef enum
127
+ @@ -659 ,4 +691 ,5 @@ typedef enum
122
128
123
129
#define CFG_OTP_END_ADRESS OTP_AREA_END_ADDR
124
130
125
131
- #endif /*APP_CONF_H */
126
132
+ #endif
127
133
+ #endif /*APP_CONF_DEFAULT_H */
128
- diff --git a/src/utility/STM32_WPAN/ble_bufsize.h b/src/utility/STM32_WPAN/ble_bufsize.h
129
- index b9935c0..d4d2890 100644
130
- --- a/src/utility/STM32_WPAN/ble_bufsize.h
131
- +++ b/src/utility/STM32_WPAN/ble_bufsize.h
132
- @@ -75,6 +75,13 @@
133
- ((pw) + MAX(BLE_MEM_BLOCK_X_MTU(mtu, n_link), \
134
- BLE_MBLOCKS_SECURE_CONNECTIONS))
135
-
136
- + /*
137
- + * BLE_DEFAULT_MBLOCKS_COUNT: default memory blocks count
138
- + */
139
- + #define BLE_DEFAULT_MBLOCKS_COUNT(n_link) \
140
- + BLE_MBLOCKS_CALC(BLE_DEFAULT_PREP_WRITE_LIST_SIZE, \
141
- + BLE_DEFAULT_MAX_ATT_MTU, n_link)
142
- +
143
- /*
144
- * BLE_FIXED_BUFFER_SIZE_BYTES:
145
- * A part of the RAM, is dynamically allocated by initializing all the pointers
146
134
diff --git a/src/utility/STM32_WPAN/hw.h b/src/utility/STM32_WPAN/hw.h
147
135
index 651e1f1..1472a5e 100644
148
136
--- a/src/utility/STM32_WPAN/hw.h
@@ -174,53 +162,50 @@ index 651e1f1..1472a5e 100644
174
162
void HW_IPCC_BLE_Init( void );
175
163
void HW_IPCC_BLE_SendCmd( void );
176
164
diff --git a/src/utility/STM32_WPAN/hw_ipcc.c b/src/utility/STM32_WPAN/hw_ipcc.c
177
- index fd620b8..c730482 100644
165
+ index fd620b8..3461cbe 100644
178
166
--- a/src/utility/STM32_WPAN/hw_ipcc.c
179
167
+++ b/src/utility/STM32_WPAN/hw_ipcc.c
180
- @@ -17,9 +17,9 @@
181
- ******************************************************************************
168
+ @@ -18,8 +18,9 @@
182
169
*/
183
170
/* USER CODE END Header */
184
- -
171
+
185
172
+ #if defined(STM32WBxx)
186
173
/* Includes ------------------------------------------------------------------*/
187
174
- #include "app_common.h"
188
175
+ #include "hw.h"
189
176
#include "mbox_def.h"
190
177
191
178
/* Global variables ---------------------------------------------------------*/
192
- @@ -667,3 +667 ,4 @@ static void HW_IPCC_TRACES_EvtHandler( void )
179
+ @@ -667,3 +668 ,4 @@ static void HW_IPCC_TRACES_EvtHandler( void )
193
180
}
194
181
195
182
__weak void HW_IPCC_TRACES_EvtNot( void ){};
196
183
+ #endif /* STM32WBxx */
197
184
diff --git a/src/utility/STM32_WPAN/shci.c b/src/utility/STM32_WPAN/shci.c
198
- index eaa35d7..4525656 100644
185
+ index 5c32555..40110f4 100644
199
186
--- a/src/utility/STM32_WPAN/shci.c
200
187
+++ b/src/utility/STM32_WPAN/shci.c
201
- @@ -16,7 +16,7 @@
202
- ******************************************************************************
188
+ @@ -17,6 +17,7 @@
203
189
*/
204
190
205
- -
191
+
206
192
+ #if defined(STM32WBxx)
207
193
/* Includes ------------------------------------------------------------------*/
208
194
#include "stm32_wpan_common.h"
209
195
210
- @@ -739 ,3 +739 ,4 @@ SHCI_CmdStatus_t SHCI_GetWirelessFwInfo( WirelessFwInfo_t* pWirelessInfo )
196
+ @@ -759 ,3 +760 ,4 @@ SHCI_CmdStatus_t SHCI_GetWirelessFwInfo( WirelessFwInfo_t* pWirelessInfo )
211
197
212
198
return (SHCI_Success);
213
199
}
214
200
+ #endif /* STM32WBxx */
215
201
diff --git a/src/utility/STM32_WPAN/shci_tl.c b/src/utility/STM32_WPAN/shci_tl.c
216
- index 0f60430..e343809 100644
202
+ index 0f60430..daa988c 100644
217
203
--- a/src/utility/STM32_WPAN/shci_tl.c
218
204
+++ b/src/utility/STM32_WPAN/shci_tl.c
219
- @@ -16,12 +16,13 @@
220
- ******************************************************************************
205
+ @@ -17,11 +17,13 @@
221
206
*/
222
207
223
- -
208
+
224
209
+ #if defined(STM32WBxx)
225
210
/* Includes ------------------------------------------------------------------*/
226
211
#include "stm32_wpan_common.h"
@@ -231,7 +216,7 @@ index 0f60430..e343809 100644
231
216
232
217
/* Private typedef -----------------------------------------------------------*/
233
218
typedef enum
234
- @@ -168,6 +169 ,20 @@ void shci_send( uint16_t cmd_code, uint8_t len_cmd_payload, uint8_t * p_cmd_payl
219
+ @@ -168,6 +170 ,20 @@ void shci_send( uint16_t cmd_code, uint8_t len_cmd_payload, uint8_t * p_cmd_payl
235
220
return;
236
221
}
237
222
@@ -252,20 +237,19 @@ index 0f60430..e343809 100644
252
237
/* Private functions ---------------------------------------------------------*/
253
238
static void TlInit( TL_CmdPacket_t * p_cmdbuffer )
254
239
{
255
- @@ -250,3 +265 ,4 @@ __WEAK void shci_cmd_resp_release(uint32_t flag)
240
+ @@ -250,3 +266 ,4 @@ __WEAK void shci_cmd_resp_release(uint32_t flag)
256
241
257
242
return;
258
243
}
259
244
+ #endif /* STM32WBxx */
260
245
diff --git a/src/utility/STM32_WPAN/stm_list.c b/src/utility/STM32_WPAN/stm_list.c
261
- index 4c92864..4e8c364 100644
246
+ index 4c92864..df6c215 100644
262
247
--- a/src/utility/STM32_WPAN/stm_list.c
263
248
+++ b/src/utility/STM32_WPAN/stm_list.c
264
- @@ -16,11 +16,13 @@
265
- ******************************************************************************
249
+ @@ -17,10 +17,13 @@
266
250
*/
267
251
268
- -
252
+
269
253
+ #if defined(STM32WBxx)
270
254
/******************************************************************************
271
255
* Include Files
@@ -277,13 +261,13 @@ index 4c92864..4e8c364 100644
277
261
278
262
#include "stm_list.h"
279
263
280
- @@ -204,3 +206 ,4 @@ void LST_get_prev_node (tListNode * ref_node, tListNode ** node)
264
+ @@ -204,3 +207 ,4 @@ void LST_get_prev_node (tListNode * ref_node, tListNode ** node)
281
265
282
266
__set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
283
267
}
284
268
+ #endif /* STM32WBxx */
285
269
diff --git a/src/utility/STM32_WPAN/tl_mbox.c b/src/utility/STM32_WPAN/tl_mbox.c
286
- index 27a998a..1139316 100644
270
+ index 27a998a..40c9679 100644
287
271
--- a/src/utility/STM32_WPAN/tl_mbox.c
288
272
+++ b/src/utility/STM32_WPAN/tl_mbox.c
289
273
@@ -16,6 +16,7 @@
@@ -294,19 +278,18 @@ index 27a998a..1139316 100644
294
278
/* Includes ------------------------------------------------------------------*/
295
279
#include "stm32_wpan_common.h"
296
280
#include "hw.h"
297
- @@ -51,9 +52,10 @@ PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_BleLldTable_t TL_BleLldTable;
281
+ @@ -51,8 +52,10 @@ PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_BleLldTable_t TL_BleLldTable;
298
282
PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_SysTable_t TL_SysTable;
299
283
PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_MemManagerTable_t TL_MemManagerTable;
300
284
PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_TracesTable_t TL_TracesTable;
301
285
+ #if 0
302
286
PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_Mac_802_15_4_t TL_Mac_802_15_4_Table;
303
287
PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_ZigbeeTable_t TL_Zigbee_Table;
304
- -
305
288
+ #endif
289
+
306
290
/**< tables */
307
291
PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static tListNode FreeBufQueue;
308
- PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static tListNode TracesEvtQueue;
309
- @@ -97,8 +99,10 @@ void TL_Init( void )
292
+ @@ -97,8 +100,10 @@ void TL_Init( void )
310
293
TL_RefTable.p_sys_table = &TL_SysTable;
311
294
TL_RefTable.p_mem_manager_table = &TL_MemManagerTable;
312
295
TL_RefTable.p_traces_table = &TL_TracesTable;
@@ -317,11 +300,11 @@ index 27a998a..1139316 100644
317
300
HW_IPCC_Init();
318
301
319
302
return;
320
- @@ -846,3 +850 ,4 @@ static void OutputDbgTrace(TL_MB_PacketType_t packet_type, uint8_t* buffer)
303
+ @@ -846,3 +851 ,4 @@ static void OutputDbgTrace(TL_MB_PacketType_t packet_type, uint8_t* buffer)
321
304
322
305
return;
323
306
}
324
307
+ #endif /* STM32WBxx */
325
308
- -
326
- 2.38.0.windows .1
309
+ 2.34 .1
327
310
0 commit comments