Skip to content

Commit d758a66

Browse files
committed
chore: adapt STM32Cube_FW sources
Compare to previous patch, do the minimum changes required to ease further update. Signed-off-by: Frederic Pillon <[email protected]>
1 parent a903124 commit d758a66

File tree

8 files changed

+90
-23
lines changed

8 files changed

+90
-23
lines changed

Diff for: src/utility/STM32Cube_FW/app_conf_default.h

+35-12
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/* USER CODE BEGIN Header */
22
/**
33
******************************************************************************
4-
* @file app_conf.h
4+
* @file app_conf_default.h
55
* @author MCD Application Team
6-
* @brief Application configuration file for STM32WPAN Middleware.
6+
* @brief Default application configuration file for STM32WPAN Middleware.
77
******************************************************************************
88
* @attention
99
*
@@ -19,18 +19,38 @@
1919
/* USER CODE END Header */
2020

2121
/* Define to prevent recursive inclusion -------------------------------------*/
22-
#ifndef APP_CONF_H
23-
#define APP_CONF_H
24-
22+
#ifndef APP_CONF_DEFAULT_H
23+
#define APP_CONF_DEFAULT_H
24+
#if 0
2525
#include "hw.h"
2626
#include "hw_conf.h"
2727
#include "hw_if.h"
2828
#include "ble_bufsize.h"
29-
29+
#endif
3030
/******************************************************************************
3131
* Application Config
3232
******************************************************************************/
3333

34+
/**< generic parameters ******************************************************/
35+
/* HCI related defines */
36+
37+
#define ACI_HAL_SET_TX_POWER_LEVEL 0xFC0F
38+
#define ACI_WRITE_CONFIG_DATA_OPCODE 0xFC0C
39+
#define ACI_READ_CONFIG_DATA_OPCODE 0xFC0D
40+
#define MAX_HCI_ACL_PACKET_SIZE (sizeof(TL_PacketHeader_t) + 5 + 251)
41+
#define HCI_RESET 0x0C03
42+
43+
#ifndef BLE_SHARED_MEM_BYTE_ORDER
44+
#define BLE_SHARED_MEM_BYTE_ORDER MSBFIRST
45+
#endif
46+
#define BLE_MODULE_SHARED_MEM_BUFFER_SIZE 128
47+
48+
/**
49+
* Define Tx Power
50+
*/
51+
#define CFG_TX_POWER (0x18) /* -0.15dBm */
52+
53+
#if 0
3454
/**
3555
* Define Secure Connections Support
3656
*/
@@ -104,7 +124,7 @@
104124
#define CFG_FW_SUBVERSION (1)
105125
#define CFG_FW_BRANCH (0)
106126
#define CFG_FW_BUILD (0)
107-
127+
#endif
108128
/******************************************************************************
109129
* BLE Stack
110130
******************************************************************************/
@@ -152,13 +172,15 @@
152172
* Prepare Write List size in terms of number of packet
153173
* This parameter is ignored by the CPU2 when CFG_BLE_OPTIONS has SHCI_C2_BLE_INIT_OPTIONS_LL_ONLY flag set
154174
*/
155-
#define CFG_BLE_PREPARE_WRITE_LIST_SIZE BLE_PREP_WRITE_X_ATT(CFG_BLE_MAX_ATT_MTU)
175+
// #define CFG_BLE_PREPARE_WRITE_LIST_SIZE BLE_PREP_WRITE_X_ATT(CFG_BLE_MAX_ATT_MTU)
176+
#define CFG_BLE_PREPARE_WRITE_LIST_SIZE (0x3A)
156177

157178
/**
158179
* Number of allocated memory blocks
159180
* 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
160181
*/
161-
#define CFG_BLE_MBLOCK_COUNT (BLE_MBLOCKS_CALC(CFG_BLE_PREPARE_WRITE_LIST_SIZE, CFG_BLE_MAX_ATT_MTU, CFG_BLE_NUM_LINK))
182+
//#define CFG_BLE_MBLOCK_COUNT (BLE_MBLOCKS_CALC(CFG_BLE_PREPARE_WRITE_LIST_SIZE, CFG_BLE_MAX_ATT_MTU, CFG_BLE_NUM_LINK))
183+
#define CFG_BLE_MBLOCK_COUNT (0x79)
162184

