1
- From 542e007fa5a1b53664d2efb5f01d67767123a357 Mon Sep 17 00:00:00 2001
1
+ From 89f654aa16086d9f73e885f8e8977b53469a4895 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 | 50 +++++++++++++++++++----
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, 86 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..3b5f882 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,41 @@
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
******************************************************************************/
@@ -64,6 +63,7 @@ index 51bd33a..1c6dd91 100644
64
63
+ #define BLE_SHARED_MEM_BYTE_ORDER MSBFIRST
65
64
+ #endif
66
65
+ #define BLE_MODULE_SHARED_MEM_BUFFER_SIZE 128
66
+ + #endif
67
67
+
68
68
+ /**
69
69
+ * Define Tx Power
@@ -74,75 +74,64 @@ index 51bd33a..1c6dd91 100644
74
74
/**
75
75
* Define Secure Connections Support
76
76
*/
77
- @@ -104,7 +124 ,7 @@
77
+ @@ -104,6 +127 ,7 @@
78
78
#define CFG_FW_SUBVERSION (1)
79
79
#define CFG_FW_BRANCH (0)
80
80
#define CFG_FW_BUILD (0)
81
- -
82
81
+ #endif
82
+
83
83
/******************************************************************************
84
84
* 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 @@
85
+ @@ -250,7 +274,7 @@
105
86
* 0: LE Power Class 2-3
106
87
* other bits: complete with Options_extension flag
107
88
*/
108
89
- #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)
90
+ + #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
91
111
92
/**
112
93
* BLE stack Options_extension flags to be configured with:
113
- @@ -323,6 +345,7 @@
94
+ @@ -292,7 +316,11 @@
95
+ * This parameter is considered by the CPU2 when CFG_BLE_OPTIONS has SHCI_C2_BLE_INIT_OPTIONS_EXT_ADV flag set
96
+ */
97
+
98
+ - #define CFG_BLE_MAX_ADV_SET_NBR (8)
99
+ + #if defined(STM32WB15xx)
100
+ + #define CFG_BLE_MAX_ADV_SET_NBR (3)
101
+ + #else
102
+ + #define CFG_BLE_MAX_ADV_SET_NBR (8)
103
+ + #endif
104
+
105
+ /* Maximum advertising data length (in bytes)
106
+ * Range: 31 .. 1650 with limitation:
107
+ @@ -301,7 +329,11 @@
108
+ * This parameter is considered by the CPU2 when CFG_BLE_OPTIONS has SHCI_C2_BLE_INIT_OPTIONS_EXT_ADV flag set
109
+ */
110
+
111
+ - #define CFG_BLE_MAX_ADV_DATA_LEN (207)
112
+ + #if defined(STM32WB15xx)
113
+ + #define CFG_BLE_MAX_ADV_DATA_LEN (414)
114
+ + #else
115
+ + #define CFG_BLE_MAX_ADV_DATA_LEN (207)
116
+ + #endif
117
+
118
+ /* RF TX Path Compensation Value (16-bit signed integer). Units: 0.1 dB.
119
+ * Range: -1280 .. 1280
120
+ @@ -324,6 +356,7 @@
114
121
115
- #define CFG_BLE_CORE_VERSION (SHCI_C2_BLE_INIT_BLE_CORE_5_3 )
122
+ #define CFG_BLE_CORE_VERSION (SHCI_C2_BLE_INIT_BLE_CORE_5_4 )
116
123
117
124
+ #if 0
118
125
/******************************************************************************
119
126
* Transport Layer
120
127
******************************************************************************/
121
- @@ -658 ,4 +681 ,5 @@ typedef enum
128
+ @@ -659 ,4 +692 ,5 @@ typedef enum
122
129
123
130
#define CFG_OTP_END_ADRESS OTP_AREA_END_ADDR
124
131
125
132
- #endif /*APP_CONF_H */
126
133
+ #endif
127
134
+ #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
135
diff --git a/src/utility/STM32_WPAN/hw.h b/src/utility/STM32_WPAN/hw.h
147
136
index 651e1f1..1472a5e 100644
148
137
--- a/src/utility/STM32_WPAN/hw.h
@@ -174,53 +163,50 @@ index 651e1f1..1472a5e 100644
174
163
void HW_IPCC_BLE_Init( void );
175
164
void HW_IPCC_BLE_SendCmd( void );
176
165
diff --git a/src/utility/STM32_WPAN/hw_ipcc.c b/src/utility/STM32_WPAN/hw_ipcc.c
177
- index fd620b8..c730482 100644
166
+ index fd620b8..3461cbe 100644
178
167
--- a/src/utility/STM32_WPAN/hw_ipcc.c
179
168
+++ b/src/utility/STM32_WPAN/hw_ipcc.c
180
- @@ -17,9 +17,9 @@
181
- ******************************************************************************
169
+ @@ -18,8 +18,9 @@
182
170
*/
183
171
/* USER CODE END Header */
184
- -
172
+
185
173
+ #if defined(STM32WBxx)
186
174
/* Includes ------------------------------------------------------------------*/
187
175
- #include "app_common.h"
188
176
+ #include "hw.h"
189
177
#include "mbox_def.h"
190
178
191
179
/* Global variables ---------------------------------------------------------*/
192
- @@ -667,3 +667 ,4 @@ static void HW_IPCC_TRACES_EvtHandler( void )
180
+ @@ -667,3 +668 ,4 @@ static void HW_IPCC_TRACES_EvtHandler( void )
193
181
}
194
182
195
183
__weak void HW_IPCC_TRACES_EvtNot( void ){};
196
184
+ #endif /* STM32WBxx */
197
185
diff --git a/src/utility/STM32_WPAN/shci.c b/src/utility/STM32_WPAN/shci.c
198
- index eaa35d7..4525656 100644
186
+ index 5c32555..40110f4 100644
199
187
--- a/src/utility/STM32_WPAN/shci.c
200
188
+++ b/src/utility/STM32_WPAN/shci.c
201
- @@ -16,7 +16,7 @@
202
- ******************************************************************************
189
+ @@ -17,6 +17,7 @@
203
190
*/
204
191
205
- -
192
+
206
193
+ #if defined(STM32WBxx)
207
194
/* Includes ------------------------------------------------------------------*/
208
195
#include "stm32_wpan_common.h"
209
196
210
- @@ -739 ,3 +739 ,4 @@ SHCI_CmdStatus_t SHCI_GetWirelessFwInfo( WirelessFwInfo_t* pWirelessInfo )
197
+ @@ -759 ,3 +760 ,4 @@ SHCI_CmdStatus_t SHCI_GetWirelessFwInfo( WirelessFwInfo_t* pWirelessInfo )
211
198
212
199
return (SHCI_Success);
213
200
}
214
201
+ #endif /* STM32WBxx */
215
202
diff --git a/src/utility/STM32_WPAN/shci_tl.c b/src/utility/STM32_WPAN/shci_tl.c
216
- index 0f60430..e343809 100644
203
+ index 0f60430..daa988c 100644
217
204
--- a/src/utility/STM32_WPAN/shci_tl.c
218
205
+++ b/src/utility/STM32_WPAN/shci_tl.c
219
- @@ -16,12 +16,13 @@
220
- ******************************************************************************
206
+ @@ -17,11 +17,13 @@
221
207
*/
222
208
223
- -
209
+
224
210
+ #if defined(STM32WBxx)
225
211
/* Includes ------------------------------------------------------------------*/
226
212
#include "stm32_wpan_common.h"
@@ -231,7 +217,7 @@ index 0f60430..e343809 100644
231
217
232
218
/* Private typedef -----------------------------------------------------------*/
233
219
typedef enum
234
- @@ -168,6 +169 ,20 @@ void shci_send( uint16_t cmd_code, uint8_t len_cmd_payload, uint8_t * p_cmd_payl
220
+ @@ -168,6 +170 ,20 @@ void shci_send( uint16_t cmd_code, uint8_t len_cmd_payload, uint8_t * p_cmd_payl
235
221
return;
236
222
}
237
223
@@ -252,20 +238,19 @@ index 0f60430..e343809 100644
252
238
/* Private functions ---------------------------------------------------------*/
253
239
static void TlInit( TL_CmdPacket_t * p_cmdbuffer )
254
240
{
255
- @@ -250,3 +265 ,4 @@ __WEAK void shci_cmd_resp_release(uint32_t flag)
241
+ @@ -250,3 +266 ,4 @@ __WEAK void shci_cmd_resp_release(uint32_t flag)
256
242
257
243
return;
258
244
}
259
245
+ #endif /* STM32WBxx */
260
246
diff --git a/src/utility/STM32_WPAN/stm_list.c b/src/utility/STM32_WPAN/stm_list.c
261
- index 4c92864..4e8c364 100644
247
+ index 4c92864..df6c215 100644
262
248
--- a/src/utility/STM32_WPAN/stm_list.c
263
249
+++ b/src/utility/STM32_WPAN/stm_list.c
264
- @@ -16,11 +16,13 @@
265
- ******************************************************************************
250
+ @@ -17,10 +17,13 @@
266
251
*/
267
252
268
- -
253
+
269
254
+ #if defined(STM32WBxx)
270
255
/******************************************************************************
271
256
* Include Files
@@ -277,13 +262,13 @@ index 4c92864..4e8c364 100644
277
262
278
263
#include "stm_list.h"
279
264
280
- @@ -204,3 +206 ,4 @@ void LST_get_prev_node (tListNode * ref_node, tListNode ** node)
265
+ @@ -204,3 +207 ,4 @@ void LST_get_prev_node (tListNode * ref_node, tListNode ** node)
281
266
282
267
__set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
283
268
}
284
269
+ #endif /* STM32WBxx */
285
270
diff --git a/src/utility/STM32_WPAN/tl_mbox.c b/src/utility/STM32_WPAN/tl_mbox.c
286
- index 27a998a..1139316 100644
271
+ index 27a998a..40c9679 100644
287
272
--- a/src/utility/STM32_WPAN/tl_mbox.c
288
273
+++ b/src/utility/STM32_WPAN/tl_mbox.c
289
274
@@ -16,6 +16,7 @@
@@ -294,19 +279,18 @@ index 27a998a..1139316 100644
294
279
/* Includes ------------------------------------------------------------------*/
295
280
#include "stm32_wpan_common.h"
296
281
#include "hw.h"
297
- @@ -51,9 +52,10 @@ PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_BleLldTable_t TL_BleLldTable;
282
+ @@ -51,8 +52,10 @@ PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_BleLldTable_t TL_BleLldTable;
298
283
PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_SysTable_t TL_SysTable;
299
284
PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_MemManagerTable_t TL_MemManagerTable;
300
285
PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_TracesTable_t TL_TracesTable;
301
286
+ #if 0
302
287
PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_Mac_802_15_4_t TL_Mac_802_15_4_Table;
303
288
PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_ZigbeeTable_t TL_Zigbee_Table;
304
- -
305
289
+ #endif
290
+
306
291
/**< tables */
307
292
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 )
293
+ @@ -97,8 +100,10 @@ void TL_Init( void )
310
294
TL_RefTable.p_sys_table = &TL_SysTable;
311
295
TL_RefTable.p_mem_manager_table = &TL_MemManagerTable;
312
296
TL_RefTable.p_traces_table = &TL_TracesTable;
@@ -317,11 +301,11 @@ index 27a998a..1139316 100644
317
301
HW_IPCC_Init();
318
302
319
303
return;
320
- @@ -846,3 +850 ,4 @@ static void OutputDbgTrace(TL_MB_PacketType_t packet_type, uint8_t* buffer)
304
+ @@ -846,3 +851 ,4 @@ static void OutputDbgTrace(TL_MB_PacketType_t packet_type, uint8_t* buffer)
321
305
322
306
return;
323
307
}
324
308
+ #endif /* STM32WBxx */
325
309
- -
326
- 2.38.0.windows .1
310
+ 2.34 .1
327
311
0 commit comments