Skip to content

Update STM32Cube_FW from Cube version v1.14.0 #43

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
From a771c9e9a12d085fc240a45f68ca5aafb8b42006 Mon Sep 17 00:00:00 2001
From: Alexandre Bourdiol <alexandre.bourdiol@st.com>
Date: Mon, 6 Dec 2021 18:59:38 +0100
From 56bf751554bb993c041a92e774274d69a7a837b7 Mon Sep 17 00:00:00 2001
From: TLIG Dhaou <dhaou.tlig-ext@st.com>
Date: Wed, 27 Jul 2022 11:23:10 +0200
Subject: [PATCH 3/4] Added support for custom app_conf.h (#35)

Signed-off-by: TLIG Dhaou <dhaou.tlig-ext@st.com>
---
src/utility/STM32Cube_FW/app_conf_default.h | 75 ++++++++++++++-------
1 file changed, 49 insertions(+), 26 deletions(-)
src/utility/STM32Cube_FW/app_conf_default.h | 72 ++++++++++++++-------
1 file changed, 48 insertions(+), 24 deletions(-)

diff --git a/src/utility/STM32Cube_FW/app_conf_default.h b/src/utility/STM32Cube_FW/app_conf_default.h
index 4f300e0..9f8e085 100644
index 1d5e06a..492340d 100644
--- a/src/utility/STM32Cube_FW/app_conf_default.h
+++ b/src/utility/STM32Cube_FW/app_conf_default.h
@@ -1,8 +1,8 @@
Expand All @@ -24,7 +25,7 @@ index 4f300e0..9f8e085 100644
*
@@ -17,11 +17,8 @@
*/

/* Define to prevent recursive inclusion -------------------------------------*/
-#ifndef APP_CONF_H
-#define APP_CONF_H
Expand All @@ -33,29 +34,29 @@ index 4f300e0..9f8e085 100644
-#include "ble_bufsize.h"
+#ifndef APP_CONF_DEFAULT_H
+#define APP_CONF_DEFAULT_H

/******************************************************************************
* Application Config
@@ -44,7 +41,9 @@
/**
@@ -48,7 +45,9 @@
* Define Tx Power
*/

-#define CFG_TX_POWER (0x18) /* -0.15dBm */
+#ifndef CFG_TX_POWER
+ #define CFG_TX_POWER (0x18) /* -0.15dBm */
+#endif

/******************************************************************************
* BLE Stack
@@ -53,32 +52,41 @@
@@ -57,32 +56,41 @@
* Maximum number of simultaneous connections that the device will support.
* Valid values are from 1 to 8
*/
-#define CFG_BLE_NUM_LINK 2
-#define CFG_BLE_NUM_LINK 8
+#ifndef CFG_BLE_NUM_LINK
+ #define CFG_BLE_NUM_LINK 2
+#endif

/**
* Maximum number of Services that can be stored in the GATT database.
- * Note that the GAP and GATT services are automatically added so this parameter should be 2 plus the number of user services
Expand All @@ -65,7 +66,7 @@ index 4f300e0..9f8e085 100644
+#ifndef CFG_BLE_NUM_GATT_SERVICES
#define CFG_BLE_NUM_GATT_SERVICES 8
+#endif

/**
* Maximum number of Attributes
- * (i.e. the number of characteristic + the number of characteristic values + the number of descriptors, excluding the services)
Expand All @@ -80,16 +81,16 @@ index 4f300e0..9f8e085 100644
+#ifndef CFG_BLE_NUM_GATT_ATTRIBUTES
+ #define CFG_BLE_NUM_GATT_ATTRIBUTES 68
+#endif

/**
* Maximum supported ATT_MTU size
* This parameter is ignored by the CPU2 when CFG_BLE_OPTIONS is set to 1"
* This parameter is ignored by the CPU2 when CFG_BLE_OPTIONS has SHCI_C2_BLE_INIT_OPTIONS_LL_ONLY flag set
*/
-#define CFG_BLE_MAX_ATT_MTU (156)
+#ifndef CFG_BLE_MAX_ATT_MTU
+ #define CFG_BLE_MAX_ATT_MTU (156)
+#endif

/**
* Size of the storage area for Attribute values
- * This value depends on the number of attributes used by application. In particular the sum of the following quantities (in octets) should be made for each attribute:
Expand All @@ -98,89 +99,93 @@ index 4f300e0..9f8e085 100644
* - attribute value length
* - 5, if UUID is 16 bit; 19, if UUID is 128 bit
* - 2, if server configuration descriptor is used
@@ -87,14 +95,18 @@
@@ -91,14 +99,18 @@
* The total amount of memory needed is the sum of the above quantities for each attribute.
* This parameter is ignored by the CPU2 when CFG_BLE_OPTIONS is set to 1"
* This parameter is ignored by the CPU2 when CFG_BLE_OPTIONS has SHCI_C2_BLE_INIT_OPTIONS_LL_ONLY flag set
*/
+#ifndef CFG_BLE_ATT_VALUE_ARRAY_SIZE
#define CFG_BLE_ATT_VALUE_ARRAY_SIZE (1344)
+#endif

/**
* Prepare Write List size in terms of number of packet
* This parameter is ignored by the CPU2 when CFG_BLE_OPTIONS is set to 1"
* This parameter is ignored by the CPU2 when CFG_BLE_OPTIONS has SHCI_C2_BLE_INIT_OPTIONS_LL_ONLY flag set
*/
// #define CFG_BLE_PREPARE_WRITE_LIST_SIZE BLE_PREP_WRITE_X_ATT(CFG_BLE_MAX_ATT_MTU)
-#define CFG_BLE_PREPARE_WRITE_LIST_SIZE (0x3A)
+#ifndef CFG_BLE_PREPARE_WRITE_LIST_SIZE
+ #define CFG_BLE_PREPARE_WRITE_LIST_SIZE (0x3A)
+#endif

/**
* Number of allocated memory blocks
@@ -106,12 +118,16 @@
@@ -110,12 +122,16 @@
/**
* Enable or disable the Extended Packet length feature. Valid values are 0 or 1.
*/
-#define CFG_BLE_DATA_LENGTH_EXTENSION 1
+#ifndef CFG_BLE_DATA_LENGTH_EXTENSION
+ #define CFG_BLE_DATA_LENGTH_EXTENSION 1
+#endif

/**
* Sleep clock accuracy in Slave mode (ppm value)
*/
-#define CFG_BLE_SLAVE_SCA 500
+#ifndef CFG_BLE_SLAVE_SCA
+ #define CFG_BLE_SLAVE_SCA 500
+#endif

/**
* Sleep clock accuracy in Master mode
@@ -124,24 +140,32 @@
@@ -128,7 +144,9 @@
* 6 : 21 ppm to 30 ppm
* 7 : 0 ppm to 20 ppm
*/
-#define CFG_BLE_MASTER_SCA 0
+#ifndef CFG_BLE_MASTER_SCA
+ #define CFG_BLE_MASTER_SCA 0
+#endif

/**
* Source for the low speed clock for RF wake-up
* 1 : external high speed crystal HSE/32/32
* 0 : external low speed crystal ( no calibration )
* LsSource
@@ -136,21 +154,27 @@
* - bit 0: 1: Calibration for the RF system wakeup clock source 0: No calibration for the RF system wakeup clock source
* - bit 1: 1: STM32W5M Module device 0: Other devices as STM32WBxx SOC, STM32WB1M module
*/
-#define CFG_BLE_LSE_SOURCE 0
+#ifndef CFG_BLE_LSE_SOURCE
+ #define CFG_BLE_LSE_SOURCE 0
#if defined(STM32WB5Mxx)
#define CFG_BLE_LSE_SOURCE (SHCI_C2_BLE_INIT_CFG_BLE_LSE_NOCALIB | SHCI_C2_BLE_INIT_CFG_BLE_LSE_MOD5MM_DEV)
#else
#define CFG_BLE_LSE_SOURCE (SHCI_C2_BLE_INIT_CFG_BLE_LSE_NOCALIB | SHCI_C2_BLE_INIT_CFG_BLE_LSE_OTHER_DEV)
#endif
+#endif

/**
* Start up time of the high speed (16 or 32 MHz) crystal oscillator in units of 625/256 us (~2.44 us)
*/
-#define CFG_BLE_HSE_STARTUP_TIME 0x148
+#ifndef CFG_BLE_HSE_STARTUP_TIME
+ #define CFG_BLE_HSE_STARTUP_TIME 0x148
+#endif

/**
* Maximum duration of the connection event when the device is in Slave mode in units of 625/256 us (~2.44 us)
*/
-#define CFG_BLE_MAX_CONN_EVENT_LENGTH (0xFFFFFFFF)
+#ifndef CFG_BLE_MAX_CONN_EVENT_LENGTH
+ #define CFG_BLE_MAX_CONN_EVENT_LENGTH (0xFFFFFFFF)
+#endif

/**
* Viterbi Mode
@@ -199,5 +223,4 @@

#define CFG_BLE_RX_MODEL_CONFIG SHCI_C2_BLE_INIT_RX_MODEL_AGC_RSSI_LEGACY

-
-#endif /*APP_CONF_H */
@@ -237,5 +261,5 @@
*/

#define CFG_BLE_RX_PATH_COMPENS (0)
- #endif /*APP_CONF_H */
+#endif /* APP_CONF_DEFAULT_H */

--
2.31.1.windows.1
2.25.1

4 changes: 2 additions & 2 deletions src/utility/STM32Cube_FW/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

## Source

[STMicroelectronics/STM32CubeWB Release v1.13.3](https://github.com/STMicroelectronics/STM32CubeWB/releases/tag/v1.13.3)
- Application: [BLE_TransparentMode](https://github.com/STMicroelectronics/STM32CubeWB/tree/v1.13.3/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode)
[STMicroelectronics/STM32CubeWB Release v1.14.0](https://github.com/STMicroelectronics/STM32CubeWB/releases/tag/v1.14.0)
- Application: [BLE_TransparentMode](https://github.com/STMicroelectronics/STM32CubeWB/tree/v1.14.0/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode)

65 changes: 52 additions & 13 deletions src/utility/STM32Cube_FW/app_conf_default.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
* Application Config
******************************************************************************/

/**
* Define Keypress Notification Support
*/
/**< generic parameters ******************************************************/
/* HCI related defines */

Expand All @@ -41,6 +44,7 @@
/**
* Define Tx Power
*/

#ifndef CFG_TX_POWER
#define CFG_TX_POWER (0x18) /* -0.15dBm */
#endif
Expand Down Expand Up @@ -77,7 +81,7 @@

/**
* Maximum supported ATT_MTU size
* This parameter is ignored by the CPU2 when CFG_BLE_OPTIONS is set to 1"
* This parameter is ignored by the CPU2 when CFG_BLE_OPTIONS has SHCI_C2_BLE_INIT_OPTIONS_LL_ONLY flag set
*/
#ifndef CFG_BLE_MAX_ATT_MTU
#define CFG_BLE_MAX_ATT_MTU (156)
Expand All @@ -93,15 +97,15 @@
* - 2*DTM_NUM_LINK, if client configuration descriptor is used
* - 2, if extended properties is used
* The total amount of memory needed is the sum of the above quantities for each attribute.
* This parameter is ignored by the CPU2 when CFG_BLE_OPTIONS is set to 1"
* This parameter is ignored by the CPU2 when CFG_BLE_OPTIONS has SHCI_C2_BLE_INIT_OPTIONS_LL_ONLY flag set
*/
#ifndef CFG_BLE_ATT_VALUE_ARRAY_SIZE
#define CFG_BLE_ATT_VALUE_ARRAY_SIZE (1344)
#endif

/**
* Prepare Write List size in terms of number of packet
* This parameter is ignored by the CPU2 when CFG_BLE_OPTIONS is set to 1"
* This parameter is ignored by the CPU2 when CFG_BLE_OPTIONS has SHCI_C2_BLE_INIT_OPTIONS_LL_ONLY flag set
*/
// #define CFG_BLE_PREPARE_WRITE_LIST_SIZE BLE_PREP_WRITE_X_ATT(CFG_BLE_MAX_ATT_MTU)
#ifndef CFG_BLE_PREPARE_WRITE_LIST_SIZE
Expand All @@ -110,7 +114,7 @@

/**
* Number of allocated memory blocks
* This parameter is overwritten by the CPU2 with an hardcoded optimal value when the parameter when CFG_BLE_OPTIONS is set to 1
* 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
*/
// #define CFG_BLE_MBLOCK_COUNT (BLE_MBLOCKS_CALC(CFG_BLE_PREPARE_WRITE_LIST_SIZE, CFG_BLE_MAX_ATT_MTU, CFG_BLE_NUM_LINK))
#define CFG_BLE_MBLOCK_COUNT (0x79)
Expand Down Expand Up @@ -145,12 +149,17 @@
#endif

/**
* Source for the low speed clock for RF wake-up
* 1 : external high speed crystal HSE/32/32
* 0 : external low speed crystal ( no calibration )
* LsSource
* Some information for Low speed clock mapped in bits field
* - bit 0: 1: Calibration for the RF system wakeup clock source 0: No calibration for the RF system wakeup clock source
* - bit 1: 1: STM32W5M Module device 0: Other devices as STM32WBxx SOC, STM32WB1M module
*/
#ifndef CFG_BLE_LSE_SOURCE
#define CFG_BLE_LSE_SOURCE 0
#if defined(STM32WB5Mxx)
#define CFG_BLE_LSE_SOURCE (SHCI_C2_BLE_INIT_CFG_BLE_LSE_NOCALIB | SHCI_C2_BLE_INIT_CFG_BLE_LSE_MOD5MM_DEV)
#else
#define CFG_BLE_LSE_SOURCE (SHCI_C2_BLE_INIT_CFG_BLE_LSE_NOCALIB | SHCI_C2_BLE_INIT_CFG_BLE_LSE_OTHER_DEV)
#endif
#endif

/**
Expand Down Expand Up @@ -195,8 +204,8 @@
* 0: with service change desc.
* (bit 2): 1: device name Read-Only
* 0: device name R/W
* (bit 3): 1: extended advertizing supported [NOT SUPPORTED]
* 0: extended advertizing not supported [NOT SUPPORTED]
* (bit 3): 1: extended advertizing supported
* 0: extended advertizing not supported
* (bit 4): 1: CS Algo #2 supported
* 0: CS Algo #2 not supported
* (bit 7): 1: LE Power Class 1
Expand All @@ -207,9 +216,9 @@

#define CFG_BLE_MAX_COC_INITIATOR_NBR (32)

#define CFG_BLE_MIN_TX_POWER (0)
#define CFG_BLE_MIN_TX_POWER (-40)

#define CFG_BLE_MAX_TX_POWER (0)
#define CFG_BLE_MAX_TX_POWER (6)

/**
* BLE Rx model configuration flags to be configured with:
Expand All @@ -221,6 +230,36 @@
* other bits: reserved (shall be set to 0)
*/

#define CFG_BLE_RX_MODEL_CONFIG SHCI_C2_BLE_INIT_RX_MODEL_AGC_RSSI_LEGACY
#define CFG_BLE_RX_MODEL_CONFIG (SHCI_C2_BLE_INIT_RX_MODEL_AGC_RSSI_LEGACY)

/* Maximum number of advertising sets.
* Range: 1 .. 8 with limitation:
* This parameter is linked to CFG_BLE_MAX_ADV_DATA_LEN such as both compliant with allocated Total memory computed with BLE_EXT_ADV_BUFFER_SIZE based
* on Max Extended advertising configuration supported.
* This parameter is considered by the CPU2 when CFG_BLE_OPTIONS has SHCI_C2_BLE_INIT_OPTIONS_EXT_ADV flag set
*/

#define CFG_BLE_MAX_ADV_SET_NBR (8)

/* Maximum advertising data length (in bytes)
* Range: 31 .. 1650 with limitation:
* This parameter is linked to CFG_BLE_MAX_ADV_SET_NBR such as both compliant with allocated Total memory computed with BLE_EXT_ADV_BUFFER_SIZE based
* on Max Extended advertising configuration supported.
* This parameter is considered by the CPU2 when CFG_BLE_OPTIONS has SHCI_C2_BLE_INIT_OPTIONS_EXT_ADV flag set
*/

#define CFG_BLE_MAX_ADV_DATA_LEN (207)

/* RF TX Path Compensation Value (16-bit signed integer). Units: 0.1 dB.
* Range: -1280 .. 1280
*/

#define CFG_BLE_TX_PATH_COMPENS (0)

/* RF RX Path Compensation Value (16-bit signed integer). Units: 0.1 dB.
* Range: -1280 .. 1280
*/

#define CFG_BLE_RX_PATH_COMPENS (0)
#endif /* APP_CONF_DEFAULT_H */

Loading