Skip to content

chore: update STM32Cube_FW from Cube version v1.15.0 #48

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

Merged
merged 9 commits into from
Dec 15, 2022
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ indent_style = space
indent_size = 2
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.sh]
# like -i=2
indent_style = space
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ jobs:
check_hidden: true
# In the event of a false positive, add the word in all lower case to this file:
# ignore_words_file: ./extras/codespell-ignore-words-list.txt
path: src
skip: src/utility/STM32Cube_FW
path: src
23 changes: 14 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
# STM32duinoBLE

This library is a fork of ArduinoBLE library to add the support of SPBTLE-RF and SPBTLE-1S BLE modules.
It was successfully tested with the X-NUCLEO-IDB05A2 or X-NUCLEO-IDB05A1 or X-NUCLEO-BNRG2A1 expansion board and a NUCLEO-F401RE
or NUCLEO-L476RG or NUCLEO-L053R8, with B-L475E-IOT01A and with STEVAL-MKSBOX1V1.
In order to use this library with STEVAL-MKSBOX1V1, you need to update the firmware of the SPBTLE-1S BLE module
mounted on that board as described in the following wiki page:

This library is a fork of ArduinoBLE library to add the support of STM32WBxx, SPBTLE-RF and SPBTLE-1S BLE modules.
It was successfully tested with the P-NUCELO_WB55RG, STM32WB5MM-DK, X-NUCLEO-IDB05A2 or X-NUCLEO-IDB05A1 or
X-NUCLEO-BNRG2A1 expansion board and a NUCLEO-F401RE or NUCLEO-L476RG or NUCLEO-L053R8, with B-L475E-IOT01A
and with STEVAL-MKSBOX1V1.

- In order to use this library with SM32WBxx series, you need to update the STM32WB Copro Wireless Binaries
with stm32wbxx_BLE_HCILayer_fw.bin depending of your mcu:
https://github.com/STMicroelectronics/STM32CubeWB/tree/master/Projects/STM32WB_Copro_Wireless_Binaries
Each subdirectories contains binaries and Release_Notes.html which explain how to update it.

- In order to use this library with STEVAL-MKSBOX1V1, you need to update the firmware of the SPBTLE-1S BLE module
mounted on that board as described in the following wiki page:
https://github.com/stm32duino/wiki/wiki/STM32duinoBLE#stm32duinoble-with-steval_mksbox1v1

In order to use this library with X-NUCLEO-BNRG2A1, you need to update the firmware of the BLUENRG-M2SP BLE module
mounted on that expansion board as described in the following wiki page:

- In order to use this library with X-NUCLEO-BNRG2A1, you need to update the firmware of the BLUENRG-M2SP BLE module
mounted on that expansion board as described in the following wiki page:
https://github.com/stm32duino/wiki/wiki/STM32duinoBLE#stm32duinoble-with-x-nucleo-bnrg2a1

For more information about ArduinoBLE library please visit the official web page at:
Expand Down
12 changes: 6 additions & 6 deletions src/utility/HCISharedMemTransport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ int HCISharedMemTransportClass::stm32wb_start_ble(void)
CFG_BLE_MAX_ATT_MTU,
CFG_BLE_SLAVE_SCA,
CFG_BLE_MASTER_SCA,
CFG_BLE_LSE_SOURCE,
CFG_BLE_LS_SOURCE,
CFG_BLE_MAX_CONN_EVENT_LENGTH,
CFG_BLE_HSE_STARTUP_TIME,
CFG_BLE_VITERBI_MODE,
Expand All @@ -654,11 +654,11 @@ int HCISharedMemTransportClass::stm32wb_start_ble(void)
CFG_BLE_MIN_TX_POWER,
CFG_BLE_MAX_TX_POWER,
CFG_BLE_RX_MODEL_CONFIG,
CFG_BLE_MAX_ADV_SET_NBR,
CFG_BLE_MAX_ADV_DATA_LEN,
CFG_BLE_TX_PATH_COMPENS,
CFG_BLE_RX_PATH_COMPENS

CFG_BLE_MAX_ADV_SET_NBR,
CFG_BLE_MAX_ADV_DATA_LEN,
CFG_BLE_TX_PATH_COMPENS,
CFG_BLE_RX_PATH_COMPENS,
CFG_BLE_CORE_VERSION
};
/**
* Starts the BLE Stack on CPU2
Expand Down
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.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)
[STMicroelectronics/STM32CubeWB Release vv1.15.0](https://github.com/STMicroelectronics/STM32CubeWB/releases/tag/vv1.15.0)
- Application: [BLE_TransparentMode](https://github.com/STMicroelectronics/STM32CubeWB/tree/vv1.15.0/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode)

50 changes: 37 additions & 13 deletions src/utility/STM32Cube_FW/app_conf_default.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
* Define Tx Power
*/
#ifndef CFG_TX_POWER
#define CFG_TX_POWER (0x18) /* -0.15dBm */
#define CFG_TX_POWER (0x18) /* -0.15dBm */
#endif