163185
/**
164186
* Enable or disable the Extended Packet length feature. Valid values are 0 or 1.
@@ -250,7 +272,7 @@
250272
* 0: LE Power Class 2-3
251273
* other bits: complete with Options_extension flag
252274
*/
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)
275+
#define CFG_BLE_OPTIONS (SHCI_C2_BLE_INIT_OPTIONS_LL_ONLY)
254276

255277
/**
256278
* BLE stack Options_extension flags to be configured with:
@@ -323,6 +345,7 @@
323345

324346
#define CFG_BLE_CORE_VERSION (SHCI_C2_BLE_INIT_BLE_CORE_5_3)
325347

348+
#if 0
326349
/******************************************************************************
327350
* Transport Layer
328351
******************************************************************************/
@@ -657,5 +680,5 @@ typedef enum
657680
#define CFG_OTP_BASE_ADDRESS OTP_AREA_BASE
658681

659682
#define CFG_OTP_END_ADRESS OTP_AREA_END_ADDR
660-
661-
#endif /*APP_CONF_H */
683+
#endif
684+
#endif /*APP_CONF_DEFAULT_H */

Diff for: src/utility/STM32Cube_FW/ble_bufsize.h

+9-2
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,22 @@
7575
((pw) + MAX(BLE_MEM_BLOCK_X_MTU(mtu, n_link), \
7676
BLE_MBLOCKS_SECURE_CONNECTIONS))
7777

78+
/*
79+
* BLE_DEFAULT_MBLOCKS_COUNT: default memory blocks count
80+
*/
81+
#define BLE_DEFAULT_MBLOCKS_COUNT(n_link) \
82+
BLE_MBLOCKS_CALC(BLE_DEFAULT_PREP_WRITE_LIST_SIZE, \
83+
BLE_DEFAULT_MAX_ATT_MTU, n_link)
84+
7885
/*
7986
* BLE_FIXED_BUFFER_SIZE_BYTES:
8087
* A part of the RAM, is dynamically allocated by initializing all the pointers
8188
* defined in a global context variable "mem_alloc_ctx_p".
82-
* This initialization is made in the Dynamic_allocator functions, which
89+
* This initialization is made in the Dynamic_allocator functions, which
8390
* assign a portion of RAM given by the external application to the above
8491
* mentioned "global pointers".
8592
*
86-
* The size of this Dynamic RAM is made of 2 main components:
93+
* The size of this Dynamic RAM is made of 2 main components:
8794
* - a part that is parameters-dependent (num of links, GATT buffers, ...),
8895
* and which value is made explicit by the following macro;
8996
* - a part, that may be considered "fixed", i.e. independent from the above

Diff for: src/utility/STM32Cube_FW/hw.h

+12-3
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,23 @@ 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"
2938

3039
/******************************************************************************
3140
* HW IPCC
3241
******************************************************************************/
3342
void HW_IPCC_Enable( void );
3443
void HW_IPCC_Init( void );
35-
void HW_IPCC_Rx_Handler( void );
36-
void HW_IPCC_Tx_Handler( void );
44+
#define HW_IPCC_Rx_Handler IPCC_C1_RX_IRQHandler
45+
#define HW_IPCC_Tx_Handler IPCC_C1_TX_IRQHandler
3746

3847
void HW_IPCC_BLE_Init( void );
3948
void HW_IPCC_BLE_SendCmd( void );
@@ -76,7 +85,7 @@ extern "C" {
7685
void HW_IPCC_BLE_LLD_ReceiveRsp( void );
7786
void HW_IPCC_BLE_LLD_SendRspAck( void );
7887

79-
88+
8089
void HW_IPCC_TRACES_Init( void );
8190
void HW_IPCC_TRACES_EvtNot( void );
8291

Diff for: src/utility/STM32Cube_FW/hw_ipcc.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@
1818
*/
1919
/* USER CODE END Header */
2020

21+
#if defined(STM32WBxx)
2122
/* Includes ------------------------------------------------------------------*/
22-
#include "app_common.h"
23+
#include "hw.h"
2324
#include "mbox_def.h"
2425

2526
/* Global variables ---------------------------------------------------------*/
@@ -667,3 +668,4 @@ static void HW_IPCC_TRACES_EvtHandler( void )
667668
}
668669

669670
__weak void HW_IPCC_TRACES_EvtNot( void ){};
671+
#endif /* STM32WBxx */

Diff for: src/utility/STM32Cube_FW/shci.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
******************************************************************************
1717
*/
1818

