Skip to content

Commit 5c85f8b

Browse files
committed
chore: update with stm32wb
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
1 parent 10e8a76 commit 5c85f8b

File tree

7 files changed

+43
-10
lines changed

7 files changed

+43
-10
lines changed

.github/workflows/compile-examples.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ jobs:
2424
- STMicroelectronics:stm32:Eval:pnum=STEVAL_MKSBOX1V1,usb=CDCgen
2525
- STMicroelectronics:stm32:Nucleo_64:pnum=NUCLEO_L476RG
2626
- STMicroelectronics:stm32:Disco:pnum=B_L475E_IOT01A
27+
- STMicroelectronics:stm32:Nucleo_64:pnum=P_NUCLEO_WB55RG
28+
- STMicroelectronics:stm32:Nucleo_64:pnum=P_NUCLEO_WB55_USB_DONGLE
2729

2830
steps:
2931
- uses: actions/checkout@v4

.github/workflows/spell-check.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,10 @@ jobs:
2323

2424
- name: Spell check
2525
uses: codespell-project/actions-codespell@v2
26+
with:
27+
check_filenames: true
28+
check_hidden: true
29+
# In the event of a false positive, add the word in all lower case to this file:
30+
# ignore_words_file: ./extras/codespell-ignore-words-list.txt
31+
skip: src/utility/STM32_WPAN
32+
path: src

README.md

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
# STM32duinoBLE
22

3-
This library is a fork of ArduinoBLE library to add the support of SPBTLE-RF, SPBTLE-1S, BLUENRG-M2SP, BLUENRG-LP and BLUENRG-M0 BLE modules.
3+
This library is a fork of ArduinoBLE library to add the support of STM32WB, SPBTLE-RF, SPBTLE-1S, BLUENRG-M2SP, BLUENRG-LP and BLUENRG-M0 BLE modules.
44

5-
It was successfully tested with the X-NUCLEO-IDB05A1 or X-NUCLEO-IDB05A2 or X-NUCLEO-BNRG2A1 expansion board and
6-
a NUCLEO-F401RE or NUCLEO-L476RG or NUCLEO-L053R8, with B-L475E-IOT01A and with STEVAL-MKSBOX1V1.
5+
It was successfully tested with the NUCLEO-WB15CC, P-NUCELO_WB55RG, STM32WB5MM-DK, X-NUCLEO-IDB05A2 or
6+
X-NUCLEO-IDB05A1 or X-NUCLEO-BNRG2A1 expansion board and a NUCLEO-F401RE or NUCLEO-L476RG or NUCLEO-L053R8,
7+
with B-L475E-IOT01A and with STEVAL-MKSBOX1V1.
8+
9+
- 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:
10+
11+
https://github.com/STMicroelectronics/STM32CubeWB/tree/master/Projects/STM32WB_Copro_Wireless_Binaries
12+
13+
Each subdirectories contains binaries and Release_Notes.html which explain how to update it.
714

815
- 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:
916

@@ -14,10 +21,19 @@ https://github.com/stm32duino/Arduino_Core_STM32/wiki/STM32duinoBLE#stm32duinobl
1421
https://github.com/stm32duino/Arduino_Core_STM32/wiki/STM32duinoBLE#stm32duinoble-with-x-nucleo-bnrg2a1
1522

1623
For more information about ArduinoBLE library please visit the official web page at:
24+
1725
https://www.arduino.cc/en/Reference/ArduinoBLE
1826

1927
# Configuration
2028

29+
### STM32WB
30+
31+
STM32Cube_WPAN has several configuration options, which are set in the `app_conf.h`.
32+
This package has a default configuration named `app_conf_default.h`.
33+
The user can include the file `app_conf_custom.h` to customize the BLE application.
34+
Options wrapped in `#ifndef`, `#endif` in `app_conf_default.h` can be overwritten.
35+
Additional options can be added.
36+
2137
### Shield
2238

2339
The user can include the file `ble_spi_conf.h` to define which shield and configuration to use from the following list:
@@ -71,6 +87,12 @@ This is equivalent to the below configuration using the `CUSTOM_BLE_SPI`:
7187
#define BLE_RESET D7
7288
```
7389
90+
#### Using a SPI BLE module on STM32WB
91+
92+
If required, user can use a compatible BLE module over SPI.
93+
94+
In the `ble_spi_conf.h`, define `USE_BLE_SPI`.
95+
7496
## License
7597
7698
```

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name=STM32duinoBLE
22
version=1.3.7
33
author=Arduino, SRA
44
maintainer=stm32duino
5-
sentence=Fork of ArduinoBLE library to add the support of SPBTLE-RF, SPBTLE-1S, BLUENRG-M2SP, BLUENRG-LP and BLUENRG-M0 BLE modules.
5+
sentence=Fork of ArduinoBLE library to add the support of STM32WB, SPBTLE-RF, SPBTLE-1S, BLUENRG-M2SP, BLUENRG-LP and BLUENRG-M0 BLE modules.
66
paragraph=This library supports creating a Bluetooth® Low Energy peripheral & central mode.
77
category=Communication
88
url=https://github.com/stm32duino/STM32duinoBLE

src/utility/HCISharedMemTransport.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
License along with this library; if not, write to the Free Software
1717
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1818
*/
19-
#if defined(STM32WBxx)
19+
#if defined(STM32WBxx) && !defined(USE_BLE_SPI)
2020

2121
#include "HCISharedMemTransport.h"
2222
#include "STM32_WPAN/hw.h"
@@ -779,4 +779,4 @@ int HCISharedMemTransportClass::bt_ipm_set_power(void)
779779
}
780780

781781
HCITransportInterface& HCITransport = HCISharedMemTransport;
782-
#endif /* STM32WBxx */
782+
#endif /* STM32WBxx && !USE_BLE_SPI */

src/utility/HCISpiTransport.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,9 @@
1717
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1818
*/
1919

20+
#if !defined(STM32WBxx) || defined(USE_BLE_SPI)
2021
#include "HCISpiTransport.h"
2122

22-
#if __has_include("ble_spi_conf.h")
23-
#include "ble_spi_conf.h"
24-
#endif
25-
2623
#if defined(CUSTOM_BLE_SPI)
2724
SPIClass SpiHCI(BLE_SPI_MOSI, BLE_SPI_MISO, BLE_SPI_CLK);
2825
HCISpiTransportClass HCISpiTransport(SpiHCI, BLE_CHIP_TYPE, BLE_SPI_CS, BLE_SPI_IRQ, BLE_RESET, BLE_SPI_FREQ, BLE_SPI_MODE);
@@ -1400,3 +1397,4 @@ void HCISpiTransportClass::wait_for_set_address()
14001397
}
14011398

14021399
HCITransportInterface& HCITransport = HCISpiTransport;
1400+
#endif // !STM32WBxx || USE_BLE_SPI

src/utility/HCITransport.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222

2323
#include <Arduino.h>
2424

25+
#if __has_include("ble_spi_conf.h")
26+
#include "ble_spi_conf.h"
27+
#endif
28+
2529
class HCITransportInterface {
2630
public:
2731
virtual int begin() = 0;

0 commit comments

Comments
 (0)