/******************************************************************************
Expand Down Expand Up @@ -80,7 +80,7 @@
* 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)
#define CFG_BLE_MAX_ATT_MTU (156)
#endif

/**
Expand All @@ -104,7 +104,7 @@
*/
// #define CFG_BLE_PREPARE_WRITE_LIST_SIZE BLE_PREP_WRITE_X_ATT(CFG_BLE_MAX_ATT_MTU)
#ifndef CFG_BLE_PREPARE_WRITE_LIST_SIZE
#define CFG_BLE_PREPARE_WRITE_LIST_SIZE (0x3A)
#define CFG_BLE_PREPARE_WRITE_LIST_SIZE (0x3A)
#endif

/**
Expand All @@ -118,14 +118,14 @@
* Enable or disable the Extended Packet length feature. Valid values are 0 or 1.
*/
#ifndef CFG_BLE_DATA_LENGTH_EXTENSION
#define CFG_BLE_DATA_LENGTH_EXTENSION 1
#define CFG_BLE_DATA_LENGTH_EXTENSION 1
#endif

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

/**
Expand All @@ -140,35 +140,36 @@
* 7 : 0 ppm to 20 ppm
*/
#ifndef CFG_BLE_MASTER_SCA
#define CFG_BLE_MASTER_SCA 0
#define CFG_BLE_MASTER_SCA 0
#endif

/**
* 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
* - bit 1: 1: STM32WB5M Module device 0: Other devices as STM32WBxx SOC, STM32WB1M module
* - bit 2: 1: HSE/1024 Clock config 0: LSE Clock config
*/
#ifndef CFG_BLE_LSE_SOURCE
#ifndef CFG_BLE_LS_SOURCE
#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)
#define CFG_BLE_LS_SOURCE (SHCI_C2_BLE_INIT_CFG_BLE_LS_NOCALIB | SHCI_C2_BLE_INIT_CFG_BLE_LS_MOD5MM_DEV | SHCI_C2_BLE_INIT_CFG_BLE_LS_CLK_LSE)
#else
#define CFG_BLE_LSE_SOURCE (SHCI_C2_BLE_INIT_CFG_BLE_LSE_NOCALIB | SHCI_C2_BLE_INIT_CFG_BLE_LSE_OTHER_DEV)
#define CFG_BLE_LS_SOURCE (SHCI_C2_BLE_INIT_CFG_BLE_LS_NOCALIB | SHCI_C2_BLE_INIT_CFG_BLE_LS_OTHER_DEV | SHCI_C2_BLE_INIT_CFG_BLE_LS_CLK_LSE)
#endif
#endif

/**
* Start up time of the high speed (16 or 32 MHz) crystal oscillator in units of 625/256 us (~2.44 us)
*/
#ifndef CFG_BLE_HSE_STARTUP_TIME
#define CFG_BLE_HSE_STARTUP_TIME 0x148
#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)
*/
#ifndef CFG_BLE_MAX_CONN_EVENT_LENGTH
#define CFG_BLE_MAX_CONN_EVENT_LENGTH (0xFFFFFFFF)
#define CFG_BLE_MAX_CONN_EVENT_LENGTH (0xFFFFFFFF)
#endif

/**
Expand All @@ -190,8 +191,16 @@
* - SHCI_C2_BLE_INIT_OPTIONS_NO_EXT_ADV
* - SHCI_C2_BLE_INIT_OPTIONS_CS_ALGO2
* - SHCI_C2_BLE_INIT_OPTIONS_NO_CS_ALGO2
* - SHCI_C2_BLE_INIT_OPTIONS_REDUC_GATTDB_NVM
* - SHCI_C2_BLE_INIT_OPTIONS_FULL_GATTDB_NVM
* - SHCI_C2_BLE_INIT_OPTIONS_GATT_CACHING_USED
* - SHCI_C2_BLE_INIT_OPTIONS_GATT_CACHING_NOTUSED
* - SHCI_C2_BLE_INIT_OPTIONS_POWER_CLASS_1
* - SHCI_C2_BLE_INIT_OPTIONS_POWER_CLASS_2_3
* - SHCI_C2_BLE_INIT_OPTIONS_APPEARANCE_WRITABLE
* - SHCI_C2_BLE_INIT_OPTIONS_APPEARANCE_READONLY
* - SHCI_C2_BLE_INIT_OPTIONS_ENHANCED_ATT_SUPPORTED
* - SHCI_C2_BLE_INIT_OPTIONS_ENHANCED_ATT_NOTSUPPORTED
* which are used to set following configuration bits:
* (bit 0): 1: LL only
* 0: LL + host
Expand All @@ -203,8 +212,16 @@
* 0: extended advertizing not supported
* (bit 4): 1: CS Algo #2 supported
* 0: CS Algo #2 not supported
* (bit 5): 1: Reduced GATT database in NVM
* 0: Full GATT database in NVM
* (bit 6): 1: GATT caching is used
* 0: GATT caching is not used
* (bit 7): 1: LE Power Class 1
* 0: LE Power Class 2-3
* (bit 8): 1: appearance Writable
* 0: appearance Read-Only
* (bit 9): 1: Enhanced ATT supported
* 0: Enhanced ATT not supported
* other bits: reserved (shall be set to 0)
*/
#define CFG_BLE_OPTIONS (SHCI_C2_BLE_INIT_OPTIONS_LL_ONLY)
Expand Down Expand Up @@ -257,5 +274,12 @@