19-
19+
#if defined(STM32WBxx)
2020
/* Includes ------------------------------------------------------------------*/
2121
#include "stm32_wpan_common.h"
2222

@@ -739,3 +739,4 @@ SHCI_CmdStatus_t SHCI_GetWirelessFwInfo( WirelessFwInfo_t* pWirelessInfo )
739739

740740
return (SHCI_Success);
741741
}
742+
#endif /* STM32WBxx */

Diff for: src/utility/STM32Cube_FW/shci_tl.c

+17-1
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,13 @@
1616
******************************************************************************
1717
*/
1818

19-
19+
#if defined(STM32WBxx)
2020
/* Includes ------------------------------------------------------------------*/
2121
#include "stm32_wpan_common.h"
2222

2323
#include "stm_list.h"
2424
#include "shci_tl.h"
25+
#include "stm32_def.h"
2526

2627
/* Private typedef -----------------------------------------------------------*/
2728
typedef enum
@@ -168,6 +169,20 @@ void shci_send( uint16_t cmd_code, uint8_t len_cmd_payload, uint8_t * p_cmd_payl
168169
return;
169170
}
170171

172+
void shci_notify_asynch_evt(void *pdata)
173+
{
174+
UNUSED(pdata);
175+
/* Need to parse data in future version */
176+
shci_user_evt_proc();
177+
}
178+
179+
void shci_register_io_bus(tSHciIO *fops)
180+
{
181+
/* Register IO bus services */
182+
fops->Init = TL_SYS_Init;
183+
fops->Send = TL_SYS_SendCmd;
184+
}
185+
171186
/* Private functions ---------------------------------------------------------*/
172187
static void TlInit( TL_CmdPacket_t * p_cmdbuffer )
173188
{
@@ -251,3 +266,4 @@ __WEAK void shci_cmd_resp_release(uint32_t flag)
251266

252267
return;
253268
}
269+
#endif /* STM32WBxx */

Diff for: src/utility/STM32Cube_FW/stm_list.c

+5-2
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@
1616
******************************************************************************
1717
*/
1818

19-
19+
#if defined(STM32WBxx)
2020
/******************************************************************************
2121
* Include Files
2222
******************************************************************************/
23-
#include "utilities_common.h"
23+
#include "stdint.h"
24+
#include "cmsis_gcc.h"
25+
#include "stm32_wpan_common.h"
2426

2527
#include "stm_list.h"
2628

@@ -204,3 +206,4 @@ void LST_get_prev_node (tListNode * ref_node, tListNode ** node)
204206

205207
__set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
206208
}
209+
#endif /* STM32WBxx */

Diff for: src/utility/STM32Cube_FW/tl_mbox.c

+7-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
******************************************************************************
1717
*/
1818

19+
#if defined(STM32WBxx)
1920
/* Includes ------------------------------------------------------------------*/
2021
#include "stm32_wpan_common.h"
2122
#include "hw.h"
@@ -51,9 +52,10 @@ PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_BleLldTable_t TL_BleLldTable;
5152
PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_SysTable_t TL_SysTable;
5253
PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_MemManagerTable_t TL_MemManagerTable;
5354
PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_TracesTable_t TL_TracesTable;
55+
#if 0
5456
PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_Mac_802_15_4_t TL_Mac_802_15_4_Table;
5557
PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_ZigbeeTable_t TL_Zigbee_Table;
56-
58+
#endif
5759
/**< tables */
5860
PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static tListNode FreeBufQueue;
5961
PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static tListNode TracesEvtQueue;
@@ -97,8 +99,11 @@ void TL_Init( void )
9799
TL_RefTable.p_sys_table = &TL_SysTable;
98100
TL_RefTable.p_mem_manager_table = &TL_MemManagerTable;
99101
TL_RefTable.p_traces_table = &TL_TracesTable;
102+
103+
#if 0
100104
TL_RefTable.p_mac_802_15_4_table = &TL_Mac_802_15_4_Table;
101105
TL_RefTable.p_zigbee_table = &TL_Zigbee_Table;
106+
#endif
102107
HW_IPCC_Init();
103108

104109
return;
@@ -846,3 +851,4 @@ static void OutputDbgTrace(TL_MB_PacketType_t packet_type, uint8_t* buffer)
846851

847852
return;
848853
}
854+
#endif /* STM32WBxx */

0 commit comments

Comments
 (0)