Skip to content

Commit a7c80df

Browse files
committed
include the STM32Cube_FW to support the BLE of the stm32WB55
Signed-off-by: Francois Ramu <[email protected]>
1 parent 4a4584f commit a7c80df

File tree

11 files changed

+515
-102
lines changed

11 files changed

+515
-102
lines changed

src/utility/STM32Cube_FW/README

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Release v1.8.0

src/utility/STM32Cube_FW/app_conf.h

+73-47
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,32 @@
1+
/* USER CODE BEGIN Header */
12
/**
23
******************************************************************************
34
* File Name : app_conf.h
45
* Description : Application configuration file for STM32WPAN Middleware.
5-
*
6-
******************************************************************************
6+
******************************************************************************
77
* @attention
88
*
9-
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
9+
* <h2><center>&copy; Copyright (c) 2020 STMicroelectronics.
1010
* All rights reserved.</center></h2>
1111
*
12-
* This software component is licensed by ST under BSD 3-Clause license,
13-
* the "License"; You may not use this file except in compliance with the
14-
* License. You may obtain a copy of the License at:
15-
* opensource.org/licenses/BSD-3-Clause
12+
* This software component is licensed by ST under Ultimate Liberty license
13+
* SLA0044, the "License"; You may not use this file except in compliance with
14+
* the License. You may obtain a copy of the License at:
15+
* www.st.com/SLA0044
1616
*
1717
******************************************************************************
1818
*/
19+
/* USER CODE END Header */
1920

2021
/* Define to prevent recursive inclusion -------------------------------------*/
2122
#ifndef APP_CONF_H
2223
#define APP_CONF_H
2324

2425

26+
#include "hw.h"
27+
#include "ble_bufsize.h"
28+
29+
2530
/******************************************************************************
2631
* Application Config
2732
******************************************************************************/
@@ -31,7 +36,7 @@
3136
/**
3237
* Define Tx Power
3338
*/
34-
#define CFG_TX_POWER (0x18) /**< 0dbm */
39+
#define CFG_TX_POWER (0x18) /* -0.15dBm */
3540

3641
/**
3742
* Define Advertising parameters
@@ -45,11 +50,11 @@
4550
/**
4651
* Define IO Authentication
4752
*/
48-
#define CFG_BONDING_MODE (1)
49-
#define CFG_FIXED_PIN (111111)
50-
#define CFG_USED_FIXED_PIN (0)
51-
#define CFG_ENCRYPTION_KEY_SIZE_MAX (16)
52-
#define CFG_ENCRYPTION_KEY_SIZE_MIN (8)
53+
#define CFG_BONDING_MODE (0)
54+
#define CFG_FIXED_PIN (111111)
55+
#define CFG_USED_FIXED_PIN (0)
56+
#define CFG_ENCRYPTION_KEY_SIZE_MAX (16)
57+
#define CFG_ENCRYPTION_KEY_SIZE_MIN (8)
5358

5459
/**
5560
* Define IO capabilities
@@ -60,7 +65,7 @@
6065
#define CFG_IO_CAPABILITY_NO_INPUT_NO_OUTPUT (0x03)
6166
#define CFG_IO_CAPABILITY_KEYBOARD_DISPLAY (0x04)
6267

63-
#define CFG_IO_CAPABILITY CFG_IO_CAPABILITY_DISPLAY_YES_NO
68+
#define CFG_IO_CAPABILITY CFG_IO_CAPABILITY_NO_INPUT_NO_OUTPUT
6469

6570
/**
6671
* Define MITM modes
@@ -71,15 +76,33 @@
7176
#define CFG_MITM_PROTECTION CFG_MITM_PROTECTION_REQUIRED
7277

7378
/**
74-
* Define PHY
79+
* Define Secure Connections Support
80+
*/
81+
#define CFG_SECURE_NOT_SUPPORTED (0x00)
82+
#define CFG_SECURE_OPTIONAL (0x01)
83+
#define CFG_SECURE_MANDATORY (0x02)
84+
85+
#define CFG_SC_SUPPORT CFG_SECURE_OPTIONAL
86+
87+
/**
88+
* Define Keypress Notification Support
7589
*/
76-
#define ALL_PHYS_PREFERENCE 0x00
77-
#define RX_2M_PREFERRED 0x02
78-
#define TX_2M_PREFERRED 0x02
79-
#define TX_1M 0x01
80-
#define TX_2M 0x02
81-
#define RX_1M 0x01
82-
#define RX_2M 0x02
90+
#define CFG_KEYPRESS_NOT_SUPPORTED (0x00)
91+
#define CFG_KEYPRESS_SUPPORTED (0x01)
92+
93+
#define CFG_KEYPRESS_NOTIFICATION_SUPPORT CFG_KEYPRESS_NOT_SUPPORTED
94+
95+
/**
96+
* Numeric Comparison Answers
97+
*/
98+
#define YES (0x01)
99+
#define NO (0x00)
100+
101+
/**
102+
* Device name configuration for Generic Access Service
103+
*/
104+
#define CFG_GAP_DEVICE_NAME "TEMPLATE"
105+
#define CFG_GAP_DEVICE_NAME_LENGTH (8)
83106