#define CFG_BLE_RX_PATH_COMPENS (0)

#endif /* APP_CONF_DEFAULT_H */
/* BLE core version (16-bit signed integer).
* - SHCI_C2_BLE_INIT_BLE_CORE_5_2
* - SHCI_C2_BLE_INIT_BLE_CORE_5_3
* which are used to set: 11(5.2), 12(5.3).
*/

#define CFG_BLE_CORE_VERSION (SHCI_C2_BLE_INIT_BLE_CORE_5_3)

#endif /* APP_CONF_DEFAULT_H */
30 changes: 15 additions & 15 deletions src/utility/STM32Cube_FW/ble_bufsize.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,47 +84,47 @@

/*
* BLE_FIXED_BUFFER_SIZE_BYTES:
* A part of the RAM, is dynamically allocated by initializing all the pointers
* A part of the RAM, is dynamically allocated by initializing all the pointers
* defined in a global context variable "mem_alloc_ctx_p".
* This initialization is made in the Dynamic_allocator functions, which
* assign a portion of RAM given by the external application to the above
* mentioned "global pointers".
*
* The size of this Dynamic RAM is made of 2 main components:
* - a part that is parameters-dependent (num of links, GATT buffers, ...),
* and which value is defined by the following macro;
* and which value is made explicit by the following macro;
* - a part, that may be considered "fixed", i.e. independent from the above
* mentioned parameters.
*/
#if (BEACON_ONLY != 0)
#define BLE_FIXED_BUFFER_SIZE_BYTES 4076 /* Beacon only */
#define BLE_FIXED_BUFFER_SIZE_BYTES 4092 /* Beacon only */
#elif (LL_ONLY_BASIC != 0)
#define BLE_FIXED_BUFFER_SIZE_BYTES 5692 /* LL only Basic*/
#define BLE_FIXED_BUFFER_SIZE_BYTES 5788 /* LL only Basic*/
#elif (LL_ONLY != 0)
#define BLE_FIXED_BUFFER_SIZE_BYTES 5940 /* LL only Full */
#define BLE_FIXED_BUFFER_SIZE_BYTES 6036 /* LL only Full */
#elif (SLAVE_ONLY != 0)
#define BLE_FIXED_BUFFER_SIZE_BYTES 6204 /* Peripheral only */
#define BLE_FIXED_BUFFER_SIZE_BYTES 6292 /* Peripheral only */
#elif (BASIC_FEATURES != 0)
#define BLE_FIXED_BUFFER_SIZE_BYTES 6532 /* Basic Features */
#define BLE_FIXED_BUFFER_SIZE_BYTES 6624 /* Basic Features */
#else
#define BLE_FIXED_BUFFER_SIZE_BYTES 7056 /* Full stack */
#define BLE_FIXED_BUFFER_SIZE_BYTES 7144 /* Full stack */
#endif

/*
* BLE_PER_LINK_SIZE_BYTES: additional memory size used per link
*/
#if (BEACON_ONLY != 0)
#define BLE_PER_LINK_SIZE_BYTES 128 /* Beacon only */
#define BLE_PER_LINK_SIZE_BYTES 112 /* Beacon only */
#elif (LL_ONLY_BASIC != 0)
#define BLE_PER_LINK_SIZE_BYTES 260 /* LL only Basic */
#define BLE_PER_LINK_SIZE_BYTES 244 /* LL only Basic */
#elif (LL_ONLY != 0)
#define BLE_PER_LINK_SIZE_BYTES 260 /* LL only Full */
#define BLE_PER_LINK_SIZE_BYTES 244 /* LL only Full */
#elif (SLAVE_ONLY != 0)
#define BLE_PER_LINK_SIZE_BYTES 392 /* Peripheral only */
#define BLE_PER_LINK_SIZE_BYTES 336 /* Peripheral only */
#elif (BASIC_FEATURES != 0)
#define BLE_PER_LINK_SIZE_BYTES 440 /* Basic Features */
#define BLE_PER_LINK_SIZE_BYTES 412 /* Basic Features */
#else
#define BLE_PER_LINK_SIZE_BYTES 444 /* Full stack */
#define BLE_PER_LINK_SIZE_BYTES 424 /* Full stack */
#endif

/*
Expand Down Expand Up @@ -155,7 +155,7 @@
* Valid values are from 31 to 1650.
*/
#define BLE_EXT_ADV_BUFFER_SIZE(set_nbr, data_len) \
(2304 + ((892 + (DIVC(data_len, 207) * 244)) * (set_nbr)))
(2512 + ((892 + (DIVC(data_len, 207) * 244)) * (set_nbr)))

/*
* BLE_TOTAL_BUFFER_SIZE_GATT: this macro returns the amount of memory,
Expand Down
Loading