84107
/**
85108
* Identity root key used to derive LTK and CSRK
@@ -102,11 +125,21 @@
102125

103126
/**< specific parameters */
104127
/*****************************************************/
128+
105129
/**
106-
* AD Element - Group B Feature
107-
*/
108-
/* LSB - Second Byte */
109-
#define CFG_FEATURE_OTA_REBOOT (0x20)
130+
* Beacon selection
131+
* Beacons are all exclusive
132+
*/
133+
#define CFG_EDDYSTONE_UID_BEACON_TYPE (1<<0)
134+
#define CFG_EDDYSTONE_URL_BEACON_TYPE (1<<1)
135+
#define CFG_EDDYSTONE_TLM_BEACON_TYPE (1<<2)
136+
#define CFG_IBEACON (1<<3)
137+
138+
#define CFG_BEACON_TYPE (CFG_IBEACON)
139+
140+
#define OTA_BEACON_DATA_ADDRESS FLASH_BASE + 0x6000
141+
#define OFFSET_PAYLOAD_LENGTH 9
142+
#define OFFSET_PAYLOAD_DATA 10
110143

111144
/******************************************************************************
112145
* BLE Stack
@@ -150,14 +183,14 @@
150183
#define CFG_BLE_ATT_VALUE_ARRAY_SIZE (1344)
151184

152185
/**
153-
* Prepare Write List size in terms of number of packet with ATT_MTU=23 bytes
186+
* Prepare Write List size in terms of number of packet
154187
*/
155-
#define CFG_BLE_PREPARE_WRITE_LIST_SIZE ( 0x3A )
188+
#define CFG_BLE_PREPARE_WRITE_LIST_SIZE BLE_PREP_WRITE_X_ATT(CFG_BLE_MAX_ATT_MTU)
156189

157190
/**
158191
* Number of allocated memory blocks
159192
*/
160-
#define CFG_BLE_MBLOCK_COUNT ( 0x79 )
193+
#define CFG_BLE_MBLOCK_COUNT (BLE_MBLOCKS_CALC(CFG_BLE_PREPARE_WRITE_LIST_SIZE, CFG_BLE_MAX_ATT_MTU, CFG_BLE_NUM_LINK))
161194

162195
/**
163196
* Enable or disable the Extended Packet length feature. Valid values are 0 or 1.
@@ -211,7 +244,7 @@
211244
* 1 : LL Only
212245
* 0 : LL + Host
213246
*/
214-
#define CFG_BLE_LL_ONLY 1
247+
#define CFG_BLE_LL_ONLY 0
215248
/******************************************************************************
216249
* Transport Layer
217250
******************************************************************************/
@@ -250,7 +283,7 @@
250283
* Select UART interfaces
251284
*/
252285
#define CFG_DEBUG_TRACE_UART hw_uart1
253-
#define CFG_CONSOLE_MENU
286+
#define CFG_CONSOLE_MENU 0
254287
/******************************************************************************
255288
* USB interface
256289
******************************************************************************/
@@ -346,7 +379,7 @@
346379

347380
typedef enum
348381
{
349-
CFG_TIM_PROC_ID_ISR,
382+
CFG_TIM_PROC_ID_ISR,
350383
} CFG_TimProcID_t;
351384

352385
/******************************************************************************
@@ -365,17 +398,17 @@ typedef enum
365398
* keep debugger enabled while in any low power mode when set to 1
366399
* should be set to 0 in production
367400
*/
368-
#define CFG_DEBUGGER_SUPPORTED 0
401+
#define CFG_DEBUGGER_SUPPORTED 1
369402

370403
/**
371404
* When set to 1, the traces are enabled in the BLE services
372405
*/
373-
#define CFG_DEBUG_BLE_TRACE 0
406+
#define CFG_DEBUG_BLE_TRACE 1
374407

375408
/**
376409
* Enable or Disable traces in application
377410
*/
378-
#define CFG_DEBUG_APP_TRACE 0
411+
#define CFG_DEBUG_APP_TRACE 1
379412

380413
#if (CFG_DEBUG_APP_TRACE != 0)
381414
#define APP_DBG_MSG PRINT_MESG_DBG
@@ -431,18 +464,12 @@ typedef enum
431464
#define MAX_DBG_TRACE_MSG_SIZE 1024
432465

433466
/* USER CODE BEGIN Defines */
434-
#define CFG_LED_SUPPORTED 0
467+
#define CFG_LED_SUPPORTED 1
435468
#define CFG_BUTTON_SUPPORTED 1
436469

437-
#ifdef LITTLE_DORY
438-
#define PUSH_BUTTON_SW1_EXTI_IRQHandler EXTI0_IRQHandler
439-
#define PUSH_BUTTON_SW2_EXTI_IRQHandler EXTI4_IRQHandler
440-
#define PUSH_BUTTON_SW3_EXTI_IRQHandler EXTI9_5_IRQHandler
441-
#else
442-
#define PUSH_BUTTON_SW1_EXTI_IRQHandler EXTI4_IRQHandler
443-
#define PUSH_BUTTON_SW2_EXTI_IRQHandler EXTI0_IRQHandler
444-
#define PUSH_BUTTON_SW3_EXTI_IRQHandler EXTI1_IRQHandler
445-
#endif
470+
#define PUSH_BUTTON_SW1_EXTI_IRQHandler EXTI4_IRQHandler
471+
#define PUSH_BUTTON_SW2_EXTI_IRQHandler EXTI0_IRQHandler
472+
#define PUSH_BUTTON_SW3_EXTI_IRQHandler EXTI1_IRQHandler
446473
/* USER CODE END Defines */
447474

448475
/******************************************************************************
@@ -459,8 +486,7 @@ typedef enum
459486
/**< Add in that list all tasks that may send a ACI/HCI command */
460487
typedef enum
461488
{
462-
CFG_TASK_ADV_UPDATE_ID,
463-
CFG_TASK_MEAS_REQ_ID,
489+
CFG_TASK_BEACON_UPDATE_REQ_ID,
464490
CFG_TASK_HCI_ASYNCH_EVT_ID,
465491
/* USER CODE BEGIN CFG_Task_Id_With_HCI_Cmd_t */
466492

0 commit comments

Comments
 (0)