diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 00000000..47433680
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,26 @@
+[*]
+end_of_line = lf
+insert_final_newline = true
+indent_style = space
+indent_size = 2
+trim_trailing_whitespace =  true
+
+[*.patch]
+insert_final_newline = unset
+indent_style = unset
+indent_size = unset
+trim_trailing_whitespace =  unset
+
+[*.md]
+trim_trailing_whitespace =  false
+
+[*.sh]
+# like -i=2
+indent_style = space
+indent_size = 2
+
+#shell_variant      = posix # like -ln=posix
+#binary_next_line   = true  # like -bn
+switch_case_indent = true  # like -ci
+space_redirects    = true  # like -sr
+#keep_padding       = true  # like -kp
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 00000000..422ae6f5
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,42 @@
+# Set the default behavior, in case people don't have core.autocrlf set.
+* text=auto
+
+# Explicitly declare text files you want to always be normalized and converted
+# to native line endings on checkout.
+.editorconfig text eol=lf
+.flake8 text eol=lf
+.gitattributes text eol=lf
+.gitignore text eol=lf
+
+*.adoc text eol=lf
+*.c text eol=lf
+*.cmake text eol=lf
+*.cpp text eol=lf
+*.css text eol=lf
+*.dtsi text eol=lf
+*.gv text eol=lf
+*.h text eol=lf
+*.html text eol=lf
+*.in text eol=lf
+*.ino text eol=lf
+*.json text eol=lf
+*.ld text eol=lf
+*.md text eol=lf
+*.MD text eol=lf
+*.old text eol=lf
+*.patch text eol=lf
+*.pde text eol=lf
+*.properties text eol=lf
+*.py text eol=lf
+*.s text eol=lf
+*.S text eol=lf
+*.sh text eol=lf
+*.spec text eol=lf
+*.txt text eol=lf
+*.yml text eol=lf
+
+# Denote all files that are truly binary and should not be modified.
+*.jpg binary
+*.pdf binary
+*.png binary
+
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
deleted file mode 100644
index f2bfa724..00000000
--- a/.github/dependabot.yml
+++ /dev/null
@@ -1,13 +0,0 @@
-# See: https://docs.github.com/en/code-security/supply-chain-security/configuration-options-for-dependency-updates#about-the-dependabotyml-file
-version: 2
-
-updates:
-  # Configure check for outdated GitHub Actions actions in workflows.
-  # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/dependabot/README.md
-  # See: https://docs.github.com/en/code-security/supply-chain-security/keeping-your-actions-up-to-date-with-dependabot
-  - package-ecosystem: github-actions
-    directory: / # Check the repository's workflows under /.github/workflows/
-    schedule:
-      interval: daily
-    labels:
-      - "topic: infrastructure"
diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml
index d97458e6..059e70f1 100644
--- a/.github/workflows/compile-examples.yml
+++ b/.github/workflows/compile-examples.yml
@@ -16,84 +16,19 @@ on:
     # Run every Tuesday at 8 AM UTC to catch breakage caused by changes to external resources (libraries, platforms).
     - cron: "0 8 * * TUE"
   workflow_dispatch:
-  repository_dispatch:
 
 jobs:
-  build:
-    name: ${{ matrix.board.fqbn }}
-    runs-on: ubuntu-latest
-
-    env:
-      SKETCHES_REPORTS_PATH: sketches-reports
-
-    strategy:
-      fail-fast: false
-
-      matrix:
-        board:
-          - fqbn: arduino:samd:mkrwifi1010
-            platforms: |
-              - name: arduino:samd
-            artifact-name-suffix: arduino-samd-mkrwifi1010
-          - fqbn: arduino:samd:nano_33_iot
-            platforms: |
-              - name: arduino:samd
-            artifact-name-suffix: arduino-samd-nano_33_iot
-          - fqbn: arduino:megaavr:uno2018:mode=on
-            platforms: |
-              - name: arduino:megaavr
-            artifact-name-suffix: arduino-megaavr-uno2018
-          - fqbn: arduino:mbed_nano:nano33ble
-            platforms: |
-              - name: arduino:mbed_nano
-            artifact-name-suffix: arduino-mbed_nano-nano33ble
-          - fqbn: arduino:mbed_nano:nanorp2040connect
-            platforms: |
-              - name: arduino:mbed_nano
-            artifact-name-suffix: arduino-mbed_nano-nanorp2040connect
-          - fqbn: arduino:renesas_uno:unor4wifi
-            platforms: |
-              - name: arduino:renesas_uno
-            artifact-name-suffix: arduino-renesas_uno-unor4wifi
-
-    steps:
-      - name: Checkout repository
-        uses: actions/checkout@v4
-
-      - name: Compile examples
-        uses: arduino/compile-sketches@v1
-        with:
-          github-token: ${{ secrets.GITHUB_TOKEN }}
-          fqbn: ${{ matrix.board.fqbn }}
-          platforms: ${{ matrix.board.platforms }}
-          libraries: |
-            # Install the library from the local path.
-            - source-path: ./
-          sketch-paths: |
-            - examples
-          enable-deltas-report: true
-          sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }}
-
-      - name: Save sketches report as workflow artifact
-        uses: actions/upload-artifact@v4
-        with:
-          if-no-files-found: error
-          path: ${{ env.SKETCHES_REPORTS_PATH }}
-          name: sketches-report-${{ matrix.board.artifact-name-suffix }}
-
-  build-for-esp32:
+  build-for-stm32:
     runs-on: ubuntu-latest
 
     strategy:
       matrix:
         fqbn:
-          - esp32:esp32:esp32
-          - esp32:esp32:esp32s3
-          - esp32:esp32:esp32c3
-          - esp32:esp32:esp32c6
-          - esp32:esp32:esp32h2
-          # Not supported out of the box by ESP32 Arduino core
-          #- esp32:esp32:esp32c2
+          - STMicroelectronics:stm32:Eval:pnum=STEVAL_MKSBOX1V1,usb=CDCgen
+          - STMicroelectronics:stm32:Nucleo_64:pnum=NUCLEO_L476RG
+          - STMicroelectronics:stm32:Disco:pnum=B_L475E_IOT01A
+          - STMicroelectronics:stm32:Nucleo_64:pnum=P_NUCLEO_WB55RG
+          - STMicroelectronics:stm32:Nucleo_64:pnum=P_NUCLEO_WB55_USB_DONGLE
 
     steps:
       - uses: actions/checkout@v4
@@ -102,14 +37,11 @@ jobs:
           github-token: ${{ secrets.GITHUB_TOKEN }}
           fqbn: ${{ matrix.fqbn }}
           platforms: |
-            - name: esp32:esp32
-              source-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
+            - name: STMicroelectronics:stm32
+              source-url: https://github.com/stm32duino/BoardManagerFiles/raw/main/package_stmicroelectronics_index.json
           sketch-paths: |
-            - examples/Central/Scan
-            - examples/Central/PeripheralExplorer
-            - examples/Central/ScanCallback
-            - examples/Central/SensorTagButton
-            - examples/Peripheral/Advertising/EnhancedAdvertising
-            - examples/Peripheral/Advertising/RawDataAdvertising
+            - examples
           cli-compile-flags: |
-            - --warnings="none"
+            - --build-property
+            - build.extra_flags=-DIDB05A2_SPI_CLOCK_D3
+
diff --git a/.github/workflows/report-size-deltas.yml b/.github/workflows/report-size-deltas.yml
deleted file mode 100644
index 39e2a0ad..00000000
--- a/.github/workflows/report-size-deltas.yml
+++ /dev/null
@@ -1,24 +0,0 @@
-name: Report Size Deltas
-
-# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows
-on:
-  push:
-    paths:
-      - ".github/workflows/report-size-deltas.yml"
-  schedule:
-    # Run at the minimum interval allowed by GitHub Actions.
-    # Note: GitHub Actions periodically has outages which result in workflow failures.
-    # In this event, the workflows will start passing again once the service recovers.
-    - cron: "*/5 * * * *"
-  workflow_dispatch:
-  repository_dispatch:
-
-jobs:
-  report:
-    runs-on: ubuntu-latest
-    steps:
-      - name: Comment size deltas reports to PRs
-        uses: arduino/report-size-deltas@v1
-        with:
-          # Regex matching the names of the workflow artifacts created by the "Compile Examples" workflow
-          sketches-reports-source: ^sketches-report-.+
diff --git a/.github/workflows/spell-check.yml b/.github/workflows/spell-check.yml
index 6faf09c8..61af09cd 100644
--- a/.github/workflows/spell-check.yml
+++ b/.github/workflows/spell-check.yml
@@ -23,3 +23,10 @@ jobs:
 
       - name: Spell check
         uses: codespell-project/actions-codespell@v2
+        with:
+          check_filenames: true
+          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
+          skip: src/utility/STM32_WPAN
+          path: src
diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml
deleted file mode 100644
index 53a9f54f..00000000
--- a/.github/workflows/sync-labels.yml
+++ /dev/null
@@ -1,138 +0,0 @@
-# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/sync-labels.md
-name: Sync Labels
-
-# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
-on:
-  push:
-    paths:
-      - ".github/workflows/sync-labels.ya?ml"
-      - ".github/label-configuration-files/*.ya?ml"
-  pull_request:
-    paths:
-      - ".github/workflows/sync-labels.ya?ml"
-      - ".github/label-configuration-files/*.ya?ml"
-  schedule:
-    # Run daily at 8 AM UTC to sync with changes to shared label configurations.
-    - cron: "0 8 * * *"
-  workflow_dispatch:
-  repository_dispatch:
-
-env:
-  CONFIGURATIONS_FOLDER: .github/label-configuration-files
-  CONFIGURATIONS_ARTIFACT: label-configuration-files
-
-jobs:
-  check:
-    runs-on: ubuntu-latest
-
-    steps:
-      - name: Checkout repository
-        uses: actions/checkout@v4
-
-      - name: Download JSON schema for labels configuration file
-        id: download-schema
-        uses: carlosperate/download-file-action@v2
-        with:
-          file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/arduino-tooling-gh-label-configuration-schema.json
-          location: ${{ runner.temp }}/label-configuration-schema
-
-      - name: Install JSON schema validator
-        run: |
-          sudo npm install \
-            --global \
-            ajv-cli \
-            ajv-formats
-
-      - name: Validate local labels configuration
-        run: |
-          # See: https://github.com/ajv-validator/ajv-cli#readme
-          ajv validate \
-            --all-errors \
-            -c ajv-formats \
-            -s "${{ steps.download-schema.outputs.file-path }}" \
-            -d "${{ env.CONFIGURATIONS_FOLDER }}/*.{yml,yaml}"
-
-  download:
-    needs: check
-    runs-on: ubuntu-latest
-
-    strategy:
-      matrix:
-        filename:
-          # Filenames of the shared configurations to apply to the repository in addition to the local configuration.
-          # https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/sync-labels
-          - universal.yml
-
-    steps:
-      - name: Download
-        uses: carlosperate/download-file-action@v2
-        with:
-          file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/${{ matrix.filename }}
-
-      - name: Pass configuration files to next job via workflow artifact
-        uses: actions/upload-artifact@v4
-        with:
-          path: |
-            *.yaml
-            *.yml
-          if-no-files-found: error
-          name: ${{ env.CONFIGURATIONS_ARTIFACT }}
-
-  sync:
-    needs: download
-    runs-on: ubuntu-latest
-
-    steps:
-      - name: Set environment variables
-        run: |
-          # See: https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable
-          echo "MERGED_CONFIGURATION_PATH=${{ runner.temp }}/labels.yml" >> "$GITHUB_ENV"
-
-      - name: Determine whether to dry run
-        id: dry-run
-        if: >
-          github.event_name == 'pull_request' ||
-          (
-            (
-              github.event_name == 'push' ||
-              github.event_name == 'workflow_dispatch'
-            ) &&
-            github.ref != format('refs/heads/{0}', github.event.repository.default_branch)
-          )
-        run: |
-          # Use of this flag in the github-label-sync command will cause it to only check the validity of the
-          # configuration.
-          echo "::set-output name=flag::--dry-run"
-
-      - name: Checkout repository
-        uses: actions/checkout@v4
-
-      - name: Download configuration files artifact
-        uses: actions/download-artifact@v4
-        with:
-          name: ${{ env.CONFIGURATIONS_ARTIFACT }}
-          path: ${{ env.CONFIGURATIONS_FOLDER }}
-
-      - name: Remove unneeded artifact
-        uses: geekyeggo/delete-artifact@v5
-        with:
-          name: ${{ env.CONFIGURATIONS_ARTIFACT }}
-
-      - name: Merge label configuration files
-        run: |
-          # Merge all configuration files
-          shopt -s extglob
-          cat "${{ env.CONFIGURATIONS_FOLDER }}"/*.@(yml|yaml) > "${{ env.MERGED_CONFIGURATION_PATH }}"
-
-      - name: Install github-label-sync
-        run: sudo npm install --global github-label-sync
-
-      - name: Sync labels
-        env:
-          GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-        run: |
-          # See: https://github.com/Financial-Times/github-label-sync
-          github-label-sync \
-            --labels "${{ env.MERGED_CONFIGURATION_PATH }}" \
-            ${{ steps.dry-run.outputs.flag }} \
-            ${{ github.repository }}
diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml
deleted file mode 100644
index 2a96b8a5..00000000
--- a/.github/workflows/unit-tests.yml
+++ /dev/null
@@ -1,58 +0,0 @@
-name: Unit Tests
-
-on:
-  pull_request:
-    paths:
-      - ".github/workflows/unit-tests.yml"
-      - 'extras/test/**'
-      - 'src/**'
-
-  push:
-    paths:
-      - ".github/workflows/unit-tests.yml"
-      - 'extras/test/**'
-      - 'src/**'
-
-jobs:
-  test:
-    name: Run unit tests
-    runs-on: ubuntu-latest
-
-    env:
-      COVERAGE_DATA_PATH: extras/coverage-data/coverage.info
-
-    steps:
-      - name: Checkout
-        uses: actions/checkout@v4
-
-      - uses: arduino/cpp-test-action@main
-        with:
-          runtime-paths: |
-            - extras/test/build/bin/TEST_TARGET_UUID
-            - extras/test/build/bin/TEST_TARGET_DISC_DEVICE
-            - extras/test/build/bin/TEST_TARGET_ADVERTISING_DATA
-          coverage-exclude-paths: |
-            - '*/extras/test/*'
-            - '/usr/*'
-          coverage-data-path: ${{ env.COVERAGE_DATA_PATH }}
-
-      # A token is used to avoid intermittent spurious job failures caused by rate limiting.
-      - name: Set up Codecov upload token
-        run: |
-          if [[ "${{ github.repository }}" == "arduino-libraries/ArduinoBLE" ]]; then
-            # In order to avoid uploads of data from forks, only use the token for runs in the parent repo.
-            # Token is intentionally exposed.
-            # See: https://community.codecov.com/t/upload-issues-unable-to-locate-build-via-github-actions-api/3954
-            CODECOV_TOKEN="8118de48-b2af-48b4-a66a-26026847bfc5"
-          else
-            # codecov/codecov-action does unauthenticated upload if empty string is passed via the `token` input.
-            CODECOV_TOKEN=""
-          fi
-          echo "CODECOV_TOKEN=$CODECOV_TOKEN" >> "$GITHUB_ENV"
-
-      - name: Upload coverage report to Codecov
-        uses: codecov/codecov-action@v3
-        with:
-          file: "${{ env.COVERAGE_DATA_PATH }}"
-          fail_ci_if_error: true
-          token: ${{ env.CODECOV_TOKEN }}
diff --git a/README.md b/README.md
index b0027583..ca305c4a 100644
--- a/README.md
+++ b/README.md
@@ -1,22 +1,110 @@
-# ArduinoBLE
+# STM32duinoBLE
 
-[![Compile Examples Status](https://github.com/arduino-libraries/ArduinoBLE/workflows/Compile%20Examples/badge.svg)](https://github.com/arduino-libraries/ArduinoBLE/actions?workflow=Compile+Examples) [![Spell Check Status](https://github.com/arduino-libraries/ArduinoBLE/workflows/Spell%20Check/badge.svg)](https://github.com/arduino-libraries/ArduinoBLE/actions?workflow=Spell+Check)
+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.
 
-Enables Bluetooth® Low Energy connectivity on the Arduino MKR WiFi 1010, Arduino UNO WiFi Rev2, Arduino Nano 33 IoT, Arduino Nano 33 BLE, Arduino Portenta H7, Arduino Giga R1 and Arduino UNO R4 WiFi.
+It was successfully tested with the [NUCLEO-WB15CC], [P-NUCLEO-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], [B-L4S5I-IOT01A], [STEVAL-MKSBOX1V1], [STEVAL-MKBOXPRO] and with [STM32L562E-DK].
 
-This library supports creating a Bluetooth® Low Energy peripheral & central mode.
+ - 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:
 
-For the Arduino MKR WiFi 1010, Arduino UNO WiFi Rev2, and Arduino Nano 33 IoT boards, it requires the NINA module to be running [Arduino NINA-W102 firmware](https://github.com/arduino/nina-fw) v1.2.0 or later.
+https://github.com/STMicroelectronics/STM32CubeWB/tree/master/Projects/STM32WB_Copro_Wireless_Binaries
 
-For the Arduino UNO R4 WiFi, it requires the ESP32-S3 module to be running [firmware](https://github.com/arduino/uno-r4-wifi-usb-bridge) v0.2.0 or later.
+  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:
 
-For more information about this library please visit us at:
+https://github.com/stm32duino/Arduino_Core_STM32/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:
+
+https://github.com/stm32duino/Arduino_Core_STM32/wiki/STM32duinoBLE#stm32duinoble-with-x-nucleo-bnrg2a1
+
+For more information about ArduinoBLE library please visit the official web page at:
 https://www.arduino.cc/en/Reference/ArduinoBLE
 
+# Configuration
+
+### STM32WB
+
+STM32Cube_WPAN has several configuration options, which are set in the `app_conf.h`.
+This package has a default configuration named `app_conf_default.h`.
+The user can include the file `app_conf_custom.h` to customize the BLE application.
+Options wrapped in `#ifndef`, `#endif` in `app_conf_default.h` can be overwritten.
+Additional options can be added.
+
+The user can refer to [AN5270](https://www.st.com/resource/en/application_note/an5270-introduction-to-stm32wb-bluetooth-low-energy-wireless-interface-stmicroelectronics.pdf)
+
+##### Examples
+
+The user can change the Tx Power by redefining `CFG_TX_POWER` using the [`build_opt.h`](https://github.com/stm32duino/Arduino_Core_STM32/wiki/Customize-build-options-using-build_opt.h) file. Possible values are listed in the chapter 
+**4.2 Tx power level**, default value is `0x18`(`-0.15dBm`). To set it at `+1dBm`, `CFG_TX_POWER` have to be defined at `0x1A`:
+
+```
+-DCFG_TX_POWER=0x1A
+```
+
+### Shield
+
+The user can include the file `ble_spi_conf.h` to define which shield and configuration to use from the following list:
+
+ * [X-NUCLEO-IDB05A2]
+    * `IDB05A2_SPI_CLOCK_D3`: SPI clock on D3
+    * `IDB05A2_SPI_CLOCK_D13` SPI clock on D13
+ * [X-NUCLEO-IDB05A1]
+    * `IDB05A1_SPI_CLOCK_D3`: SPI clock on D3
+    * `IDB05A1_SPI_CLOCK_D13`: SPI clock on D13
+ * [X-NUCLEO-BNRG2A1]
+    * `BNRG2A1_SPI_CLOCK_D3`: SPI clock on D3
+    * `BNRG2A1_SPI_CLOCK_D13`: SPI clock on D13
+ * `CUSTOM_BLE_SPI`: define a custom configuration, it requires below definition:
+    * `BLE_SPI_MISO`: SPI MISO pin
+    * `BLE_SPI_MOSI`: SPI MOSI pin
+    * `BLE_SPI_CLK`: SPI CLocK pin
+    * `BLE_SPI_CS`: SPI Chip Select pin
+    * `BLE_SPI_IRQ`: SPI IRQ pin
+    * `BLE_SPI_FREQ`: SPI bus frequency
+    * `BLE_SPI_MODE`: can be one of the below `SPIMode`:
+      * `SPI_MODE0`
+      * `SPI_MODE1`
+      * `SPI_MODE2`
+      * `SPI_MODE0`
+    * `BLE_CHIP_TYPE`: can be one of the below `BLEChip_t`:
+      * `SPBTLE_RF`
+      * `SPBTLE_1S`
+      * `BLUENRG_M2SP`
+      * `BLUENRG_M0`
+      * `BLUENRG_LP`
+    * `BLE_RESET`: BLE reset pin
+
+#### Examples
+
+To use the [X-NUCLEO-IDB05A2] with SPI clock on D3, define in `ble_spi_conf.h`:
+```C
+#define IDB05A2_SPI_CLOCK_D3
+```
+This is equivalent to the below configuration using the `CUSTOM_BLE_SPI`:
+```C
+#define CUSTOM_BLE_SPI
+#define BLE_SPI_MISO    D12
+#define BLE_SPI_MOSI    D11
+#define BLE_SPI_CLK     D3
+#define BLE_SPI_CS      A1
+#define BLE_SPI_IRQ     A0
+#define BLE_SPI_FREQ    8000000
+#define BLE_SPI_MODE    SPI_MODE0
+#define BLE_CHIP_TYPE   BLUENRG_M0
+#define BLE_RESET       D7
+```
+
+#### Using a SPI BLE module on STM32WB
+
+If required, user can use a compatible BLE module over SPI.
+
+In the `ble_spi_conf.h`, define `USE_BLE_SPI`.
+
 ## License
 
 ```
+Copyright (c) 2019 STMicroelectronics. All rights reserved.
 Copyright (c) 2019 Arduino SA. All rights reserved.
 
 This library is free software; you can redistribute it and/or
@@ -33,3 +121,19 @@ You should have received a copy of the GNU Lesser General Public
 License along with this library; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 ```
+
+
+[B-L475E-IOT01A]: https://www.st.com/en/evaluation-tools/b-l475e-iot01a.html
+[B-L4S5I-IOT01A]: https://www.st.com/en/evaluation-tools/b-l4s5i-iot01a.html
+[NUCLEO-F401RE]: https://www.st.com/en/evaluation-tools/nucleo-f401re.html
+[NUCLEO-L053R8]: https://www.st.com/en/evaluation-tools/nucleo-l053r8.html
+[NUCLEO-L476RG]: https://www.st.com/en/evaluation-tools/nucleo-l476rg.html
+[NUCLEO-WB15CC]: https://www.st.com/en/evaluation-tools/nucleo-wb15cc.html
+[P-NUCLEO-WB55RG]: https://www.st.com/en/evaluation-tools/p-nucleo-wb55.html
+[STEVAL-MKSBOX1V1]: https://www.st.com/en/evaluation-tools/steval-mksbox1v1.html
+[STEVAL-MKBOXPRO]: https://www.st.com/en/evaluation-tools/steval-mkboxpro.html
+[STM32L562E-DK]: https://www.st.com/en/evaluation-tools/stm32l562e-dk.html
+[STM32WB5MM-DK]: https://www.st.com/en/evaluation-tools/stm32wb5mm-dk.html
+[X-NUCLEO-BNRG2A1]: https://www.st.com/en/ecosystems/x-nucleo-bnrg2a1.html
+[X-NUCLEO-IDB05A2]: https://www.st.com/en/ecosystems/x-nucleo-idb05a2.html
+[X-NUCLEO-IDB05A1]: https://www.st.com/en/ecosystems/x-nucleo-idb05a1.html
diff --git a/docs/api.md b/docs/api.md
deleted file mode 100644
index d80d0cdc..00000000
--- a/docs/api.md
+++ /dev/null
@@ -1,3820 +0,0 @@
-# ArduinoBLE library
-
-## BLE class
-
-Used to enable the Bluetooth® Low Energy module.
-
-### `BLE.begin()`
-
-Initializes the Bluetooth® Low Energy device.
-
-#### Syntax
-
-```
-BLE.begin()
-
-```
-
-#### Parameters
-
-None
-
-#### Returns
-- 1 on success
-- 0 on failure
-
-#### Example
-
-```arduino
-
-  // begin initialization
-  if (!BLE.begin()) {
-    Serial.println("starting Bluetooth® Low Energy module failed!");
-
-    while (1);
-  }
-
-
-```
-
-### `BLE.end()`
-
-Stops the Bluetooth® Low Energy device.
-
-#### Syntax
-
-```
-BLE.end()
-
-```
-
-#### Parameters
-
-None
-
-#### Returns
-Nothing
-
-#### Example
-
-```arduino
-
-  // begin initialization
-  if (!BLE.begin()) {
-    Serial.println("starting Bluetooth® Low Energy module failed!");
-
-    while (1);
-  }
-
-  // ....
-
-  BLE.end();
-
-
-```
-
-### `BLE.poll()`
-
-Poll for Bluetooth® Low Energy radio events and handle them.
-
-#### Syntax
-
-```
-BLE.poll()
-BLE.poll(timeout)
-
-```
-
-#### Parameters
-
-**timeout**: optional timeout in ms, to wait for event. If not specified defaults to 0 ms.
-
-#### Returns
-Nothing
-
-#### Example
-
-```arduino
-
-  // assign event handlers for connected, disconnected to peripheral
-  BLE.setEventHandler(BLEConnected, blePeripheralConnectHandler);
-  BLE.setEventHandler(BLEDisconnected, blePeripheralDisconnectHandler);
-
-
-  BLE.poll();
-
-
-```
-
-### `BLE.setEventHandler()`
-
-Set the event handler (callback) function that will be called when the specified event occurs.
-
-#### Syntax
-
-```
-BLE.setEventHandler(eventType, callback)
-
-```
-
-#### Parameters
-
-- **eventType**: event type (BLEConnected, BLEDisconnected)
-- **callback**: function to call when event occurs
-#### Returns
-Nothing.
-
-#### Example
-
-```arduino
-
-  // begin initialization
-  if (!BLE.begin()) {
-    Serial.println("starting Bluetooth® Low Energy module failed!");
-
-    while (1);
-  }
-
-  // ...
-
-  // assign event handlers for connected, disconnected to peripheral
-  BLE.setEventHandler(BLEConnected, blePeripheralConnectHandler);
-  BLE.setEventHandler(BLEDisconnected, blePeripheralDisconnectHandler);
-
-
-
-void blePeripheralConnectHandler(BLEDevice central) {
-  // central connected event handler
-  Serial.print("Connected event, central: ");
-  Serial.println(central.address());
-}
-
-void blePeripheralDisconnectHandler(BLEDevice central) {
-  // central disconnected event handler
-  Serial.print("Disconnected event, central: ");
-  Serial.println(central.address());
-}
-
-
-```
-
-### `BLE.connected()`
-
-Query if another Bluetooth® Low Energy device is connected
-
-#### Syntax
-
-```
-BLE.connected()
-
-```
-
-#### Parameters
-
-None
-
-#### Returns
-- **true** if another Bluetooth® Low Energy device is connected,
-- otherwise **false**.
-
-#### Example
-
-```arduino
-
-    // while the central is still connected to peripheral:
-    while (BLE.connected()) {
-
-       // ...
-    }
-
-
-```
-
-### `BLE.disconnect()`
-
-Disconnect any Bluetooth® Low Energy devices that are connected
-
-#### Syntax
-
-```
-BLE.disconnect()
-
-```
-
-#### Parameters
-
-None
-
-#### Returns
-- **true** if any Bluetooth® Low Energy device that was previously connected was disconnected,
-- otherwise **false**.
-
-#### Example
-
-```arduino
-
-  if (BLE.connected()) {
-    BLE.disconnect();
-  }
-
-
-```
-
-### `BLE.address()`
-
-Query the Bluetooth® address of the Bluetooth® Low Energy device.
-
-#### Syntax
-
-```
-BLE.address()
-
-```
-
-#### Parameters
-
-None
-
-#### Returns
-- The **Bluetooth® address** of the Bluetooth® Low Energy device (as a String).
-
-#### Example
-
-```arduino
-
-  String address = BLE.address();
-
-  Serial.print("Local address is: ");
-  Serial.println(address);
-
-
-```
-
-### `BLE.rssi()`
-
-Query the RSSI (Received signal strength indication) of the connected Bluetooth® Low Energy device.
-
-#### Syntax
-
-```
-BLE.rssi()
-
-```
-
-#### Parameters
-
-None
-
-#### Returns
-- The **RSSI** of the connected Bluetooth® Low Energy device, 127 if no Bluetooth® Low Energy device is connected.
-
-#### Example
-
-```arduino
-
-  if (BLE.connected()) {
-    Serial.print("RSSI = ");
-    Serial.println(BLE.rssi());
-  }
-
-
-```
-
-### `BLE.setAdvertisedServiceUuid()`
-
-Set the advertised service UUID used when advertising.
-
-#### Syntax
-
-```
-BLE.setAdvertisedServiceUuid(uuid)
-
-```
-
-#### Parameters
-
-- **uuid:** 16-bit or 128-bit Bluetooth® Low Energy UUID in **String** format
-
-#### Returns
-Nothing
-
-#### Example
-
-```arduino
-
-  // begin initialization
-  if (!BLE.begin()) {
-    Serial.println("starting Bluetooth® Low Energy module failed!");
-
-    while (1);
-  }
-
-  BLE.setAdvertisedServiceUuid("19B10000-E8F2-537E-4F6C-D104768A1214");
-
-  // ...
-
-  // start advertising
-  BLE.advertise();
-
-
-```
-
-### `BLE.setAdvertisedService()`
-
-Set the advertised service UUID used when advertising to the value of the BLEService provided.
-
-#### Syntax
-
-```
-BLE.setAdvertisedService(bleService)
-
-```
-
-#### Parameters
-
-- **bleService:** BLEService to use UUID from
-
-#### Returns
-Nothing
-
-#### Example
-
-```arduino
-
-BLEService ledService("19B10000-E8F2-537E-4F6C-D104768A1214"); // Bluetooth® Low Energy LED Service
-
-// ...
-
-  // begin initialization
-  if (!BLE.begin()) {
-    Serial.println("starting Bluetooth® Low Energy module failed!");
-
-    while (1);
-  }
-
-  BLE.setAdvertisedService(ledService);
-
-  // ...
-
-  // start advertising
-  BLE.advertise();
-
-
-```
-
-### `BLE.setManufacturerData()`
-
-Set the manufacturer data value used when advertising.
-
-#### Syntax
-
-```
-BLE.setManufacturerData(data, length)
-
-```
-
-#### Parameters
-
-- **data:** byte array containing manufacturer data
-- **length:** length of manufacturer data array
-
-#### Returns
-Nothing
-
-#### Example
-
-```arduino
-
- // begin initialization
-  if (!BLE.begin()) {
-    Serial.println("starting Bluetooth® Low Energy module failed!");
-
-    while (1);
-  }
-
-  byte data[5] = { 0x01, 0x02, 0x03, 0x04, 0x05};
-
-  BLE.setManufacturerData(data, 5);
-
-  // ...
-
-  // start advertising
-  BLE.advertise();
-
-
-
-```
-
-### `BLE.setLocalName()`
-
-Set the local value used when advertising.
-
-#### Syntax
-
-```
-BLE.setLocalName(name)
-
-```
-
-#### Parameters
-
-- **name:** local name value to use when advertising
-
-#### Returns
-Nothing
-
-#### Example
-
-```arduino
-
- // begin initialization
-  if (!BLE.begin()) {
-    Serial.println("starting Bluetooth® Low Energy module failed!");
-
-    while (1);
-  }
-
-  BLE.setLocalName("LED");
-
-  // ...
-
-  // start advertising
-  BLE.advertise();
-
-
-
-```
-
-### `BLE.setDeviceName()`
-
-Set the device name in the built in device name characteristic. If not set, the value defaults to “Arduino”.
-
-#### Syntax
-
-```
-BLE.setDeviceName(name)
-
-```
-
-#### Parameters
-
-- **name:** device name value
-
-#### Returns
-Nothing
-
-#### Example
-
-```arduino
-
- // begin initialization
-  if (!BLE.begin()) {
-    Serial.println("starting Bluetooth® Low Energy module failed!");
-
-    while (1);
-  }
-
-  BLE.setDeviceName("LED");
-
-  // ...
-
-  // start advertising
-  BLE.advertise();
-
-
-
-```
-
-### `BLE.setAppearance()`
-
-Set the appearance in the built in appearance characteristic. If not set, the value defaults to 0x0000.
-
-#### Syntax
-
-```
-BLE.setAppearance(appearance)
-
-```
-
-#### Parameters
-
-- **appearance:** appearance value
-
-#### Returns
-Nothing
-
-#### Example
-
-```arduino
-
- // begin initialization
-  if (!BLE.begin()) {
-    Serial.println("starting Bluetooth® Low Energy module failed!");
-
-    while (1);
-  }
-
-  BLE.setAppearance(0x8000);
-
-  // ...
-
-  // start advertising
-  BLE.advertise();
-
-
-
-```
-
-### `BLE.addService()`
-
-Add a BLEService to the set of services the Bluetooth® Low Energy device provides
-
-#### Syntax
-
-```
-BLE.addService(service)
-
-```
-
-#### Parameters
-
-- **service:** BLEService to add
-
-#### Returns
-Nothing
-
-#### Example
-
-```arduino
-
-BLEService ledService("19B10000-E8F2-537E-4F6C-D104768A1214"); // Bluetooth® Low Energy LED Service
-
-
-
- // begin initialization
-  if (!BLE.begin()) {
-    Serial.println("starting Bluetooth® Low Energy module failed!");
-
-    while (1);
-  }
-
-  // ...
-
-  BLE.addService(ledService);
-
-  // ...
-
-
-```
-
-### `BLE.advertise()`
-
-Start advertising.
-
-#### Syntax
-
-```
-BLE.advertise()
-
-```
-
-#### Parameters
-
-None
-
-#### Returns
-- 1 on success,
-- 0 on failure.
-
-#### Example
-
-```arduino
-
-  // begin initialization
-  if (!BLE.begin()) {
-    Serial.println("starting Bluetooth® Low Energy module failed!");
-
-    while (1);
-  }
-
-  // ...
-
-  BLE.advertise();
-
-  // ...
-
-
-```
-
-### `BLE.stopAdvertise()`
-
-Stop advertising.
-
-#### Syntax
-
-```
-BLE.stopAdvertise()
-
-```
-
-#### Parameters
-
-None
-
-#### Returns
-Nothing
-
-#### Example
-
-```arduino
-
-  // begin initialization
-  if (!BLE.begin()) {
-    Serial.println("starting Bluetooth® Low Energy module failed!");
-
-    while (1);
-  }
-
-  // ...
-
-  BLE.advertise();
-
-  // ...
-
-  BLE.stopAdvertise();
-
-
-```
-
-### `BLE.central()`
-
-Query the central Bluetooth® Low Energy device connected.
-
-#### Syntax
-
-```
-BLE.central()
-
-```
-
-#### Parameters
-
-None
-
-#### Returns
-- **BLEDevice** representing the central.
-
-#### Example
-
-```arduino
-
-  // listen for Bluetooth® Low Energy peripherals to connect:
-  BLEDevice central = BLE.central();
-
-  // if a central is connected to peripheral:
-  if (central) {
-    Serial.print("Connected to central: ");
-    // print the central's MAC address:
-    Serial.println(central.address());
-  }
-
-
-```
-
-### `BLE.setAdvertisingInterval()`
-
-Set the advertising interval in units of 0.625 ms. Defaults to 100ms (160 * 0.625 ms) if not provided.
-
-#### Syntax
-
-```
-BLE.setAdvertisingInterval(advertisingInterval)
-
-```
-
-#### Parameters
-
-- **advertisingInterval:** advertising interval in units of 0.625 ms
-
-#### Returns
-Nothing.
-
-#### Example
-
-```arduino
-
-  // begin initialization
-  if (!BLE.begin()) {
-    Serial.println("starting Bluetooth® Low Energy module failed!");
-
-    while (1);
-  }
-
-  // ...
-
-  BLE.setAdvertisingInterval(320); // 200 * 0.625 ms
-
-  BLE.advertise();
-
-
-```
-
-### `BLE.setConnectionInterval()`
-
-Set the minimum and maximum desired connection intervals in units of 1.25 ms.
-
-#### Syntax
-
-```
-BLE.setConnectionInterval(minimum, maximum)
-
-```
-
-#### Parameters
-
-- **minimum:** minimum desired connection interval in units of 1.25 ms
-- **maximum:** maximum desired connection interval in units of 1.25 ms
-
-#### Returns
-Nothing.
-
-#### Example
-
-```arduino
-
-  // begin initialization
-  if (!BLE.begin()) {
-    Serial.println("starting Bluetooth® Low Energy module failed!");
-
-    while (1);
-  }
-
-  // ...
-
-  BLE.setConnectionInterval(0x0006, 0x0c80); // 7.5 ms minimum, 4 s maximum
-
-
-
-```
-
-### `BLE.setConnectable()`
-
-Set if the device is connectable after advertising, defaults to **true**.
-
-#### Syntax
-
-```
-BLE.setConnectable(connectable)
-
-```
-
-#### Parameters
-
-- **true**: the device will be connectable when advertising
-- **false**: the device will NOT be connectable when advertising
-
-#### Returns
-Nothing.
-
-#### Example
-
-```arduino
-
-  // begin initialization
-  if (!BLE.begin()) {
-    Serial.println("starting Bluetooth® Low Energy module failed!");
-
-    while (1);
-  }
-
-  // ...
-
-  BLE.setConnectable(false); // make the device unconnectable when advertising
-
-
-
-```
-
-### `BLE.scan()`
-
-Start scanning for Bluetooth® Low Energy devices that are advertising.
-
-#### Syntax
-
-```
-BLE.scan()
-BLE.scan(withDuplicates)
-
-```
-
-#### Parameters
-
-- **withDuplicates:** optional, defaults to **false**. If **true**, advertisements received more than once will not be filtered
-
-#### Returns
-- 1 on success,
-- 0 on failure.
-
-#### Example
-
-```arduino
-
-  // begin initialization
-  if (!BLE.begin()) {
-    Serial.println("starting Bluetooth® Low Energy module failed!");
-
-    while (1);
-  }
-
-  Serial.println("BLE Central scan");
-
-  // start scanning for peripheral
-  BLE.scan();
-
-
-  BLEDevice peripheral = BLE.available();
-
-  if (peripheral) {
-     // ...
-  }
-
-
-```
-
-### `BLE.scanForName()`
-
-Start scanning for Bluetooth® Low Energy devices that are advertising with a particular (local) name.
-
-#### Syntax
-
-```
-BLE.scanForName(name)
-BLE.scanForName(name, withDuplicates)
-
-```
-
-#### Parameters
-
--  **name:** (local) name of device (as a **String**) to filter for
-- **withDuplicates:** optional, defaults to **false**. If **true**, advertisements received more than once will not be filtered.
-
-#### Returns
-- 1 on success,
-- 0 on failure.
-
-#### Example
-
-```arduino
-
-  // begin initialization
-  if (!BLE.begin()) {
-    Serial.println("starting Bluetooth® Low Energy module failed!");
-
-    while (1);
-  }
-
-  Serial.println("BLE Central scan");
-
-  // start scanning for peripheral
-  BLE.scanForName("LED");
-
-
-  BLEDevice peripheral = BLE.available();
-
-  if (peripheral) {
-     // ...
-  }
-
-
-```
-
-### `BLE.scanForAddress()`
-
-Start scanning for Bluetooth® Low Energy devices that are advertising with a particular (Bluetooth®) address.
-
-#### Syntax
-
-```
-BLE.scanForAddress(address)
-BLE.scanForAddress(address, withDuplicates)
-
-```
-
-#### Parameters
-
-- **address:** (Bluetooth®) address (as a String) to filter for
-- **withDuplicates:** optional, defaults to **false**. If **true**, advertisements received more than once will not be filtered
-
-#### Returns
-- 1 on success,
-- 0 on failure.
-
-#### Example
-
-```arduino
-
-  // begin initialization
-  if (!BLE.begin()) {
-    Serial.println("starting Bluetooth® Low Energy module failed!");
-
-    while (1);
-  }
-
-  Serial.println("BLE Central scan");
-
-  // start scanning for peripheral
-  BLE.scanForAddress("aa:bb:cc:ee:dd:ff");
-
-
-  BLEDevice peripheral = BLE.available();
-
-  if (peripheral) {
-     // ...
-  }
-
-
-```
-
-### `BLE.scanForUuid()`
-
-Start scanning for Bluetooth® Low Energy devices that are advertising with a particular (service) UUID.
-
-#### Syntax
-
-```
-BLE.scanForUuid(uuid)
-BLE.scanForUuid(uuid, withDuplicates)
-
-```
-
-#### Parameters
-
-- **uuid:** (service) UUID (as a **String**) to filter for
-- **withDuplicates:** optional, defaults to **false**. If **true**, advertisements received more than once will not be filtered.
-
-#### Returns
-- 1 on success,
-- 0 on failure.
-
-#### Example
-
-```arduino
-
-  // begin initialization
-  if (!BLE.begin()) {
-    Serial.println("starting Bluetooth® Low Energy module failed!");
-
-    while (1);
-  }
-
-  Serial.println("BLE Central scan");
-
-  // start scanning for peripheral
-  BLE.scanForUuid("aa10");
-
-
-  BLEDevice peripheral = BLE.available();
-
-  if (peripheral) {
-     // ...
-  }
-
-
-```
-
-### `BLE.stopScan()`
-
-Stop scanning for Bluetooth® Low Energy devices that are advertising.
-
-#### Syntax
-
-```
-BLE.stopScan()
-
-```
-
-#### Parameters
-
-None
-
-#### Returns
-Nothing
-
-#### Example
-
-```arduino
-
-  // begin initialization
-  if (!BLE.begin()) {
-    Serial.println("starting Bluetooth® Low Energy module failed!");
-
-    while (1);
-  }
-
-  Serial.println("BLE Central scan");
-
-  // start scanning for peripheral
-  BLE.scan();
-
-  BLE.stopScan();
-
-
-```
-
-### `BLE.available()`
-
-Query for a discovered Bluetooth® Low Energy device that was found during scanning.
-
-#### Syntax
-
-```
-BLE.available()
-
-```
-
-#### Parameters
-
-Nothing
-
-#### Returns
-- **BLEDevice** representing the discovered device.
-
-#### Example
-
-```arduino
-
-  // begin initialization
-  if (!BLE.begin()) {
-    Serial.println("starting Bluetooth® Low Energy module failed!");
-
-    while (1);
-  }
-
-  Serial.println("BLE Central scan");
-
-  // start scanning for peripheral
-  BLE.scan();
-
-
-  BLEDevice peripheral = BLE.available();
-
-  if (peripheral) {
-     // ...
-  }
-
-
-```
-
-## BLEDevice Class
-
-Used to get information about the devices connected or discovered while scanning
-
-### `bleDevice.poll()`
-
-Poll for Bluetooth® Low Energy radio events for the specified Bluetooth® Low Energy device and handle them.
-
-#### Syntax
-
-```
-bleDevice.poll()
-bleDevice.poll(timeout)
-
-```
-
-#### Parameters
-
-- **timeout**: optional timeout in ms, to wait for event. If not specified defaults to 0 ms.
-
-#### Returns
-Nothing
-
-#### Example
-
-```arduino
-
-  // listen for Bluetooth® Low Energy centrals to connect:
-  BLEDevice central = BLE.central();
-
-  // if a central is connected to peripheral:
-  if (central) {
-   central.poll();
-
-    // ...
-  }
-
-
-```
-
-### `bleDevice.connected()`
-
-Query if a Bluetooth® Low Energy device is connected
-
-#### Syntax
-
-```
-bleDevice.connected()
-
-```
-
-#### Parameters
-
-None
-
-#### Returns
-- **true** if the Bluetooth® Low Energy device is connected,
-- otherwise **false**.
-
-#### Example
-
-```arduino
-
-  // listen for Bluetooth® Low Energy centrals to connect:
-  BLEDevice central = BLE.central();
-
-    // while the central is still connected
-    while (central.connected()) {
-
-       // ...
-    }
-
-
-```
-
-### `bleDevice.disconnect()`
-
-Disconnect the Bluetooth® Low Energy device, if connected
-
-#### Syntax
-
-```
-bleDevice.disconnect()
-
-```
-
-#### Parameters
-
-None
-
-#### Returns
-- **true** if the Bluetooth® Low Energy device was disconnected,
-- otherwise **false**.
-
-#### Example
-
-```arduino
-
- // listen for Bluetooth® Low Energy centrals to connect:
-  BLEDevice central = BLE.central();
-
-
-  central.disconnect();
-
-
-```
-
-### `bleDevice.address()`
-
-Query the Bluetooth® address of the Bluetooth® Low Energy device.
-
-#### Syntax
-
-```
-bleDevice.address()
-
-```
-
-#### Parameters
-
-None
-
-#### Returns
-- **Bluetooth® address** of the Bluetooth® Low Energy device (as a String).
-
-#### Example
-
-```arduino
-
-  // listen for Bluetooth® Low Energy peripherals to connect:
-  BLEDevice central = BLE.central();
-
-  // if a central is connected to peripheral:
-  if (central) {
-    Serial.print("Connected to central: ");
-    // print the central's MAC address:
-    Serial.println(central.address());
-  }
-
-
-```
-
-### `bleDevice.rssi()`
-
-Query the RSSI (Received signal strength indication) of the Bluetooth® Low Energy device.
-
-#### Syntax
-
-```
-bleDevice.rssi()
-
-```
-
-#### Parameters
-
-None
-
-#### Returns
-- **RSSI** of the connected Bluetooth® Low Energy device, 127 if the Bluetooth® Low Energy device is not connected.
-
-#### Example
-
-```arduino
-
-  if (bleDevice.connected()) {
-    Serial.print("RSSI = ");
-    Serial.println(bleDevice.rssi());
-  }
-
-
-```
-
-### `bleDevice.characteristic()`
-
-Get a BLECharacteristic representing a Bluetooth® Low Energy characteristic the device provides.
-
-#### Syntax
-
-```
-bleDevice.characteristic(index)
-bleDevice.characteristic(uuid)
-bleDevice.characteristic(uuid, index)
-
-```
-
-#### Parameters
-
-- **index**: index of characteristic
-- **uuid**: uuid (as a **String**)
-
-#### Returns
-- **BLECharacteristic** for provided parameters
-
-#### Example
-
-```arduino
-
-  // begin initialization
-  if (!BLE.begin()) {
-    Serial.println("starting Bluetooth® Low Energy module failed!");
-
-    while (1);
-  }
-
-  Serial.println("BLE Central scan");
-
-  // start scanning for peripheral
-  BLE.scan();
-
-
-  BLEDevice peripheral = BLE.available();
-
-  if (peripheral) {
-    // ...
-
-    Serial.println("Connecting ...");
-
-    if (peripheral.connect()) {
-      Serial.println("Connected");
-    } else {
-      Serial.println("Failed to connect!");
-      return;
-    }
-
-    // discover peripheral attributes
-    Serial.println("Discovering attributes ...");
-    if (peripheral.discoverAttributes()) {
-      Serial.println("Attributes discovered");
-    } else {
-      Serial.println("Attribute discovery failed!");
-      peripheral.disconnect();
-      return;
-    }
-
-    BLECharacteristic batteryLevelCharacteristic = peripheral.characteristic("2a19");
-
-    if (batteryLevelCharacteristic) {
-      // use the characteristic
-    } else {
-      Serial.println("Peripheral does NOT have battery level characteristic");
-    }
-
-    // ...
-  }
-
-
-```
-
-### `bleDevice.discoverAttributes()`
-
-Discover all of the attributes of Bluetooth® Low Energy device.
-
-#### Syntax
-
-```
-bleDevice.discoverAttributes()
-
-```
-
-#### Parameters
-
-None
-
-#### Returns
-- **true**, if successful,
-- **false** on failure.
-
-#### Example
-
-```arduino
-
-  // begin initialization
-  if (!BLE.begin()) {
-    Serial.println("starting Bluetooth® Low Energy module failed!");
-
-    while (1);
-  }
-
-  Serial.println("BLE Central scan");
-
-  // start scanning for peripheral
-  BLE.scan();
-
-
-  BLEDevice peripheral = BLE.available();
-
-  if (peripheral) {
-    // ...
-
-    Serial.println("Connecting ...");
-
-    if (peripheral.connect()) {
-      Serial.println("Connected");
-    } else {
-      Serial.println("Failed to connect!");
-      return;
-    }
-
-    // discover peripheral attributes
-    Serial.println("Discovering attributes ...");
-    if (peripheral.discoverAttributes()) {
-      Serial.println("Attributes discovered");
-    } else {
-      Serial.println("Attribute discovery failed!");
-      peripheral.disconnect();
-      return;
-    }
-
-    // ...
-  }
-
-
-```
-
-### `bleDevice.discoverService()`
-
-Discover the attributes of a particular service on the Bluetooth® Low Energy device.
-
-#### Syntax
-
-```
-bleDevice.discoverService(serviceUuid)
-
-```
-
-#### Parameters
-
-- **serviceUuid:** service UUID to discover (as a **String**)
-
-#### Returns
-- **true**, if successful,
-- **false** on failure.
-
-#### Example
-
-```arduino
-
-  // begin initialization
-  if (!BLE.begin()) {
-    Serial.println("starting Bluetooth® Low Energy module failed!");
-
-    while (1);
-  }
-
-  Serial.println("BLE Central scan");
-
-  // start scanning for peripheral
-  BLE.scan();
-
-
-  BLEDevice peripheral = BLE.available();
-
-  if (peripheral) {
-    // ...
-
-    Serial.println("Connecting ...");
-
-    if (peripheral.connect()) {
-      Serial.println("Connected");
-    } else {
-      Serial.println("Failed to connect!");
-      return;
-    }
-
-    // discover service attributes
-    Serial.println("Discovering service attributes ...");
-    if (peripheral.serviceUuid("fffe")) {
-      Serial.println("Service attributes discovered");
-    } else {
-      Serial.println("Service attribute discovery failed!");
-      peripheral.disconnect();
-      return;
-    }
-
-    // ...
-  }
-
-
-```
-
-### `bleDevice.deviceName()`
-
-Query the device name (BLE characteristic UUID 0x2a00) of a Bluetooth® Low Energy device.
-
-#### Syntax
-
-```
-bleDevice.deviceName()
-
-```
-
-#### Parameters
-
-None
-
-#### Returns
-- **Device name** (as a String).
-
-#### Example
-
-```arduino
-
-  // begin initialization
-  if (!BLE.begin()) {
-    Serial.println("starting Bluetooth® Low Energy module failed!");
-
-    while (1);
-  }
-
-  Serial.println("BLE Central scan");
-
-  // start scanning for peripheral
-  BLE.scan();
-
-
-  BLEDevice peripheral = BLE.available();
-
-  if (peripheral) {
-    // ...
-
-    Serial.println("Connecting ...");
-
-    if (peripheral.connect()) {
-      Serial.println("Connected");
-    } else {
-      Serial.println("Failed to connect!");
-      return;
-    }
-
-    // discover peripheral attributes
-    Serial.println("Discovering attributes ...");
-    if (peripheral.discoverAttributes()) {
-      Serial.println("Attributes discovered");
-    } else {
-      Serial.println("Attribute discovery failed!");
-      peripheral.disconnect();
-      return;
-    }
-
-    // read and print device name of peripheral
-    Serial.println();
-    Serial.print("Device name: ");
-    Serial.println(peripheral.deviceName());
-    Serial.print("Appearance: 0x");
-    Serial.println(peripheral.appearance(), HEX);
-    Serial.println();
-
-    // ...
-  }
-
-
-```
-
-### `bleDevice.appearance()`
-
-Query the appearance (BLE characteristic UUID 0x2a01) of a Bluetooth® Low Energy device.
-
-#### Syntax
-
-```
-bleDevice.appearance()
-
-```
-
-#### Parameters
-
-None
-
-#### Returns
-- **Appearance value** (as a number).
-
-#### Example
-
-```arduino
-
-  // begin initialization
-  if (!BLE.begin()) {
-    Serial.println("starting Bluetooth® Low Energy module failed!");
-
-    while (1);
-  }
-
-  Serial.println("BLE Central scan");
-
-  // start scanning for peripheral
-  BLE.scan();
-
-
-  BLEDevice peripheral = BLE.available();
-
-  if (peripheral) {
-    // ...
-
-    Serial.println("Connecting ...");
-
-    if (peripheral.connect()) {
-      Serial.println("Connected");
-    } else {
-      Serial.println("Failed to connect!");
-      return;
-    }
-
-    // discover peripheral attributes
-    Serial.println("Discovering attributes ...");
-    if (peripheral.discoverAttributes()) {
-      Serial.println("Attributes discovered");
-    } else {
-      Serial.println("Attribute discovery failed!");
-      peripheral.disconnect();
-      return;
-    }
-
-    // read and print device name of peripheral
-    Serial.println();
-    Serial.print("Device name: ");
-    Serial.println(peripheral.deviceName());
-    Serial.print("Appearance: 0x");
-    Serial.println(peripheral.appearance(), HEX);
-    Serial.println();
-
-    // ...
-  }
-
-
-```
-
-### `bleDevice.serviceCount()`
-
-Query the number of services discovered for the Bluetooth® Low Energy device.
-
-#### Syntax
-
-```
-bleDevice.serviceCount()
-
-```
-
-#### Parameters
-
-None
-
-#### Returns
-- The number of **services discovered** for the Bluetooth® Low Energy device.
-
-#### Example
-
-```arduino
-
-  // begin initialization
-  if (!BLE.begin()) {
-    Serial.println("starting Bluetooth® Low Energy module failed!");
-
-    while (1);
-  }
-
-  Serial.println("BLE Central scan");
-
-  // start scanning for peripheral
-  BLE.scan();
-
-
-  BLEDevice peripheral = BLE.available();
-
-  if (peripheral) {
-    // ...
-
-    Serial.println("Connecting ...");
-
-    if (peripheral.connect()) {
-      Serial.println("Connected");
-    } else {
-      Serial.println("Failed to connect!");
-      return;
-    }
-
-    // discover peripheral attributes
-    Serial.println("Discovering attributes ...");
-    if (peripheral.discoverAttributes()) {
-      Serial.println("Attributes discovered");
-    } else {
-      Serial.println("Attribute discovery failed!");
-      peripheral.disconnect();
-      return;
-    }
-
-    int serviceCount = peripheral.serviceCount();
-
-    Serial.print(serviceCount);
-    Serial.println(" services discovered");
-
-    // ...
-  }
-
-
-```
-
-### `bleDevice.hasService()`
-
-Query if the Bluetooth® Low Energy device has a particular service.
-
-#### Syntax
-
-```
-bleDevice.hasService(uuid)
-bleDevice.hasService(uuid, index)
-
-```
-
-#### Parameters
-
-- **uuid**: uuid to check (as a **String**)
-- **index**: optional, index of service to check if the device provides more than on. Defaults to 0, if not provided.
-
-#### Returns
-- **true**, if the device provides the service,
-- **false** otherwise.
-
-#### Example
-
-```arduino
-
-  // begin initialization
-  if (!BLE.begin()) {
-    Serial.println("starting Bluetooth® Low Energy module failed!");
-
-    while (1);
-  }
-
-  Serial.println("BLE Central scan");
-
-  // start scanning for peripheral
-  BLE.scan();
-
-
-  BLEDevice peripheral = BLE.available();
-
-  if (peripheral) {
-    // ...
-
-    Serial.println("Connecting ...");
-
-    if (peripheral.connect()) {
-      Serial.println("Connected");
-    } else {
-      Serial.println("Failed to connect!");
-      return;
-    }
-
-    // discover peripheral attributes
-    Serial.println("Discovering attributes ...");
-    if (peripheral.discoverAttributes()) {
-      Serial.println("Attributes discovered");
-    } else {
-      Serial.println("Attribute discovery failed!");
-      peripheral.disconnect();
-      return;
-    }
-
-    if (peripheral.hasService("180f")) {
-      Serial.println("Peripheral has battery service");
-    }
-
-    // ...
-  }
-
-
-```
-
-### `bleDevice.service()`
-
-Get a BLEService representing a Bluetooth® Low Energy service the device provides.
-
-#### Syntax
-
-```
-bleDevice.service(index)
-bleDevice.service(uuid)
-bleDevice.service(uuid, index)
-
-```
-
-#### Parameters
-
-- **index**: index of service
-- **uuid**: uuid (as a **String**)
-
-#### Returns
-- **BLEService** for provided parameters
-
-#### Example
-
-```arduino
-
-  // begin initialization
-  if (!BLE.begin()) {
-    Serial.println("starting Bluetooth® Low Energy module failed!");
-
-    while (1);
-  }
-
-  Serial.println("BLE Central scan");
-
-  // start scanning for peripheral
-  BLE.scan();
-
-
-  BLEDevice peripheral = BLE.available();
-
-  if (peripheral) {
-    // ...
-
-    Serial.println("Connecting ...");
-
-    if (peripheral.connect()) {
-      Serial.println("Connected");
-    } else {
-      Serial.println("Failed to connect!");
-      return;
-    }
-
-    // discover peripheral attributes
-    Serial.println("Discovering attributes ...");
-    if (peripheral.discoverAttributes()) {
-      Serial.println("Attributes discovered");
-    } else {
-      Serial.println("Attribute discovery failed!");
-      peripheral.disconnect();
-      return;
-    }
-
-    BLEService batteryService = peripheral.service("180f");
-
-    if (batteryService) {
-      // use the service
-    } else {
-      Serial.println("Peripheral does NOT have battery service");
-    }
-
-    // ...
-  }
-
-
-```
-
-### `bleDevice.characteristicCount()`
-
-Query the number of characteristics discovered for the Bluetooth® Low Energy device.
-
-#### Syntax
-
-```
-bleDevice.characteristicCount()
-
-```
-
-#### Parameters
-
-None
-
-#### Returns
-- The **number of characteristics** discovered for the Bluetooth® Low Energy device.
-
-#### Example
-
-```arduino
-
-  // begin initialization
-  if (!BLE.begin()) {
-    Serial.println("starting Bluetooth® Low Energy module failed!");
-
-    while (1);
-  }
-
-  Serial.println("BLE Central scan");
-
-  // start scanning for peripheral
-  BLE.scan();
-
-
-  BLEDevice peripheral = BLE.available();
-
-  if (peripheral) {
-    // ...
-
-    Serial.println("Connecting ...");
-
-    if (peripheral.connect()) {
-      Serial.println("Connected");
-    } else {
-      Serial.println("Failed to connect!");
-      return;
-    }
-
-    // discover peripheral attributes
-    Serial.println("Discovering attributes ...");
-    if (peripheral.discoverAttributes()) {
-      Serial.println("Attributes discovered");
-    } else {
-      Serial.println("Attribute discovery failed!");
-      peripheral.disconnect();
-      return;
-    }
-
-    int characteristicCount = peripheral.characteristicCount();
-
-    Serial.print(characteristicCount);
-    Serial.println(" characteristics discovered");
-
-    // ...
-  }
-
-
-```
-
-### `bleDevice.hasCharacteristic()`
-
-Query if the Bluetooth® Low Energy device has a particular characteristic.
-
-#### Syntax
-
-```
-bleDevice.hasCharacteristic(uuid)
-bleDevice.hasCharacteristic(uuid, index)
-
-```
-
-#### Parameters
-
-- **uuid**: uuid to check (as a **String**)
-- **index**: optional, index of characteristic to check if the device provides more than on. Defaults to 0, if not provided.
-
-#### Returns
-- **true**, if the device provides the characteristic,
-- **false** otherwise.
-
-#### Example
-
-```arduino
-
-  // begin initialization
-  if (!BLE.begin()) {
-    Serial.println("starting Bluetooth® Low Energy module failed!");
-
-    while (1);
-  }
-
-  Serial.println("BLE Central scan");
-
-  // start scanning for peripheral
-  BLE.scan();
-
-
-  BLEDevice peripheral = BLE.available();
-
-  if (peripheral) {
-    // ...
-
-    Serial.println("Connecting ...");
-
-    if (peripheral.connect()) {
-      Serial.println("Connected");
-    } else {
-      Serial.println("Failed to connect!");
-      return;
-    }
-
-    // discover peripheral attributes
-    Serial.println("Discovering attributes ...");
-    if (peripheral.discoverAttributes()) {
-      Serial.println("Attributes discovered");
-    } else {
-      Serial.println("Attribute discovery failed!");
-      peripheral.disconnect();
-      return;
-    }
-
-    if (peripheral.hasCharacteristic("2a19")) {
-      Serial.println("Peripheral has battery level characteristic");
-    }
-
-    // ...
-  }
-
-
-```
-
-### `bleDevice.hasLocalName()`
-
-Query if a discovered Bluetooth® Low Energy device is advertising a local name.
-
-#### Syntax
-
-```
-bleDevice.hasLocalName()
-
-```
-
-#### Parameters
-
-Nothing
-
-#### Returns
-- **true**, if the device is advertising a local name,
-- **false** otherwise.
-
-#### Example
-
-```arduino
-
-  // begin initialization
-  if (!BLE.begin()) {
-    Serial.println("starting Bluetooth® Low Energy module failed!");
-
-    while (1);
-  }
-
-  Serial.println("BLE Central scan");
-
-  // start scanning for peripheral
-  BLE.scan();
-
-
-  BLEDevice peripheral = BLE.available();
-
-  if (peripheral) {
-    // ...
-
-    // print the local name, if present
-    if (peripheral.hasLocalName()) {
-      Serial.print("Local Name: ");
-      Serial.println(peripheral.localName());
-    }
-
-    // ...
-  }
-
-
-```
-
-### `bleDevice.hasAdvertisedServiceUuid()`
-
-Query if a discovered Bluetooth® Low Energy device is advertising a service UUID.
-
-#### Syntax
-
-```
-bleDevice.hasAdvertisedServiceUuid()
-bleDevice.hasAdvertisedServiceUuid(index)
-
-```
-
-#### Parameters
-
-- **index**: optional, defaults to 0, the index of the service UUID, if the device is advertising more than one.
-
-#### Returns
-- **true**, if the device is advertising a service UUID,
-- **false** otherwise.
-
-#### Example
-
-```arduino
-
-  // begin initialization
-  if (!BLE.begin()) {
-    Serial.println("starting Bluetooth® Low Energy module failed!");
-
-    while (1);
-  }
-
-  Serial.println("BLE Central scan");
-
-  // start scanning for peripheral
-  BLE.scan();
-
-
-  BLEDevice peripheral = BLE.available();
-
-  if (peripheral) {
-    // ...
-
-    // print the advertised service UUIDs, if present
-    if (peripheral.hasAdvertisedServiceUuid()) {
-      Serial.print("Service UUIDs: ");
-      for (int i = 0; i < peripheral.advertisedServiceUuidCount(); i++) {
-        Serial.print(peripheral.advertisedServiceUuid(i));
-        Serial.print(" ");
-      }
-      Serial.println();
-    }
-
-    // ...
-  }
-
-
-```
-
-### `bleDevice.advertisedServiceUuidCount()`
-
-Query the number of advertised services a discovered Bluetooth® Low Energy device is advertising.
-
-#### Syntax
-
-```
-bleDevice.advertisedServiceUuidCount()
-
-```
-
-#### Parameters
-
-None
-
-#### Returns
-- The **number of advertised services** a discovered Bluetooth® Low Energy device is advertising.
-
-#### Example
-
-```arduino
-
-  // begin initialization
-  if (!BLE.begin()) {
-    Serial.println("starting Bluetooth® Low Energy module failed!");
-
-    while (1);
-  }
-
-  Serial.println("BLE Central scan");
-
-  // start scanning for peripheral
-  BLE.scan();
-
-
-  BLEDevice peripheral = BLE.available();
-
-  if (peripheral) {
-    // ...
-
-    // print the advertised service UUIDs, if present
-    if (peripheral.hasAdvertisedServiceUuid()) {
-      Serial.print("Service UUIDs: ");
-      for (int i = 0; i < peripheral.advertisedServiceUuidCount(); i++) {
-        Serial.print(peripheral.advertisedServiceUuid(i));
-        Serial.print(" ");
-      }
-      Serial.println();
-    }
-
-    // ...
-  }
-
-
-```
-
-### `bleDevice.localName()`
-
-Query the local name a discovered Bluetooth® Low Energy device is advertising with.
-
-#### Syntax
-
-```
-bleDevice.localName()
-
-```
-
-#### Parameters
-
-Nothing
-
-#### Returns
-- **Advertised local name** (as a String).
-
-#### Example
-
-```arduino
-
-  // begin initialization
-  if (!BLE.begin()) {
-    Serial.println("starting Bluetooth® Low Energy module failed!");
-
-    while (1);
-  }
-
-  Serial.println("BLE Central scan");
-
-  // start scanning for peripheral
-  BLE.scan();
-
-
-  BLEDevice peripheral = BLE.available();
-
-  if (peripheral) {
-    // ...
-
-    // print the local name, if present
-    if (peripheral.hasLocalName()) {
-      Serial.print("Local Name: ");
-      Serial.println(peripheral.localName());
-    }
-
-    // ...
-  }
-
-
-```
-
-### `bleDevice.advertisedServiceUuid()`
-
-Query an advertised service UUID discovered Bluetooth® Low Energy device is advertising.
-
-#### Syntax
-
-```
-bleDevice.advertisedServiceUuid()
-bleDevice.advertisedServiceUuid(index)
-
-```
-
-#### Parameters
-
-- **index**: optional, defaults to 0, the index of the **service UUID**, if the device is advertising more than one.
-
-#### Returns
-- Advertised service **UUID** (as a String).
-
-#### Example
-
-```arduino
-
-  // begin initialization
-  if (!BLE.begin()) {
-    Serial.println("starting Bluetooth® Low Energy module failed!");
-
-    while (1);
-  }
-
-  Serial.println("BLE Central scan");
-
-  // start scanning for peripheral
-  BLE.scan();
-
-
-  BLEDevice peripheral = BLE.available();
-
-  if (peripheral) {
-    // ...
-
-    // print the advertised service UUIDs, if present
-    if (peripheral.hasAdvertisedServiceUuid()) {
-      Serial.print("Service UUIDs: ");
-      for (int i = 0; i < peripheral.advertisedServiceUuidCount(); i++) {
-        Serial.print(peripheral.advertisedServiceUuid(i));
-        Serial.print(" ");
-      }
-      Serial.println();
-    }
-
-    // ...
-  }
-
-
-```
-
-### `bleDevice.connect()`
-
-Connect to a Bluetooth® Low Energy device.
-
-#### Syntax
-
-```
-bleDevice.connect()
-
-```
-
-#### Parameters
-
-None
-
-#### Returns
-- **true**, if the connection was successful,
-- **false** otherwise.
-
-#### Example
-
-```arduino
-
-  // begin initialization
-  if (!BLE.begin()) {
-    Serial.println("starting Bluetooth® Low Energy module failed!");
-
-    while (1);
-  }
-
-  Serial.println("BLE Central scan");
-
-  // start scanning for peripheral
-  BLE.scan();
-
-
-  BLEDevice peripheral = BLE.available();
-
-  if (peripheral) {
-    // ...
-
-    Serial.println("Connecting ...");
-
-    if (peripheral.connect()) {
-      Serial.println("Connected");
-    } else {
-      Serial.println("Failed to connect!");
-      return;
-    }
-
-    // ...
-  }
-
-
-```
-
-## BLEService Class
-
-Used to enable the services board provides or interact with services a remote board provides.
-
-### `BLEService()`
-
-Create a new Bluetooth® Low Energy service.
-
-#### Syntax
-
-```
-BLEService(uuid)
-
-```
-
-#### Parameters
-
-- **uuid**: 16-bit or 128-bit UUID in **String** format
-
-#### Returns
-- New **BLEService** with the specified **UUID**
-
-#### Example
-
-```arduino
-
-BLEService ledService("19B10000-E8F2-537E-4F6C-D104768A1214"); // Bluetooth® Low Energy LED Service
-
-
-```
-
-### `bleService.uuid()`
-
-Query the UUID of the specified BLEService.
-
-#### Syntax
-
-```
-bleService.uuid()
-
-```
-
-#### Parameters
-
-None
-
-#### Returns
-- UUID of the Bluetooth® Low Energy service as a **String**.
-
-#### Example
-
-```arduino
-
-BLEService ledService("19B10000-E8F2-537E-4F6C-D104768A1214"); // Bluetooth® Low Energy LED Service
-
-
-Serial.print("LED service UUID = ");
-Serial.println(ledService.uuid());
-
-
-
-```
-
-### `bleService.addCharacteristic()`
-
-Add a BLECharacteristic to the Bluetooth® Low Energy service.
-
-#### Syntax
-
-```
-bleService.addCharacteristic(bleCharacteristic)
-
-```
-
-#### Parameters
-
-None
-
-#### Returns
-Nothing
-
-#### Example
-
-```arduino
-
-BLEService ledService("19B10000-E8F2-537E-4F6C-D104768A1214"); // Bluetooth® Low Energy LED Service
-
-// Bluetooth® Low Energy LED Switch Characteristic - custom 128-bit UUID, readable and writable by central
-BLECharacteristic switchCharacteristic("19B10001-E8F2-537E-4F6C-D104768A1214", BLERead | BLEWrite, 1);
-
-
-
-
-// add the characteristic to the service
-ledService.addCharacteristic(switchCharacteristic);
-
-
-
-```
-
-### `bleService.characteristicCount()`
-
-Query the number of characteristics discovered for the Bluetooth® Low Energy service.
-
-#### Syntax
-
-```
-bleService.characteristicCount()
-
-```
-
-#### Parameters
-
-None
-
-#### Returns
-- The **number of characteristics** discovered for the Bluetooth® Low Energy service.
-
-#### Example
-
-```arduino
-
-  // begin initialization
-  if (!BLE.begin()) {
-    Serial.println("starting Bluetooth® Low Energy module failed!");
-
-    while (1);
-  }
-
-  Serial.println("BLE Central scan");
-
-  // start scanning for peripheral
-  BLE.scan();
-
-
-  BLEDevice peripheral = BLE.available();
-
-  if (peripheral) {
-    // ...
-
-    Serial.println("Connecting ...");
-
-    if (peripheral.connect()) {
-      Serial.println("Connected");
-    } else {
-      Serial.println("Failed to connect!");
-      return;
-    }
-
-    // discover peripheral attributes
-    Serial.println("Discovering attributes ...");
-    if (peripheral.discoverAttributes()) {
-      Serial.println("Attributes discovered");
-    } else {
-      Serial.println("Attribute discovery failed!");
-      peripheral.disconnect();
-      return;
-    }
-
-    BLEService batteryService = peripheral.service("180f");
-
-    if (batteryService) {
-      // use the service
-      int characteristicCount = batteryService.characteristicCount();
-
-      Serial.print(characteristicCount);
-      Serial.println(" characteristics discovered in battery service");
-    } else {
-      Serial.println("Peripheral does NOT have battery service");
-    }
-
-    // ...
-  }
-
-
-```
-
-### `bleService.hasCharacteristic()`
-
-Query if the Bluetooth® Low Energy service has a particular characteristic.
-
-#### Syntax
-
-```
-bleService.hasCharacteristic(uuid)
-bleService.hasCharacteristic(uuid, index)
-
-```
-
-#### Parameters
-
-- **uuid**: uuid to check (as a **String**)
-- **index**: optional, index of characteristic to check if the device provides more than on. Defaults to 0, if not provided.
-
-#### Returns
-- **true**, if the service provides the characteristic,
-- **false** otherwise.
-
-#### Example
-
-```arduino
-
-  // begin initialization
-  if (!BLE.begin()) {
-    Serial.println("starting Bluetooth® Low Energy module failed!");
-
-    while (1);
-  }
-
-  Serial.println("BLE Central scan");
-
-  // start scanning for peripheral
-  BLE.scan();
-
-  BLEDevice peripheral = BLE.available();
-
-  if (peripheral) {
-    // ...
-
-    Serial.println("Connecting ...");
-
-    if (peripheral.connect()) {
-      Serial.println("Connected");
-    } else {
-      Serial.println("Failed to connect!");
-      return;
-    }
-
-    // discover peripheral attributes
-    Serial.println("Discovering attributes ...");
-    if (peripheral.discoverAttributes()) {
-      Serial.println("Attributes discovered");
-    } else {
-      Serial.println("Attribute discovery failed!");
-      peripheral.disconnect();
-      return;
-    }
-
-    BLEService batteryService = peripheral.service("180f");
-
-    if (batteryService) {
-      // use the service
-      if (batteryService.hasCharacteristic("2a19")) {
-        Serial.println("Battery service has battery level characteristic");
-      }
-    } else {
-      Serial.println("Peripheral does NOT have battery service");
-    }
-
-    // ...
-  }
-
-
-```
-
-### `bleService.characteristic()`
-
-Get a BLECharacteristic representing a Bluetooth® Low Energy characteristic the service provides.
-
-#### Syntax
-
-```
-bleService.characteristic(index)
-bleService.characteristic(uuid)
-bleService.characteristic(uuid, index)
-
-```
-
-#### Parameters
-
-- **index**: index of characteristic
-- **uuid**: uuid (as a **String**)
-
-#### Returns
-- **BLECharacteristic** for provided parameters
-
-#### Example
-
-```arduino
-
-  // begin initialization
-  if (!BLE.begin()) {
-    Serial.println("starting Bluetooth® Low Energy module failed!");
-
-    while (1);
-  }
-
-  Serial.println("BLE Central scan");
-
-  // start scanning for peripheral
-  BLE.scan();
-
-
-  BLEDevice peripheral = BLE.available();
-
-  if (peripheral) {
-    // ...
-
-    Serial.println("Connecting ...");
-
-    if (peripheral.connect()) {
-      Serial.println("Connected");
-    } else {
-      Serial.println("Failed to connect!");
-      return;
-    }
-
-    // discover peripheral attributes
-    Serial.println("Discovering attributes ...");
-    if (peripheral.discoverAttributes()) {
-      Serial.println("Attributes discovered");
-    } else {
-      Serial.println("Attribute discovery failed!");
-      peripheral.disconnect();
-      return;
-    }
-
-    BLEService batteryService = peripheral.service("180f");
-
-    if (batteryService) {
-      // use the service
-      BLECharacteristic batteryLevelCharacteristic = peripheral.characteristic("2a19");
-
-      if (batteryLevelCharacteristic) {
-        // use the characteristic
-      } else {
-        Serial.println("Peripheral does NOT have battery level characteristic");
-      }
-    } else {
-      Serial.println("Peripheral does NOT have battery service");
-    }
-
-    // ...
-  }
-
-
-```
-
-## BLECharacteristic Class
-
-Used to enable the characteristics board offers in a service or interact with characteristics a remote board provides.
-
-### `BLECharacteristic()`
-
-Create a new Bluetooth® Low Energy characteristic.
-
-#### Syntax
-
-```
-BLECharacteristic(uuid, properties, valueSize)
-BLECharacteristic(uuid, properties, valueSize, fixedLength)
-BLECharacteristic(uuid, properties, stringValue)
-
-BLEBoolCharacteristic(uuid, properties)
-BLEBooleanCharacteristic(uuid, properties)
-BLECharCharacteristic(uuid, properties)
-BLEUnsignedCharCharacteristic(uuid, properties)
-BLEByteCharacteristic(uuid, properties)
-BLEShortCharacteristic(uuid, properties)
-BLEUnsignedShortCharacteristic(uuid, properties)
-BLEWordCharacteristic(uuid, properties)
-BLEIntCharacteristic(uuid, properties)
-BLEUnsignedIntCharacteristic(uuid, properties)
-BLELongCharacteristic(uuid, properties)
-BLEUnsignedLongCharacteristic(uuid, properties)
-BLEFloatCharacteristic(uuid, properties)
-BLEDoubleCharacteristic(uuid, properties)
-```
-
-#### Parameters
-
-- **uuid**: 16-bit or 128-bit UUID in **String** format
-- **properties**: mask of the properties (BLEBroadcast, BLERead, BLEWriteWithoutResponse, BLEWrite, BLENotify, BLEIndicate)
-- **valueSize**: (maximum) size of characteristic value
-- **fixedLength**: if true, size of characteristic value is fixed
-- **stringValue**: value as a string
-
-#### Returns
-- New **BLECharacteristic** with the specified **UUID** and value
-
-#### Example
-
-```arduino
-
-// Bluetooth® Low Energy Battery Level Characteristic
-BLEUnsignedCharCharacteristic batteryLevelChar("2A19",  // standard 16-bit characteristic UUID
-    BLERead | BLENotify); // remote clients will be able to get notifications if this characteristic changes
-
-
-
-```
-
-### `bleCharacteristic.uuid()`
-
-Query the UUID of the specified BLECharacteristic.
-
-#### Syntax
-
-```
-bleCharacteristic.uuid()
-
-```
-
-#### Parameters
-
-None
-
-#### Returns
-- **UUID** of the Bluetooth® Low Energy service as a **String**.
-
-#### Example
-
-```arduino
-
-// Bluetooth® Low Energy LED Switch Characteristic - custom 128-bit UUID, read and writable by central
-BLEByteCharacteristic switchCharacteristic("19B10001-E8F2-537E-4F6C-D104768A1214", BLERead | BLEWrite);
-
-
-Serial.print("Switch characteristic UUID = ");
-Serial.println(switchCharacteristic.uuid());
-
-
-
-```
-
-### `bleCharacteristic.properties()`
-
-Query the property mask of the specified BLECharacteristic.
-
-#### Syntax
-
-```
-bleCharacteristic.properties()
-
-```
-
-#### Parameters
-
-None
-
-#### Returns
-- **Properties of the characteristic masked** (BLEBroadcast, BLERead, BLEWriteWithoutResponse, BLEWrite, BLENotify, BLEIndicate)
-
-#### Example
-
-```arduino
-
-// Bluetooth® Low Energy LED Switch Characteristic - custom 128-bit UUID, read and writable by central
-BLEByteCharacteristic switchCharacteristic("19B10001-E8F2-537E-4F6C-D104768A1214", BLERead | BLEWrite);
-
-
-byte properties = switchCharacteristic.properties();
-
-if (properties & BLERead) {
-  // characteristic is readable ...
-}
-
-if (properties & (BLEWrite | BLEWriteWithoutResponse)) {
-  // characteristic is writable ...
-}
-
-
-```
-
-### `bleCharacteristic.valueSize()`
-
-Query the maximum value size of the specified BLECharacteristic.
-
-#### Syntax
-
-```
-bleCharacteristic.valueSize()
-
-```
-
-#### Parameters
-
-None
-
-#### Returns
-- The **maximum value** size of the characteristic (in bytes)
-
-#### Example
-
-```arduino
-
-// Bluetooth® Low Energy LED Switch Characteristic - custom 128-bit UUID, read and writable by central
-BLEByteCharacteristic switchCharacteristic("19B10001-E8F2-537E-4F6C-D104768A1214", BLERead | BLEWrite);
-
-
-
-Serial.print("value size = ");
-Serial.println(switchCharacteristic.valueSize());
-
-
-```
-
-### `bleCharacteristic.value()`
-
-Query the current value of the specified BLECharacteristic.
-
-#### Syntax
-
-```
-bleCharacteristic.value()
-
-```
-
-#### Parameters
-
-None
-
-#### Returns
-- The **current value** of the characteristic, value type depends on the constructor used
-
-#### Example
-
-```arduino
-
-// Bluetooth® Low Energy LED Switch Characteristic - custom 128-bit UUID, read and writable by central
-BLEByteCharacteristic switchCharacteristic("19B10001-E8F2-537E-4F6C-D104768A1214", BLERead | BLEWrite);
-
-
-
-  if (switchCharacteristic.value()) {  // any value other than 0
-    Serial.println("LED on");
-    digitalWrite(ledPin, HIGH);  // will turn the LED on
-  } else {                       // a 0 value
-    Serial.println(F("LED off"));
-    digitalWrite(ledPin, LOW);  // will turn the LED off
-  }
-
-
-
-```
-
-### `bleCharacteristic.valueLength()`
-
-Query the current value size of the specified BLECharacteristic.
-
-#### Syntax
-
-```
-bleCharacteristic.valueLength()
-
-```
-
-#### Parameters
-
-None
-
-#### Returns
-- The **current value** size of the characteristic (in bytes)
-
-#### Example
-
-```arduino
-
-// Bluetooth® Low Energy LED Switch Characteristic - custom 128-bit UUID, read and writable by central
-BLEByteCharacteristic switchCharacteristic("19B10001-E8F2-537E-4F6C-D104768A1214", BLERead | BLEWrite);
-
-
-
-Serial.print("value length = ");
-Serial.println(switchCharacteristic.valueLength());
-
-
-```
-
-### `bleCharacteristic.readValue()`
-
-Read the current value of the characteristic. If the characteristic is on a remote device, a read request will be sent.
-
-#### Syntax
-
-```
-bleCharacteristic.readValue(buffer, length)
-bleCharacteristic.readValue(value)
-
-```
-
-#### Parameters
-
-- **buffer:** byte array to read value into length: size of buffer argument in bytes
-- **value**: variable to read value into (by reference)
-
-#### Returns
-- **Number of bytes** read
-
-#### Example
-
-```arduino
-
-  while (peripheral.connected()) {
-    // while the peripheral is connected
-
-    // check if the value of the simple key characteristic has been updated
-    if (simpleKeyCharacteristic.valueUpdated()) {
-      // yes, get the value, characteristic is 1 byte so use byte value
-      byte value = 0;
-
-      simpleKeyCharacteristic.readValue(value);
-
-      if (value & 0x01) {
-        // first bit corresponds to the right button
-        Serial.println("Right button pressed");
-      }
-
-      if (value & 0x02) {
-        // second bit corresponds to the left button
-        Serial.println("Left button pressed");
-      }
-    }
-  }
-
-
-```
-
-### `bleCharacteristic.writeValue()`
-
-Write the value of the characteristic. If the characteristic is on a remote device, a write request or command will be sent.
-
-#### Syntax
-
-```
-bleCharacteristic.writeValue(buffer, length)
-bleCharacteristic.writeValue(value)
-
-```
-
-#### Parameters
-
-- **buffer**: byte array to write value with
-- **length**: number of bytes of the buffer argument to write
-- **value**: value to write
-
-#### Returns
-- 1 on success,
-- 0 on failure
-
-#### Example
-
-```arduino
-
-    // read the button pin
-    int buttonState = digitalRead(buttonPin);
-
-    if (oldButtonState != buttonState) {
-      // button changed
-      oldButtonState = buttonState;
-
-      if (buttonState) {
-        Serial.println("button pressed");
-
-        // button is pressed, write 0x01 to turn the LED on
-        ledCharacteristic.writeValue((byte)0x01);
-      } else {
-        Serial.println("button released");
-
-        // button is released, write 0x00 to turn the LED off
-        ledCharacteristic.writeValue((byte)0x00);
-      }
-    }
-
-
-```
-
-### `bleCharacteristic.setEventHandler()`
-
-Set the event handler (callback) function that will be called when the specified event occurs.
-
-#### Syntax
-
-```
-bleCharacteristic.setEventHandler(eventType, callback)
-
-```
-
-#### Parameters
-
-- **eventType**: event type (BLESubscribed, BLEUnsubscribed, BLERead, BLEWritten)
-- **callback**: function to call when the event occurs
-
-#### Returns
-Nothing
-
-#### Example
-
-```arduino
-
-// create switch characteristic and allow remote device to read and write
-BLEByteCharacteristic switchCharacteristic("19B10001-E8F2-537E-4F6C-D104768A1214", BLERead | BLEWrite);
-
-
-
-
-  // assign event handlers for characteristic
-  switchCharacteristic.setEventHandler(BLEWritten, switchCharacteristicWritten);
-
-
-
-void switchCharacteristicWritten(BLEDevice central, BLECharacteristic characteristic) {
-  // central wrote new value to characteristic, update LED
-  Serial.print("Characteristic event, written: ");
-
-  if (switchCharacteristic.value()) {
-    Serial.println("LED on");
-    digitalWrite(ledPin, HIGH);
-  } else {
-    Serial.println("LED off");
-    digitalWrite(ledPin, LOW);
-  }
-}
-
-
-```
-
-### `bleCharacteristic.broadcast()`
-
-Broadcast the characteristics value as service data when advertising.
-
-#### Syntax
-
-```
-bleCharacteristic.broadcast()
-
-```
-
-#### Parameters
-
-None
-
-#### Returns
-- 1 on success,
-- 0 on failure
-
-#### Example
-
-```arduino
-
-// create button characteristic and allow remote device to get notifications
-BLEByteCharacteristic buttonCharacteristic("19B10012-E8F2-537E-4F6C-D104768A1214", BLERead | BLENotify | BLEBroadcast);
-
-
-
-buttonCharacteristic.broadcast();
-
-
-
-```
-
-### `bleCharacteristic.written()`
-
-Query if the characteristic value has been written by another Bluetooth® Low Energy device.
-
-#### Syntax
-
-```
-bleCharacteristic.written()
-
-```
-
-#### Parameters
-
-None
-
-#### Returns
-- **true** if the characteristic value has been written by another Bluetooth® Low Energy device,
-- **false** otherwise
-
-#### Example
-
-```arduino
-
-// Bluetooth® Low Energy LED Switch Characteristic - custom 128-bit UUID, read and writable by central
-BLEByteCharacteristic switchCharacteristic("19B10001-E8F2-537E-4F6C-D104768A1214", BLERead | BLEWrite);
-
-
-
-
- // listen for Bluetooth® Low Energy peripherals to connect:
-  BLEDevice central = BLE.central();
-
-  // if a central is connected to peripheral:
-  if (central) {
-    Serial.print("Connected to central: ");
-    // print the central's MAC address:
-    Serial.println(central.address());
-
-    // while the central is still connected to peripheral:
-    while (central.connected()) {
-      // if the remote device wrote to the characteristic,
-      // use the value to control the LED:
-      if (switchCharacteristic.written()) {
-        if (switchCharacteristic.value()) {   // any value other than 0
-          Serial.println("LED on");
-          digitalWrite(ledPin, HIGH);         // will turn the LED on
-        } else {                              // a 0 value
-          Serial.println(F("LED off"));
-          digitalWrite(ledPin, LOW);          // will turn the LED off
-        }
-      }
-    }
-
-    // when the central disconnects, print it out:
-    Serial.print(F("Disconnected from central: "));
-    Serial.println(central.address());
-  }
-
-
-
-
-```
-
-### `bleCharacteristic.subscribed()`
-
-Query if the characteristic has been subscribed to by another Bluetooth® Low Energy device.
-
-#### Syntax
-
-```
-bleCharacteristic.subscribed()
-
-```
-
-#### Parameters
-
-None
-
-#### Returns
-- **true** if the characteristic value has been subscribed to by another Bluetooth® Low Energy device,
-- **false** otherwise
-
-#### Example
-
-```arduino
-
-// Bluetooth® Low Energy Battery Level Characteristic
-BLEUnsignedCharCharacteristic batteryLevelChar("2A19",  // standard 16-bit characteristic UUID
-    BLERead | BLENotify); // remote clients will be able to get notifications if this characteristic changes
-
-
-
-
-
-  if (batteryLevelChar.subscribed()) {
-     // set a new value , that well be pushed to subscribed Bluetooth® Low Energy devices
-    batteryLevelChar.writeValue(0xab);
-  }
-
-
-```
-
-### `bleCharacteristic.addDescriptor()`
-
-Add a BLEDescriptor to the characteristic.
-
-#### Syntax
-
-```
-bleCharacteristic.addDescriptor(bleDescriptor)
-
-```
-
-#### Parameters
-
-- **bleDescriptor**: descriptor to add to the characteristic
-
-#### Returns
-Nothing
-
-#### Example
-
-```arduino
-
-// Bluetooth® Low Energy Battery Level Characteristic
-BLEUnsignedCharCharacteristic batteryLevelChar("2A19",  // standard 16-bit characteristic UUID
-    BLERead | BLENotify); // remote clients will be able to get notifications if this characteristic changes
-
-BLEDescriptor batteryLevelDescriptor("2901", "millis");
-
-
-
-
-
-  batteryLevelChar.addDescriptor(batteryLevelDescriptor);
-
-
-```
-
-### `bleCharacteristic.descriptorCount()`
-
-Query the number of Bluetooth® Low Energy descriptors discovered for the characteristic.
-
-#### Syntax
-
-```
-bleCharacteristic.descriptorCount()
-
-```
-
-#### Parameters
-
-None
-
-#### Returns
-- The **number of Bluetooth® Low Energy descriptors** discovered for the characteristic
-
-#### Example
-
-```arduino
-
- // loop the descriptors of the characteristic and explore each
-  for (int i = 0; i < characteristic.descriptorCount(); i++) {
-    BLEDescriptor descriptor = characteristic.descriptor(i);
-
-    // ...
-  }
-
-
-```
-
-### `bleCharacteristic.hasDescriptor()`
-
-Check if a characteristic has a particular descriptor.
-
-#### Syntax
-
-```
-bleCharacteristic.hasDescriptor(uuid)
-bleCharacteristic.hasDescriptor(uuid, index)
-
-```
-
-#### Parameters
-
-- **index**: index of descriptor
-- **uuid**: uuid (as a **String**)
-
-#### Returns
-- **true**, if the characteristic has a matching descriptor,
-- otherwise **false**.
-
-#### Example
-
-```arduino
-
-  if (characteristic.hasDescriptor("2901")) {
-    Serial.println("characteristic has description descriptor");
-  }
-
-
-```
-
-### `bleCharacteristic.descriptor()`
-
-Get a BLEDescriptor that represents a characteristics Bluetooth® Low Energy descriptor.
-
-#### Syntax
-
-```
-bleCharacteristic.descriptor(index)
-bleCharacteristic.descriptor(uuid)
-bleCharacteristic.descriptor(uuid, index)
-
-```
-
-#### Parameters
-
-- **index**: index of descriptor
-- **uuid**: uuid (as a **String**)
-
-#### Returns
-- BLEDescriptor that represents a characteristics Bluetooth® Low Energy descriptor
-
-#### Example
-
-```arduino
-
-  if (characteristic.hasDescriptor("2901")) {
-    Serial.println("characteristic has description descriptor");
-  }
-
-
-```
-
-### `bleCharacteristic.canRead()`
-
-Query if a Bluetooth® Low Energy characteristic is readable.
-
-#### Syntax
-
-```
-bleCharacteristic.canRead()
-
-```
-
-#### Parameters
-
-None
-
-#### Returns
-- **true**, if characteristic is readable,
-- **false** otherwise
-
-#### Example
-
-```arduino
-
-  if (characteristic.canRead("2901")) {
-    Serial.println("characteristic is readable");
-  }
-
-
-```
-
-read
-
-Perform a read request for the characteristic.
-
-#### Syntax
-
-```
-bleCharacteristic.read()
-
-```
-
-#### Parameters
-
-None
-
-#### Returns
-- **true**, if successful,
-- **false** on failure
-
-#### Example
-
-```arduino
-
-  if (characteristic.read()) {
-    Serial.println("characteristic value read");
-
-    // ...
-  } else {
-    Serial.println("error reading characteristic value");
-  }
-
-
-```
-
-### `bleCharacteristic.canWrite()`
-
-Query if a Bluetooth® Low Energy characteristic is writable.
-
-#### Syntax
-
-```
-bleCharacteristic.canWrite()
-
-```
-
-#### Parameters
-
-None
-
-#### Returns
-- **true**, if characteristic is writable,
-- **false** otherwise
-
-#### Example
-
-```arduino
-
-  if (characteristic.canWrite()) {
-    Serial.println("characteristic is writable");
-  }
-
-
-```
-
-### `bleCharacteristic.canSubscribe()`
-
-Query if a Bluetooth® Low Energy characteristic is subscribable.
-
-#### Syntax
-
-```
-bleCharacteristic.canSubscribe()
-
-```
-
-#### Parameters
-
-None
-
-#### Returns
-- **true**, if characteristic is subscribable,
-- **false** otherwise
-
-#### Example
-
-```arduino
-
-  if (characteristic.canSubscribe()) {
-    Serial.println("characteristic is subscribable");
-  }
-
-
-```
-
-### `bleCharacteristic.subscribe()`
-
-Subscribe to a Bluetooth® Low Energy characteristics notification or indications.
-
-#### Syntax
-
-```
-bleCharacteristic.subscribe()
-
-```
-
-#### Parameters
-
-None
-
-#### Returns
-- **true**, on success,
-- **false** on failure
-
-#### Example
-
-```arduino
-
-  // ...
-
-  // retrieve the simple key characteristic
-  BLECharacteristic simpleKeyCharacteristic = peripheral.characteristic("ffe1");
-
-  // subscribe to the simple key characteristic
-  Serial.println("Subscribing to simple key characteristic ...");
-  if (!simpleKeyCharacteristic) {
-    Serial.println("no simple key characteristic found!");
-    peripheral.disconnect();
-    return;
-  } else if (!simpleKeyCharacteristic.canSubscribe()) {
-    Serial.println("simple key characteristic is not subscribable!");
-    peripheral.disconnect();
-    return;
-  } else if (!simpleKeyCharacteristic.subscribe()) {
-    Serial.println("subscription failed!");
-    peripheral.disconnect();
-    return;
-  }
-
-  // ...
-
-
-```
-
-### `bleCharacteristic.canUnsubscribe()`
-
-Query if a Bluetooth® Low Energy characteristic is unsubscribable.
-
-#### Syntax
-
-```
-bleCharacteristic.canUnsubscribe()
-
-```
-
-#### Parameters
-
-None
-
-#### Returns
-- **true**, if characteristic is unsubscribable,
-- **false** otherwise
-
-#### Example
-
-```arduino
-
-  if (characteristic.canUnsubscribe()) {
-    Serial.println("characteristic is unsubscribable");
-  }
-
-
-```
-
-### `bleCharacteristic.unsubscribe()`
-
-Unsubscribe to a Bluetooth® Low Energy characteristics notifications or indications.
-
-#### Syntax
-
-```
-bleCharacteristic.unsubscribe()
-
-```
-
-#### Parameters
-
-None
-
-#### Returns
-- **true**, on success,
-- **false** on failure
-
-#### Example
-
-```arduino
-
-  // ...
-
-  // retrieve the simple key characteristic
-  BLECharacteristic simpleKeyCharacteristic = peripheral.characteristic("ffe1");
-
-  // subscribe to the simple key characteristic
-  Serial.println("Subscribing to simple key characteristic ...");
-  if (!simpleKeyCharacteristic) {
-    Serial.println("no simple key characteristic found!");
-    peripheral.disconnect();
-    return;
-  } else if (!simpleKeyCharacteristic.canSubscribe()) {
-    Serial.println("simple key characteristic is not subscribable!");
-    peripheral.disconnect();
-    return;
-  } else if (!simpleKeyCharacteristic.subscribe()) {
-    Serial.println("subscription failed!");
-    peripheral.disconnect();
-    return;
-  }
-
-  // ...
-
-  simpleKeyCharacteristic.unsubscribe();
-
-
-```
-
-### `bleCharacteristic.valueUpdated()`
-
-Has the characteristics value been updated via a notification or indication.
-
-#### Syntax
-
-```
-bleCharacteristic.valueUpdated()
-
-```
-
-#### Parameters
-
-None
-
-#### Returns
-- **true**, if the characteristics value been updated via a notification or indication
-
-#### Example
-
-```arduino
-
-  while (peripheral.connected()) {
-    // while the peripheral is connected
-
-    // check if the value of the simple key characteristic has been updated
-    if (simpleKeyCharacteristic.valueUpdated()) {
-      // yes, get the value, characteristic is 1 byte so use byte value
-      byte value = 0;
-
-      simpleKeyCharacteristic.readValue(value);
-
-      if (value & 0x01) {
-        // first bit corresponds to the right button
-        Serial.println("Right button pressed");
-      }
-
-      if (value & 0x02) {
-        // second bit corresponds to the left button
-        Serial.println("Left button pressed");
-      }
-    }
-  }
-
-
-```
-
-## BLEDescriptor Class
-
-Used to describe a characteristic the board offers
-
-### `BLEDescriptor()`
-
-Create a new Bluetooth® Low Energy descriptor.
-
-#### Syntax
-
-```
-BLEDescriptor(uuid, value, valueSize)
-BLEDescriptor(uuid, stringValue)
-
-```
-
-#### Parameters
-
-- **uuid**: 16-bit or 128-bit UUID in string format
-- **value**: byte array value
-- **valueSize**: size of byte array value
-- **stringValue**: value as a string
-
-#### Returns
-- New **BLEDescriptor** with the specified **UUID** and value
-
-#### Example
-
-```arduino
-
-BLEDescriptor millisLabelDescriptor("2901", "millis");
-
-
-```
-
-### `bleDescriptor.uuid()`
-
-Query the UUID of the specified BLEDescriptor.
-
-#### Syntax
-
-```
-bleDescriptor.uuid()
-
-```
-
-#### Parameters
-
-None
-
-#### Returns
-- **UUID** of the Bluetooth® Low Energy descriptor (as a String).
-
-#### Example
-
-```arduino
-
-BLEDescriptor millisLabelDescriptor("2901", "millis");
-
-
-Serial.print("millis label descriptor UUID = ");
-Serial.println(millisLabelDescriptor.uuid());
-
-
-
-```
-
-### `bleDescriptor.valueSize()`
-
-Query the value size of the specified BLEDescriptor.
-
-#### Syntax
-
-```
-bleDescriptor.valueSize()
-
-```
-
-#### Parameters
-
-None
-
-#### Returns
-- **Value size** (in bytes) of the Bluetooth® Low Energy descriptor.
-
-#### Example
-
-```arduino
-
-BLEDescriptor millisLabelDescriptor("2901", "millis");
-
-
-Serial.print("millis label descriptor value size = ");
-Serial.println(millisLabelDescriptor.valueSize());
-
-
-
-```
-
-### `bleDescriptor.valueLength()`
-
-Query the length, in bytes, of the descriptor current value.
-
-#### Syntax
-
-```
-bleDescriptor.valueLength()
-
-```
-
-#### Parameters
-
-None
-
-#### Returns
-- **Length of descriptor** value in bytes.
-
-#### Example
-
-```arduino
-
-  // read the descriptor value
-  descriptor.read();
-
-  // print out the value of the descriptor
-  Serial.print(", value 0x");
-  printData(descriptor.value(), descriptor.valueLength());
-
-  // ...
-
-  void printData(const unsigned char data[], int length) {
-    for (int i = 0; i < length; i++) {
-      unsigned char b = data[i];
-
-      if (b < 16) {
-        Serial.print("0");
-      }
-
-      Serial.print(b, HEX);
-    }
-  }
-
-
-```
-
-### `bleDescriptor.value()`
-
-Query the value of the specified BLEDescriptor.
-
-#### Syntax
-
-```
-bleDescriptor.value()
-
-```
-
-#### Parameters
-
-None
-
-#### Returns
-- Value byte array of the **BLE descriptor**.
-
-#### Example
-
-```arduino
-
-BLEDescriptor millisLabelDescriptor("2901", "millis");
-
-
-
-  int descriptorValueSize = millisLabelDescriptor.valueSize();
-  byte descriptorValue[descriptorValueSize];
-
-  for (int i = 0; i < descriptorValueSize; i++) {
-    descriptorValue[i] = millisLabelDescriptor.value()[i];
-  }
-
-
-
-```
-
-### `bleDescriptor.readValue()`
-
-Read the current value of the descriptor. If the descriptor is on a remote device, a read request will be sent.
-
-#### Syntax
-
-```
-bleDescriptor.readValue(buffer, length)
-bleDescriptor.readValue(value)
-
-```
-
-#### Parameters
-
-- **buffer**: byte array to read value into
-- **length**: size of buffer argument in bytes
-- **value**: variable to read value into (by reference)
-
-#### Returns
-- **Number of bytes** read
-
-#### Example
-
-
-```arduino
-
-  byte value = 0;
-
-  // get the value, descriptor is 1 byte so use byte value
-  descriptor.readValue(value);
-
-
-```
-
-### `bleDescriptor.read()`
-
-Perform a read request for the descriptor.
-
-#### Syntax
-
-```
-bleDescriptor.read()
-
-```
-
-#### Parameters
-
-None
-
-#### Returns
-- **true**, if successful,
-- **false** on failure
-
-#### Example
-
-```arduino
-
-  if (descriptor.read()) {
-    Serial.println("descriptor value read");
-
-    // ...
-  } else {
-    Serial.println("error reading descriptor value");
-  }
-
-```
diff --git a/docs/assets/ble-bulletin-board-model.png b/docs/assets/ble-bulletin-board-model.png
deleted file mode 100644
index 409ae9e8..00000000
Binary files a/docs/assets/ble-bulletin-board-model.png and /dev/null differ
diff --git a/docs/readme.md b/docs/readme.md
deleted file mode 100644
index b584d71e..00000000
--- a/docs/readme.md
+++ /dev/null
@@ -1,91 +0,0 @@
-# ArduinoBLE library
-
-This library supports all the Arduino boards that have the hardware enabled for Bluetooth® Low Energy and Bluetooth® 4.0 and above; these include Nano 33 BLE, Arduino NANO 33 IoT, Uno WiFi Rev2, MKR WiFi 1010, Nicla Sense ME.
-
-To use this library
-``#include <ArduinoBLE.h>``
-
-## A quick introduction to BLE
-
-Bluetooth® 4.0 includes both traditional Bluetooth®, now labeled "Bluetooth® Classic", and the Bluetooth® Low Energy. Bluetooth® Low Energy is optimized for low power use at low data rates, and was designed to operate from simple lithium coin cell batteries.
-
-Unlike standard Bluetooth® communication basically based on an asynchronous serial connection (UART) a Bluetooth® LE radio acts like a community bulletin board. The computers that connect to it are like community members that read the bulletin board. Each radio acts as either the bulletin board or the reader. If your radio is a bulletin board (called a peripheral device in Bluetooth® LE parlance) it posts data for all radios in the community to read. If your radio is a reader (called a central device in Bluetooth LE terms) it reads from any of the bulletin boards (peripheral devices) that have information about which it cares. You can also think of peripheral devices as the servers in a client-server transaction, because they contain the information that reader radios ask for. Similarly, central devices are the clients of the Bluetooth® LE world because they read information available from the peripherals.
-
-![Communication between central and peripheral devices](https://raw.githubusercontent.com/arduino-libraries/ArduinoBLE/master/docs/assets/ble-bulletin-board-model.png)
-
-Think of a Bluetooth® LE peripheral device as a bulletin board and central devices as viewers of the board. Central devices view the services, get the data, then move on. Each transaction is quick (a few milliseconds), so multiple central devices can get data from one peripheral.
-
-The information presented by a peripheral is structured as **services**, each of which is subdivided into **characteristics**. You can think of services as the notices on a bulletin board, and characteristics as the individual paragraphs of those notices. If you're a peripheral device, you just update each service characteristic when it needs updating and don't worry about whether the central devices read them or not. If you're a central device, you connect to the peripheral then read the boxes you want. If a given characteristic is readable and writable, then the peripheral and central can both change it.
-
-## Notify
-
-The Bluetooth® LE specification includes a mechanism known as **notify** that lets you know when data's changed. When notify on a characteristic is enabled and the sender writes to it, the new value is automatically sent to the receiver, without the receiver explicitly issuing a read command. This is commonly used for streaming data such as accelerometer or other sensor readings. There's a variation on this specification called **indicate** which works similarly, but in the indicate specification, the reader sends an acknowledgment of the pushed data.
-
-The client-server structure of Bluetooth® LE, combined with the notify characteristic, is generally called a **publish-and-subscribe model**.
-
-## Update a characteristic
-
-Your peripheral should update characteristics when there's a significant change to them. For example, when a switch changes from off to on, update its characteristic. When an analog sensor changes by a significant amount, update its characteristic.
-
-Just as with writing to a characteristic, you could update your characteristics on a regular interval, but this wastes processing power and energy if the characteristic has not changed.
-
-## Central and Peripheral Devices
-
-**Central** devices are **clients**. They read and write data from peripheral devices. **Peripheral** devices are **servers**. They provide data from sensors as readable characteristics, and provide read/writable characteristics to control actuators like motors, lights, and so forth.
-
-## Services, characteristics, and UUIDs
-
-A Bluetooth® Low Energy peripheral will provide **services**, which in turn provide **characteristics**. You can define your own services, or use standard services (see section 3.4 in the [Assigned Numbers document](https://www.bluetooth.com/specifications/assigned-numbers/)).
-
-Services are identified by unique numbers known as UUIDs. You know about UUIDs from other contexts. Standard services have a 16-bit UUID and custom services have a 128-bit UUID. The ability to define services and characteristics depends on the radio you're using and its firmware.
-
-## Service design patterns
-
-A characteristic value can be up to 512 bytes long. This is a key constraint in designing services. Given this limit, you should consider how best to store data about your sensors and actuators most effectively for your application. The simplest design pattern is to store one sensor or actuator value per characteristic, in ASCII encoded values.
-
-|**Characteristic**|**Value**|
-|------------------|---------|
-|Accelerometer X|200|
-|Accelerometer Y|134|
-|Accelerometer Z|150|
-
-This is also the most expensive in memory terms, and would take the longest to read. But it's the simplest for development and debugging.
-
-You could also combine readings into a single characteristic, when a given sensor or actuator has multiple values associated with it.
-
-|**Characteristic**|**Value**|
-|------------------|---------|
-|Motor Speed, Direction|150,1|
-|Accelerometer X, Y, Z|200,133,150|
-
-This is more efficient, but you need to be careful not to exceed the 512-byte limit. The accelerometer characteristic above, for example, takes 11 bytes as an ASCII-encoded string.
-
-## Read/write/notify/indicate
-
-There are 4 things a central device can do with a characteristic:
-
-- **Read:** ask the peripheral to send back the current value of the characteristic. Often used for characteristics that don't change very often, for example characteristics used for configuration, version numbers, etc.
-- **Write:** modify the value of the characteristic. Often used for things that are like commands, for example telling the peripheral to turn a motor on or off.
-- **Indicate** and **Notify:** ask the peripheral to continuously send updated values of the characteristic, without the central having to constantly ask for it.
-
-## Advertising and GAP
-
-BLE devices let other devices know that they exist by advertising using the **General Advertising Profile (GAP)**. Advertising packets can contain a device name, some other information, and also a list of the services it provides.
-
-Advertising packets have a limited size. You will only be able to fit a single 128-bit service UUID in the packet. Make sure the device name is not too long, or you won't even be able to fit that.
-
-You can provide additional services that are not advertised. Central devices will learn about these through the connection/bonding process. Non-advertised services cannot be used to discover devices, though. Sometimes this is not an issue. For example, you may have a custom peripheral device with a custom service, but in your central device app you may know that it also provides the Battery Service and other services.
-
-## GATT
-
-The Bluetooth LE protocol operates on multiple layers. **General Attribute Profile (GATT)** is the layer that defines services and characteristics and enables read/write/notify/indicate operations on them. When reading more about GATT, you may encounter GATT concepts of a "server" and "client". These don't always correspond to central and peripherals. In most cases, though, the peripheral is the GATT server (since it provides the services and characteristics), while the central is the GATT client.
-
-## Library structure
-
-As the library enables multiple types of functionality, there are a number of different classes.
-
-- `BLE` used to enable the Bluetooth® Low Energy module.
-- `BLEDevice` used to get information about the devices connected or discovered while scanning.
-- `BLEService` used to enable the services board provides or interact with services a remote board provides.
-- `BLECharacteristic` used to enable the characteristics board offers in a service or interact with characteristics a remote board provides.
-- `BLEDescriptor` used to describe a characteristic the board offers.
diff --git a/examples/Central/LedControl/LedControl.ino b/examples/Central/LedControl/LedControl.ino
index 953de7d8..cbda07d1 100644
--- a/examples/Central/LedControl/LedControl.ino
+++ b/examples/Central/LedControl/LedControl.ino
@@ -6,9 +6,7 @@
   it will remotely control the Bluetooth® Low Energy peripheral's LED, when the button is pressed or released.
 
   The circuit:
-  - Arduino MKR WiFi 1010, Arduino Uno WiFi Rev2 board, Arduino Nano 33 IoT,
-    Arduino Nano 33 BLE, or Arduino Nano 33 BLE Sense board.
-  - Button with pull-up resistor connected to pin 2.
+  - Board with supported BLE modules.
 
   You can use it with another board that is compatible with this library and the
   Peripherals -> LED example.
@@ -16,26 +14,44 @@
   This example code is in the public domain.
 */
 
-#include <ArduinoBLE.h>
+#include <STM32duinoBLE.h>
 
 // variables for button
-const int buttonPin = 2;
+#ifdef USER_BTN
+const int buttonPin = USER_BTN; // set buttonPin to on-board button
+#else
+const int buttonPin = PC13; // set buttonPin to digital pin PC13 */
+#endif
 int oldButtonState = LOW;
+int initialButtonState = LOW;
 
 void setup() {
   Serial.begin(9600);
   while (!Serial);
 
   // configure the button pin as input
-  pinMode(buttonPin, INPUT);
+  pinMode(buttonPin, INPUT_PULLUP);
 
   // initialize the Bluetooth® Low Energy hardware
   BLE.begin();
 
+  // Get initial button state
+  initialButtonState = digitalRead(buttonPin);
+  oldButtonState = initialButtonState;
+
   Serial.println("Bluetooth® Low Energy Central - LED control");
 
   // start scanning for peripherals
-  BLE.scanForUuid("19b10000-e8f2-537e-4f6c-d104768a1214");
+  int ret = 1;
+  do
+  {
+    ret = BLE.scanForUuid("19b10000-e8f2-537e-4f6c-d104768a1214");
+    if (ret == 0)
+    {
+      BLE.end();
+      BLE.begin();
+    }
+  } while(ret == 0);
 }
 
 void loop() {
@@ -57,12 +73,30 @@ void loop() {
     }
 
     // stop scanning
-    BLE.stopScan();
+    int ret = 1;
+    do
+    {
+      ret = BLE.stopScan();
+      if (ret == 0)
+      {
+        BLE.end();
+        BLE.begin();
+      }
+    } while(ret == 0);
 
     controlLed(peripheral);
 
     // peripheral disconnected, start scanning again
-    BLE.scanForUuid("19b10000-e8f2-537e-4f6c-d104768a1214");
+    ret = 1;
+    do
+    {
+      ret = BLE.scanForUuid("19b10000-e8f2-537e-4f6c-d104768a1214");
+      if (ret == 0)
+      {
+        BLE.end();
+        BLE.begin();
+      }
+    } while(ret == 0);
   }
 }
 
@@ -110,7 +144,7 @@ void controlLed(BLEDevice peripheral) {
       // button changed
       oldButtonState = buttonState;
 
-      if (buttonState) {
+      if (buttonState != initialButtonState) {
         Serial.println("button pressed");
 
         // button is pressed, write 0x01 to turn the LED on
diff --git a/examples/Central/PeripheralExplorer/PeripheralExplorer.ino b/examples/Central/PeripheralExplorer/PeripheralExplorer.ino
index 919cdde0..7d4841ae 100644
--- a/examples/Central/PeripheralExplorer/PeripheralExplorer.ino
+++ b/examples/Central/PeripheralExplorer/PeripheralExplorer.ino
@@ -5,8 +5,7 @@
   is found. Then connects, and discovers + prints all the peripheral's attributes.
 
   The circuit:
-  - Arduino MKR WiFi 1010, Arduino Uno WiFi Rev2 board, Arduino Nano 33 IoT,
-    Arduino Nano 33 BLE, or Arduino Nano 33 BLE Sense board.
+  - Board with supported BLE modules.
 
   You can use it with another board that is compatible with this library and the
   Peripherals -> LED example.
@@ -14,7 +13,7 @@
   This example code is in the public domain.
 */
 
-#include <ArduinoBLE.h>
+#include <STM32duinoBLE.h>
 
 void setup() {
   Serial.begin(9600);
@@ -30,7 +29,16 @@ void setup() {
   Serial.println("Bluetooth® Low Energy Central - Peripheral Explorer");
 
   // start scanning for peripherals
-  BLE.scan();
+  int ret = 1;
+  do
+  {
+    ret = BLE.scan();
+    if (ret == 0)
+    {
+      BLE.end();
+      BLE.begin();
+    }
+  } while(ret == 0);
 }
 
 void loop() {
@@ -50,7 +58,16 @@ void loop() {
     // see if peripheral is a LED
     if (peripheral.localName() == "LED") {
       // stop scanning
-      BLE.stopScan();
+      int ret = 1;
+      do
+      {
+        ret = BLE.stopScan();
+        if (ret == 0)
+        {
+          BLE.end();
+          BLE.begin();
+        }
+      } while(ret == 0);
 
       explorerPeripheral(peripheral);
 
diff --git a/examples/Central/Scan/Scan.ino b/examples/Central/Scan/Scan.ino
index 162e3c07..ca6b2b9a 100644
--- a/examples/Central/Scan/Scan.ino
+++ b/examples/Central/Scan/Scan.ino
@@ -5,13 +5,12 @@
   address, local name, advertised service UUID's.
 
   The circuit:
-  - Arduino MKR WiFi 1010, Arduino Uno WiFi Rev2 board, Arduino Nano 33 IoT,
-    Arduino Nano 33 BLE, or Arduino Nano 33 BLE Sense board.
+  - Board with supported BLE modules.
 
   This example code is in the public domain.
 */
 
-#include <ArduinoBLE.h>
+#include <STM32duinoBLE.h>
 
 void setup() {
   Serial.begin(9600);
@@ -26,8 +25,17 @@ void setup() {
 
   Serial.println("Bluetooth® Low Energy Central scan");
 
-  // start scanning for peripheral
-  BLE.scan();
+  // start scanning for peripherals
+  int ret = 1;
+  do
+  {
+    ret = BLE.scan();
+    if (ret == 0)
+    {
+      BLE.end();
+      BLE.begin();
+    }
+  } while(ret == 0);
 }
 
 void loop() {
diff --git a/examples/Central/ScanCallback/ScanCallback.ino b/examples/Central/ScanCallback/ScanCallback.ino
index 2687a3b9..cc33ee85 100644
--- a/examples/Central/ScanCallback/ScanCallback.ino
+++ b/examples/Central/ScanCallback/ScanCallback.ino
@@ -7,13 +7,12 @@
   reported for every single advertisement it makes.
 
   The circuit:
-  - Arduino MKR WiFi 1010, Arduino Uno WiFi Rev2 board, Arduino Nano 33 IoT,
-    Arduino Nano 33 BLE, or Arduino Nano 33 BLE Sense board.
+  - Board with supported BLE modules.
 
   This example code is in the public domain.
 */
 
-#include <ArduinoBLE.h>
+#include <STM32duinoBLE.h>
 
 void setup() {
   Serial.begin(9600);
@@ -32,7 +31,16 @@ void setup() {
   BLE.setEventHandler(BLEDiscovered, bleCentralDiscoverHandler);
 
   // start scanning for peripherals with duplicates
-  BLE.scan(true);
+  int ret = 1;
+  do
+  {
+    ret = BLE.scan(true);
+    if (ret == 0)
+    {
+      BLE.end();
+      BLE.begin();
+    }
+  } while(ret == 0);
 }
 
 void loop() {
diff --git a/examples/Central/SensorTagButton/SensorTagButton.ino b/examples/Central/SensorTagButton/SensorTagButton.ino
index 27c421fe..f063ac68 100644
--- a/examples/Central/SensorTagButton/SensorTagButton.ino
+++ b/examples/Central/SensorTagButton/SensorTagButton.ino
@@ -8,14 +8,13 @@
   outputted to the Serial Monitor when one is pressed.
 
   The circuit:
-  - Arduino MKR WiFi 1010, Arduino Uno WiFi Rev2 board, Arduino Nano 33 IoT,
-    Arduino Nano 33 BLE, or Arduino Nano 33 BLE Sense board.
+  - Board with supported BLE modules.
   - TI SensorTag
 
   This example code is in the public domain.
 */
 
-#include <ArduinoBLE.h>
+#include <STM32duinoBLE.h>
 
 void setup() {
   Serial.begin(9600);
@@ -31,8 +30,17 @@ void setup() {
   Serial.println("Bluetooth® Low Energy Central - SensorTag button");
   Serial.println("Make sure to turn on the device.");
 
-  // start scanning for peripheral
-  BLE.scan();
+  // start scanning for peripherals
+  int ret = 1;
+  do
+  {
+    ret = BLE.scan();
+    if (ret == 0)
+    {
+      BLE.end();
+      BLE.begin();
+    }
+  } while(ret == 0);
 }
 
 void loop() {
@@ -53,12 +61,30 @@ void loop() {
     // "CC2650 SensorTag"
     if (peripheral.localName() == "CC2650 SensorTag") {
       // stop scanning
-      BLE.stopScan();
+      int ret = 1;
+      do
+      {
+        ret = BLE.stopScan();
+        if (ret == 0)
+        {
+          BLE.end();
+          BLE.begin();
+        }
+      } while(ret == 0);
 
       monitorSensorTagButtons(peripheral);
 
       // peripheral disconnected, start scanning again
-      BLE.scan();
+      ret = 1;
+      do
+      {
+        ret = BLE.scan();
+        if (ret == 0)
+        {
+          BLE.end();
+          BLE.begin();
+         }
+      } while(ret == 0);
     }
   }
 }
diff --git a/examples/Peripheral/Advertising/EnhancedAdvertising/EnhancedAdvertising.ino b/examples/Peripheral/Advertising/EnhancedAdvertising/EnhancedAdvertising.ino
index 979b69a8..806c41bd 100644
--- a/examples/Peripheral/Advertising/EnhancedAdvertising/EnhancedAdvertising.ino
+++ b/examples/Peripheral/Advertising/EnhancedAdvertising/EnhancedAdvertising.ino
@@ -1,4 +1,4 @@
-#include <ArduinoBLE.h>
+#include <STM32duinoBLE.h>
 
 BLEService myService("fff0");
 BLEIntCharacteristic myCharacteristic("fff1", BLERead | BLEBroadcast);
diff --git a/examples/Peripheral/Advertising/RawDataAdvertising/RawDataAdvertising.ino b/examples/Peripheral/Advertising/RawDataAdvertising/RawDataAdvertising.ino
index 5e7ba7f3..88b17e29 100644
--- a/examples/Peripheral/Advertising/RawDataAdvertising/RawDataAdvertising.ino
+++ b/examples/Peripheral/Advertising/RawDataAdvertising/RawDataAdvertising.ino
@@ -1,4 +1,4 @@
-#include <ArduinoBLE.h>
+#include <STM32duinoBLE.h>
 
 BLEService myService("fff0");
 BLEIntCharacteristic myCharacteristic("fff1", BLERead | BLEBroadcast);
diff --git a/examples/Peripheral/BatteryMonitor/BatteryMonitor.ino b/examples/Peripheral/BatteryMonitor/BatteryMonitor.ino
index 0d786627..3413127e 100644
--- a/examples/Peripheral/BatteryMonitor/BatteryMonitor.ino
+++ b/examples/Peripheral/BatteryMonitor/BatteryMonitor.ino
@@ -5,8 +5,7 @@
   level characteristic. The A0 pin is used to calculate the battery level.
 
   The circuit:
-  - Arduino MKR WiFi 1010, Arduino Uno WiFi Rev2 board, Arduino Nano 33 IoT,
-    Arduino Nano 33 BLE, or Arduino Nano 33 BLE Sense board.
+    - Board with supported BLE modules.
 
   You can use a generic Bluetooth® Low Energy central app, like LightBlue (iOS and Android) or
   nRF Connect (Android), to interact with the services and characteristics
@@ -15,7 +14,7 @@
   This example code is in the public domain.
 */
 
-#include <ArduinoBLE.h>
+#include <STM32duinoBLE.h>
 
  // Bluetooth® Low Energy Battery Service
 BLEService batteryService("180F");
diff --git a/examples/Peripheral/ButtonLED/ButtonLED.ino b/examples/Peripheral/ButtonLED/ButtonLED.ino
index cbc14dd8..8ae7d665 100644
--- a/examples/Peripheral/ButtonLED/ButtonLED.ino
+++ b/examples/Peripheral/ButtonLED/ButtonLED.ino
@@ -6,9 +6,7 @@
   represents the state of the button.
 
   The circuit:
-  - Arduino MKR WiFi 1010, Arduino Uno WiFi Rev2 board, Arduino Nano 33 IoT,
-    Arduino Nano 33 BLE, or Arduino Nano 33 BLE Sense board.
-  - Button connected to pin 4
+  - Board with supported BLE modules.
 
   You can use a generic Bluetooth® Low Energy central app, like LightBlue (iOS and Android) or
   nRF Connect (Android), to interact with the services and characteristics
@@ -17,10 +15,14 @@
   This example code is in the public domain.
 */
 
-#include <ArduinoBLE.h>
+#include <STM32duinoBLE.h>
 
 const int ledPin = LED_BUILTIN; // set ledPin to on-board LED
-const int buttonPin = 4; // set buttonPin to digital pin 4
+#ifdef USER_BTN
+const int buttonPin = USER_BTN; // set buttonPin to on-board button
+#else
+const int buttonPin = PC13; // set buttonPin to digital pin PC13 */
+#endif
 
 BLEService ledService("19B10010-E8F2-537E-4F6C-D104768A1214"); // create service
 
@@ -34,7 +36,7 @@ void setup() {
   while (!Serial);
 
   pinMode(ledPin, OUTPUT); // use the LED as an output
-  pinMode(buttonPin, INPUT); // use button pin as an input
+  pinMode(buttonPin, INPUT_PULLUP); // use button pin as an input
 
   // begin initialization
   if (!BLE.begin()) {
diff --git a/examples/Peripheral/CallbackLED/CallbackLED.ino b/examples/Peripheral/CallbackLED/CallbackLED.ino
index 59bda5ed..8bb90106 100644
--- a/examples/Peripheral/CallbackLED/CallbackLED.ino
+++ b/examples/Peripheral/CallbackLED/CallbackLED.ino
@@ -6,8 +6,7 @@
   library are used.
 
   The circuit:
-  - Arduino MKR WiFi 1010, Arduino Uno WiFi Rev2 board, Arduino Nano 33 IoT,
-    Arduino Nano 33 BLE, or Arduino Nano 33 BLE Sense board.
+  - Board with supported BLE modules.
 
   You can use a generic Bluetooth® Low Energy central app, like LightBlue (iOS and Android) or
   nRF Connect (Android), to interact with the services and characteristics
@@ -16,7 +15,7 @@
   This example code is in the public domain.
 */
 
-#include <ArduinoBLE.h>
+#include <STM32duinoBLE.h>
 
 BLEService ledService("19B10000-E8F2-537E-4F6C-D104768A1214"); // create service
 
diff --git a/examples/Peripheral/EncryptedBatteryMonitor/EncryptedBatteryMonitor.ino b/examples/Peripheral/EncryptedBatteryMonitor/EncryptedBatteryMonitor.ino
deleted file mode 100644
index dfc9f4a0..00000000
--- a/examples/Peripheral/EncryptedBatteryMonitor/EncryptedBatteryMonitor.ino
+++ /dev/null
@@ -1,265 +0,0 @@
-/*
-  Battery Monitor
-
-  This example creates a BLE peripheral with the standard battery service and
-  level characteristic. The A0 pin is used to calculate the battery level.
-
-  The circuit:
-  - Arduino MKR WiFi 1010, Arduino Uno WiFi Rev2 board, Arduino Nano 33 IoT,
-    Arduino Nano 33 BLE, or Arduino Nano 33 BLE Sense board.
-
-  You can use a generic BLE central app, like LightBlue (iOS and Android) or
-  nRF Connect (Android), to interact with the services and characteristics
-  created in this sketch.
-
-  This example code is in the public domain.
-*/
-
-#include <ArduinoBLE.h>
-
-
-#define PAIR_BUTTON 3        // button for pairing
-#define PAIR_LED 24           // LED used to signal pairing
-#define PAIR_LED_ON LOW       // Blue LED on Nano BLE has inverted logic
-#define PAIR_INTERVAL 30000   // interval for pairing after button press in ms
-
-#define CTRL_LED LED_BUILTIN
-
-
- // BLE Battery Service
-BLEService batteryService("180F");
-
-// BLE Battery Level Characteristic
-BLEUnsignedCharCharacteristic batteryLevelChar("2A19",  // standard 16-bit characteristic UUID
-    BLERead | BLENotify); // remote clients will be able to get notifications if this characteristic changes
-BLEStringCharacteristic stringcharacteristic("183E", BLERead | BLEWrite, 31);
-
-
-// Add BLEEncryption tag to require pairing. This controls the LED.
-BLEUnsignedCharCharacteristic secretValue("2a3F", BLERead | BLEWrite | BLEEncryption);
-
-int oldBatteryLevel = 0;  // last battery level reading from analog input
-unsigned long previousMillis = 0;  // last time the battery level was checked, in ms
-unsigned long pairingStarted = 0;  // pairing start time when button is pressed
-bool wasConnected = 0;
-bool acceptOrReject = true;
-
-void setup() {
-  Serial.begin(9600);    // initialize serial communication
-  while (!Serial);
-
-  pinMode(CTRL_LED, OUTPUT); // initialize the built-in LED pin to indicate when a central is connected
-  pinMode(PAIR_LED, OUTPUT);
-  pinMode(PAIR_BUTTON, INPUT_PULLUP);
-
-
-  Serial.println("Serial connected");
-
-  // Callback function with confirmation code when new device is pairing.
-  BLE.setDisplayCode([](uint32_t confirmCode){
-    Serial.println("New device pairing request.");
-    Serial.print("Confirm code matches pairing device: ");
-    char code[6];
-    sprintf(code, "%06d", confirmCode);
-    Serial.println(code);
-  });
-
-  // Callback to allow accepting or rejecting pairing
-  BLE.setBinaryConfirmPairing([&acceptOrReject](){
-    Serial.print("Should we confirm pairing? ");
-    delay(5000);
-    if(acceptOrReject){
-      acceptOrReject = false;
-      Serial.println("yes");
-      return true;
-    }else{
-      acceptOrReject = true;
-      Serial.println("no");
-      return false;
-    }
-  });
-
-  // IRKs are keys that identify the true owner of a random mac address.
-  // Add IRKs of devices you are bonded with.
-  BLE.setGetIRKs([](uint8_t* nIRKs, uint8_t** BDaddrTypes, uint8_t*** BDAddrs, uint8_t*** IRKs){
-    // Set to number of devices
-    *nIRKs       = 2;
-
-    *BDAddrs     = new uint8_t*[*nIRKs];
-    *IRKs        = new uint8_t*[*nIRKs];
-    *BDaddrTypes = new uint8_t[*nIRKs];
-
-    // Set these to the mac and IRK for your bonded devices as printed in the serial console after bonding.
-    uint8_t device1Mac[6]    = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
-    uint8_t device1IRK[16]   = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
-
-    uint8_t device2Mac[6]    = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
-    uint8_t device2IRK[16]   = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
-
-
-    (*BDaddrTypes)[0] = 0; // Type 0 is for pubc address, type 1 is for static random
-    (*BDAddrs)[0] = new uint8_t[6];
-    (*IRKs)[0]    = new uint8_t[16];
-    memcpy((*IRKs)[0]   , device1IRK,16);
-    memcpy((*BDAddrs)[0], device1Mac, 6);
-
-
-    (*BDaddrTypes)[1] = 0;
-    (*BDAddrs)[1] = new uint8_t[6];
-    (*IRKs)[1]    = new uint8_t[16];
-    memcpy((*IRKs)[1]   , device2IRK,16);
-    memcpy((*BDAddrs)[1], device2Mac, 6);
-
-
-    return 1;
-  });
-  // The LTK is the secret key which is used to encrypt bluetooth traffic
-  BLE.setGetLTK([](uint8_t* address, uint8_t* LTK){
-    // address is input
-    Serial.print("Received request for address: ");
-    btct.printBytes(address,6);
-
-    // Set these to the MAC and LTK of your devices after bonding.
-    uint8_t device1Mac[6]  = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
-    uint8_t device1LTK[16] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
-    uint8_t device2Mac[6]  = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
-    uint8_t device2LTK[16] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
-
-
-    if(memcmp(device1Mac, address, 6) == 0) {
-      memcpy(LTK, device1LTK, 16);
-      return 1;
-    }else if(memcmp(device2Mac, address, 6) == 0) {
-      memcpy(LTK, device2LTK, 16);
-      return 1;
-    }
-    return 0;
-  });
-  BLE.setStoreIRK([](uint8_t* address, uint8_t* IRK){
-    Serial.print(F("New device with MAC : "));
-    btct.printBytes(address,6);
-    Serial.print(F("Need to store IRK   : "));
-    btct.printBytes(IRK,16);
-    return 1;
-  });
-  BLE.setStoreLTK([](uint8_t* address, uint8_t* LTK){
-    Serial.print(F("New device with MAC : "));
-    btct.printBytes(address,6);
-    Serial.print(F("Need to store LTK   : "));
-    btct.printBytes(LTK,16);
-    return 1;
-  });
-
-  while(1){
-    // begin initialization
-    if (!BLE.begin()) {
-      Serial.println("starting BLE failed!");
-      delay(200);
-      continue;
-    }
-    Serial.println("BT init");
-    delay(200);
-
-    /* Set a local name for the BLE device
-       This name will appear in advertising packets
-       and can be used by remote devices to identify this BLE device
-       The name can be changed but maybe be truncated based on space left in advertisement packet
-    */
-
-    BLE.setDeviceName("Arduino");
-    BLE.setLocalName("BatteryMonitor");
-
-    BLE.setAdvertisedService(batteryService); // add the service UUID
-    batteryService.addCharacteristic(batteryLevelChar); // add the battery level characteristic
-    batteryService.addCharacteristic(stringcharacteristic);
-    batteryService.addCharacteristic(secretValue);
-
-    BLE.addService(batteryService);               // Add the battery service
-    batteryLevelChar.writeValue(oldBatteryLevel); // set initial value for this characteristic
-    char* stringCharValue = new char[32];
-    stringCharValue = "string";
-    stringcharacteristic.writeValue(stringCharValue);
-    secretValue.writeValue(0);
-
-    delay(1000);
-
-    // prevent pairing until button is pressed (will show a pairing rejected message)
-    BLE.setPairable(false);
-
-    /* Start advertising BLE.  It will start continuously transmitting BLE
-       advertising packets and will be visible to remote BLE central devices
-       until it receives a new connection */
-
-    // start advertising
-    if(!BLE.advertise()){
-      Serial.println("failed to advertise bluetooth.");
-      BLE.stopAdvertise();
-      delay(500);
-    }else{
-      Serial.println("advertising...");
-      break;
-    }
-    BLE.end();
-    delay(100);
-  }
-}
-
-
-void loop() {
-  // wait for a BLE central
-  BLEDevice central = BLE.central();
-
-
-  // If button is pressed, allow pairing for 30 sec
-  if (!BLE.pairable() && digitalRead(PAIR_BUTTON) == LOW){
-    pairingStarted = millis();
-    BLE.setPairable(Pairable::ONCE);
-    Serial.println("Accepting pairing for 30 s");
-  } else if (BLE.pairable() && millis() > pairingStarted + PAIR_INTERVAL){
-    BLE.setPairable(false);
-    Serial.println("No longer accepting pairing");
-  }
-  // Make LED blink while pairing is allowed
-  digitalWrite(PAIR_LED, (BLE.pairable() ? (millis()%400)<200 : BLE.paired()) ? PAIR_LED_ON : !PAIR_LED_ON);
-
-
-  // if a central is connected to the peripheral:
-  if (central && central.connected()) {
-    if (!wasConnected){
-      wasConnected = true;
-      Serial.print("Connected to central: ");
-      // print the central's BT address:
-      Serial.println(central.address());
-    }
-
-    // check the battery level every 200ms
-    // while the central is connected:
-    long currentMillis = millis();
-    // if 200ms have passed, check the battery level:
-    if (currentMillis - previousMillis >= 1000) {
-      previousMillis = currentMillis;
-      updateBatteryLevel();
-      digitalWrite(CTRL_LED, secretValue.value()>0 ? HIGH : LOW);
-    }
-  } else if (wasConnected){
-    wasConnected = false;
-    Serial.print("Disconnected from central: ");
-    Serial.println(central.address());
-  }
-
-}
-
-void updateBatteryLevel() {
-  /* Read the current voltage level on the A0 analog input pin.
-     This is used here to simulate the charge level of a battery.
-  */
-  int battery = analogRead(A0);
-  int batteryLevel = map(battery, 0, 1023, 0, 100);
-
-  if (batteryLevel != oldBatteryLevel) {      // if the battery level has changed
-    // Serial.print("Battery Level % is now: "); // print it
-    // Serial.println(batteryLevel);
-    batteryLevelChar.writeValue(batteryLevel);  // and update the battery level characteristic
-    oldBatteryLevel = batteryLevel;           // save the level for next comparison
-  }
-}
\ No newline at end of file
diff --git a/examples/Peripheral/LED/LED.ino b/examples/Peripheral/LED/LED.ino
index 65b88605..7223365f 100644
--- a/examples/Peripheral/LED/LED.ino
+++ b/examples/Peripheral/LED/LED.ino
@@ -5,8 +5,7 @@
   characteristic to control an LED.
 
   The circuit:
-  - Arduino MKR WiFi 1010, Arduino Uno WiFi Rev2 board, Arduino Nano 33 IoT,
-    Arduino Nano 33 BLE, or Arduino Nano 33 BLE Sense board.
+  - Board with supported BLE modules.
 
   You can use a generic Bluetooth® Low Energy central app, like LightBlue (iOS and Android) or
   nRF Connect (Android), to interact with the services and characteristics
@@ -15,7 +14,7 @@
   This example code is in the public domain.
 */
 
-#include <ArduinoBLE.h>
+#include <STM32duinoBLE.h>
 
 BLEService ledService("19B10000-E8F2-537E-4F6C-D104768A1214"); // Bluetooth® Low Energy LED Service
 
diff --git a/extras/STM32_WPAN/0001-chore-adapt-STM32_WPAN-sources.patch b/extras/STM32_WPAN/0001-chore-adapt-STM32_WPAN-sources.patch
new file mode 100644
index 00000000..a3f62011
--- /dev/null
+++ b/extras/STM32_WPAN/0001-chore-adapt-STM32_WPAN-sources.patch
@@ -0,0 +1,310 @@
+From 7f99c89e8a6f834daf4a76bf98307e9ebcd01c91 Mon Sep 17 00:00:00 2001
+From: Frederic Pillon <frederic.pillon@st.com>
+Date: Wed, 10 Jan 2024 18:16:01 +0100
+Subject: [PATCH 1/4] chore: adapt STM32_WPAN sources
+
+Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
+---
+ src/utility/STM32_WPAN/app_conf_default.h | 49 +++++++++++++++++++----
+ src/utility/STM32_WPAN/hw.h               | 13 +++++-
+ src/utility/STM32_WPAN/hw_ipcc.c          |  4 +-
+ src/utility/STM32_WPAN/shci.c             |  2 +
+ src/utility/STM32_WPAN/shci_tl.c          | 17 ++++++++
+ src/utility/STM32_WPAN/stm_list.c         |  6 ++-
+ src/utility/STM32_WPAN/tl_mbox.c          |  6 +++
+ 7 files changed, 85 insertions(+), 12 deletions(-)
+
+diff --git a/src/utility/STM32_WPAN/app_conf_default.h b/src/utility/STM32_WPAN/app_conf_default.h
+index 71fc107..bf2274a 100644
+--- a/src/utility/STM32_WPAN/app_conf_default.h
++++ b/src/utility/STM32_WPAN/app_conf_default.h
+@@ -1,9 +1,9 @@
+ /* USER CODE BEGIN Header */
+ /**
+   ******************************************************************************
+-  * @file    app_conf.h
++  * @file    app_conf_default.h
+   * @author  MCD Application Team
+-  * @brief   Application configuration file for STM32WPAN Middleware.
++  * @brief   Default application configuration file for STM32WPAN Middleware.
+   ******************************************************************************
+   * @attention
+   *
+@@ -19,18 +19,40 @@
+ /* USER CODE END Header */
+ 
+ /* Define to prevent recursive inclusion -------------------------------------*/
+-#ifndef APP_CONF_H
+-#define APP_CONF_H
++#ifndef APP_CONF_DEFAULT_H
++#define APP_CONF_DEFAULT_H
+ 
++#if 0
+ #include "hw.h"
+ #include "hw_conf.h"
+ #include "hw_if.h"
+ #include "ble_bufsize.h"
++#endif
+ 
+ /******************************************************************************
+  * Application Config
+  ******************************************************************************/
+ 
++/**< generic parameters ******************************************************/
++/* HCI related defines */
++
++#define ACI_HAL_SET_TX_POWER_LEVEL 0xFC0F
++#define ACI_WRITE_CONFIG_DATA_OPCODE 0xFC0C
++#define ACI_READ_CONFIG_DATA_OPCODE 0xFC0D
++#define MAX_HCI_ACL_PACKET_SIZE (sizeof(TL_PacketHeader_t) + 5 + 251)
++#define HCI_RESET 0x0C03
++
++#ifndef BLE_SHARED_MEM_BYTE_ORDER
++  #define BLE_SHARED_MEM_BYTE_ORDER  MSBFIRST
++#endif
++#define BLE_MODULE_SHARED_MEM_BUFFER_SIZE 128
++
++/**
++ * Define Tx Power
++ */
++#define CFG_TX_POWER                      (0x18) /* -0.15dBm */
++
++#if 0
+ /**
+  * Define Secure Connections Support
+  */
+@@ -104,6 +126,7 @@
+ #define CFG_FW_SUBVERSION         (1)
+ #define CFG_FW_BRANCH             (0)
+ #define CFG_FW_BUILD              (0)
++#endif
+ 
+ /******************************************************************************
+  * BLE Stack
+@@ -250,7 +273,7 @@
+  *          0: LE Power Class 2-3
+  * other bits: complete with Options_extension flag
+  */
+-#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)
++#define CFG_BLE_OPTIONS  (SHCI_C2_BLE_INIT_OPTIONS_LL_ONLY | 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)
+ 
+ /**
+  * BLE stack Options_extension flags to be configured with:
+@@ -292,7 +315,11 @@
+  * 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)
++#if defined(STM32WB15xx)
++  #define CFG_BLE_MAX_ADV_SET_NBR     (3)
++#else
++  #define CFG_BLE_MAX_ADV_SET_NBR     (8)
++#endif
+ 
+  /* Maximum advertising data length (in bytes)
+  * Range: 31 .. 1650 with limitation:
+@@ -301,7 +328,11 @@
+  * 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)
++#if defined(STM32WB15xx)
++  #define CFG_BLE_MAX_ADV_DATA_LEN    (414)
++#else
++  #define CFG_BLE_MAX_ADV_DATA_LEN    (207)
++#endif
+ 
+  /* RF TX Path Compensation Value (16-bit signed integer). Units: 0.1 dB.
+   * Range: -1280 .. 1280
+@@ -324,6 +355,7 @@
+ 
+ #define CFG_BLE_CORE_VERSION   (SHCI_C2_BLE_INIT_BLE_CORE_5_4)
+ 
++#if 0
+ /******************************************************************************
+  * Transport Layer
+  ******************************************************************************/
+@@ -660,4 +692,5 @@ typedef enum
+ 
+ #define CFG_OTP_END_ADRESS      OTP_AREA_END_ADDR
+ 
+-#endif /*APP_CONF_H */
++#endif
++#endif /*APP_CONF_DEFAULT_H */
+diff --git a/src/utility/STM32_WPAN/hw.h b/src/utility/STM32_WPAN/hw.h
+index 651e1f1..1472a5e 100644
+--- a/src/utility/STM32_WPAN/hw.h
++++ b/src/utility/STM32_WPAN/hw.h
+@@ -26,14 +26,23 @@ extern "C" {
+ #endif
+ 
+   /* Includes ------------------------------------------------------------------*/
++#include "stm32_def.h"
++#include "stm32wbxx_ll_bus.h"
++#include "stm32wbxx_ll_exti.h"
++#include "stm32wbxx_ll_system.h"
++#include "stm32wbxx_ll_rcc.h"
++#include "stm32wbxx_ll_ipcc.h"
++#include "stm32wbxx_ll_cortex.h"
++#include "stm32wbxx_ll_utils.h"
++#include "stm32wbxx_ll_pwr.h"
+ 
+   /******************************************************************************
+    * HW IPCC
+    ******************************************************************************/
+   void HW_IPCC_Enable( void );
+   void HW_IPCC_Init( void );
+-  void HW_IPCC_Rx_Handler( void );
+-  void HW_IPCC_Tx_Handler( void );
++#define HW_IPCC_Rx_Handler IPCC_C1_RX_IRQHandler
++#define HW_IPCC_Tx_Handler IPCC_C1_TX_IRQHandler
+ 
+   void HW_IPCC_BLE_Init( void );
+   void HW_IPCC_BLE_SendCmd( void );
+diff --git a/src/utility/STM32_WPAN/hw_ipcc.c b/src/utility/STM32_WPAN/hw_ipcc.c
+index 6a311b1..ad3c9d4 100644
+--- a/src/utility/STM32_WPAN/hw_ipcc.c
++++ b/src/utility/STM32_WPAN/hw_ipcc.c
+@@ -18,8 +18,9 @@
+   */
+ /* USER CODE END Header */
+ 
++#if defined(STM32WBxx)
+ /* Includes ------------------------------------------------------------------*/
+-#include "app_common.h"
++#include "hw.h"
+ #include "mbox_def.h"
+ #include "utilities_conf.h"
+ 
+@@ -745,3 +746,4 @@ static void HW_IPCC_TRACES_EvtHandler( void )
+ }
+ 
+ __weak void HW_IPCC_TRACES_EvtNot( void ){};
++#endif /* STM32WBxx */
+diff --git a/src/utility/STM32_WPAN/shci.c b/src/utility/STM32_WPAN/shci.c
+index 5c32555..40110f4 100644
+--- a/src/utility/STM32_WPAN/shci.c
++++ b/src/utility/STM32_WPAN/shci.c
+@@ -17,6 +17,7 @@
+  */
+ 
+ 
++#if defined(STM32WBxx)
+ /* Includes ------------------------------------------------------------------*/
+ #include "stm32_wpan_common.h"
+ 
+@@ -759,3 +760,4 @@ SHCI_CmdStatus_t SHCI_GetWirelessFwInfo( WirelessFwInfo_t* pWirelessInfo )
+ 
+   return (SHCI_Success);
+ }
++#endif /* STM32WBxx */
+diff --git a/src/utility/STM32_WPAN/shci_tl.c b/src/utility/STM32_WPAN/shci_tl.c
+index 0f60430..daa988c 100644
+--- a/src/utility/STM32_WPAN/shci_tl.c
++++ b/src/utility/STM32_WPAN/shci_tl.c
+@@ -17,11 +17,13 @@
+  */
+ 
+ 
++#if defined(STM32WBxx)
+ /* Includes ------------------------------------------------------------------*/
+ #include "stm32_wpan_common.h"
+ 
+ #include "stm_list.h"
+ #include "shci_tl.h"
++#include "stm32_def.h"
+ 
+ /* Private typedef -----------------------------------------------------------*/
+ typedef enum
+@@ -168,6 +170,20 @@ void shci_send( uint16_t cmd_code, uint8_t len_cmd_payload, uint8_t * p_cmd_payl
+   return;
+ }
+ 
++void shci_notify_asynch_evt(void *pdata)
++{
++  UNUSED(pdata);
++  /* Need to parse data in future version */
++  shci_user_evt_proc();
++}
++
++void shci_register_io_bus(tSHciIO *fops)
++{
++  /* Register IO bus services */
++  fops->Init    = TL_SYS_Init;
++  fops->Send    = TL_SYS_SendCmd;
++}
++
+ /* Private functions ---------------------------------------------------------*/
+ static void TlInit( TL_CmdPacket_t * p_cmdbuffer )
+ {
+@@ -250,3 +266,4 @@ __WEAK void shci_cmd_resp_release(uint32_t flag)
+ 
+   return;
+ }
++#endif /* STM32WBxx */
+diff --git a/src/utility/STM32_WPAN/stm_list.c b/src/utility/STM32_WPAN/stm_list.c
+index 4c92864..df6c215 100644
+--- a/src/utility/STM32_WPAN/stm_list.c
++++ b/src/utility/STM32_WPAN/stm_list.c
+@@ -17,10 +17,13 @@
+   */
+ 
+ 
++#if defined(STM32WBxx)
+ /******************************************************************************
+  * Include Files
+  ******************************************************************************/
+-#include "utilities_common.h"
++#include "stdint.h"
++#include "cmsis_gcc.h"
++#include "stm32_wpan_common.h"
+ 
+ #include "stm_list.h"
+ 
+@@ -204,3 +207,4 @@ void LST_get_prev_node (tListNode * ref_node, tListNode ** node)
+ 
+   __set_PRIMASK(primask_bit);      /**< Restore PRIMASK bit*/
+ }
++#endif /* STM32WBxx */
+diff --git a/src/utility/STM32_WPAN/tl_mbox.c b/src/utility/STM32_WPAN/tl_mbox.c
+index df07a19..9a2a297 100644
+--- a/src/utility/STM32_WPAN/tl_mbox.c
++++ b/src/utility/STM32_WPAN/tl_mbox.c
+@@ -16,6 +16,7 @@
+  ******************************************************************************
+  */
+ 
++#if defined(STM32WBxx)
+ /* Includes ------------------------------------------------------------------*/
+ #include "stm32_wpan_common.h"
+ #include "hw.h"
+@@ -51,8 +52,10 @@ PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_BleLldTable_t TL_BleLldTable;
+ PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_SysTable_t TL_SysTable;
+ PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_MemManagerTable_t TL_MemManagerTable;
+ PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_TracesTable_t TL_TracesTable;
++#if 0
+ PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_Mac_802_15_4_t TL_Mac_802_15_4_Table;
+ PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_ZigbeeTable_t TL_Zigbee_Table;
++#endif
+ 
+ /**< tables */
+ PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static tListNode  FreeBufQueue;
+@@ -97,8 +100,10 @@ void TL_Init( void )
+   TL_RefTable.p_sys_table = &TL_SysTable;
+   TL_RefTable.p_mem_manager_table = &TL_MemManagerTable;
+   TL_RefTable.p_traces_table = &TL_TracesTable;
++#if 0
+   TL_RefTable.p_mac_802_15_4_table = &TL_Mac_802_15_4_Table;
+   TL_RefTable.p_zigbee_table = &TL_Zigbee_Table;
++#endif
+   HW_IPCC_Init();
+ 
+   return;
+@@ -847,3 +852,4 @@ static void OutputDbgTrace(TL_MB_PacketType_t packet_type, uint8_t* buffer)
+ 
+   return;
+ }
++#endif /* STM32WBxx */
+-- 
+2.34.1
+
diff --git a/extras/STM32_WPAN/0002-fix-include-a-timeout-when-waiting-for-the-cmd_resp.patch b/extras/STM32_WPAN/0002-fix-include-a-timeout-when-waiting-for-the-cmd_resp.patch
new file mode 100644
index 00000000..bd6f66a2
--- /dev/null
+++ b/extras/STM32_WPAN/0002-fix-include-a-timeout-when-waiting-for-the-cmd_resp.patch
@@ -0,0 +1,41 @@
+From a33328182e334e1ddedd368a047d75cf1662e330 Mon Sep 17 00:00:00 2001
+From: Frederic Pillon <frederic.pillon@st.com>
+Date: Thu, 13 Jul 2023 17:16:40 +0200
+Subject: [PATCH 2/4] fix: include a timeout when waiting for the cmd_resp
+
+Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
+---
+ src/utility/STM32_WPAN/shci_tl.c | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/src/utility/STM32_WPAN/shci_tl.c b/src/utility/STM32_WPAN/shci_tl.c
+index daa988c..25e1a21 100644
+--- a/src/utility/STM32_WPAN/shci_tl.c
++++ b/src/utility/STM32_WPAN/shci_tl.c
+@@ -24,6 +24,7 @@
+ #include "stm_list.h"
+ #include "shci_tl.h"
+ #include "stm32_def.h"
++#include "wiring_time.h"
+ 
+ /* Private typedef -----------------------------------------------------------*/
+ typedef enum
+@@ -251,10 +252,11 @@ static void TlUserEvtReceived(TL_EvtPacket_t *shcievt)
+ /* Weak implementation ----------------------------------------------------------------*/
+ __WEAK void shci_cmd_resp_wait(uint32_t timeout)
+ {
+-  (void)timeout;
+-
+-  while(CmdRspStatusFlag != SHCI_TL_CMD_RESP_RELEASE);
+-
++  for (unsigned long start = millis(); (millis() - start) < timeout;) {
++    if (CmdRspStatusFlag == SHCI_TL_CMD_RESP_RELEASE) {
++      break;
++    }
++  }
+   return;
+ }
+ 
+-- 
+2.34.1
+
diff --git a/extras/STM32_WPAN/0003-chore-add-support-for-customize-app_conf_default.h.patch b/extras/STM32_WPAN/0003-chore-add-support-for-customize-app_conf_default.h.patch
new file mode 100644
index 00000000..3c5e66ae
--- /dev/null
+++ b/extras/STM32_WPAN/0003-chore-add-support-for-customize-app_conf_default.h.patch
@@ -0,0 +1,135 @@
+From a973b405bf34a93b0c300c8bbc4aa5d59fa182e5 Mon Sep 17 00:00:00 2001
+From: Frederic Pillon <frederic.pillon@st.com>
+Date: Wed, 10 Jan 2024 18:45:17 +0100
+Subject: [PATCH 3/4] chore: add support for customize app_conf_default.h
+
+Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
+---
+ src/utility/STM32_WPAN/app_conf_default.h | 58 ++++++++++++++++++-----
+ 1 file changed, 45 insertions(+), 13 deletions(-)
+
+diff --git a/src/utility/STM32_WPAN/app_conf_default.h b/src/utility/STM32_WPAN/app_conf_default.h
+index bf2274a..ff2dc01 100644
+--- a/src/utility/STM32_WPAN/app_conf_default.h
++++ b/src/utility/STM32_WPAN/app_conf_default.h
+@@ -50,7 +50,9 @@
+ /**
+  * Define Tx Power
+  */
+-#define CFG_TX_POWER                      (0x18) /* -0.15dBm */
++#ifndef CFG_TX_POWER
++  #define CFG_TX_POWER                        (0x18) /* -0.15dBm */
++#endif
+ 
+ #if 0
+ /**
+@@ -135,13 +137,25 @@
+  * Maximum number of simultaneous connections that the device will support.
+  * Valid values are from 1 to 8
+  */
+-#define CFG_BLE_NUM_LINK            8
++#ifndef CFG_BLE_NUM_LINK
++#ifdef STM32WB15xx
++  #define CFG_BLE_NUM_LINK            3
++#else
++  #define CFG_BLE_NUM_LINK            8
++#endif
++#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
+  */
+-#define CFG_BLE_NUM_GATT_SERVICES   8
++#ifndef CFG_BLE_NUM_GATT_SERVICES
++#ifdef STM32WB15xx
++  #define CFG_BLE_NUM_GATT_SERVICES   4
++#else
++  #define CFG_BLE_NUM_GATT_SERVICES   8
++#endif
++#endif
+ 
+ /**
+  * Maximum number of Attributes
+@@ -150,7 +164,13 @@
+  * Note that certain characteristics and relative descriptors are added automatically during device initialization
+  * so this parameters should be 9 plus the number of user Attributes
+  */
+-#define CFG_BLE_NUM_GATT_ATTRIBUTES 68
++#ifndef CFG_BLE_NUM_GATT_ATTRIBUTES
++#ifdef STM32WB15xx
++  #define CFG_BLE_NUM_GATT_ATTRIBUTES 30
++#else
++  #define CFG_BLE_NUM_GATT_ATTRIBUTES 68
++#endif
++#endif
+ 
+ /**
+  * Maximum supported ATT_MTU size
+@@ -186,12 +206,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 Peripheral mode (ppm value)
+  */
+-#define CFG_BLE_PERIPHERAL_SCA   500
++#ifndef CFG_BLE_PERIPHERAL_SCA
++  #define CFG_BLE_PERIPHERAL_SCA   500
++#endif
+ 
+ /**
+  * Sleep clock accuracy in Central mode
+@@ -204,7 +228,9 @@
+  * 6 : 21 ppm to 30 ppm
+  * 7 : 0 ppm to 20 ppm
+  */
+-#define CFG_BLE_CENTRAL_SCA   0
++#ifndef CFG_BLE_CENTRAL_SCA
++  #define CFG_BLE_CENTRAL_SCA   0
++#endif
+ 
+ /**
+  * LsSource
+@@ -213,21 +239,27 @@
+  * - 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
+  */
+-#if defined(STM32WB5Mxx)
+-  #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_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)
++#ifndef CFG_BLE_LS_SOURCE
++  #if defined(STM32WB5Mxx)
++    #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_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)
+  */
+-#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 Peripheral 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
+-- 
+2.34.1
+
diff --git a/extras/STM32_WPAN/0004-fix-TL_Evt_t-payload-size-for-reset.patch b/extras/STM32_WPAN/0004-fix-TL_Evt_t-payload-size-for-reset.patch
new file mode 100644
index 00000000..110a8410
--- /dev/null
+++ b/extras/STM32_WPAN/0004-fix-TL_Evt_t-payload-size-for-reset.patch
@@ -0,0 +1,30 @@
+From 324eef795bfd0a754aae4d5f9b528d4c8ad706c8 Mon Sep 17 00:00:00 2001
+From: Frederic Pillon <frederic.pillon@st.com>
+Date: Mon, 24 Jul 2023 10:55:20 +0200
+Subject: [PATCH 4/4] fix: TL_Evt_t payload size for reset
+
+Within STM32CubeWB v1.17.0 update TL_Evt_t payload size was reduced.
+This produce a warning -Warray-bounds due to the reset management
+which require 4 bytes.
+
+Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
+---
+ src/utility/STM32_WPAN/tl.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/utility/STM32_WPAN/tl.h b/src/utility/STM32_WPAN/tl.h
+index 8e8c6cb..7452087 100644
+--- a/src/utility/STM32_WPAN/tl.h
++++ b/src/utility/STM32_WPAN/tl.h
+@@ -108,7 +108,7 @@ typedef PACKED_STRUCT
+ {
+   uint8_t   evtcode;
+   uint8_t   plen;
+-  uint8_t   payload[2];
++  uint8_t   payload[4];
+ } TL_Evt_t;
+ 
+ typedef PACKED_STRUCT
+-- 
+2.34.1
+
diff --git a/extras/arduino-ble-parser.py b/extras/arduino-ble-parser.py
deleted file mode 100644
index 8f678711..00000000
--- a/extras/arduino-ble-parser.py
+++ /dev/null
@@ -1,85 +0,0 @@
-'''
-Convert ArduinoBLE debug files into Btsnoop files ready to be analyzed using wireshark or hcidump
-Btsnoop file format reference
- https://www.fte.com/WebHelpII/Sodera/Content/Technical_Information/BT_Snoop_File_Format.htm
-'''
-
-import  os
-import argparse
-
-DEBUG = False
-
-parser = argparse.ArgumentParser()
-parser.add_argument('-i', dest='inputPath', type=str, required=True, help='input file containing debug log')
-parser.add_argument('-o', dest='outputPath', type=str, required=True, help='result file that will contain the btsnoop encoded debug file')
-args = parser.parse_args()
-
-# Extract only hci debug messages
-def extractHCIDebugPrint(inputPath, outputPath):
-  inputFile = open(inputPath, 'r')
-  outputFile = open(outputPath, 'w')
-  for inputLine in inputFile:
-    lineItems = inputLine.split()
-    if (len(lineItems) < 7) or (lineItems[1] != "->") or (lineItems[2] != "HCI"):
-      if (len(lineItems) < 4) or (lineItems[0] != "HCI") or ((lineItems[3] != "<-") and (lineItems[3] != "->")):
-        continue
-    outputFile.write(inputLine)  
-  outputFile.close()
-
-# Return packet in btsnoop format
-def buildBinaryPacket(hciMessage, hciDirection, hciType):
-  commandFlag = 1 if (hciType == "COMMAND" or hciType == "EVENT") else 0
-  directionFlag =  0 if (hciDirection == "TX") else 1
-  flagHex = ("0" * 7) + str((commandFlag * 2) + directionFlag)
-  timestampHex = "0" * 16
-  packetDropHex = "0" * 8
-  dataLengthHex = format( (int(len(hciMessage) / 2)), 'x')
-  packetLengthHex = ("0" * (8 - len(dataLengthHex))) + dataLengthHex
-  binaryPacket = bytearray.fromhex(packetLengthHex + packetLengthHex + flagHex + packetDropHex + timestampHex + hciMessage)
-  if DEBUG:
-    print(len(hciMessage))
-    print(dataLengthHex)
-    print(packetLengthHex)
-    print(flagHex)
-    print('\n')
-  return binaryPacket
-
-def buildBinaryHeader():
-  defaultHeader = "6274736e6f6f700000000001000003ea"
-  binaryHeader = bytearray.fromhex(defaultHeader)
-  return binaryHeader
-
-def convertToBtsnoop(inputPath, outputPath):
-  # Open output file and write the Btsnoop header
-  outputFile = open(outputPath,'wb')
-  header = buildBinaryHeader()
-  outputFile.write(header)
-
-  # Open input file containing HCI debug packets
-  inputFile = open(inputPath, 'r')
-  for inputLine in inputFile:
-    lineItems = inputLine.split()
-    # For a safer script, do not use indexes but look for symbols in the line
-    baseIndex = lineItems.index("HCI")
-    hciMessage = lineItems[baseIndex + 4]
-    hciDirection = lineItems[baseIndex + 2]
-    hciType = lineItems[baseIndex + 1]
-    # Build and write the encoded line
-    btsnoopPacket = buildBinaryPacket(hciMessage, hciDirection, hciType)
-    outputFile.write(btsnoopPacket)
-    if DEBUG:
-      print(hciDirection)
-      print(hciMessage)
-      print(hciType)
-      print('\n')
-  outputFile.close()
-
-inputPath = args.inputPath
-outputPath = args.outputPath
-tempFile = "temp-debug-print.txt"
-# Run
-extractHCIDebugPrint(inputPath,tempFile)
-convertToBtsnoop(tempFile, outputPath)
-# Delete temp file
-os.remove(tempFile) 
-
diff --git a/extras/test/.gitignore b/extras/test/.gitignore
deleted file mode 100644
index 7e9215ee..00000000
--- a/extras/test/.gitignore
+++ /dev/null
@@ -1,17 +0,0 @@
-build
-### CMake ###
-CMakeLists.txt.user
-CMakeCache.txt
-CMakeFiles
-CMakeScripts
-Testing
-Makefile
-cmake_install.cmake
-install_manifest.txt
-compile_commands.json
-CTestTestfile.cmake
-_deps
-
-### CMake Patch ###
-# External projects
-*-prefix/
\ No newline at end of file
diff --git a/extras/test/CMakeLists.txt b/extras/test/CMakeLists.txt
deleted file mode 100644
index 5e66e18b..00000000
--- a/extras/test/CMakeLists.txt
+++ /dev/null
@@ -1,164 +0,0 @@
-##########################################################################
-
-set(CMAKE_VERBOSE_MAKEFILE ON)
-cmake_minimum_required(VERSION 3.5)
-
-##########################################################################
-
-project(testArduinoBLE)
-
-Include(FetchContent)
-
-FetchContent_Declare(
-  Catch2
-  GIT_REPOSITORY https://github.com/catchorg/Catch2.git
-  GIT_TAG        v3.4.0
-)
-
-FetchContent_MakeAvailable(Catch2)
-
-##########################################################################
-
-set(CMAKE_CXX_STANDARD 11)
-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
-
-##########################################################################
-
-set(COMMON_TEST_SRCS
-  src/test_main.cpp
-  src/Arduino.cpp
-  src/util/itoa.c
-  src/util/TestUtil.cpp
-  src/util/String.cpp
-  src/util/Common.cpp
-)
-
-set(DUT_SRCS
-  ../../src/utility/BLEUuid.cpp
-  ../../src/BLEDevice.cpp
-  ../../src/BLECharacteristic.cpp
-  ../../src/BLEDescriptor.cpp
-  ../../src/BLEService.cpp
-  ../../src/BLEAdvertisingData.cpp
-  ../../src/utility/ATT.cpp
-  ../../src/utility/GAP.cpp
-  ../../src/utility/HCI.cpp
-  ../../src/utility/GATT.cpp
-  ../../src/utility/L2CAPSignaling.cpp
-  ../../src/utility/keyDistribution.cpp
-  ../../src/utility/bitDescriptions.cpp
-  ../../src/utility/btct.cpp
-  ../../src/local/BLELocalAttribute.cpp
-  ../../src/local/BLELocalCharacteristic.cpp
-  ../../src/local/BLELocalDescriptor.cpp
-  ../../src/local/BLELocalDevice.cpp
-  ../../src/local/BLELocalService.cpp
-  ../../src/remote/BLERemoteAttribute.cpp
-  ../../src/remote/BLERemoteCharacteristic.cpp
-  ../../src/remote/BLERemoteDescriptor.cpp
-  ../../src/remote/BLERemoteDevice.cpp
-  ../../src/remote/BLERemoteService.cpp
-  ../../src/BLEStringCharacteristic.cpp
-  ../../src/BLETypedCharacteristics.cpp
-)
-
-set(TEST_TARGET_UUID_SRCS
-  # Test files
-  ${COMMON_TEST_SRCS}
-  src/test_uuid/test_uuid.cpp
-  # DUT files
-  #${DUT_SRCS}
-  ../../src/utility/BLEUuid.cpp
-)
-
-set(TEST_TARGET_DISC_DEVICE_SRCS
-  # Test files
-  ${COMMON_TEST_SRCS}
-  src/test_discovered_device/test_discovered_device.cpp
-  # DUT files
-  ${DUT_SRCS}
-  # Fake classes files
-  src/util/HCIFakeTransport.cpp
-  src/test_discovered_device/FakeGAP.cpp
-)
-
-set(TEST_TARGET_ADVERTISING_DATA_SRCS
-  # Test files
-  ${COMMON_TEST_SRCS}
-  src/test_advertising_data/test_advertising_data.cpp
-  src/test_advertising_data/test_service.cpp
-  src/test_advertising_data/test_local_name.cpp
-  src/test_advertising_data/test_manufacturer.cpp
-  # DUT files
-  ${DUT_SRCS}
-  # Fake classes files
-  src/util/HCIFakeTransport.cpp
-  src/test_advertising_data/FakeBLELocalDevice.cpp
-)
-
-set(TEST_TARGET_CHARACTERISTIC_SRCS
-  # Test files
-  ${COMMON_TEST_SRCS}
-  src/test_characteristic/test_permissions.cpp
-  src/test_characteristic/test_writeValue.cpp
-  # DUT files
-  ${DUT_SRCS}
-  # Fake classes files
-  src/util/HCIFakeTransport.cpp
-  src/test_advertising_data/FakeBLELocalDevice.cpp
-)
-
-##########################################################################
-
-set(CMAKE_C_FLAGS   ${CMAKE_C_FLAGS}   "--coverage")
-set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "--coverage")
-
-##########################################################################
-
-add_executable(TEST_TARGET_UUID ${TEST_TARGET_UUID_SRCS})
-add_executable(TEST_TARGET_DISC_DEVICE ${TEST_TARGET_DISC_DEVICE_SRCS})
-add_executable(TEST_TARGET_ADVERTISING_DATA ${TEST_TARGET_ADVERTISING_DATA_SRCS})
-add_executable(TEST_TARGET_CHARACTERISTIC_DATA ${TEST_TARGET_CHARACTERISTIC_SRCS})
-
-##########################################################################
-
-include_directories(include)
-include_directories(include/util)
-include_directories(../../src)
-include_directories(../../src/local)
-include_directories(../../src/remote)
-include_directories(../../src/utility)
-
-target_include_directories(TEST_TARGET_DISC_DEVICE PUBLIC include/test_discovered_device)
-target_include_directories(TEST_TARGET_ADVERTISING_DATA PUBLIC include/test_advertising_data)
-target_include_directories(TEST_TARGET_CHARACTERISTIC_DATA PUBLIC include/test_advertising_data)
-
-##########################################################################
-
-target_compile_definitions(TEST_TARGET_DISC_DEVICE PUBLIC FAKE_GAP)
-target_compile_definitions(TEST_TARGET_ADVERTISING_DATA PUBLIC FAKE_BLELOCALDEVICE)
-target_compile_definitions(TEST_TARGET_CHARACTERISTIC_DATA PUBLIC FAKE_BLELOCALDEVICE)
-
-##########################################################################
-
-# Build unit tests as a post build step
-add_custom_command(TARGET TEST_TARGET_UUID POST_BUILD
-  COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/TEST_TARGET_UUID
-)
-add_custom_command(TARGET TEST_TARGET_DISC_DEVICE POST_BUILD
-  COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/TEST_TARGET_DISC_DEVICE
-)
-add_custom_command(TARGET TEST_TARGET_ADVERTISING_DATA POST_BUILD
-  COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/TEST_TARGET_ADVERTISING_DATA
-)
-
-add_custom_command(TARGET TEST_TARGET_CHARACTERISTIC_DATA POST_BUILD
-  COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/TEST_TARGET_CHARACTERISTIC_DATA
-)
-
-##########################################################################
-
-target_link_libraries( TEST_TARGET_UUID Catch2WithMain )
-target_link_libraries( TEST_TARGET_DISC_DEVICE Catch2WithMain )
-target_link_libraries( TEST_TARGET_ADVERTISING_DATA Catch2WithMain )
-target_link_libraries( TEST_TARGET_CHARACTERISTIC_DATA Catch2WithMain )
diff --git a/extras/test/include/Arduino.h b/extras/test/include/Arduino.h
deleted file mode 100644
index 38f45554..00000000
--- a/extras/test/include/Arduino.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
-  This file is part of the ArduinoBLE library.
-  Copyright (c) 2018 Arduino SA. All rights reserved.
-
-  This library is free software; you can redistribute it and/or
-  modify it under the terms of the GNU Lesser General Public
-  License as published by the Free Software Foundation; either
-  version 2.1 of the License, or (at your option) any later version.
-
-  This library is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  Lesser General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public
-  License along with this library; if not, write to the Free Software
-  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-#ifndef TEST_ARDUINO_H_
-#define TEST_ARDUINO_H_
-
-/******************************************************************************
-   INCLUDE
- ******************************************************************************/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include "String.h"
-#include "Stream.h"
-#include "itoa.h"
-#include "Common.h"
-
-/******************************************************************************
-   TYPEDEF
- ******************************************************************************/
-
-typedef arduino::String String;
-typedef bool boolean;
-
-#if defined(__cplusplus)
-
-#undef F
-// C++11 F replacement declaration
-template <typename T1>
-auto F(T1&& A)
-  -> const arduino::__FlashStringHelper*
-{
-  return (const arduino::__FlashStringHelper*)A;
-}
-
-#endif
-
-/******************************************************************************
-   FUNCTION PROTOTYPES
- ******************************************************************************/
-
-#endif /* TEST_ARDUINO_H_ */
diff --git a/extras/test/include/test_advertising_data/FakeBLELocalDevice.h b/extras/test/include/test_advertising_data/FakeBLELocalDevice.h
deleted file mode 100644
index 94e97730..00000000
--- a/extras/test/include/test_advertising_data/FakeBLELocalDevice.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
-  This file is part of the ArduinoBLE library.
-  Copyright (c) 2018 Arduino SA. All rights reserved.
-
-  This library is free software; you can redistribute it and/or
-  modify it under the terms of the GNU Lesser General Public
-  License as published by the Free Software Foundation; either
-  version 2.1 of the License, or (at your option) any later version.
-
-  This library is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  Lesser General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public
-  License along with this library; if not, write to the Free Software
-  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-#ifndef _FAKE_BLELOCALDEVICE_H_
-#define _FAKE_BLELOCALDEVICE_H_
-
-#define private public
-#define protected public
-#include "BLELocalDevice.h"
-
-class FakeBLELocalDevice : public BLELocalDevice {
-  public:
-    FakeBLELocalDevice();
-    virtual ~FakeBLELocalDevice();
-    
-    int advertise();
-};
-
-#endif
diff --git a/extras/test/include/test_discovered_device/FakeGAP.h b/extras/test/include/test_discovered_device/FakeGAP.h
deleted file mode 100644
index 35b3233b..00000000
--- a/extras/test/include/test_discovered_device/FakeGAP.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
-  This file is part of the ArduinoBLE library.
-  Copyright (c) 2018 Arduino SA. All rights reserved.
-
-  This library is free software; you can redistribute it and/or
-  modify it under the terms of the GNU Lesser General Public
-  License as published by the Free Software Foundation; either
-  version 2.1 of the License, or (at your option) any later version.
-
-  This library is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  Lesser General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public
-  License along with this library; if not, write to the Free Software
-  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-#ifndef _FAKE_GAP_H_
-#define _FAKE_GAP_H_
-
-#define private public
-#define protected public
-#include "GAP.h"
-
-class FakeGAPClass : public GAPClass {
-  public:
-    FakeGAPClass();
-    virtual ~FakeGAPClass();
-};
-
-#endif
diff --git a/extras/test/include/util/Common.h b/extras/test/include/util/Common.h
deleted file mode 100644
index 8d288e18..00000000
--- a/extras/test/include/util/Common.h
+++ /dev/null
@@ -1,167 +0,0 @@
-#pragma once
-#include <stdint.h>
-
-#ifdef __cplusplus
-extern "C"{
-#endif
-
-void yield(void);
-
-typedef enum {
-  LOW     = 0,
-  HIGH    = 1,
-  CHANGE  = 2,
-  FALLING = 3,
-  RISING  = 4,
-} PinStatus;
-
-typedef enum {
-  INPUT           = 0x0,
-  OUTPUT          = 0x1,
-  INPUT_PULLUP    = 0x2,
-  INPUT_PULLDOWN  = 0x3,
-} PinMode;
-
-typedef enum {
-  LSBFIRST = 0,
-  MSBFIRST = 1,
-} BitOrder;
-
-#define PI          3.1415926535897932384626433832795
-#define HALF_PI     1.5707963267948966192313216916398
-#define TWO_PI      6.283185307179586476925286766559
-#define DEG_TO_RAD  0.017453292519943295769236907684886
-#define RAD_TO_DEG  57.295779513082320876798154814105
-#define EULER       2.718281828459045235360287471352
-
-#define SERIAL      0x0
-#define DISPLAY     0x1
-
-#ifndef constrain
-#define constrain(amt,low,high) ((amt)<(low)?(low):((amt)>(high)?(high):(amt)))
-#endif
-
-#ifndef radians
-#define radians(deg) ((deg)*DEG_TO_RAD)
-#endif
-
-#ifndef degrees
-#define degrees(rad) ((rad)*RAD_TO_DEG)
-#endif
-
-#ifndef sq
-#define sq(x) ((x)*(x))
-#endif
-
-typedef void (*voidFuncPtr)(void);
-typedef void (*voidFuncPtrParam)(void*);
-
-// interrupts() / noInterrupts() must be defined by the core
-
-#define lowByte(w) ((uint8_t) ((w) & 0xff))
-#define highByte(w) ((uint8_t) ((w) >> 8))
-
-#define bitRead(value, bit) (((value) >> (bit)) & 0x01)
-#define bitSet(value, bit) ((value) |= (1UL << (bit)))
-#define bitClear(value, bit) ((value) &= ~(1UL << (bit)))
-#define bitToggle(value, bit) ((value) ^= (1UL << (bit)))
-#define bitWrite(value, bit, bitvalue) (bitvalue ? bitSet(value, bit) : bitClear(value, bit))
-
-#ifndef bit
-#define bit(b) (1UL << (b))
-#endif
-
-/* TODO: request for removal */
-typedef bool      boolean;
-typedef uint8_t   byte;
-typedef uint16_t  word;
-
-void init(void);
-void initVariant(void);
-
-int atexit(void (*func)()) __attribute__((weak));
-int main() __attribute__((weak));
-
-#ifdef EXTENDED_PIN_MODE
-// Platforms who wnat to declare more than 256 pins need to define EXTENDED_PIN_MODE globally
-typedef uint32_t pin_size_t;
-#else
-typedef uint8_t pin_size_t;
-#endif
-
-void pinMode(pin_size_t pinNumber, PinMode pinMode);
-void digitalWrite(pin_size_t pinNumber, PinStatus status);
-PinStatus digitalRead(pin_size_t pinNumber);
-int analogRead(pin_size_t pinNumber);
-void analogReference(uint8_t mode);
-void analogWrite(pin_size_t pinNumber, int value);
-
-unsigned long millis(void);
-unsigned long micros(void);
-void delay(unsigned long);
-void delayMicroseconds(unsigned int us);
-unsigned long pulseIn(pin_size_t pin, uint8_t state, unsigned long timeout);
-unsigned long pulseInLong(pin_size_t pin, uint8_t state, unsigned long timeout);
-
-void shiftOut(pin_size_t dataPin, pin_size_t clockPin, BitOrder bitOrder, uint8_t val);
-pin_size_t shiftIn(pin_size_t dataPin, pin_size_t clockPin, BitOrder bitOrder);
-
-void attachInterrupt(pin_size_t interruptNumber, voidFuncPtr callback, PinStatus mode);
-void attachInterruptParam(pin_size_t interruptNumber, voidFuncPtrParam callback, PinStatus mode, void* param);
-void detachInterrupt(pin_size_t interruptNumber);
-
-void setup(void);
-void loop(void);
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#ifdef __cplusplus
-  template<class T, class L> 
-  auto min(const T& a, const L& b) -> decltype((b < a) ? b : a)
-  {
-    return (b < a) ? b : a;
-  }
-
-  template<class T, class L> 
-  auto max(const T& a, const L& b) -> decltype((b < a) ? b : a)
-  {
-    return (a < b) ? b : a;
-  }
-#else
-#ifndef min
-#define min(a,b) \
-   ({ __typeof__ (a) _a = (a); \
-       __typeof__ (b) _b = (b); \
-     _a < _b ? _a : _b; })
-#endif
-#ifndef max
-#define max(a,b) \
-   ({ __typeof__ (a) _a = (a); \
-       __typeof__ (b) _b = (b); \
-     _a > _b ? _a : _b; })
-#endif
-#endif
-
-#ifdef __cplusplus
-
-/* C++ prototypes */
-uint16_t makeWord(uint16_t w);
-uint16_t makeWord(byte h, byte l);
-
-#define word(...) makeWord(__VA_ARGS__)
-
-unsigned long pulseIn(uint8_t pin, uint8_t state, unsigned long timeout = 1000000L);
-unsigned long pulseInLong(uint8_t pin, uint8_t state, unsigned long timeout = 1000000L);
-
-void tone(uint8_t _pin, unsigned int frequency, unsigned long duration = 0);
-void noTone(uint8_t _pin);
-
-// WMath prototypes
-long random(long);
-long random(long, long);
-void randomSeed(unsigned long);
-long map(long, long, long, long, long);
-
-#endif // __cplusplus
diff --git a/extras/test/include/util/HCIFakeTransport.h b/extras/test/include/util/HCIFakeTransport.h
deleted file mode 100644
index 6c8ac08c..00000000
--- a/extras/test/include/util/HCIFakeTransport.h
+++ /dev/null
@@ -1,19 +0,0 @@
-//#include "Common.h"
-#pragma once
-
-#include "HCITransport.h"
-
-class HCIFakeTransportClass : public HCITransportInterface
-{
-public:
-    HCIFakeTransportClass() {};
-    ~HCIFakeTransportClass() {};
-
-    int begin() {return 0;}
-    void end() {return;}
-    void wait(unsigned long timeout) {return;}
-    int available() {return 0;}
-    int peek() {return 0;}
-    int read() {return 0;}
-    size_t write(const uint8_t* data, size_t length) {return 0;}
-};
\ No newline at end of file
diff --git a/extras/test/include/util/Stream.h b/extras/test/include/util/Stream.h
deleted file mode 100644
index f367e34c..00000000
--- a/extras/test/include/util/Stream.h
+++ /dev/null
@@ -1,40 +0,0 @@
-//#include "Common.h"
-#pragma once
-
-#define DEC 10
-#define HEX 16
-#define OCT 8
-#define BIN 2
-
-class Stream 
-{
-public:
-  Stream(const char *name = NULL);
-  ~Stream();
-
-  void flush() {}
-
-  size_t print(const char[]) { return 0; }
-  size_t print(char) { return 0; }
-  size_t print(unsigned char, int) { return 0; }
-  size_t print(int, int) { return 0; }
-  size_t print(unsigned int, int) { return 0; }
-  size_t print(long, int) { return 0; }
-  size_t print(unsigned long, int) { return 0; }
-  size_t print(long long, int) { return 0; }
-  size_t print(unsigned long long, int) { return 0; }
-  size_t print(double, int) { return 0; }
-  size_t print(void) { return 0; }
-
-  size_t println(const char[]) { return 0; }
-  size_t println(char) { return 0; }
-  size_t println(unsigned char, int) { return 0; }
-  size_t println(int, int) { return 0; }
-  size_t println(unsigned int, int) { return 0; }
-  size_t println(long, int) { return 0; }
-  size_t println(unsigned long, int) { return 0; }
-  size_t println(long long, int) { return 0; }
-  size_t println(unsigned long long, int) { return 0; }
-  size_t println(double, int) { return 0; }
-  size_t println(void) { return 0; }
-};
diff --git a/extras/test/include/util/String.h b/extras/test/include/util/String.h
deleted file mode 100644
index 3021a31e..00000000
--- a/extras/test/include/util/String.h
+++ /dev/null
@@ -1,248 +0,0 @@
-/*
-  String library for Wiring & Arduino
-  ...mostly rewritten by Paul Stoffregen...
-  Copyright (c) 2009-10 Hernando Barragan.  All right reserved.
-  Copyright 2011, Paul Stoffregen, paul@pjrc.com
-
-  This library is free software; you can redistribute it and/or
-  modify it under the terms of the GNU Lesser General Public
-  License as published by the Free Software Foundation; either
-  version 2.1 of the License, or (at your option) any later version.
-
-  This library is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  Lesser General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public
-  License along with this library; if not, write to the Free Software
-  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-#ifdef __cplusplus
-
-#ifndef __ARDUINO_STRINGS__
-#define __ARDUINO_STRINGS__
-
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-
-namespace arduino {
-
-// When compiling programs with this class, the following gcc parameters
-// dramatically increase performance and memory (RAM) efficiency, typically
-// with little or no increase in code size.
-//     -felide-constructors
-//     -std=c++0x
-
-class __FlashStringHelper;
-#define F(string_literal) (reinterpret_cast<const __FlashStringHelper *>(PSTR(string_literal)))
-
-// An inherited class for holding the result of a concatenation.  These
-// result objects are assumed to be writable by subsequent concatenations.
-class StringSumHelper;
-
-// The string class
-class String
-{
-	friend class StringSumHelper;
-	// use a function pointer to allow for "if (s)" without the
-	// complications of an operator bool(). for more information, see:
-	// http://www.artima.com/cppsource/safebool.html
-	typedef void (String::*StringIfHelperType)() const;
-	void StringIfHelper() const {}
-
-public:
-	// constructors
-	// creates a copy of the initial value.
-	// if the initial value is null or invalid, or if memory allocation
-	// fails, the string will be marked as invalid (i.e. "if (s)" will
-	// be false).
-	String(const char *cstr = "");
-	String(const String &str);
-	String(const __FlashStringHelper *str);
-	#if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__)
-	String(String &&rval);
-	String(StringSumHelper &&rval);
-	#endif
-	explicit String(char c);
-	explicit String(unsigned char, unsigned char base=10);
-	explicit String(int, unsigned char base=10);
-	explicit String(unsigned int, unsigned char base=10);
-	explicit String(long, unsigned char base=10);
-	explicit String(unsigned long, unsigned char base=10);
-	//explicit String(float, unsigned char decimalPlaces=2);
-	//explicit String(double, unsigned char decimalPlaces=2);
-	~String(void);
-
-	// memory management
-	// return true on success, false on failure (in which case, the string
-	// is left unchanged).  reserve(0), if successful, will validate an
-	// invalid string (i.e., "if (s)" will be true afterwards)
-	unsigned char reserve(unsigned int size);
-	inline unsigned int length(void) const {return len;}
-
-	// creates a copy of the assigned value.  if the value is null or
-	// invalid, or if the memory allocation fails, the string will be
-	// marked as invalid ("if (s)" will be false).
-	String & operator = (const String &rhs);
-	String & operator = (const char *cstr);
-	//String & operator = (const __FlashStringHelper *str);
-	#if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__)
-	String & operator = (String &&rval);
-	String & operator = (StringSumHelper &&rval);
-	#endif
-
-	// concatenate (works w/ built-in types)
-
-	// returns true on success, false on failure (in which case, the string
-	// is left unchanged).  if the argument is null or invalid, the
-	// concatenation is considered unsucessful.
-	unsigned char concat(const String &str);
-	unsigned char concat(const char *cstr);
-	unsigned char concat(char c);
-	unsigned char concat(unsigned char c);
-	unsigned char concat(int num);
-	unsigned char concat(unsigned int num);
-	unsigned char concat(long num);
-	unsigned char concat(unsigned long num);
-	unsigned char concat(float num);
-	//unsigned char concat(double num);
-	unsigned char concat(const __FlashStringHelper * str);
-
-	// if there's not enough memory for the concatenated value, the string
-	// will be left unchanged (but this isn't signalled in any way)
-	String & operator += (const String &rhs)	{concat(rhs); return (*this);}
-	String & operator += (const char *cstr)		{concat(cstr); return (*this);}
-	String & operator += (char c)			{concat(c); return (*this);}
-	String & operator += (unsigned char num)		{concat(num); return (*this);}
-	String & operator += (int num)			{concat(num); return (*this);}
-	String & operator += (unsigned int num)		{concat(num); return (*this);}
-	String & operator += (long num)			{concat(num); return (*this);}
-	String & operator += (unsigned long num)	{concat(num); return (*this);}
-	String & operator += (float num)		{concat(num); return (*this);}
-	//String & operator += (double num)		{concat(num); return (*this);}
-	String & operator += (const __FlashStringHelper *str){concat(str); return (*this);}
-
-	friend StringSumHelper & operator + (const StringSumHelper &lhs, const String &rhs);
-	friend StringSumHelper & operator + (const StringSumHelper &lhs, const char *cstr);
-	friend StringSumHelper & operator + (const StringSumHelper &lhs, char c);
-	friend StringSumHelper & operator + (const StringSumHelper &lhs, unsigned char num);
-	friend StringSumHelper & operator + (const StringSumHelper &lhs, int num);
-	friend StringSumHelper & operator + (const StringSumHelper &lhs, unsigned int num);
-	friend StringSumHelper & operator + (const StringSumHelper &lhs, long num);
-	friend StringSumHelper & operator + (const StringSumHelper &lhs, unsigned long num);
-	friend StringSumHelper & operator + (const StringSumHelper &lhs, float num);
-	//friend StringSumHelper & operator + (const StringSumHelper &lhs, double num);
-	//friend StringSumHelper & operator + (const StringSumHelper &lhs, const __FlashStringHelper *rhs);
-
-	// comparison (only works w/ Strings and "strings")
-	operator StringIfHelperType() const { return buffer ? &String::StringIfHelper : 0; }
-	int compareTo(const String &s) const;
-	int compareTo(const char *cstr) const;
-	unsigned char equals(const String &s) const;
-	unsigned char equals(const char *cstr) const;
-
-	friend unsigned char operator == (const String &a, const String &b) { return a.equals(b); }
-	friend unsigned char operator == (const String &a, const char   *b) { return a.equals(b); }
-	friend unsigned char operator == (const char   *a, const String &b) { return b == a; }
-	friend unsigned char operator <  (const String &a, const String &b) { return a.compareTo(b) < 0; }
-	friend unsigned char operator <  (const String &a, const char   *b) { return a.compareTo(b) < 0; }
-	friend unsigned char operator <  (const char   *a, const String &b) { return b.compareTo(a) > 0; }
-
-	friend unsigned char operator != (const String &a, const String &b) { return !(a == b); }
-	friend unsigned char operator != (const String &a, const char   *b) { return !(a == b); }
-	friend unsigned char operator != (const char   *a, const String &b) { return !(a == b); }
-	friend unsigned char operator >  (const String &a, const String &b) { return b < a; }
-	friend unsigned char operator >  (const String &a, const char   *b) { return b < a; }
-	friend unsigned char operator >  (const char   *a, const String &b) { return b < a; }
-	friend unsigned char operator <= (const String &a, const String &b) { return !(b < a); }
-	friend unsigned char operator <= (const String &a, const char   *b) { return !(b < a); }
-	friend unsigned char operator <= (const char   *a, const String &b) { return !(b < a); }
-	friend unsigned char operator >= (const String &a, const String &b) { return !(a < b); }
-	friend unsigned char operator >= (const String &a, const char   *b) { return !(a < b); }
-	friend unsigned char operator >= (const char   *a, const String &b) { return !(a < b); }
-
-	unsigned char equalsIgnoreCase(const String &s) const;
-	unsigned char startsWith( const String &prefix) const;
-	unsigned char startsWith(const String &prefix, unsigned int offset) const;
-	unsigned char endsWith(const String &suffix) const;
-
-	// character acccess
-	char charAt(unsigned int index) const;
-	void setCharAt(unsigned int index, char c);
-	char operator [] (unsigned int index) const;
-	char& operator [] (unsigned int index);
-	void getBytes(unsigned char *buf, unsigned int bufsize, unsigned int index=0) const;
-	void toCharArray(char *buf, unsigned int bufsize, unsigned int index=0) const
-		{ getBytes((unsigned char *)buf, bufsize, index); }
-	const char* c_str() const { return buffer; }
-	char* begin() { return buffer; }
-	char* end() { return buffer + length(); }
-	const char* begin() const { return c_str(); }
-	const char* end() const { return c_str() + length(); }
-
-	// search
-	int indexOf( char ch ) const;
-	int indexOf( char ch, unsigned int fromIndex ) const;
-	int indexOf( const String &str ) const;
-	int indexOf( const String &str, unsigned int fromIndex ) const;
-	int lastIndexOf( char ch ) const;
-	int lastIndexOf( char ch, unsigned int fromIndex ) const;
-	int lastIndexOf( const String &str ) const;
-	int lastIndexOf( const String &str, unsigned int fromIndex ) const;
-	String substring( unsigned int beginIndex ) const { return substring(beginIndex, len); };
-	String substring( unsigned int beginIndex, unsigned int endIndex ) const;
-
-	// modification
-	void replace(char find, char replace);
-	void replace(const String& find, const String& replace);
-	void remove(unsigned int index);
-	void remove(unsigned int index, unsigned int count);
-	void toLowerCase(void);
-	void toUpperCase(void);
-	void trim(void);
-
-	// parsing/conversion
-	long toInt(void) const;
-	float toFloat(void) const;
-	double toDouble(void) const;
-
-protected:
-	char *buffer;	        // the actual char array
-	unsigned int capacity;  // the array length minus one (for the '\0')
-	unsigned int len;       // the String length (not counting the '\0')
-protected:
-	void init(void);
-	void invalidate(void);
-	unsigned char changeBuffer(unsigned int maxStrLen);
-	unsigned char concat(const char *cstr, unsigned int length);
-
-	// copy and move
-	String & copy(const char *cstr, unsigned int length);
-	String & copy(const __FlashStringHelper *pstr, unsigned int length);
-	#if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__)
-	void move(String &rhs);
-	#endif
-};
-
-class StringSumHelper : public String
-{
-public:
-    StringSumHelper(const String &s) : String(s) {}
-    StringSumHelper(const char *p) : String(p) {}
-    StringSumHelper(char c) : String(c) {}
-    StringSumHelper(unsigned char num) : String(num) {}
-    StringSumHelper(int num) : String(num) {}
-    StringSumHelper(unsigned int num) : String(num) {}
-    StringSumHelper(long num) : String(num) {}
-    StringSumHelper(unsigned long num) : String(num) {}
-    //StringSumHelper(float num) : String(num) {}
-    //StringSumHelper(double num) : String(num) {}
-};
-
-} // namespace arduino
-
-#endif  // __cplusplus
-#endif  // __ARDUINO_STRINGS__
diff --git a/extras/test/include/util/TestUtil.h b/extras/test/include/util/TestUtil.h
deleted file mode 100644
index 111607ec..00000000
--- a/extras/test/include/util/TestUtil.h
+++ /dev/null
@@ -1,3 +0,0 @@
-/*
- * Copyright (c) 2020 Arduino.  All rights reserved.
- */
diff --git a/extras/test/include/util/itoa.h b/extras/test/include/util/itoa.h
deleted file mode 100644
index 55b28493..00000000
--- a/extras/test/include/util/itoa.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
-  Copyright (c) 2016 Arduino LLC.  All right reserved.
-
-  This library is free software; you can redistribute it and/or
-  modify it under the terms of the GNU Lesser General Public
-  License as published by the Free Software Foundation; either
-  version 2.1 of the License, or (at your option) any later version.
-
-  This library is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-  See the GNU Lesser General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public
-  License along with this library; if not, write to the Free Software
-  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-#pragma once
-
-// Standard C functions required in Arduino API
-// If these functions are not provided by the standard library, the
-// core should supply an implementation of them.
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern char* itoa(int value, char *string, int radix);
-extern char* ltoa(long value, char *string, int radix);
-extern char* utoa(unsigned value, char *string, int radix);
-extern char* ultoa(unsigned long value, char *string, int radix);
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
diff --git a/extras/test/src/Arduino.cpp b/extras/test/src/Arduino.cpp
deleted file mode 100644
index 6a6ab4e5..00000000
--- a/extras/test/src/Arduino.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
-  This file is part of the ArduinoBLE library.
-  Copyright (c) 2018 Arduino SA. All rights reserved.
-
-  This library is free software; you can redistribute it and/or
-  modify it under the terms of the GNU Lesser General Public
-  License as published by the Free Software Foundation; either
-  version 2.1 of the License, or (at your option) any later version.
-
-  This library is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  Lesser General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public
-  License along with this library; if not, write to the Free Software
-  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-/******************************************************************************
-   INCLUDE
- ******************************************************************************/
-
-#include <Arduino.h>
-
-/******************************************************************************
-   GLOBAL VARIABLES
- ******************************************************************************/
-
-static unsigned long current_millis = 0;
-
-/******************************************************************************
-   PUBLIC FUNCTIONS
- ******************************************************************************/
-
-void set_millis(unsigned long const millis)
-{
-  current_millis = millis;
-}
-
-unsigned long millis()
-{
-  return current_millis;
-}
diff --git a/extras/test/src/test_advertising_data/FakeBLELocalDevice.cpp b/extras/test/src/test_advertising_data/FakeBLELocalDevice.cpp
deleted file mode 100644
index 7f5a71ad..00000000
--- a/extras/test/src/test_advertising_data/FakeBLELocalDevice.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
-  This file is part of the ArduinoBLE library.
-  Copyright (c) 2018 Arduino SA. All rights reserved.
-
-  This library is free software; you can redistribute it and/or
-  modify it under the terms of the GNU Lesser General Public
-  License as published by the Free Software Foundation; either
-  version 2.1 of the License, or (at your option) any later version.
-
-  This library is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  Lesser General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public
-  License along with this library; if not, write to the Free Software
-  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-#include "FakeBLELocalDevice.h"
-
-FakeBLELocalDevice::FakeBLELocalDevice()
-{
-
-}
-
-FakeBLELocalDevice::~FakeBLELocalDevice()
-{
-
-}
-
-int FakeBLELocalDevice::advertise()
-{
-  _advertisingData.updateData();
-  _scanResponseData.updateData();
-  return 1;
-}
-
-FakeBLELocalDevice FakeBLEObj;
-BLELocalDevice& BLE = FakeBLEObj;
diff --git a/extras/test/src/test_advertising_data/test_advertising_data.cpp b/extras/test/src/test_advertising_data/test_advertising_data.cpp
deleted file mode 100644
index 7f2e9cb8..00000000
--- a/extras/test/src/test_advertising_data/test_advertising_data.cpp
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
-  This file is part of the ArduinoBLE library.
-  Copyright (c) 2018 Arduino SA. All rights reserved.
-
-  This library is free software; you can redistribute it and/or
-  modify it under the terms of the GNU Lesser General Public
-  License as published by the Free Software Foundation; either
-  version 2.1 of the License, or (at your option) any later version.
-
-  This library is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  Lesser General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public
-  License along with this library; if not, write to the Free Software
-  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-#include <catch2/catch_test_macros.hpp>
-
-#define private public
-#define protected public
-
-#include "FakeBLELocalDevice.h"
-#include "BLEAdvertisingData.h"
-
-TEST_CASE("Test flags override", "[ArduinoBLE::BLEAdvertisingData]")
-{
-  // Mocking advertisement packet
-  BLEAdvertisingData advData;
-  // Expected results
-  const uint8_t defaultData[] = {0x02, BLEFieldFlags, 0x06};
-  const uint8_t goldenFlags[] = {0x02, 0x01, BLEFlagsBREDRNotSupported};
-
-  WHEN("Default options for flags")
-  {
-    BLE.advertise();
-    REQUIRE( 0 == (memcmp(defaultData, BLE.getAdvertisingData().data(), sizeof(defaultData))) );
-    REQUIRE( BLE.getScanResponseData().dataLength() == 0 );
-  }
-
-  WHEN("Setting external advertising data which has flags")
-  {
-    advData.setFlags(BLEFlagsBREDRNotSupported);
-    advData.updateData();
-    BLE.setAdvertisingData(advData);
-    BLE.advertise();
-    REQUIRE( 3 == BLE.getAdvertisingData().dataLength());
-    REQUIRE( 0 == (memcmp(goldenFlags, advData.data(), sizeof(goldenFlags))) );
-    REQUIRE( 0 == (memcmp(goldenFlags, BLE.getAdvertisingData().data(), sizeof(goldenFlags))) );
-    REQUIRE( 0 != (memcmp(defaultData, BLE.getAdvertisingData().data(), sizeof(defaultData))) );
-  }
-
-  WHEN("Setting external advertising data without flags")
-  {
-    advData.clear();
-    BLE.setAdvertisingData(advData);
-    BLE.advertise();
-    REQUIRE( 0 == (memcmp(defaultData, BLE.getAdvertisingData().data(), sizeof(defaultData))) );
-  }
-
-  // Clear BLE advertising data
-  advData.clear();
-  BLE.setAdvertisingData(advData);
-}
-
-TEST_CASE("Set default flags in an already full advertising data packet", "[ArduinoBLE::BLEAdvertisingData]")
-{
-    BLEAdvertisingData advData;
-    bool retVal;
-
-    const char* name = "tes";
-    const uint8_t manufacturerData[24] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
-                                          17, 18, 19, 20, 21, 22, 23};
-
-    const uint8_t defaultFlags[3] = {0x02, 0x01, 0x06}; 
-
-    const uint8_t goldenData[31] = { 
-       (sizeof(manufacturerData) + 1), BLEFieldManufacturerData, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
-                                                                17, 18, 19, 20, 21, 22, 23,
-        ((uint8_t)(strlen(name) + 1)), BLEFieldCompleteLocalName, 't', 'e', 's'
-    }; 
-
-  WHEN("Test flags when advertising data is full")
-  {
-    retVal = advData.setLocalName("tes");
-    retVal = advData.setManufacturerData(manufacturerData, sizeof(manufacturerData));
-
-    BLE.setAdvertisingData(advData);
-    BLE.advertise();
-    REQUIRE(0 != memcmp(defaultFlags, BLE.getAdvertisingData().data(), sizeof(defaultFlags)));
-    REQUIRE(0 == memcmp(goldenData, BLE.getAdvertisingData().data(), sizeof(goldenData)));
-  }
-
-  // Clear BLE advertising data
-  advData.clear();
-  BLE.setAdvertisingData(advData);
-}
-
-TEST_CASE("BLE overwrite a full internal advertising data with an external built one", "[ArduinoBLE::BLEAdvertisingData]")
-{
-  bool verify;
-  BLEAdvertisingData advData;
-  BLEAdvertisingData internalData;
-
-  WHEN("Copy empty external advertising data")
-  {
-    BLE.setLocalName("test");
-    BLE.setAdvertisedServiceUuid("1818");
-    BLE.advertise();
-
-    THEN("Check that BLE advertising data has been set") 
-    {
-      verify = (BLE.getAdvertisingData().dataLength() == (3 + (2+2)));
-      REQUIRE(verify);
-    }
-
-    THEN("Check that BLE scan response data has been set") 
-    {
-      verify = (BLE.getScanResponseData().dataLength() == (4+2));
-      REQUIRE(verify);
-    }
-
-    // Copy external empty adv data into advertising data
-    BLE.setAdvertisingData(advData);
-    BLE.advertise();
-    THEN("BLE advertising data should be erased") 
-    {
-      verify = (BLE.getAdvertisingData().dataLength() == 3);
-      REQUIRE(verify);
-    }
-
-    // Copy external empty adv data into scan response data
-    BLE.setScanResponseData(advData);
-    BLE.advertise();
-    THEN("BLE scan response data should be erased") 
-    {
-      verify = (BLE.getScanResponseData().dataLength() == 0);
-      REQUIRE(verify);
-    }
-  }
-
-  // Clear BLE advertising data
-  advData.clear();
-  BLE.setAdvertisingData(advData);
-}
-
-TEST_CASE("BLE test raw data", "[ArduinoBLE::BLEAdvertisingData]")
-{
-  BLEAdvertisingData advData;
-  bool retVal;
-
-  WHEN("Set too large raw data")
-  {
-    const uint8_t data[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
-                      11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
-                      21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32 };
-    retVal = advData.setRawData(data, sizeof(data));
-    THEN("Set raw data should return false. The parameter should not be set")
-    {
-      REQUIRE(!retVal);
-    }
-    advData.clear();
-  }
-
-  WHEN("Set correct raw data")
-  {
-    const uint8_t data[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
-                      11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
-                      21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31};
-    retVal = advData.setRawData(data, sizeof(data));
-    THEN("Set raw data should return true. The parameter should be correctly set")
-    {
-      REQUIRE(retVal);
-    }
-    advData.updateData();
-    REQUIRE( 0 == memcmp(data, advData.data(), sizeof(data)) );
-    advData.clear();
-  }
-
-  WHEN("Hide other parameters by setting raw data")
-  {
-    const uint8_t data[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
-    advData.setLocalName("test");
-    advData.setRawData(data, sizeof(data));
-
-    advData.updateData();
-    REQUIRE( 0 == memcmp(data, advData.data(), sizeof(data)) );
-
-    advData.setLocalName("test");
-    advData.updateData();
-    REQUIRE( 0 == memcmp(data, advData.data(), sizeof(data)) );
-    
-    advData.clear();
-    advData.setLocalName("test");
-    advData.updateData();
-    REQUIRE( 0 != memcmp(data, advData.data(), sizeof(data)) );
-  }
-
-  // Clear BLE advertising data
-  advData.clear();
-  BLE.setAdvertisingData(advData);
-}
diff --git a/extras/test/src/test_advertising_data/test_local_name.cpp b/extras/test/src/test_advertising_data/test_local_name.cpp
deleted file mode 100644
index 5a6fde10..00000000
--- a/extras/test/src/test_advertising_data/test_local_name.cpp
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
-  This file is part of the ArduinoBLE library.
-  Copyright (c) 2018 Arduino SA. All rights reserved.
-
-  This library is free software; you can redistribute it and/or
-  modify it under the terms of the GNU Lesser General Public
-  License as published by the Free Software Foundation; either
-  version 2.1 of the License, or (at your option) any later version.
-
-  This library is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  Lesser General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public
-  License along with this library; if not, write to the Free Software
-  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-#include <catch2/catch_test_macros.hpp>
-
-#define private public
-#define protected public
-
-#include "FakeBLELocalDevice.h"
-#include "BLEAdvertisingData.h"
-
-TEST_CASE("Test local name setting", "[ArduinoBLE::BLEAdvertisingData]")
-{
-  BLEAdvertisingData advData;
-  int oldRemainingLength = advData.remainingLength();
-  bool retVal;
-
-  WHEN("Set correct local name")
-  {
-    const char* name = "test";
-    retVal = advData.setLocalName(name);
-    THEN("Set local name should return true. The name parameter should be correctly set")
-    {
-      REQUIRE(retVal);
-    }
-
-    THEN("Check the exact number of bytes occupied by the name just set")
-    {
-      REQUIRE( (strlen(name) + 2) == (oldRemainingLength - advData.remainingLength()) );
-    }
-    oldRemainingLength = advData.remainingLength();
-
-    advData.updateData();
-    REQUIRE(advData.dataLength() == (strlen(name) + 2));
-  }
-
-  WHEN("Set too long local name")
-  {
-    const char* name = "way too long local name (len 32)";
-    retVal = advData.setLocalName(name);
-    THEN("Set local name should return false. The name parameter should not be set")
-    {
-      REQUIRE(!retVal);
-      REQUIRE( oldRemainingLength == advData.remainingLength() );
-      advData.updateData();
-      REQUIRE( advData.dataLength() == (MAX_AD_DATA_LENGTH - oldRemainingLength) );
-    }
-  }
-
-  WHEN("Overwrite local name with a name as long as max data length")
-  {
-    const char* name = "local name with full length  ";
-    retVal = advData.setLocalName(name);
-    THEN("The name parameter should be correctly overwritten. The remaining length should be 0")
-    {
-      REQUIRE(retVal);
-      REQUIRE( (strlen(name) + 2) == (oldRemainingLength - advData.remainingLength()) );
-      oldRemainingLength = advData.remainingLength();
-
-      advData.updateData();
-      REQUIRE(advData.dataLength() == (strlen(name) + 2));
-      // advData should be full now
-      REQUIRE( 0 == advData.remainingLength() );
-      REQUIRE( 0 == advData.availableForWrite() );
-    }
-  }
-
-  WHEN("Check consistency when setting the external advertising data")
-  {
-    const auto goldenData = advData.data();
-    BLE.setAdvertisingData(advData);
-    BLE.advertise();
-    REQUIRE( 0 == memcmp(goldenData, BLE.getAdvertisingData().data(), advData.dataLength()) );
-  }
-
-  // Clear BLE advertising data
-  advData.clear();
-  BLE.setAdvertisingData(advData);
-}
diff --git a/extras/test/src/test_advertising_data/test_manufacturer.cpp b/extras/test/src/test_advertising_data/test_manufacturer.cpp
deleted file mode 100644
index c2fa8483..00000000
--- a/extras/test/src/test_advertising_data/test_manufacturer.cpp
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
-  This file is part of the ArduinoBLE library.
-  Copyright (c) 2018 Arduino SA. All rights reserved.
-
-  This library is free software; you can redistribute it and/or
-  modify it under the terms of the GNU Lesser General Public
-  License as published by the Free Software Foundation; either
-  version 2.1 of the License, or (at your option) any later version.
-
-  This library is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  Lesser General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public
-  License along with this library; if not, write to the Free Software
-  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-#include <catch2/catch_test_macros.hpp>
-
-#define private public
-#define protected public
-
-#include "FakeBLELocalDevice.h"
-#include "BLEAdvertisingData.h"
-
-TEST_CASE("Test manufacturer data setting", "[ArduinoBLE::BLEAdvertisingData]")
-{
-  BLEAdvertisingData advData;
-  int oldRemainingLength = advData.remainingLength();
-  const uint16_t companyId = 0x1100;
-  bool retVal;
-
-  WHEN("Set correct manufacturer data without id")
-  {
-    const uint8_t data[] = {0x00, 0x11, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
-    const uint8_t goldenData[] = {(sizeof(data) + 1), BLEFieldManufacturerData, 
-                                  0x00, 0x11, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
-    retVal = advData.setManufacturerData(data, sizeof(data));
-    THEN("Check that the manufacturer data has been correctly set")
-    {
-      REQUIRE(retVal);
-      REQUIRE( (sizeof(data) + 2) == (oldRemainingLength - advData.remainingLength()) );
-    }
-    oldRemainingLength = advData.remainingLength();
-
-    advData.updateData();
-    REQUIRE(advData.dataLength() == sizeof(goldenData));
-    REQUIRE( 0 == memcmp(goldenData, advData.data(), sizeof(goldenData)) );
-  }
-
-  WHEN("Set correct manufacturer data given a manufacturer id")
-  {
-    const uint8_t data[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
-    const uint8_t goldenData[] = {(sizeof(data) + sizeof(companyId) + 1), BLEFieldManufacturerData, 
-                                  0x00, 0x11, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
-    retVal = advData.setManufacturerData(companyId, data, sizeof(data));
-    THEN("Check that the manufacturer data has been correctly set")
-    {
-      REQUIRE(retVal);
-      REQUIRE( (sizeof(data) + sizeof(companyId) + 2) == (oldRemainingLength - advData.remainingLength()) );
-    }
-    oldRemainingLength = advData.remainingLength();
-
-    advData.updateData();
-    REQUIRE(advData.dataLength() == sizeof(goldenData));
-    REQUIRE( 0 == memcmp(goldenData, advData.data(), sizeof(goldenData)) );
-  }
-
-  WHEN("Set too long manufacturer data given id")
-  {
-    // extreme case, 1 byte more than the maximum
-    const uint8_t data[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
-                            16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27};
-    retVal = advData.setManufacturerData(companyId, data, sizeof(data));
-    THEN("Manufacturer data was too long, check that it has not been set")
-    {
-      REQUIRE(!retVal);
-      REQUIRE( oldRemainingLength == advData.remainingLength() );
-    }
-    advData.updateData();
-    REQUIRE( advData.dataLength() == (MAX_AD_DATA_LENGTH - oldRemainingLength) );
-  }
-
-  WHEN("Set too long manufacturer data without id")
-  {
-    // extreme case, 1 byte more than the maximum
-    const uint8_t data[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
-                            16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29};
-    retVal = advData.setManufacturerData(data, sizeof(data));
-    THEN("Manufacturer data was too long, check that it has not been set")
-    {
-      REQUIRE(!retVal);
-      REQUIRE( oldRemainingLength == advData.remainingLength() );
-    }
-    advData.updateData();
-    REQUIRE( advData.dataLength() == (MAX_AD_DATA_LENGTH - oldRemainingLength) );
-  }
-
-  WHEN("Set manufacturer data without id after setting manufacturer data given id")
-  {
-    advData.clear();
-    const uint8_t dataGivenId[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
-                                  16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26};
-    const uint8_t data[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
-                            16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28};
-    THEN("Check that first insertion of manufacturer data given id is correctly done")
-    {
-      retVal = advData.setManufacturerData(companyId, dataGivenId, sizeof(dataGivenId));
-      REQUIRE(retVal);
-    }
-    THEN("Check that the insertion of manufacturer data without after one with id is correctly done")
-    {
-      retVal = advData.setManufacturerData(data, sizeof(data));
-      REQUIRE(retVal);
-      REQUIRE( 0 == advData.remainingLength() );
-      advData.updateData();
-      REQUIRE( advData.dataLength() == (MAX_AD_DATA_LENGTH) );
-    }
-  }
-
-  WHEN("Set manufacturer data given id after setting manufacturer data without id")
-  {
-    advData.clear();
-    // dataGivenId is too long!! it should not pass
-    const uint8_t dataGivenId[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
-                                  16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27};
-    const uint8_t data[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
-                            16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28};
-    THEN("Check that first insertion of manufacturer data WITHOUT id is correctly done")
-    {
-      retVal = advData.setManufacturerData(data, sizeof(data));
-      REQUIRE(retVal);
-    }
-    THEN("Check that the insertion of manufacturer data given id after one without id is correctly done")
-    {
-      retVal = advData.setManufacturerData(companyId, dataGivenId, sizeof(dataGivenId));
-      REQUIRE(!retVal);
-    }
-  }
-
-  WHEN("Overwrite manufacturer data with one as long as max data length")
-  {
-    const uint8_t data[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
-                            16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26};
-    const uint8_t goldenData[] = {(sizeof(data) + sizeof(companyId) + 1), BLEFieldManufacturerData, 
-                                  0x00, 0x11, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
-                                  12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26};
-    retVal = advData.setManufacturerData(companyId, data, sizeof(data));
-    THEN("Manufacturer data should be set correctly")
-    {
-      REQUIRE(retVal);
-
-      advData.updateData();
-      REQUIRE( 0 == advData.remainingLength() );
-      REQUIRE( 0 == advData.availableForWrite() );
-      REQUIRE( 0 == memcmp(goldenData, advData.data(), sizeof(goldenData)) );
-    }
-  }
-
-  WHEN("Check consistency when setting the external advertising data")
-  {
-    const auto goldenData = advData.data();
-    BLE.setAdvertisingData(advData);
-    BLE.advertise();
-    REQUIRE( 0 == memcmp(goldenData, BLE.getAdvertisingData().data(), advData.dataLength()) );
-  }
-
-  // Clear BLE advertising data
-  advData.clear();
-  BLE.setAdvertisingData(advData);
-}
diff --git a/extras/test/src/test_advertising_data/test_service.cpp b/extras/test/src/test_advertising_data/test_service.cpp
deleted file mode 100644
index 87c60497..00000000
--- a/extras/test/src/test_advertising_data/test_service.cpp
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
-  This file is part of the ArduinoBLE library.
-  Copyright (c) 2018 Arduino SA. All rights reserved.
-
-  This library is free software; you can redistribute it and/or
-  modify it under the terms of the GNU Lesser General Public
-  License as published by the Free Software Foundation; either
-  version 2.1 of the License, or (at your option) any later version.
-
-  This library is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  Lesser General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public
-  License along with this library; if not, write to the Free Software
-  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-#include <catch2/catch_test_macros.hpp>
-
-#define private public
-#define protected public
-
-#include "FakeBLELocalDevice.h"
-#include "BLEAdvertisingData.h"
-
-TEST_CASE("Test advertised service id setting", "[ArduinoBLE::BLEAdvertisingData]")
-{
-  BLEAdvertisingData advData;
-  int oldRemainingLength = advData.remainingLength();
-  bool retVal;
-
-  WHEN("Set correct advertised service")
-  {
-    const char* service = "00112233445566770011223344556677";
-    retVal = advData.setAdvertisedServiceUuid(service);
-    REQUIRE(retVal);
-    REQUIRE( (16 + 2) == (oldRemainingLength - advData.remainingLength()) );
-    oldRemainingLength = advData.remainingLength();
-
-    advData.updateData();
-    REQUIRE(advData.dataLength() == (16 + 2));
-  }
-
-  WHEN("Set an advertised id too long with respect to the remaining length")
-  {
-    advData.clear();
-    const char* name = "12 chars str";
-    const char* service = "00112233445566770011223344556677";
-    advData.setLocalName(name);
-    oldRemainingLength = advData.remainingLength();
-    THEN("Check that the too long parameter has not been set")
-    {
-      REQUIRE(!advData.setAdvertisedServiceUuid(service)); 
-      REQUIRE( oldRemainingLength == advData.remainingLength() );
-      advData.updateData();
-      REQUIRE( advData.dataLength() == (MAX_AD_DATA_LENGTH - oldRemainingLength) );
-    }
-  }
-
-  WHEN("Fill to maximum an advertising packet with a service id")
-  {
-    advData.clear();
-    const char* name = "11 char str";
-    const char* service = "00112233445566770011223344556677";
-    advData.setLocalName(name);
-    REQUIRE(advData.setAdvertisedServiceUuid(service));
-
-    advData.updateData();
-    REQUIRE(advData.dataLength() == (MAX_AD_DATA_LENGTH));
-    // advData should be full now
-    REQUIRE( 0 == advData.remainingLength() );
-    REQUIRE( 0 == advData.availableForWrite() );
-  }
-
-  WHEN("Check consistency when setting the external advertising data")
-  {
-    const auto goldenData = advData.data();
-    BLE.setAdvertisingData(advData);
-    BLE.advertise();
-    REQUIRE( 0 == memcmp(goldenData, BLE.getAdvertisingData().data(), advData.dataLength()) );
-  }
-
-  // Clear BLE advertising data
-  advData.clear();
-  BLE.setAdvertisingData(advData);
-}
-
-TEST_CASE("Test service data setting", "[ArduinoBLE::BLEAdvertisingData]")
-{
-  BLEAdvertisingData advData;
-  int oldRemainingLength = advData.remainingLength();
-  const uint16_t uuid = 0x1100;
-  bool retVal;
-
-  WHEN("Set correct service data")
-  {
-    const uint8_t data[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
-    const uint8_t goldenData[] = {(sizeof(data) + sizeof(uuid) + 1), BLEFieldServiceData, 
-                                  0x00, 0x11, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
-    retVal = advData.setAdvertisedServiceData(uuid, data, sizeof(data));
-    THEN("Correctly set parameter")
-    {
-      REQUIRE(retVal);
-      REQUIRE( (sizeof(data) + 2 + sizeof(uuid)) == (oldRemainingLength - advData.remainingLength()) );
-    }
-    oldRemainingLength = advData.remainingLength();
-
-    advData.updateData();
-    THEN("Check parameter analyzing advertising raw data")
-    {
-      REQUIRE(advData.dataLength() == (sizeof(data) + 2 + sizeof(uuid)));
-      REQUIRE(advData.dataLength() == sizeof(goldenData));
-      REQUIRE( 0 == memcmp(goldenData, advData.data(), sizeof(goldenData)) );
-    }
-  }
-
-  WHEN("Set too long service data")
-  {
-    // extreme case, 1 byte more than the maximum
-    const uint8_t data[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
-                            16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27};
-    retVal = advData.setAdvertisedServiceData(uuid, data, sizeof(data));
-    THEN("Check that the too long parameter has not been set")
-    {
-      REQUIRE(!retVal);
-    }
-    REQUIRE( oldRemainingLength == advData.remainingLength() );
-    advData.updateData();
-    REQUIRE( advData.dataLength() == (MAX_AD_DATA_LENGTH - oldRemainingLength) );
-  }
-
-  WHEN("Overwrite service data with one as long as max data length")
-  {
-    const uint8_t data[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
-                            16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26};
-    retVal = advData.setAdvertisedServiceData(uuid, data, sizeof(data));
-    THEN("Check correctly set parameter")
-    {
-      REQUIRE(retVal);
-    }
-
-    advData.updateData();
-    // advData should be full now
-    THEN("advData should be full now")
-    {
-      REQUIRE( 0 == advData.remainingLength() );
-      REQUIRE( 0 == advData.availableForWrite() );
-    }
-  }
-
-  WHEN("Check consistency when setting the external advertising data")
-  {
-    const auto goldenData = advData.data();
-    BLE.setAdvertisingData(advData);
-    BLE.advertise();
-    REQUIRE( 0 == memcmp(goldenData, BLE.getAdvertisingData().data(), advData.dataLength()) );
-  }
-
-  // Clear BLE advertising data
-  advData.clear();
-  BLE.setAdvertisingData(advData);
-}
diff --git a/extras/test/src/test_discovered_device/FakeGAP.cpp b/extras/test/src/test_discovered_device/FakeGAP.cpp
deleted file mode 100644
index bbf78206..00000000
--- a/extras/test/src/test_discovered_device/FakeGAP.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
-  This file is part of the ArduinoBLE library.
-  Copyright (c) 2018 Arduino SA. All rights reserved.
-
-  This library is free software; you can redistribute it and/or
-  modify it under the terms of the GNU Lesser General Public
-  License as published by the Free Software Foundation; either
-  version 2.1 of the License, or (at your option) any later version.
-
-  This library is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  Lesser General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public
-  License along with this library; if not, write to the Free Software
-  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-#include "FakeGAP.h"
-
-FakeGAPClass::FakeGAPClass()
-{
-}
-
-FakeGAPClass::~FakeGAPClass()
-{
-}
-
-FakeGAPClass GAPFakeObj;
-GAPClass& GAP = GAPFakeObj;
diff --git a/extras/test/src/test_discovered_device/test_discovered_device.cpp b/extras/test/src/test_discovered_device/test_discovered_device.cpp
deleted file mode 100644
index 14efcc0f..00000000
--- a/extras/test/src/test_discovered_device/test_discovered_device.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
-  This file is part of the ArduinoBLE library.
-  Copyright (c) 2018 Arduino SA. All rights reserved.
-
-  This library is free software; you can redistribute it and/or
-  modify it under the terms of the GNU Lesser General Public
-  License as published by the Free Software Foundation; either
-  version 2.1 of the License, or (at your option) any later version.
-
-  This library is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  Lesser General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public
-  License along with this library; if not, write to the Free Software
-  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-#include <catch2/catch_test_macros.hpp>
-
-#define private public
-#define protected public
-#include "BLEDevice.h"
-
-TEST_CASE("BLE discovered device test", "[ArduinoBLE::BLEDevice]")
-{
-
-  WHEN("Retrieve local name from advertisement packet")
-  {
-    // Mocking advertisement packet
-    uint8_t advType = 0x03;
-    uint8_t eirLength = 6;
-    uint8_t eirData[] = {0x05, 0x09, 't', 'e', 's', 't'};
-    uint8_t rssi = 0;
-
-    // Expected results
-    String goldenName = "test";
-
-    // Simulate device discovery
-    BLEDevice device = BLEDevice();
-    device.setAdvertisementData(0x03, eirLength, eirData, rssi); 
-
-    bool hasName = device.hasLocalName();
-    REQUIRE(hasName);
-
-    String name = device.localName();
-    REQUIRE(goldenName == name);
-
-  }
-
-}
diff --git a/extras/test/src/test_main.cpp b/extras/test/src/test_main.cpp
deleted file mode 100644
index 958f5367..00000000
--- a/extras/test/src/test_main.cpp
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
-  This file is part of the ArduinoBLE library.
-  Copyright (c) 2018 Arduino SA. All rights reserved.
-
-  This library is free software; you can redistribute it and/or
-  modify it under the terms of the GNU Lesser General Public
-  License as published by the Free Software Foundation; either
-  version 2.1 of the License, or (at your option) any later version.
-
-  This library is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  Lesser General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public
-  License along with this library; if not, write to the Free Software
-  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-#define CATCH_CONFIG_MAIN /* This tells Catch to provide a main() - only do this in one cpp file */
-#include <catch2/catch_test_macros.hpp>
diff --git a/extras/test/src/test_uuid/test_uuid.cpp b/extras/test/src/test_uuid/test_uuid.cpp
deleted file mode 100644
index 16c225eb..00000000
--- a/extras/test/src/test_uuid/test_uuid.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
-  This file is part of the ArduinoBLE library.
-  Copyright (c) 2018 Arduino SA. All rights reserved.
-
-  This library is free software; you can redistribute it and/or
-  modify it under the terms of the GNU Lesser General Public
-  License as published by the Free Software Foundation; either
-  version 2.1 of the License, or (at your option) any later version.
-
-  This library is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  Lesser General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public
-  License along with this library; if not, write to the Free Software
-  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-#include <catch2/catch_test_macros.hpp>
-
-#include "utility/BLEUuid.h"
-
-TEST_CASE("BLE uuid test", "[ArduinoBLE::BLEUuid]")
-{
-  WHEN("Set and retrieve uuid")
-  {
-    bool verify;
-
-    const char* goldenUuid = "19b10010-e8f2-537e-4f6c-d104768a1214";
-    // little-endian order
-    const uint8_t goldenData[] = {0x14,0x12,0x8A,0x76,0x04,0xD1,0x6C,0x4F,0x7E,0x53,0xF2,0xE8,0x10,0x00,0xB1,0x19};
-    uint8_t goldenLength = 16;
-
-    BLEUuid test(goldenUuid);
-
-    uint8_t testLength = test.length();
-    verify = (goldenLength == testLength);
-    REQUIRE(verify);
-
-    const uint8_t *testData = test.data();
-    verify = ( 0 == (memcmp(goldenData, testData, sizeof(goldenData))) );
-    REQUIRE(verify);
-
-    const char *testUuid = test.uuidToString(testData, testLength);
-    verify = ( 0 == strcmp(testUuid, goldenUuid) );
-    REQUIRE(verify);
-
-    // print the uuid
-    //WARN("test: " << testUuid << ",  golden: " << goldenUuid);
-  }
-}
\ No newline at end of file
diff --git a/extras/test/src/util/Common.cpp b/extras/test/src/util/Common.cpp
deleted file mode 100644
index e2e1eeb5..00000000
--- a/extras/test/src/util/Common.cpp
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
-  This file is part of the ArduinoBLE library.
-  Copyright (c) 2018 Arduino SA. All rights reserved.
-
-  This library is free software; you can redistribute it and/or
-  modify it under the terms of the GNU Lesser General Public
-  License as published by the Free Software Foundation; either
-  version 2.1 of the License, or (at your option) any later version.
-
-  This library is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  Lesser General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public
-  License along with this library; if not, write to the Free Software
-  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-#include "Common.h"
-
-void delay(unsigned long)
-{
-
-}
-
-/* C++ prototypes */
-long map(long x, long in_min, long in_max, long out_min, long out_max)
-{
-  return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
-}
-
-uint16_t makeWord(uint16_t w) { return w; }
-uint16_t makeWord(uint8_t h, uint8_t l) { return (h << 8) | l; }
\ No newline at end of file
diff --git a/extras/test/src/util/HCIFakeTransport.cpp b/extras/test/src/util/HCIFakeTransport.cpp
deleted file mode 100644
index 26645f5e..00000000
--- a/extras/test/src/util/HCIFakeTransport.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
-  This file is part of the ArduinoBLE library.
-  Copyright (c) 2018 Arduino SA. All rights reserved.
-
-  This library is free software; you can redistribute it and/or
-  modify it under the terms of the GNU Lesser General Public
-  License as published by the Free Software Foundation; either
-  version 2.1 of the License, or (at your option) any later version.
-
-  This library is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  Lesser General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public
-  License along with this library; if not, write to the Free Software
-  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-#include "HCIFakeTransport.h"
-
-HCIFakeTransportClass HCIFakeTransport;
-HCITransportInterface& HCITransport = HCIFakeTransport;
\ No newline at end of file
diff --git a/extras/test/src/util/String.cpp b/extras/test/src/util/String.cpp
deleted file mode 100644
index 618973b6..00000000
--- a/extras/test/src/util/String.cpp
+++ /dev/null
@@ -1,755 +0,0 @@
-/*
-  String library for Wiring & Arduino
-  ...mostly rewritten by Paul Stoffregen...
-  Copyright (c) 2009-10 Hernando Barragan.  All rights reserved.
-  Copyright 2011, Paul Stoffregen, paul@pjrc.com
-
-  This library is free software; you can redistribute it and/or
-  modify it under the terms of the GNU Lesser General Public
-  License as published by the Free Software Foundation; either
-  version 2.1 of the License, or (at your option) any later version.
-
-  This library is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  Lesser General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public
-  License along with this library; if not, write to the Free Software
-  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-#include "String.h"
-#include "itoa.h"
-
-/*********************************************/
-/*  Constructors                             */
-/*********************************************/
-
-namespace arduino {
-
-String::String(const char *cstr)
-{
-	init();
-	if (cstr) copy(cstr, strlen(cstr));
-}
-
-String::String(const String &value)
-{
-	init();
-	*this = value;
-}
-
-String::String(const __FlashStringHelper *pstr)
-{
-	init();
-	*this = pstr;
-}
-
-#if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__)
-String::String(String &&rval)
-{
-	init();
-	move(rval);
-}
-String::String(StringSumHelper &&rval)
-{
-	init();
-	move(rval);
-}
-#endif
-
-String::String(char c)
-{
-	init();
-	char buf[2];
-	buf[0] = c;
-	buf[1] = 0;
-	*this = buf;
-}
-
-String::String(unsigned char value, unsigned char base)
-{
-	init();
-	char buf[1 + 8 * sizeof(unsigned char)];
-	utoa(value, buf, base);
-	*this = buf;
-}
-
-String::String(int value, unsigned char base)
-{
-	init();
-	char buf[2 + 8 * sizeof(int)];
-	itoa(value, buf, base);
-	*this = buf;
-}
-
-String::String(unsigned int value, unsigned char base)
-{
-	init();
-	char buf[1 + 8 * sizeof(unsigned int)];
-	utoa(value, buf, base);
-	*this = buf;
-}
-
-String::String(long value, unsigned char base)
-{
-	init();
-	char buf[2 + 8 * sizeof(long)];
-	ltoa(value, buf, base);
-	*this = buf;
-}
-
-String::String(unsigned long value, unsigned char base)
-{
-	init();
-	char buf[1 + 8 * sizeof(unsigned long)];
-	ultoa(value, buf, base);
-	*this = buf;
-}
-
-/*
-String::String(float value, unsigned char decimalPlaces)
-{
-	init();
-	char buf[33];
-	*this = dtostrf(value, (decimalPlaces + 2), decimalPlaces, buf);
-}
-
-String::String(double value, unsigned char decimalPlaces)
-{
-	init();
-	char buf[33];
-	*this = dtostrf(value, (decimalPlaces + 2), decimalPlaces, buf);
-}
-*/
-
-String::~String()
-{
-	if (buffer) free(buffer);
-}
-
-/*********************************************/
-/*  Memory Management                        */
-/*********************************************/
-
-inline void String::init(void)
-{
-	buffer = NULL;
-	capacity = 0;
-	len = 0;
-}
-
-void String::invalidate(void)
-{
-	if (buffer) free(buffer);
-	buffer = NULL;
-	capacity = len = 0;
-}
-
-unsigned char String::reserve(unsigned int size)
-{
-	if (buffer && capacity >= size) return 1;
-	if (changeBuffer(size)) {
-		if (len == 0) buffer[0] = 0;
-		return 1;
-	}
-	return 0;
-}
-
-unsigned char String::changeBuffer(unsigned int maxStrLen)
-{
-	char *newbuffer = (char *)realloc(buffer, maxStrLen + 1);
-	if (newbuffer) {
-		buffer = newbuffer;
-		capacity = maxStrLen;
-		return 1;
-	}
-	return 0;
-}
-
-/*********************************************/
-/*  Copy and Move                            */
-/*********************************************/
-
-String & String::copy(const char *cstr, unsigned int length)
-{
-	if (!reserve(length)) {
-		invalidate();
-		return *this;
-	}
-	len = length;
-	strcpy(buffer, cstr);
-	return *this;
-}
-
-/*
-String & String::copy(const __FlashStringHelper *pstr, unsigned int length)
-{
-	if (!reserve(length)) {
-		invalidate();
-		return *this;
-	}
-	len = length;
-	strcpy_P(buffer, (PGM_P)pstr);
-	return *this;
-}
-*/
-
-#if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__)
-void String::move(String &rhs)
-{
-	if (buffer) {
-		if (rhs && capacity >= rhs.len) {
-			strcpy(buffer, rhs.buffer);
-			len = rhs.len;
-			rhs.len = 0;
-			return;
-		} else {
-			free(buffer);
-		}
-	}
-	buffer = rhs.buffer;
-	capacity = rhs.capacity;
-	len = rhs.len;
-	rhs.buffer = NULL;
-	rhs.capacity = 0;
-	rhs.len = 0;
-}
-#endif
-
-String & String::operator = (const String &rhs)
-{
-	if (this == &rhs) return *this;
-	
-	if (rhs.buffer) copy(rhs.buffer, rhs.len);
-	else invalidate();
-	
-	return *this;
-}
-
-#if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__)
-String & String::operator = (String &&rval)
-{
-	if (this != &rval) move(rval);
-	return *this;
-}
-
-String & String::operator = (StringSumHelper &&rval)
-{
-	if (this != &rval) move(rval);
-	return *this;
-}
-#endif
-
-String & String::operator = (const char *cstr)
-{
-	if (cstr) copy(cstr, strlen(cstr));
-	else invalidate();
-	
-	return *this;
-}
-
-/*
-String & String::operator = (const __FlashStringHelper *pstr)
-{
-	if (pstr) copy(pstr, strlen_P((PGM_P)pstr));
-	else invalidate();
-
-	return *this;
-}
-*/
-
-/*********************************************/
-/*  concat                                   */
-/*********************************************/
-
-unsigned char String::concat(const String &s)
-{
-	return concat(s.buffer, s.len);
-}
-
-unsigned char String::concat(const char *cstr, unsigned int length)
-{
-	unsigned int newlen = len + length;
-	if (!cstr) return 0;
-	if (length == 0) return 1;
-	if (!reserve(newlen)) return 0;
-	strcpy(buffer + len, cstr);
-	len = newlen;
-	return 1;
-}
-
-unsigned char String::concat(const char *cstr)
-{
-	if (!cstr) return 0;
-	return concat(cstr, strlen(cstr));
-}
-
-unsigned char String::concat(char c)
-{
-	char buf[2];
-	buf[0] = c;
-	buf[1] = 0;
-	return concat(buf, 1);
-}
-
-unsigned char String::concat(unsigned char num)
-{
-	char buf[1 + 3 * sizeof(unsigned char)];
-	itoa(num, buf, 10);
-	return concat(buf, strlen(buf));
-}
-
-unsigned char String::concat(int num)
-{
-	char buf[2 + 3 * sizeof(int)];
-	itoa(num, buf, 10);
-	return concat(buf, strlen(buf));
-}
-
-unsigned char String::concat(unsigned int num)
-{
-	char buf[1 + 3 * sizeof(unsigned int)];
-	utoa(num, buf, 10);
-	return concat(buf, strlen(buf));
-}
-
-unsigned char String::concat(long num)
-{
-	char buf[2 + 3 * sizeof(long)];
-	ltoa(num, buf, 10);
-	return concat(buf, strlen(buf));
-}
-
-unsigned char String::concat(unsigned long num)
-{
-	char buf[1 + 3 * sizeof(unsigned long)];
-	ultoa(num, buf, 10);
-	return concat(buf, strlen(buf));
-}
-
-/*
-unsigned char String::concat(float num)
-{
-	char buf[20];
-	char* string = dtostrf(num, 4, 2, buf);
-	return concat(string, strlen(string));
-}
-
-unsigned char String::concat(double num)
-{
-	char buf[20];
-	char* string = dtostrf(num, 4, 2, buf);
-	return concat(string, strlen(string));
-}
-
-unsigned char String::concat(const __FlashStringHelper * str)
-{
-	if (!str) return 0;
-	int length = strlen_P((const char *) str);
-	if (length == 0) return 1;
-	unsigned int newlen = len + length;
-	if (!reserve(newlen)) return 0;
-	strcpy_P(buffer + len, (const char *) str);
-	len = newlen;
-	return 1;
-}
-*/
-
-/*********************************************/
-/*  Concatenate                              */
-/*********************************************/
-
-StringSumHelper & operator + (const StringSumHelper &lhs, const String &rhs)
-{
-	StringSumHelper &a = const_cast<StringSumHelper&>(lhs);
-	if (!a.concat(rhs.buffer, rhs.len)) a.invalidate();
-	return a;
-}
-
-StringSumHelper & operator + (const StringSumHelper &lhs, const char *cstr)
-{
-	StringSumHelper &a = const_cast<StringSumHelper&>(lhs);
-	if (!cstr || !a.concat(cstr, strlen(cstr))) a.invalidate();
-	return a;
-}
-
-StringSumHelper & operator + (const StringSumHelper &lhs, char c)
-{
-	StringSumHelper &a = const_cast<StringSumHelper&>(lhs);
-	if (!a.concat(c)) a.invalidate();
-	return a;
-}
-
-StringSumHelper & operator + (const StringSumHelper &lhs, unsigned char num)
-{
-	StringSumHelper &a = const_cast<StringSumHelper&>(lhs);
-	if (!a.concat(num)) a.invalidate();
-	return a;
-}
-
-StringSumHelper & operator + (const StringSumHelper &lhs, int num)
-{
-	StringSumHelper &a = const_cast<StringSumHelper&>(lhs);
-	if (!a.concat(num)) a.invalidate();
-	return a;
-}
-
-StringSumHelper & operator + (const StringSumHelper &lhs, unsigned int num)
-{
-	StringSumHelper &a = const_cast<StringSumHelper&>(lhs);
-	if (!a.concat(num)) a.invalidate();
-	return a;
-}
-
-StringSumHelper & operator + (const StringSumHelper &lhs, long num)
-{
-	StringSumHelper &a = const_cast<StringSumHelper&>(lhs);
-	if (!a.concat(num)) a.invalidate();
-	return a;
-}
-
-StringSumHelper & operator + (const StringSumHelper &lhs, unsigned long num)
-{
-	StringSumHelper &a = const_cast<StringSumHelper&>(lhs);
-	if (!a.concat(num)) a.invalidate();
-	return a;
-}
-
-/*
-StringSumHelper & operator + (const StringSumHelper &lhs, float num)
-{
-	StringSumHelper &a = const_cast<StringSumHelper&>(lhs);
-	if (!a.concat(num)) a.invalidate();
-	return a;
-}
-
-StringSumHelper & operator + (const StringSumHelper &lhs, double num)
-{
-	StringSumHelper &a = const_cast<StringSumHelper&>(lhs);
-	if (!a.concat(num)) a.invalidate();
-	return a;
-}
-
-StringSumHelper & operator + (const StringSumHelper &lhs, const __FlashStringHelper *rhs)
-{
-	StringSumHelper &a = const_cast<StringSumHelper&>(lhs);
-	if (!a.concat(rhs))	a.invalidate();
-	return a;
-}
-*/
-
-/*********************************************/
-/*  Comparison                               */
-/*********************************************/
-
-int String::compareTo(const String &s) const
-{
-	if (!buffer || !s.buffer) {
-		if (s.buffer && s.len > 0) return 0 - *(unsigned char *)s.buffer;
-		if (buffer && len > 0) return *(unsigned char *)buffer;
-		return 0;
-	}
-	return strcmp(buffer, s.buffer);
-}
-
-int String::compareTo(const char *cstr) const
-{
-	if (!buffer || !cstr) {
-		if (cstr && !*cstr) return 0 - *(unsigned char *)cstr;
-		if (buffer && len > 0) return *(unsigned char *)buffer;
-		return 0;
-	}
-	return strcmp(buffer, cstr);
-}
-
-unsigned char String::equals(const String &s2) const
-{
-	return (len == s2.len && compareTo(s2) == 0);
-}
-
-unsigned char String::equals(const char *cstr) const
-{
-	if (len == 0) return (cstr == NULL || *cstr == 0);
-	if (cstr == NULL) return buffer[0] == 0;
-	return strcmp(buffer, cstr) == 0;
-}
-
-unsigned char String::equalsIgnoreCase( const String &s2 ) const
-{
-	if (this == &s2) return 1;
-	if (len != s2.len) return 0;
-	if (len == 0) return 1;
-	const char *p1 = buffer;
-	const char *p2 = s2.buffer;
-	while (*p1) {
-		if (tolower(*p1++) != tolower(*p2++)) return 0;
-	} 
-	return 1;
-}
-
-unsigned char String::startsWith( const String &s2 ) const
-{
-	if (len < s2.len) return 0;
-	return startsWith(s2, 0);
-}
-
-unsigned char String::startsWith( const String &s2, unsigned int offset ) const
-{
-	if (offset > len - s2.len || !buffer || !s2.buffer) return 0;
-	return strncmp( &buffer[offset], s2.buffer, s2.len ) == 0;
-}
-
-unsigned char String::endsWith( const String &s2 ) const
-{
-	if ( len < s2.len || !buffer || !s2.buffer) return 0;
-	return strcmp(&buffer[len - s2.len], s2.buffer) == 0;
-}
-
-/*********************************************/
-/*  Character Access                         */
-/*********************************************/
-
-char String::charAt(unsigned int loc) const
-{
-	return operator[](loc);
-}
-
-void String::setCharAt(unsigned int loc, char c) 
-{
-	if (loc < len) buffer[loc] = c;
-}
-
-char & String::operator[](unsigned int index)
-{
-	static char dummy_writable_char;
-	if (index >= len || !buffer) {
-		dummy_writable_char = 0;
-		return dummy_writable_char;
-	}
-	return buffer[index];
-}
-
-char String::operator[]( unsigned int index ) const
-{
-	if (index >= len || !buffer) return 0;
-	return buffer[index];
-}
-
-void String::getBytes(unsigned char *buf, unsigned int bufsize, unsigned int index) const
-{
-	if (!bufsize || !buf) return;
-	if (index >= len) {
-		buf[0] = 0;
-		return;
-	}
-	unsigned int n = bufsize - 1;
-	if (n > len - index) n = len - index;
-	strncpy((char *)buf, buffer + index, n);
-	buf[n] = 0;
-}
-
-/*********************************************/
-/*  Search                                   */
-/*********************************************/
-
-int String::indexOf(char c) const
-{
-	return indexOf(c, 0);
-}
-
-int String::indexOf( char ch, unsigned int fromIndex ) const
-{
-	if (fromIndex >= len) return -1;
-	const char* temp = strchr(buffer + fromIndex, ch);
-	if (temp == NULL) return -1;
-	return temp - buffer;
-}
-
-int String::indexOf(const String &s2) const
-{
-	return indexOf(s2, 0);
-}
-
-int String::indexOf(const String &s2, unsigned int fromIndex) const
-{
-	if (fromIndex >= len) return -1;
-	const char *found = strstr(buffer + fromIndex, s2.buffer);
-	if (found == NULL) return -1;
-	return found - buffer;
-}
-
-int String::lastIndexOf( char theChar ) const
-{
-	return lastIndexOf(theChar, len - 1);
-}
-
-int String::lastIndexOf(char ch, unsigned int fromIndex) const
-{
-	if (fromIndex >= len) return -1;
-	char tempchar = buffer[fromIndex + 1];
-	buffer[fromIndex + 1] = '\0';
-	char* temp = strrchr( buffer, ch );
-	buffer[fromIndex + 1] = tempchar;
-	if (temp == NULL) return -1;
-	return temp - buffer;
-}
-
-int String::lastIndexOf(const String &s2) const
-{
-	return lastIndexOf(s2, len - s2.len);
-}
-
-int String::lastIndexOf(const String &s2, unsigned int fromIndex) const
-{
-	if (s2.len == 0 || len == 0 || s2.len > len) return -1;
-	if (fromIndex >= len) fromIndex = len - 1;
-	int found = -1;
-	for (char *p = buffer; p <= buffer + fromIndex; p++) {
-		p = strstr(p, s2.buffer);
-		if (!p) break;
-		if ((unsigned int)(p - buffer) <= fromIndex) found = p - buffer;
-	}
-	return found;
-}
-
-String String::substring(unsigned int left, unsigned int right) const
-{
-	if (left > right) {
-		unsigned int temp = right;
-		right = left;
-		left = temp;
-	}
-	String out;
-	if (left >= len) return out;
-	if (right > len) right = len;
-	char temp = buffer[right];  // save the replaced character
-	buffer[right] = '\0';	
-	out = buffer + left;  // pointer arithmetic
-	buffer[right] = temp;  //restore character
-	return out;
-}
-
-/*********************************************/
-/*  Modification                             */
-/*********************************************/
-
-void String::replace(char find, char replace)
-{
-	if (!buffer) return;
-	for (char *p = buffer; *p; p++) {
-		if (*p == find) *p = replace;
-	}
-}
-
-void String::replace(const String& find, const String& replace)
-{
-	if (len == 0 || find.len == 0) return;
-	int diff = replace.len - find.len;
-	char *readFrom = buffer;
-	char *foundAt;
-	if (diff == 0) {
-		while ((foundAt = strstr(readFrom, find.buffer)) != NULL) {
-			memcpy(foundAt, replace.buffer, replace.len);
-			readFrom = foundAt + replace.len;
-		}
-	} else if (diff < 0) {
-		char *writeTo = buffer;
-		while ((foundAt = strstr(readFrom, find.buffer)) != NULL) {
-			unsigned int n = foundAt - readFrom;
-			memcpy(writeTo, readFrom, n);
-			writeTo += n;
-			memcpy(writeTo, replace.buffer, replace.len);
-			writeTo += replace.len;
-			readFrom = foundAt + find.len;
-			len += diff;
-		}
-		strcpy(writeTo, readFrom);
-	} else {
-		unsigned int size = len; // compute size needed for result
-		while ((foundAt = strstr(readFrom, find.buffer)) != NULL) {
-			readFrom = foundAt + find.len;
-			size += diff;
-		}
-		if (size == len) return;
-		if (size > capacity && !changeBuffer(size)) return; // XXX: tell user!
-		int index = len - 1;
-		while (index >= 0 && (index = lastIndexOf(find, index)) >= 0) {
-			readFrom = buffer + index + find.len;
-			memmove(readFrom + diff, readFrom, len - (readFrom - buffer));
-			len += diff;
-			buffer[len] = 0;
-			memcpy(buffer + index, replace.buffer, replace.len);
-			index--;
-		}
-	}
-}
-
-void String::remove(unsigned int index){
-	// Pass the biggest integer as the count. The remove method
-	// below will take care of truncating it at the end of the
-	// string.
-	remove(index, (unsigned int)-1);
-}
-
-void String::remove(unsigned int index, unsigned int count){
-	if (index >= len) { return; }
-	if (count <= 0) { return; }
-	if (count > len - index) { count = len - index; }
-	char *writeTo = buffer + index;
-	len = len - count;
-	memmove(writeTo, buffer + index + count,len - index);
-	buffer[len] = 0;
-}
-
-void String::toLowerCase(void)
-{
-	if (!buffer) return;
-	for (char *p = buffer; *p; p++) {
-		*p = tolower(*p);
-	}
-}
-
-void String::toUpperCase(void)
-{
-	if (!buffer) return;
-	for (char *p = buffer; *p; p++) {
-		*p = toupper(*p);
-	}
-}
-
-void String::trim(void)
-{
-	if (!buffer || len == 0) return;
-	char *begin = buffer;
-	while (isspace(*begin)) begin++;
-	char *end = buffer + len - 1;
-	while (isspace(*end) && end >= begin) end--;
-	len = end + 1 - begin;
-	if (begin > buffer) memmove(buffer, begin, len);
-	buffer[len] = 0;
-}
-
-/*********************************************/
-/*  Parsing / Conversion                     */
-/*********************************************/
-
-long String::toInt(void) const
-{
-	if (buffer) return atol(buffer);
-	return 0;
-}
-
-float String::toFloat(void) const
-{
-	return float(toDouble());
-}
-
-double String::toDouble(void) const
-{
-	if (buffer) return atof(buffer);
-	return 0;
-}
-
-} // namespace arduino
diff --git a/extras/test/src/util/TestUtil.cpp b/extras/test/src/util/TestUtil.cpp
deleted file mode 100644
index 111607ec..00000000
--- a/extras/test/src/util/TestUtil.cpp
+++ /dev/null
@@ -1,3 +0,0 @@
-/*
- * Copyright (c) 2020 Arduino.  All rights reserved.
- */
diff --git a/extras/test/src/util/itoa.c b/extras/test/src/util/itoa.c
deleted file mode 100644
index c9a275f6..00000000
--- a/extras/test/src/util/itoa.c
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
-  Copyright (c) 2014 Arduino LLC.  All right reserved.
-
-  This library is free software; you can redistribute it and/or
-  modify it under the terms of the GNU Lesser General Public
-  License as published by the Free Software Foundation; either
-  version 2.1 of the License, or (at your option) any later version.
-
-  This library is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-  See the GNU Lesser General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public
-  License along with this library; if not, write to the Free Software
-  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-#include <itoa.h>
-#include <string.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern char* itoa( int value, char *string, int radix )
-{
-  return ltoa( value, string, radix ) ;
-}
-
-extern char* ltoa( long value, char *string, int radix )
-{
-  char tmp[33];
-  char *tp = tmp;
-  long i;
-  unsigned long v;
-  int sign;
-  char *sp;
-
-  if ( string == NULL )
-  {
-    return 0 ;
-  }
-
-  if (radix > 36 || radix <= 1)
-  {
-    return 0 ;
-  }
-
-  sign = (radix == 10 && value < 0);
-  if (sign)
-  {
-    v = -value;
-  }
-  else
-  {
-    v = (unsigned long)value;
-  }
-
-  while (v || tp == tmp)
-  {
-    i = v % radix;
-    v = v / radix;
-    if (i < 10)
-      *tp++ = i+'0';
-    else
-      *tp++ = i + 'a' - 10;
-  }
-
-  sp = string;
-
-  if (sign)
-    *sp++ = '-';
-  while (tp > tmp)
-    *sp++ = *--tp;
-  *sp = 0;
-
-  return string;
-}
-
-extern char* utoa( unsigned int value, char *string, int radix )
-{
-  return ultoa( value, string, radix ) ;
-}
-
-extern char* ultoa( unsigned long value, char *string, int radix )
-{
-  char tmp[33];
-  char *tp = tmp;
-  long i;
-  unsigned long v = value;
-  char *sp;
-
-  if ( string == NULL )
-  {
-    return 0;
-  }
-
-  if (radix > 36 || radix <= 1)
-  {
-    return 0;
-  }
-
-  while (v || tp == tmp)
-  {
-    i = v % radix;
-    v = v / radix;
-    if (i < 10)
-      *tp++ = i+'0';
-    else
-      *tp++ = i + 'a' - 10;
-  }
-
-  sp = string;
-
-
-  while (tp > tmp)
-    *sp++ = *--tp;
-  *sp = 0;
-
-  return string;
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/keywords.txt b/keywords.txt
index aa35c72d..150e6262 100644
--- a/keywords.txt
+++ b/keywords.txt
@@ -1,12 +1,12 @@
 #######################################
-# Syntax Coloring Map For ArduinoBLE
+# Syntax Coloring Map For STM32duinoBLE
 #######################################
 
 #######################################
 # Datatypes (KEYWORD1)
 #######################################
 
-ArduinoBLE	KEYWORD1
+STM32duinoBLE	KEYWORD1
 BLE	KEYWORD1
 
 BLEDevice	KEYWORD1
@@ -30,6 +30,9 @@ BLEFloatCharacteristic	KEYWORD1
 BLEDoubleCharacteristic	KEYWORD1
 BLEStringCharacteristic	KEYWORD1
 
+HCISpiTransportClass	KEYWORD1
+HCISharedMemTransportClass	KEYWORD1
+
 #######################################
 # Methods and Functions (KEYWORD2)
 #######################################
@@ -136,3 +139,10 @@ BLEUnsubscribed	LITERAL1
 BLEWritten	LITERAL1
 BLEUpdated	LITERAL1
 
+SPBTLE_RF	LITERAL1
+SPBTLE_1S	LITERAL1
+BLUENRG_M2SP	LITERAL1
+BLUENRG_M0	LITERAL1
+BLUENRG_LP	LITERAL1
+BLEChip_t	LITERAL1
+
diff --git a/library.properties b/library.properties
index 2a3aae10..24c38d09 100644
--- a/library.properties
+++ b/library.properties
@@ -1,10 +1,10 @@
-name=ArduinoBLE
+name=STM32duinoBLE
 version=1.4.0
-author=Arduino
-maintainer=Arduino <info@arduino.cc>
-sentence=Enables Bluetooth® Low Energy connectivity on the Arduino MKR WiFi 1010, Arduino UNO WiFi Rev2, Arduino Nano 33 IoT, Arduino Nano 33 BLE, Nicla Sense ME and UNO R4 WiFi.
+author=Arduino, SRA
+maintainer=stm32duino
+sentence=Fork of ArduinoBLE library to add the support of STM32WB, SPBTLE-RF, SPBTLE-1S, BLUENRG-M2SP, BLUENRG-LP and BLUENRG-M0 BLE modules.
 paragraph=This library supports creating a Bluetooth® Low Energy peripheral & central mode.
 category=Communication
-url=https://www.arduino.cc/en/Reference/ArduinoBLE
-architectures=samd,megaavr,mbed,apollo3,mbed_nano,mbed_portenta,mbed_nicla,esp32,mbed_giga,renesas,renesas_portenta,mbed_opta,renesas_uno,silabs
-includes=ArduinoBLE.h
+url=https://github.com/stm32duino/STM32duinoBLE
+architectures=stm32
+includes=STM32duinoBLE.h
diff --git a/src/ArduinoBLE.h b/src/STM32duinoBLE.h
similarity index 94%
rename from src/ArduinoBLE.h
rename to src/STM32duinoBLE.h
index 588d5cb1..c603e3da 100644
--- a/src/ArduinoBLE.h
+++ b/src/STM32duinoBLE.h
@@ -17,8 +17,8 @@
   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */
 
-#ifndef _ARDUINO_BLE_H_
-#define _ARDUINO_BLE_H_
+#ifndef _STM32DUINO_BLE_H_
+#define _STM32DUINO_BLE_H_
 
 #include "local/BLELocalDevice.h"
 #include "BLEProperty.h"
diff --git a/src/local/BLELocalDevice.cpp b/src/local/BLELocalDevice.cpp
index 5792353f..0aa30313 100644
--- a/src/local/BLELocalDevice.cpp
+++ b/src/local/BLELocalDevice.cpp
@@ -39,7 +39,7 @@
 #endif
 #endif
 
-BLELocalDevice::BLELocalDevice()
+BLELocalDevice::BLELocalDevice(uint8_t ownBdaddrType): _ownBdaddrType(ownBdaddrType)
 {
   _advertisingData.setFlags(BLEFlagsGeneralDiscoverable | BLEFlagsBREDRNotSupported);
 }
@@ -124,6 +124,41 @@ int BLELocalDevice::begin()
     return 0;
   }
 
+  uint8_t randomNumber[8];
+  if (HCI.leRand(randomNumber) != 0) {
+    end();
+    return 0;
+  }
+  /* Random address only requires 6 bytes (48 bits)
+   * Force both MSB bits to b00 in order to define Static Random Address
+   */
+  randomNumber[5] |= 0xC0;
+
+  // Copy the random address in private variable as it will be sent to the BLE chip
+  randomAddress [0] = randomNumber[0];
+  randomAddress [1] = randomNumber[1];
+  randomAddress [2] = randomNumber[2];
+  randomAddress [3] = randomNumber[3];
+  randomAddress [4] = randomNumber[4];
+  randomAddress [5] = randomNumber[5];
+
+  // Set Random address only when type is STATIC_RANDOM_ADDR
+  if ((_ownBdaddrType == STATIC_RANDOM_ADDR) && (HCI.leSetRandomAddress((uint8_t*)randomNumber) != 0)) {
+    end();
+    return 0;
+  }
+  // Save address to HCI.localAddr variable, which is used to encryption in pairing
+  if(_ownBdaddrType == PUBLIC_ADDR){
+    if (HCI.readBdAddr() != 0) {
+      end();
+      return 0;
+    }
+  } else {
+    for(int k=0; k<6; k++){
+      HCI.localAddr[5-k] = randomAddress[k];
+    }
+  }
+
   uint8_t hciVer;
   uint16_t hciRev;
   uint8_t lmpVer;
@@ -139,7 +174,7 @@ int BLELocalDevice::begin()
     end();
     return 0;
   }
-  if (HCI.setLeEventMask(0x00000000000003FF) != 0) {
+  if (HCI.setLeEventMask(0x00000000000001B3) != 0) {
     end();
     return 0;
   }
@@ -207,6 +242,10 @@ int BLELocalDevice::begin()
 
   GATT.begin();
 
+  GAP.setOwnBdaddrType(_ownBdaddrType);
+
+  ATT.setOwnBdaddrType(_ownBdaddrType);
+
   return 1;
 }
 
@@ -229,6 +268,16 @@ void BLELocalDevice::end()
   _scanResponseData.clear();
 }
 
+void BLELocalDevice::getRandomAddress(uint8_t buff[6])
+{
+  buff [0] = randomAddress[0];
+  buff [1] = randomAddress[1];
+  buff [2] = randomAddress[2];
+  buff [3] = randomAddress[3];
+  buff [4] = randomAddress[4];
+  buff [5] = randomAddress[5];
+}
+
 void BLELocalDevice::poll()
 {
   HCI.poll();
@@ -264,7 +313,14 @@ bool BLELocalDevice::disconnect()
 String BLELocalDevice::address() const
 {
   uint8_t addr[6] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
-  HCI.readBdAddr(addr);
+  // return correct device address when is set to STATIC RANDOM (set by HCI)
+  if(_ownBdaddrType == PUBLIC_ADDR) {
+    HCI.readBdAddr(addr);
+  } else {
+    for(int k=0; k<6; k++) {
+        addr[k]=HCI.localAddr[5-k];
+    }
+  }
 
   char result[18];
   sprintf(result, "%02x:%02x:%02x:%02x:%02x:%02x", addr[5], addr[4], addr[3], addr[2], addr[1], addr[0]);
@@ -384,9 +440,9 @@ int BLELocalDevice::scanForAddress(String address, bool withDuplicates)
   return GAP.scanForAddress(address, withDuplicates);
 }
 
-void BLELocalDevice::stopScan()
+int BLELocalDevice::stopScan()
 {
-  GAP.stopScan();
+  return GAP.stopScan();
 }
 
 BLEDevice BLELocalDevice::central()
diff --git a/src/local/BLELocalDevice.h b/src/local/BLELocalDevice.h
index 6c45c063..8217669f 100644
--- a/src/local/BLELocalDevice.h
+++ b/src/local/BLELocalDevice.h
@@ -30,9 +30,16 @@ enum Pairable {
   ONCE = 2,
 };
 
+enum AddressType {
+  PUBLIC_ADDR = 0,
+  STATIC_RANDOM_ADDR = 1,
+  RESOLVABLE_PRIVATE_ADDR = 2,
+  NON_RESOLVABLE_PRIVATE_ADDR = 3,
+};
+
 class BLELocalDevice {
 public:
-  BLELocalDevice();
+  BLELocalDevice(uint8_t ownBdaddrType = STATIC_RANDOM_ADDR);
   virtual ~BLELocalDevice();
 
   virtual int begin();
@@ -70,7 +77,7 @@ class BLELocalDevice {
   virtual int scanForName(String name, bool withDuplicates = false);
   virtual int scanForUuid(String uuid, bool withDuplicates = false);
   virtual int scanForAddress(String address, bool withDuplicates = false);
-  virtual void stopScan();
+  virtual int stopScan();
 
   virtual BLEDevice central();
   virtual BLEDevice available();
@@ -84,6 +91,8 @@ class BLELocalDevice {
 
   virtual void setTimeout(unsigned long timeout);
 
+  virtual void getRandomAddress(uint8_t buff[6]);
+
   virtual void debug(Stream& stream);
   virtual void noDebug();
   
@@ -107,6 +116,7 @@ class BLELocalDevice {
 
   virtual void setDisplayCode(void (*displayCode)(uint32_t confirmationCode));
   virtual void setBinaryConfirmPairing(bool (*binaryConfirmPairing)());
+
   uint8_t BDaddress[6];
   
 protected:
@@ -114,8 +124,10 @@ class BLELocalDevice {
   virtual BLEAdvertisingData& getScanResponseData();
 
 private:
+  uint8_t randomAddress[6];
   BLEAdvertisingData _advertisingData;
   BLEAdvertisingData _scanResponseData;
+  uint8_t _ownBdaddrType;
 };
 
 extern BLELocalDevice& BLE;
diff --git a/src/utility/ATT.cpp b/src/utility/ATT.cpp
index ba717543..4fe4b71a 100644
--- a/src/utility/ATT.cpp
+++ b/src/utility/ATT.cpp
@@ -114,7 +114,7 @@ ATTClass::~ATTClass()
 
 bool ATTClass::connect(uint8_t peerBdaddrType, uint8_t peerBdaddr[6])
 {
-  if (HCI.leCreateConn(0x0060, 0x0030, 0x00, peerBdaddrType, peerBdaddr, 0x00,
+  if (HCI.leCreateConn(0x0060, 0x0030, 0x00, peerBdaddrType, peerBdaddr, _ownBdaddrType,
                         0x0006, 0x000c, 0x0000, 0x00c8, 0x0004, 0x0006) != 0) {
     return false;
   }
@@ -1745,8 +1745,19 @@ bool ATTClass::discoverDescriptors(uint16_t connectionHandle, BLERemoteDevice* d
         }
 
         if (responseBuffer[0] == ATT_OP_FIND_INFO_RESP) {
-          uint16_t lengthPerDescriptor = responseBuffer[1] * 4;
-          uint8_t uuidLen = 2;
+          //
+          // Format parameter (responseBuffer[1]) either 0x01 - 16-bit Bluetooth UUID(s), or 0x02 - 128 bit UUID(s)
+          //
+          // Therefore for:
+          //   0x01 - uuidLen = 2 (octets)
+          //          lengthPerDescriptor = 4 (Handle 2 octets + UUID 2 octets)
+          //   0x02 - uuidLen = 16 (octets)
+          //          lengthPerDescriptor = 18 (Handle 2 octets + UUID 16 octets)
+          //
+          // See section 3.4.3.2 ATT_FIND_INFORMATION_RSP of Bluetooth Core Specification 5.3.
+          //
+          uint16_t lengthPerDescriptor = responseBuffer[1] * 14 - 10;
+          uint8_t uuidLen = lengthPerDescriptor - 2;
 
           for (int i = 2; i < respLength; i += lengthPerDescriptor) {
             struct __attribute__ ((packed)) RawDescriptor {
@@ -1957,6 +1968,16 @@ int ATTClass::getPeerResolvedAddress(uint16_t connectionHandle, uint8_t resolved
   return 0;
 }
 
+void ATTClass::setOwnBdaddrType(uint8_t ownBdaddrType)
+{
+  _ownBdaddrType = ownBdaddrType;
+}
+
+uint8_t ATTClass::getOwnBdaddrType(void)
+{
+  return _ownBdaddrType;
+}
+
 #if !defined(FAKE_ATT)
 ATTClass ATTObj;
 ATTClass& ATT = ATTObj;
diff --git a/src/utility/ATT.h b/src/utility/ATT.h
index 9cf203a6..2d69d2b5 100644
--- a/src/utility/ATT.h
+++ b/src/utility/ATT.h
@@ -109,6 +109,10 @@ class ATTClass {
   uint8_t peerIRK[16];
   /// This is just a random number... Not sure it has use unless privacy mode is active.
   uint8_t localIRK[16] = {0x54,0x83,0x63,0x7c,0xc5,0x1e,0xf7,0xec,0x32,0xdd,0xad,0x51,0x89,0x4b,0x9e,0x07};
+
+  void setOwnBdaddrType(uint8_t ownBdaddrType);
+  uint8_t getOwnBdaddrType(); // Used in L2CAPSignaling to encryption
+
 private:
   virtual void error(uint16_t connectionHandle, uint8_t dlen, uint8_t data[]);
   virtual void mtuReq(uint16_t connectionHandle, uint8_t dlen, uint8_t data[]);
@@ -170,6 +174,8 @@ class ATTClass {
   } _pendingResp;
 
   BLEDeviceEventHandler _eventHandlers[2];
+
+  uint8_t _ownBdaddrType;
 };
 
 extern ATTClass& ATT;
diff --git a/src/utility/CordioHCICustomDriver.h b/src/utility/CordioHCICustomDriver.h
deleted file mode 100644
index fc062ee8..00000000
--- a/src/utility/CordioHCICustomDriver.h
+++ /dev/null
@@ -1,17 +0,0 @@
-#if defined(CORE_CM4)
-
-#include "CyH4TransportDriver.h"
-
-ble::vendor::cypress_ble::CyH4TransportDriver& ble_cordio_get_h4_transport_driver()
-{
-    static  ble::vendor::cypress_ble::CyH4TransportDriver s_transport_driver(
-        /* TX */ CYBSP_BT_UART_TX, /* RX */ CYBSP_BT_UART_RX,
-        /* cts */ CYBSP_BT_UART_CTS, /* rts */ CYBSP_BT_UART_RTS, NC, DEF_BT_BAUD_RATE,
-        CYBSP_BT_HOST_WAKE, CYBSP_BT_DEVICE_WAKE
-    );
-    return s_transport_driver;
-}
-
-#define CUSTOM_HCI_DRIVER
-
-#endif
\ No newline at end of file
diff --git a/src/utility/GAP.cpp b/src/utility/GAP.cpp
index f1bf02fe..649b7e5d 100644
--- a/src/utility/GAP.cpp
+++ b/src/utility/GAP.cpp
@@ -54,7 +54,7 @@ int GAPClass::advertise(uint8_t* advData, uint8_t advDataLen, uint8_t* scanData,
 
   stopAdvertise();
 
-  if (HCI.leSetAdvertisingParameters(_advertisingInterval, _advertisingInterval, type, 0x00, 0x00, directBdaddr, 0x07, 0) != 0) {
+  if (HCI.leSetAdvertisingParameters(_advertisingInterval, _advertisingInterval, type, _ownBdaddrType, 0x00, directBdaddr, 0x07, 0) != 0) {
     return 0;
   }
 
@@ -84,7 +84,12 @@ void GAPClass::stopAdvertise()
 
 int GAPClass::scan(bool withDuplicates)
 {
-  HCI.leSetScanEnable(false, true);
+  if(_scanning) {
+    // Check if the HCI command fails
+    if (HCI.leSetScanEnable(false, true) != 0) {
+      return 0;
+    }
+  }
 
   // active scan, 20 ms scan interval (N * 0.625), 20 ms scan window (N * 0.625), public own address type, no filter
   /*
@@ -93,7 +98,7 @@ int GAPClass::scan(bool withDuplicates)
     - scan window: mandatory range from 0x0011 to 0x1000
     - The scan window can only be less than or equal to the scan interval
   */
-  if (HCI.leSetScanParameters(0x01, 0x0020, 0x0020, 0x00, 0x00) != 0) {
+  if (HCI.leSetScanParameters(0x01, 0x0020, 0x0020, _ownBdaddrType, 0x00) != 0) {
     return false;
   }
 
@@ -133,10 +138,18 @@ int GAPClass::scanForAddress(String address, bool withDuplicates)
   return scan(withDuplicates);
 }
 
-void GAPClass::stopScan()
+int GAPClass::stopScan()
 {
-  HCI.leSetScanEnable(false, false);
+  if(_scanning) {
+    // Check if the HCI command fails
+    if (HCI.leSetScanEnable(false, false) != 0) {
+      return 0;
+    }
+  }
 
+  _scanNameFilter    = "";
+  _scanUuidFilter    = "";
+  _scanAddressFilter = "";
   _scanning = false;
 
   for (unsigned int i = 0; i < _discoveredDevices.size(); i++) {
@@ -146,6 +159,8 @@ void GAPClass::stopScan()
   }
 
   _discoveredDevices.clear();
+
+  return 1;
 }
 
 BLEDevice GAPClass::available()
@@ -266,6 +281,11 @@ bool GAPClass::matchesScanFilter(const BLEDevice& device)
   return true;
 }
 
+void GAPClass::setOwnBdaddrType(uint8_t ownBdaddrType)
+{
+  _ownBdaddrType = ownBdaddrType;
+}
+
 #if !defined(FAKE_GAP)
 GAPClass GAPObj;
 GAPClass& GAP = GAPObj;
diff --git a/src/utility/GAP.h b/src/utility/GAP.h
index 2ea22938..c79a2aa7 100644
--- a/src/utility/GAP.h
+++ b/src/utility/GAP.h
@@ -37,7 +37,7 @@ class GAPClass {
   virtual int scanForName(String name, bool withDuplicates);
   virtual int scanForUuid(String uuid, bool withDuplicates);
   virtual int scanForAddress(String address, bool withDuplicates);
-  virtual void stopScan();
+  virtual int stopScan();
   virtual BLEDevice available();
 
   virtual void setAdvertisingInterval(uint16_t advertisingInterval);
@@ -45,6 +45,8 @@ class GAPClass {
 
   virtual void setEventHandler(BLEDeviceEvent event, BLEDeviceEventHandler eventHandler);
 
+  void setOwnBdaddrType(uint8_t ownBdaddrType);
+
 protected:
   friend class HCIClass;
 
@@ -67,6 +69,7 @@ class GAPClass {
   String _scanNameFilter;
   String _scanUuidFilter;
   String _scanAddressFilter;
+  uint8_t _ownBdaddrType;
 };
 
 extern GAPClass& GAP;
diff --git a/src/utility/HCI.cpp b/src/utility/HCI.cpp
index af73ead2..ebe66a27 100644
--- a/src/utility/HCI.cpp
+++ b/src/utility/HCI.cpp
@@ -521,19 +521,17 @@ int HCIClass::leReadPeerResolvableAddress(uint8_t peerAddressType, uint8_t* peer
 #ifdef _BLE_TRACE_
   Serial.print("res: 0x");
   Serial.println(res, HEX);
-#endif
   if(res==0){
     struct __attribute__ ((packed)) Response {
       uint8_t status;
       uint8_t peerResolvableAddress[6];
     } *response = (Response*)_cmdResponse;
-#ifdef _BLE_TRACE_
     Serial.print("Address resolution status: 0x");
     Serial.println(response->status, HEX);
     Serial.print("peer resolvable address: ");
     btct.printBytes(response->peerResolvableAddress,6);
-#endif
   }
+  #endif
   return res;
 }
 
diff --git a/src/utility/HCICordioTransport.cpp b/src/utility/HCICordioTransport.cpp
deleted file mode 100644
index b2a911d6..00000000
--- a/src/utility/HCICordioTransport.cpp
+++ /dev/null
@@ -1,322 +0,0 @@
-/*
-  This file is part of the ArduinoBLE library.
-  Copyright (c) 2019 Arduino SA. All rights reserved.
-
-  This library is free software; you can redistribute it and/or
-  modify it under the terms of the GNU Lesser General Public
-  License as published by the Free Software Foundation; either
-  version 2.1 of the License, or (at your option) any later version.
-
-  This library is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  Lesser General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public
-  License along with this library; if not, write to the Free Software
-  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-#if defined(ARDUINO_ARCH_MBED) && !defined(TARGET_NANO_RP2040_CONNECT) // && !defined(CORE_CM4)
-#include <Arduino.h>
-#include <mbed.h>
-
-#include <driver/CordioHCITransportDriver.h>
-#include <driver/CordioHCIDriver.h>
-
-#if defined(ARDUINO_PORTENTA_H7_M4) || defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_GIGA) || defined(ARDUINO_OPTA)
-#include "ble/BLE.h"
-#include <events/mbed_events.h>
-#endif
-
-// Parts of this file are based on: https://github.com/ARMmbed/mbed-os-cordio-hci-passthrough/pull/2
-// With permission from the Arm Mbed team to re-license
-
-#if CORDIO_ZERO_COPY_HCI
-#include <wsf_types.h>
-#include <wsf_buf.h>
-#include <wsf_msg.h>
-#include <wsf_os.h>
-#include <wsf_buf.h>
-#include <wsf_timer.h>
-
-/* avoid many small allocs (and WSF doesn't have smaller buffers) */
-#define MIN_WSF_ALLOC (16)
-#endif //CORDIO_ZERO_COPY_HCI
-
-#include "HCICordioTransport.h"
-
-#if (MBED_VERSION > MBED_ENCODE_VERSION(6, 2, 0))
-#define BLE_NAMESPACE ble 
-#else
-#define BLE_NAMESPACE ble::vendor::cordio
-#endif
-
-#include "CordioHCICustomDriver.h"
-
-extern BLE_NAMESPACE::CordioHCIDriver& ble_cordio_get_hci_driver();
-extern "C" void hciTrSerialRxIncoming(uint8_t *pBuf, uint8_t len);
-
-namespace BLE_NAMESPACE {
-  struct CordioHCIHook {
-    static CordioHCIDriver& getDriver() {
-      return ble_cordio_get_hci_driver();
-    }
-
-    static CordioHCITransportDriver& getTransportDriver() {
-      return getDriver()._transport_driver;
-    }
-
-    static void setDataReceivedHandler(void (*handler)(uint8_t*, uint8_t)) {
-      getTransportDriver().set_data_received_handler(handler);
-    }
-  };
-}
-
-using BLE_NAMESPACE::CordioHCIHook;
-
-#if CORDIO_ZERO_COPY_HCI
-extern uint8_t *SystemHeapStart;
-extern uint32_t SystemHeapSize;
-
-void init_wsf(BLE_NAMESPACE::buf_pool_desc_t& buf_pool_desc) {
-    static bool init = false;
-
-    if (init) {
-      return;
-    }
-    init = true;
-
-    // use the buffer for the WSF heap
-    SystemHeapStart = buf_pool_desc.buffer_memory;
-    SystemHeapSize = buf_pool_desc.buffer_size;
-
-    // Initialize buffers with the ones provided by the HCI driver
-    uint16_t bytes_used = WsfBufInit(
-        buf_pool_desc.pool_count,
-        (wsfBufPoolDesc_t*)buf_pool_desc.pool_description
-    );
-
-    // Raise assert if not enough memory was allocated
-    MBED_ASSERT(bytes_used != 0);
-
-    SystemHeapStart += bytes_used;
-    SystemHeapSize -= bytes_used;
-
-    WsfTimerInit();
-}
-
-
-extern "C" void wsf_mbed_ble_signal_event(void)
-{
-    // do nothing
-}
-#endif //CORDIO_ZERO_COPY_HCI
-
-static void bleLoop()
-{
-#if CORDIO_ZERO_COPY_HCI
-    uint64_t last_update_us = 0;
-    mbed::LowPowerTimer timer;
-
-    timer.start();
-
-    while (true) {
-        last_update_us += (uint64_t) timer.read_high_resolution_us();
-        timer.reset();
-
-        uint64_t last_update_ms = (last_update_us / 1000);
-        wsfTimerTicks_t wsf_ticks = (last_update_ms / WSF_MS_PER_TICK);
-
-        if (wsf_ticks > 0) {
-            WsfTimerUpdate(wsf_ticks);
-            last_update_us -= (last_update_ms * 1000);
-        }
-
-        wsfOsDispatcher();
-
-        bool sleep = false;
-        {
-            /* call needs interrupts disabled */
-            mbed::CriticalSectionLock critical_section;
-            if (wsfOsReadyToSleep()) {
-                sleep = true;
-            }
-        }
-
-        uint64_t time_spent = (uint64_t) timer.read_high_resolution_us();
-
-        /* don't bother sleeping if we're already past tick */
-        if (sleep && (WSF_MS_PER_TICK * 1000 > time_spent)) {
-            /* sleep to maintain constant tick rate */
-            uint64_t wait_time_us = WSF_MS_PER_TICK * 1000 - time_spent;
-            uint64_t wait_time_ms = wait_time_us / 1000;
-
-            wait_time_us = wait_time_us % 1000;
-
-            if (wait_time_ms) {
-              rtos::ThisThread::sleep_for(wait_time_ms);
-            }
-
-            if (wait_time_us) {
-              wait_us(wait_time_us);
-            }
-        }
-    }
-#else
-    while(true) {
-        rtos::ThisThread::sleep_for(osWaitForever);
-    }
-#endif // CORDIO_ZERO_COPY_HCI
-}
-
-static rtos::EventFlags bleEventFlags; 
-static rtos::Thread* bleLoopThread = NULL;
-
-
-HCICordioTransportClass::HCICordioTransportClass() :
-  _begun(false)
-{
-}
-
-HCICordioTransportClass::~HCICordioTransportClass()
-{
-}
-
-#if (defined(ARDUINO_PORTENTA_H7_M4) || defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_GIGA) || defined(ARDUINO_OPTA)) && !defined(CUSTOM_HCI_DRIVER)
-events::EventQueue eventQueue(10 * EVENTS_EVENT_SIZE);
-void scheduleMbedBleEvents(BLE::OnEventsToProcessCallbackContext *context) {
-  eventQueue.call(mbed::Callback<void()>(&context->ble, &BLE::processEvents));
-}
-
-void completeCallback(BLE::InitializationCompleteCallbackContext *context) {
-  eventQueue.break_dispatch();
-}
-#endif
-
-int HCICordioTransportClass::begin()
-{
-  _rxBuf.clear();
-
-#if CORDIO_ZERO_COPY_HCI
-  BLE_NAMESPACE::buf_pool_desc_t bufPoolDesc = CordioHCIHook::getDriver().get_buffer_pool_description();
-  init_wsf(bufPoolDesc);
-#endif
-
-#if (defined(ARDUINO_PORTENTA_H7_M4) || defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_GIGA) || defined(ARDUINO_OPTA)) && !defined(CUSTOM_HCI_DRIVER)
-
-  BLE &ble = BLE::Instance();
-  ble.onEventsToProcess(scheduleMbedBleEvents);
-
-  ble.init(completeCallback);
-  eventQueue.dispatch(10000);
-
-  if (!ble.hasInitialized()){
-    return 0;
-  } 
-#else 
-  CordioHCIHook::getDriver().initialize();
-#endif
-
-  if (bleLoopThread == NULL) {
-    bleLoopThread = new rtos::Thread();
-    bleLoopThread->start(bleLoop);
-  }
-
-  CordioHCIHook::setDataReceivedHandler(HCICordioTransportClass::onDataReceived);
-
-  _begun = true;
-
-  return 1;
-}
-
-void HCICordioTransportClass::end()
-{
-  if (bleLoopThread != NULL) {
-    bleLoopThread->terminate();
-    delete bleLoopThread;
-    bleLoopThread = NULL;
-  }
-  // Reset the callback with the mbed-os default handler to properly handle the following CYW43xxx chip initializations and begins
-  CordioHCIHook::setDataReceivedHandler(hciTrSerialRxIncoming);
-
-#if (defined(ARDUINO_PORTENTA_H7_M4) || defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_GIGA) || defined(ARDUINO_OPTA)) && !defined(CUSTOM_HCI_DRIVER)
-  BLE &ble = BLE::Instance();
-  ble.shutdown();
-#endif
-
-#if !defined(TARGET_STM32H7)
-  CordioHCIHook::getDriver().terminate();
-#endif
-
-  _begun = false;
-}
-
-void HCICordioTransportClass::wait(unsigned long timeout)
-{
-  if (available()) {
-    return;
-  }
-
-  // wait for handleRxData to signal
-  bleEventFlags.wait_all(0x01, timeout, true);
-}
-
-int HCICordioTransportClass::available()
-{
-  return _rxBuf.available();
-}
-
-int HCICordioTransportClass::peek()
-{
-  return _rxBuf.peek();
-}
-
-int HCICordioTransportClass::read()
-{
-  return _rxBuf.read_char();
-}
-
-size_t HCICordioTransportClass::write(const uint8_t* data, size_t length)
-{
-  if (!_begun) {
-    return 0;
-  }
-
-  uint8_t packetLength = length - 1;
-  uint8_t packetType   = data[0];
-
-#if CORDIO_ZERO_COPY_HCI
-  uint8_t* packet = (uint8_t*)WsfMsgAlloc(max(packetLength, MIN_WSF_ALLOC));
-
-  memcpy(packet, &data[1], packetLength);
-
-  return CordioHCIHook::getTransportDriver().write(packetType, packetLength, packet);
-#else
-  return CordioHCIHook::getTransportDriver().write(packetType, packetLength, (uint8_t*)&data[1]);
-#endif
-}
-
-void HCICordioTransportClass::handleRxData(uint8_t* data, uint8_t len)
-{
-  if (_rxBuf.availableForStore() < len) {
-    // drop!
-    return;
-  }
-
-  for (int i = 0; i < len; i++) {
-    _rxBuf.store_char(data[i]);
-  }
-
-  bleEventFlags.set(0x01);
-}
-
-HCICordioTransportClass HCICordioTransport;
-HCITransportInterface& HCITransport = HCICordioTransport;
-
-void HCICordioTransportClass::onDataReceived(uint8_t* data, uint8_t len)
-{
-  HCICordioTransport.handleRxData(data, len);
-}
-
-#endif
diff --git a/src/utility/HCICordioTransport.h b/src/utility/HCICordioTransport.h
deleted file mode 100644
index b8d0596a..00000000
--- a/src/utility/HCICordioTransport.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-  This file is part of the ArduinoBLE library.
-  Copyright (c) 2019 Arduino SA. All rights reserved.
-
-  This library is free software; you can redistribute it and/or
-  modify it under the terms of the GNU Lesser General Public
-  License as published by the Free Software Foundation; either
-  version 2.1 of the License, or (at your option) any later version.
-
-  This library is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  Lesser General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public
-  License along with this library; if not, write to the Free Software
-  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-#ifndef _HCI_CORDIO_TRANSPORT_H_
-#define _HCI_CORDIO_TRANSPORT_H_
-
-#include <string.h>
-
-#include "api/RingBuffer.h"
-
-#include "HCITransport.h"
-
-class HCICordioTransportClass : public HCITransportInterface {
-public:
-  HCICordioTransportClass();
-  virtual ~HCICordioTransportClass();
-
-  virtual int begin();
-  virtual void end();
-
-  virtual void wait(unsigned long timeout);
-
-  virtual int available();
-  virtual int peek();
-  virtual int read();
-
-  virtual size_t write(const uint8_t* data, size_t length);
-
-private:
-  static void onDataReceived(uint8_t* data, uint8_t len);
-  void handleRxData(uint8_t* data, uint8_t len);
-
-private:
-  bool _begun;
-  RingBufferN<256> _rxBuf;
-};
-
-#endif
diff --git a/src/utility/HCISharedMemTransport.cpp b/src/utility/HCISharedMemTransport.cpp
new file mode 100644
index 00000000..1544871a
--- /dev/null
+++ b/src/utility/HCISharedMemTransport.cpp
@@ -0,0 +1,781 @@
+/*
+  This file is part of the STM32duinoBLE library.
+  Copyright (c) 2019 STMicroelectronics. All rights reserved.
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License, or (at your option) any later version.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+*/
+#if defined(STM32WBxx) && !defined(USE_BLE_SPI)
+
+#include "HCISharedMemTransport.h"
+#include "STM32_WPAN/hw.h"
+#include "otp.h"
+
+HCISharedMemTransportClass HCISharedMemTransport;
+#if !defined(ARDUINO_NUCLEO_WB15CC) && !defined(ARDUINO_P_NUCLEO_WB55RG) &&\
+    !defined(ARDUINO_STM32WB5MM_DK) && !defined(ARDUINO_P_NUCLEO_WB55_USB_DONGLE)
+#warning "Selected board has never been tested with this library, ensure to have a correct configuration!"
+#endif
+
+/* Private variables ---------------------------------------------------------*/
+PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static TL_CmdPacket_t BleCmdBuffer;
+
+PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static uint8_t EvtPool[POOL_SIZE];
+PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static TL_CmdPacket_t SystemCmdBuffer;
+PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static uint8_t
+SystemSpareEvtBuffer[sizeof(TL_PacketHeader_t) + TL_EVT_HDR_SIZE + 255];
+PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static uint8_t
+BleSpareEvtBuffer[sizeof(TL_PacketHeader_t) + TL_EVT_HDR_SIZE + 255];
+PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static uint8_t
+HciAclDataBuffer[sizeof(TL_PacketHeader_t) + 5 + 251];
+
+
+/* global var used as semaphore to control incoming events */
+volatile bool sys_event; /* true : M0 core is already up and running */
+volatile bool acl_data_on; /* true : sending ACL data in progress, false : send is possible */
+volatile bool data_overflow;
+
+/* buffer to store the received packets */
+volatile uint8_t _rxbuff[BLE_MODULE_SHARED_MEM_BUFFER_SIZE];
+volatile uint16_t _read_index; /* fifo position when reading */
+volatile uint16_t _write_index; /* fifo position when receiving */
+
+/* var of different device steps during init and receiving  */
+volatile bool phase_bd_addr;
+volatile bool phase_tx_power;
+volatile bool phase_reset;
+volatile bool phase_running;
+
+
+/** Bluetooth Device Address */
+static uint8_t bd_addr_udn[CONFIG_DATA_PUBADDR_LEN];
+
+/* Private functions ---------------------------------------------------------*/
+/**
+ * TL Mailbox synchronization means
+ */
+
+/*  returns true if sys_event was received, false otherwise */
+static bool sysevt_wait(void)
+{
+  /* sys_event remains false until event is received */
+  for (unsigned long start = millis(); (millis() - start) < BLE_IPCC_TIMEOUT;) {
+    /* Wait for 10sec max - if not return an error */
+    if (sys_event) {
+      break;
+    }
+  }
+
+  if (!sys_event) {
+#if defined(PRINT_IPCC_INFO)
+    printf("ERROR: sys_evt timeout\r\n");
+#endif /*(PRINT_IPCC_INFO)*/
+    /*  no event received, timeout occurs */
+    return false;
+  }
+  /*  release immediately, now that M0 runs */
+  return true;
+}
+
+/*  WEAK callbacks from the BLE TL driver - will be called under Interrupt */
+static void sysevt_received(void *pdata)
+{
+  UNUSED(pdata);
+  /* For now only READY event is received, so we know this is it */
+  __disable_irq();
+  sys_event = true;
+  __enable_irq();
+  /* But later on ... we'll have to parse the answer */
+}
+
+/*  returns true if sysevt was already received, which means M0 core is
+ *  already up and running */
+static bool sysevt_check(void)
+{
+  /*  Check if system is UP and running already */
+  for (unsigned long start = millis(); (millis() - start) < 10;) {
+    /* Wait for 10ms max - if not return an error */
+    if (sys_event) {
+      break;
+    }
+  }
+  if (sys_event) {
+    /*  release immediately as M0 already runs */
+    return true;
+  }
+  return false;
+}
+
+static void acl_data_ack(void)
+{
+  /**
+   * The current implementation assumes the taskGUI will not send a new HCI ACL DATA packet before this ack is received
+   * ( which means the CPU2 has handled the previous packet )
+   * In order to implement a secure mechanism, it is required either
+   * - a flow control with the stack
+   * - a local pool of buffer to store packets received from the stack
+   */
+  __disable_irq();
+  acl_data_on = false;
+  __enable_irq();
+}
+
+static bool acl_data_wait(void)
+{
+  /* Wait 10 sec for previous ACL command to be ack'ed by Low Layers
+   * before sending the next one */
+  for (unsigned long start = millis(); (millis() - start) < BLE_IPCC_TIMEOUT;) {
+    /* Wait for 10sec max - if not return an error */
+    if (!acl_data_on) {
+      break;
+    }
+  }
+  if (acl_data_on) {
+    /*  no event received, timeout occurs */
+#if defined(PRINT_IPCC_INFO)
+    printf("ERROR: acl data timeout\r\n");
+#endif /*(PRINT_IPCC_INFO)*/
+    return false;
+  }
+  /*  release immediately, now that M0 runs */
+  __disable_irq();
+  acl_data_on = false;
+  __enable_irq();
+  return true;
+}
+
+static void syscmd_status_not(SHCI_TL_CmdStatus_t status)
+{
+#if defined(PRINT_IPCC_INFO)
+  printf("syscmd_status_not, status:%d\r\n", status);
+#else
+  UNUSED(status);
+#endif /*(PRINT_IPCC_INFO)*/
+}
+
+/* to received BLE packet from the SharedMem */
+void evt_received(TL_EvtPacket_t *hcievt)
+{
+  uint16_t len = 0;
+
+  /* We need to memcpy the data before passing to higher layers.
+   * The received packet is copied in the _rxbuff
+   * but it must not exceed the BLE_MODULE_SHARED_MEM_BUFFER_SIZE
+   */
+  switch (hcievt->evtserial.type) {
+    case TL_BLEEVT_PKT_TYPE: {
+        /* before starting the running_phase', a RESET command (0x0C03) is sent
+         * by the HCI. Then this evt packet is temporarily kept in the _rxbuff
+         * the set_bd_address (0xFC0C) and the set_tw_power (0xFC0F) commands are sent.
+         * Only when both evt are received (not store in the _rxbuffer),
+         * the Reset packet is handled at HCI layer : the running_phase begins
+         */
+        if (phase_running == false) {
+          /* check the Rx event of complete the previous bd_addr or random address opcode 0xFC0C */
+          if ((hcievt->evtserial.evt.evtcode == TL_BLEEVT_CC_OPCODE) &&
+              (hcievt->evtserial.evt.payload[0] == 0x01) &&
+              (hcievt->evtserial.evt.payload[1] == 0x0C) &&
+              (hcievt->evtserial.evt.payload[2] == 0xFC)) {
+            /* First setting must be global address
+             */
+            phase_bd_addr = true;
+
+            if (hcievt->evtserial.evt.payload[3] != 0) {
+#if defined(PRINT_IPCC_INFO)
+              printf("Error: wrong BD Addr\r\n");
+#endif /*(PRINT_IPCC_INFO)*/
+            }
+            /* rx data is no more useful : not stored in the _rxbuff */
+            break;
+          }
+          /* check the Rx event of complete the previous tx power opcode 0xFC0F */
+          if ((hcievt->evtserial.evt.evtcode == TL_BLEEVT_CC_OPCODE) &&
+              (hcievt->evtserial.evt.payload[0] == 0x01) &&
+              (hcievt->evtserial.evt.payload[1] == 0x0F) &&
+              (hcievt->evtserial.evt.payload[2] == 0xFC)) {
+            phase_tx_power = true;
+            if (hcievt->evtserial.evt.payload[3] != 0) {
+#if defined(PRINT_IPCC_INFO)
+              printf("Error: wrong Tx power\r\n");
+#endif /*(PRINT_IPCC_INFO)*/
+            }
+            /* rx data is no more useful : not stored in the _rxbuff */
+            break;
+          }
+
+          /* check if the reset phase is in progress (opcode is 0x0C03) */
+          if ((hcievt->evtserial.evt.evtcode == TL_BLEEVT_CC_OPCODE) &&
+              (hcievt->evtserial.evt.payload[0] == 0x01) &&
+              (hcievt->evtserial.evt.payload[1] == 0x03) &&
+              (hcievt->evtserial.evt.payload[2] == 0x0C)) {
+            phase_reset = true;
+#if defined(PRINT_IPCC_INFO)
+            if (hcievt->evtserial.evt.payload[3] != 0) {
+              printf("Error: wrong reset\r\n");
+            }
+#endif /*(PRINT_IPCC_INFO)*/
+          }
+        }
+        __disable_irq();
+        /* store received data in the _rxbuff buffer */
+        len = hcievt->evtserial.evt.plen + TL_EVT_HDR_SIZE;
+        if (len < BLE_MODULE_SHARED_MEM_BUFFER_SIZE - _write_index) {
+          /* at the position of the _write_index */
+          memcpy((uint8_t *)&_rxbuff[_write_index], (uint8_t *)&hcievt->evtserial, len);
+          /* move index */
+          _write_index += len;
+        } else {
+          data_overflow = true;
+        }
+        __enable_irq();
+      }
+      break;
+    case TL_ACL_DATA_PKT_TYPE: {
+        TL_AclDataSerial_t *acl = &(((TL_AclDataPacket_t *)hcievt)->AclDataSerial);
+        __disable_irq();
+        len = acl->length + 5;
+        if (len < BLE_MODULE_SHARED_MEM_BUFFER_SIZE - _write_index) {
+          memcpy((uint8_t *)&_rxbuff[_write_index], (uint8_t *)acl, len);
+          /* move index */
+          _write_index += len;
+        } else {
+          data_overflow = true;
+        }
+        __enable_irq();
+      }
+      break;
+    default:
+      /* should not happen */
+#if defined(PRINT_IPCC_INFO)
+      printf("BLE TL evt_received, wrong type:%d\r\n", hcievt->evtserial.type);
+      while (1); /* let's block to check */
+#endif /*(PRINT_IPCC_INFO)*/
+      break;
+  }
+#if defined(PRINT_IPCC_INFO)
+  if (data_overflow) {
+    printf("Error: data read overflow\r\n");
+  }
+#endif /*(PRINT_IPCC_INFO)*/
+
+  /*  In case Event belongs to the Evt Pool we need to inform  */
+  if (((uint8_t *)hcievt >= EvtPool) && ((uint8_t *)hcievt < (EvtPool + POOL_SIZE))) {
+    /*  Free the message from shared memory */
+    TL_MM_EvtDone(hcievt);
+  }
+}
+
+/* to send BLE packet to the SharedMem : return nb of bytes actually written */
+uint16_t mbox_write(uint8_t type, uint16_t len, const uint8_t *pData)
+{
+  TL_CmdPacket_t *bleCmdBuf = &BleCmdBuffer;
+  // Note: Until enum is available
+  // type 01 Command
+  // type 02 ACL DATA
+  // type 03 SCO Voice (not supported)
+  // type 04 event - uplink (not supported)
+  switch (type) {
+    case 1: { //BLE command
+        bleCmdBuf->cmdserial.type = type; // for now this param is overwritten in TL_BLE_SendCmd
+        bleCmdBuf->cmdserial.cmd.plen = len;
+        memcpy((void *) &bleCmdBuf->cmdserial.cmd, pData, len);
+        /* We're tracing here the command, after copy in shared mem but before M0 trigger. */
+        TL_BLE_SendCmd(NULL, 0); // unused parameters for now
+      }
+      break;
+    case 2: { //ACL DATA
+        if (!acl_data_wait()) {
+#if defined(PRINT_IPCC_INFO)
+          printf("ERROR: previous ACL message not ACK'd\r\n");
+#endif /*(PRINT_IPCC_INFO)*/
+          /*  return number of bytes sent, 0 in this error case */
+          return 0;
+        }
+        TL_AclDataSerial_t *aclDataSerial = (TL_AclDataSerial_t *)(HciAclDataBuffer + sizeof(TL_PacketHeader_t));
+        aclDataSerial->type = type; // for now this param is overwritten in TL_BLE_SendCmd
+        memcpy(HciAclDataBuffer + sizeof(TL_PacketHeader_t) + sizeof(type), pData, len);
+        TL_BLE_SendAclData(NULL, 0); // unused parameters for now
+        __disable_irq();
+        acl_data_on = true; /* data being send */
+        __enable_irq();
+      }
+      break;
+    default:
+#if defined(PRINT_IPCC_INFO)
+      printf("ERROR: not supported type\r\n");
+#endif /*(PRINT_IPCC_INFO)*/
+      /*  return number of bytes sent, 0 in this error case */
+      len = 0;
+      break;
+  }
+  return len;
+}
+
+/**
+ * Few utilities functions
+ */
+/* This function fills in a BD address table */
+static bool get_bd_address(uint8_t *bd_addr)
+{
+  uint32_t udn;
+  uint32_t company_id;
+  uint32_t device_id;
+  bool bd_found;
+
+  udn = LL_FLASH_GetUDN();
+
+  if (udn != 0xFFFFFFFF) {
+    /* "Found Unique Device Number: %#06x", udn) */
+
+    company_id = LL_FLASH_GetSTCompanyID();
+    device_id = LL_FLASH_GetDeviceID();
+
+    bd_addr[0] = (uint8_t)(udn & 0x000000FF);
+    bd_addr[1] = (uint8_t)((udn & 0x0000FF00) >> 8);
+    bd_addr[2] = (uint8_t)device_id;
+    bd_addr[3] = (uint8_t)(company_id & 0x000000FF);
+    bd_addr[4] = (uint8_t)((company_id & 0x0000FF00) >> 8);
+    bd_addr[5] = (uint8_t)((company_id & 0x00FF0000) >> 16);
+
+    bd_found = true;
+  } else {
+    OTP_BT_t *p_otp = (OTP_BT_t *)OTP_Read(0);
+    if (p_otp) {
+      memcpy(bd_addr, p_otp->bd_address, CONFIG_DATA_PUBADDR_LEN);
+      bd_found = true;
+    } else {
+      bd_found = false;
+    }
+  }
+
+  return bd_found;
+}
+
+static void init_debug(void)
+{
+  /* In case of debug profile, configure debugger support */
+
+#if defined(CONFIG_DEBUG)
+#if defined(PRINT_IPCC_INFO)
+  printf("init_debug ENABLED\r\n");
+#endif /*(PRINT_IPCC_INFO)*/
+  /**
+   * Keep debugger enabled while in any low power mode
+   */
+  HAL_DBGMCU_EnableDBGSleepMode();
+  HAL_DBGMCU_EnableDBGStopMode();
+  HAL_DBGMCU_EnableDBGStandbyMode();
+
+  /* Enable debugger: Debug power up request wakeup EXTI line 48 */
+  LL_EXTI_EnableIT_32_63(LL_EXTI_LINE_48);
+  LL_C2_EXTI_EnableIT_32_63(LL_EXTI_LINE_48);
+
+#endif /* CONFIG_DEBUG */
+}
+
+/* Class definition ----------------------------------------------------------*/
+
+HCISharedMemTransportClass::HCISharedMemTransportClass()
+{
+  _read_index = 0; /* fifo position when reading */
+  _write_index = 0; /* fifo position when receiving */
+
+  memset((void *)_rxbuff, 0, sizeof(_rxbuff));
+
+  sys_event = false;
+  acl_data_on = false;
+
+  data_overflow = false;
+
+  phase_bd_addr = false;
+  phase_tx_power = false;
+  phase_reset = false;
+  phase_running = false;
+}
+
+HCISharedMemTransportClass::~HCISharedMemTransportClass()
+{
+}
+
+int HCISharedMemTransportClass::begin()
+{
+  int status = 1;
+  /* clean data Rx variables */
+  _read_index = 0;
+  _write_index = 0;
+
+  memset((void *)_rxbuff, 0, sizeof(_rxbuff));
+
+  /*  Check whether M0 sub-system was started already by
+   *  checking if the system event was already received
+   *  before. If it was not, then go through all init. */
+  if (!sysevt_check()) {
+    start_ble_rf();
+    init_debug();
+    /* Take BLE out of reset */
+    stm32wb_reset();
+    /* "C2 unlocking" */
+    transport_init();
+    /*  At this stage, we got the ready event,
+     *  passed through TL_SYS_EvtReceived */
+
+    WirelessFwInfo_t wireless_info_instance;
+    WirelessFwInfo_t *p_wireless_info = &wireless_info_instance;
+    SHCI_GetWirelessFwInfo(p_wireless_info);
+#if defined(PRINT_IPCC_INFO)
+    printf("WB copro FW version = %d.%d.%d\r\n", p_wireless_info->VersionMajor, p_wireless_info->VersionMinor, p_wireless_info->VersionSub);
+#endif /*(PRINT_IPCC_INFO)*/
+
+    /* Now start BLE service on firmware side, using Vendor specific
+     * command on the System Channel
+     */
+    status = stm32wb_start_ble();
+
+    /* Once reset complete event is received we will need
+     * to send a few more commands:
+     * set bd addr with bt_ipm_set_addr();
+     * during the HCI rest command */
+  }
+  /* IPM Channel is now open */
+#if defined(PRINT_IPCC_INFO)
+  printf("IPM Channel Open Completed\r\n");
+#endif /*(PRINT_IPCC_INFO)*/
+
+  return status;
+}
+
+void HCISharedMemTransportClass::end()
+{
+  /* M0 sub-system is already on (sys_event) */
+  acl_data_on = false;
+  data_overflow = false;
+
+  /* the HCI RESET command ready to be processed again */
+  phase_bd_addr = false;
+  phase_tx_power = false;
+  phase_reset = false;
+  phase_running = false;
+}
+
+void HCISharedMemTransportClass::wait(unsigned long timeout)
+{
+  for (unsigned long start = millis(); (millis() - start) < timeout;) {
+    if (available()) {
+      break;
+    }
+  }
+}
+
+int HCISharedMemTransportClass::available()
+{
+  /* assuming the reset is already achieved,
+   * the LL-only mode is already configured. */
+
+  if (_read_index != _write_index) {
+    return 1;
+  } else if (data_overflow) {
+    __disable_irq();
+    data_overflow = false;
+    __enable_irq();
+    if (_read_index != _write_index) {
+      return 1;
+    }
+  }
+
+  return 0;
+}
+
+int HCISharedMemTransportClass::peek()
+{
+  int peek_val = -1;
+  __disable_irq();
+  if (_read_index != _write_index) {
+    peek_val = _rxbuff[_read_index];
+  }
+  __enable_irq();
+  return peek_val;
+}
+
+int HCISharedMemTransportClass::read()
+{
+  int read_val = -1;
+  __disable_irq();
+  if (_read_index != _write_index) {
+    read_val = _rxbuff[_read_index];
+    _read_index++;
+    if (_read_index == _write_index) {
+      /* Reset buffer index */
+      _read_index = 0;
+      _write_index = 0;
+    }
+  }
+  __enable_irq();
+  return read_val;
+}
+
+size_t HCISharedMemTransportClass::write(const uint8_t *data, size_t length)
+{
+  const uint8_t *msg_data;
+  msg_data = &data[1];
+
+  /* capture the HCI reset send command opcode = 0x0C03
+   * After HCI reset event complete in the evt_received(),
+   * the bd_addr and tx_power must be sent
+   * before the phase_running begins.
+   */
+  if (phase_running) {
+    return mbox_write(data[0], (length - 1), msg_data);;
+  }
+  if ((data[1] == 0x03) && (data[2] == 0x0C)) {
+    phase_reset = false;
+
+    if (mbox_write(data[0], (length - 1), msg_data) != (length - 1)) {
+      /* Error: no data are written */
+      return 0;
+    }
+    /* capture event after HCI_RESET */
+    while (!phase_reset);
+
+    /* set the bd add */
+    if (!bt_ipm_set_addr()) {
+      /* in case of error, no data are written */
+      return 0;
+    }
+    /* wait for the Rx complete */
+    while (!phase_bd_addr);
+    /* this sequence is now complete */
+
+    /* set the Tx power */
+    bt_ipm_set_power();
+    /* wait for the Rx complete */
+    while (!phase_tx_power);
+
+    /* this sequence is now complete */
+    phase_running = true;
+
+    return (length - 1); /* mbox_size of the HCI reset command */
+  }
+  return 0; /* Error: no data written */
+}
+
+//private:
+void HCISharedMemTransportClass::start_ble_rf(void)
+{
+  /* Set the DBP bit in the Power control register 1 (PWR_CR1) */
+  LL_PWR_EnableBkUpAccess();
+
+  /* LSE belongs to the back-up domain, enable access.*/
+  while (!LL_PWR_IsEnabledBkUpAccess()) {
+  /* Wait for Backup domain access */
+  }
+  LL_RCC_ForceBackupDomainReset();
+  LL_RCC_ReleaseBackupDomainReset();
+
+  /* Enable LSE Oscillator (32.768 kHz) */
+  LL_RCC_LSE_Enable();
+  while (!LL_RCC_LSE_IsReady()) {
+    /* Wait for LSE ready */
+  }
+
+  LL_PWR_DisableBkUpAccess();
+
+  /* Switch OFF LSI as LSE is the source clock */
+  LL_RCC_LSI2_Disable();
+}
+
+void HCISharedMemTransportClass::stm32wb_reset(void)
+{
+  // Reset IPCC
+  LL_AHB3_GRP1_EnableClock(LL_AHB3_GRP1_PERIPH_IPCC);
+
+  LL_C1_IPCC_ClearFlag_CHx(
+    IPCC,
+    LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4
+    | LL_IPCC_CHANNEL_5 | LL_IPCC_CHANNEL_6);
+
+  LL_C2_IPCC_ClearFlag_CHx(
+    IPCC,
+    LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4
+    | LL_IPCC_CHANNEL_5 | LL_IPCC_CHANNEL_6);
+
+  LL_C1_IPCC_DisableTransmitChannel(
+    IPCC,
+    LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4
+    | LL_IPCC_CHANNEL_5 | LL_IPCC_CHANNEL_6);
+
+  LL_C2_IPCC_DisableTransmitChannel(
+    IPCC,
+    LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4
+    | LL_IPCC_CHANNEL_5 | LL_IPCC_CHANNEL_6);
+
+  LL_C1_IPCC_DisableReceiveChannel(
+    IPCC,
+    LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4
+    | LL_IPCC_CHANNEL_5 | LL_IPCC_CHANNEL_6);
+
+  LL_C2_IPCC_DisableReceiveChannel(
+    IPCC,
+    LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4
+    | LL_IPCC_CHANNEL_5 | LL_IPCC_CHANNEL_6);
+
+  /* IPCC default IRQ handlers: IPCC_C1_TX_IRQHandler & IPCC_C1_RX_IRQHandler
+   * are mapped in the flash mem area, so that NVIC does not need to SetVector
+   */
+}
+
+int HCISharedMemTransportClass::stm32wb_start_ble(void)
+{
+  SHCI_C2_Ble_Init_Cmd_Packet_t ble_init_cmd_packet = {
+    0, 0, 0,                            /**< Header unused */
+    0,                                  /** pBleBufferAddress not used */
+    0,                                  /** BleBufferSize not used */
+    CFG_BLE_NUM_GATT_ATTRIBUTES,
+    CFG_BLE_NUM_GATT_SERVICES,
+    CFG_BLE_ATT_VALUE_ARRAY_SIZE,
+    CFG_BLE_NUM_LINK,
+    CFG_BLE_DATA_LENGTH_EXTENSION,
+    CFG_BLE_PREPARE_WRITE_LIST_SIZE,
+    CFG_BLE_MBLOCK_COUNT,
+    CFG_BLE_MAX_ATT_MTU,
+    CFG_BLE_PERIPHERAL_SCA,
+    CFG_BLE_CENTRAL_SCA,
+    CFG_BLE_LS_SOURCE,
+    CFG_BLE_MAX_CONN_EVENT_LENGTH,
+    CFG_BLE_HSE_STARTUP_TIME,
+    CFG_BLE_VITERBI_MODE,
+    CFG_BLE_OPTIONS,
+    0,                                  /** TODO Should be read from HW */
+    CFG_BLE_MAX_COC_INITIATOR_NBR,
+    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_CORE_VERSION,
+    CFG_BLE_OPTIONS_EXT
+  };
+  /**
+   * Starts the BLE Stack on CPU2
+   */
+  if (SHCI_C2_BLE_Init(&ble_init_cmd_packet) == SHCI_Success) {
+    return 1;
+  }
+  return 0;
+}
+
+void HCISharedMemTransportClass::transport_init(void)
+{
+  TL_MM_Config_t tl_mm_config;
+  TL_BLE_InitConf_t tl_ble_config;
+  /* STM32WB offers a System Channel HCI interface for
+     offering system services, with proprietary commands.
+     System Channel must be used as well for starting up
+     BLE service so we need to initialize it. */
+  SHCI_TL_HciInitConf_t shci_init_config;
+
+  /**< Reference table initialization */
+  TL_Init();
+
+  /**< System channel initialization */
+  shci_init_config.p_cmdbuffer = (uint8_t *)&SystemCmdBuffer;
+  shci_init_config.StatusNotCallBack = syscmd_status_not;
+  shci_init(sysevt_received, (void *) &shci_init_config);
+
+  /**< Memory Manager channel initialization */
+  tl_mm_config.p_BleSpareEvtBuffer = BleSpareEvtBuffer;
+  tl_mm_config.p_SystemSpareEvtBuffer = SystemSpareEvtBuffer;
+  tl_mm_config.p_AsynchEvtPool = EvtPool;
+  tl_mm_config.AsynchEvtPoolSize = POOL_SIZE;
+  TL_MM_Init(&tl_mm_config);
+
+  TL_Enable();
+
+  /*  At this stage, we'll need to wait for ready event,
+   *  passed through TL_SYS_EvtReceived */
+  if (!sysevt_wait()) {
+#if defined(PRINT_IPCC_INFO)
+    printf("ERROR booting WB controller\r\n");
+#endif /*(PRINT_IPCC_INFO)*/
+  } else {
+    /**< BLE channel initialization */
+    tl_ble_config.p_cmdbuffer = (uint8_t *)&BleCmdBuffer;
+    tl_ble_config.p_AclDataBuffer = HciAclDataBuffer;
+    tl_ble_config.IoBusEvtCallBack = evt_received;
+    tl_ble_config.IoBusAclDataTxAck = acl_data_ack;
+    TL_BLE_Init((void *)&tl_ble_config);
+  }
+}
+
+int HCISharedMemTransportClass::bt_ipm_set_addr(void)
+{
+  /* the specific table for set addr is 8 bytes:
+   * one byte for config_offset
+   * one byte for length
+   * 6 bytes for payload */
+  uint8_t data[4 + 8];
+
+  phase_bd_addr = false;
+
+  if (get_bd_address(bd_addr_udn)) {
+    /* create ACI_HAL_WRITE_CONFIG_DATA */
+
+    data[0] = BT_BUF_CMD;
+    data[1] = uint8_t(ACI_WRITE_CONFIG_DATA_OPCODE & 0x000000FF); /* OCF */
+    data[2] = uint8_t((ACI_WRITE_CONFIG_DATA_OPCODE & 0x0000FF00) >> 8); /* OGF */
+    data[3] = 8; /* length of parameters */
+    /* fill the ACI_HAL_WRITE_CONFIG_DATA with the addr*/
+    data[4] = CONFIG_DATA_PUBADDR_OFFSET; /* the offset */
+    data[5] = 6; /* is the length of the bd_addr table */
+    memcpy(data + 6, bd_addr_udn, 6);
+    /* send the ACI_HAL_WRITE_CONFIG_DATA */
+    if (mbox_write(data[0], 11, &data[1]) != 11) {
+      /* Error: no data are written */
+      return 0;
+    }
+    /* now wait for the corresponding Rx event */
+    return 1; /* success */
+  }
+  return 0; /* Error */
+}
+
+
+int HCISharedMemTransportClass::bt_ipm_set_power(void)
+{
+  /* the specific table for power is 2 bytes:
+   * En_High_Power byte, PA_level byte */
+  uint8_t data[4 + 2];
+
+  phase_tx_power = false;
+
+  data[0] = BT_BUF_CMD; /* the type */
+  data[1] = (uint8_t)(ACI_HAL_SET_TX_POWER_LEVEL & 0x000000FF); /* the OPCODE */
+  data[2] = (uint8_t)((ACI_HAL_SET_TX_POWER_LEVEL & 0x0000FF00) >> 8);
+  data[3] = 2; /* the length */
+  /* fill the SET_POWER */
+  data[4] = 0x01; /* En_High_Power */
+  data[5] = CFG_TX_POWER; /* PA_level */
+
+  /* send the SET_POWER */
+  if (mbox_write(data[0], 5, &data[1]) != 5) {
+    /* Error: no data are written */
+    return 0;
+  }
+  /* now wait for the corresponding Rx event */
+  return 1; /* success */
+}
+
+HCITransportInterface& HCITransport = HCISharedMemTransport;
+#endif /* STM32WBxx && !USE_BLE_SPI */
diff --git a/src/utility/HCISharedMemTransport.h b/src/utility/HCISharedMemTransport.h
new file mode 100644
index 00000000..e739d63f
--- /dev/null
+++ b/src/utility/HCISharedMemTransport.h
@@ -0,0 +1,93 @@
+/*
+  This file is part of the STM32duinoBLE library.
+  Copyright (c) 2019 STMicroelectronics. All rights reserved.
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License, or (at your option) any later version.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+*/
+
+#ifndef _HCI_SHARED_MEM_TRANSPORT_H_
+#define _HCI_SHARED_MEM_TRANSPORT_H_
+
+#include "HCITransport.h"
+
+/* STM32WB include files */
+#include "stm32wbxx_ll_rcc.h"
+#include "stm32wbxx_ll_ipcc.h"
+#include "stm32wbxx_ll_system.h"
+#include "STM32_WPAN/tl.h"
+#include "STM32_WPAN/shci.h"
+#include "STM32_WPAN/shci_tl.h"
+#include "STM32_WPAN/app_conf.h"
+
+/* this one is for printing info content when HW serial enabled */
+//#define PRINT_IPCC_INFO
+
+/* this CONFIG_DEBUG must be defined for -Og option */
+//#define CONFIG_DEBUG
+
+/******************************************************************************
+ * BLE config parameters
+ ******************************************************************************/
+/*  Defined from WB Cube reference SW */
+#define CFG_TLBLE_EVT_QUEUE_LENGTH 5
+#define CFG_TLBLE_MOST_EVENT_PAYLOAD_SIZE 255   /**< Set to 255 with the memory manager and the mailbox */
+#define TL_BLE_EVENT_FRAME_SIZE ( TL_EVT_HDR_SIZE + CFG_TLBLE_MOST_EVENT_PAYLOAD_SIZE )
+#define POOL_SIZE (CFG_TLBLE_EVT_QUEUE_LENGTH*4*DIVC(( sizeof(TL_PacketHeader_t) + TL_BLE_EVENT_FRAME_SIZE ), 4))
+
+#define CONFIG_DATA_PUBADDR_OFFSET          (0x00) /**< Bluetooth public address */
+#define CONFIG_DATA_PUBADDR_LEN             (6)
+
+#define BT_BUF_CMD 1
+#define BT_BUF_ACL_OUT 2
+
+/* timeout (in ms) to wait for an incoming event */
+#define BLE_IPCC_TIMEOUT 10000
+
+/* to received BLE packet from the SharedMem */
+void evt_received(TL_EvtPacket_t *hcievt);
+
+/* to send BLE packet to the SharedMem */
+uint16_t mbox_write(uint8_t type, uint16_t len, const uint8_t *pData);
+
+class HCISharedMemTransportClass : public HCITransportInterface {
+  public:
+    HCISharedMemTransportClass();
+    virtual ~HCISharedMemTransportClass();
+
+    virtual int begin();
+    virtual void end();
+
+    virtual void wait(unsigned long timeout);
+
+    virtual int available();
+    virtual int peek();
+    virtual int read();
+
+    virtual size_t write(const uint8_t *data, size_t length);
+
+  private:
+
+    /* method to initialize the BLE device */
+    void transport_init(void);
+    void start_ble_rf(void);
+    void stm32wb_reset(void);
+    int stm32wb_start_ble(void);
+    int bt_ipm_set_addr(void);
+    int bt_ipm_set_power(void);
+
+    uint8_t _random_addr[6];
+};
+
+#endif /* _HCI_SHARED_MEM_TRANSPORT_H_ */
diff --git a/src/utility/HCISilabsTransport.cpp b/src/utility/HCISilabsTransport.cpp
deleted file mode 100644
index 135fd020..00000000
--- a/src/utility/HCISilabsTransport.cpp
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
-  This file is part of the ArduinoBLE library.
-  Copyright (c) 2024 Arduino SA. All rights reserved.
-
-  This library is free software; you can redistribute it and/or
-  modify it under the terms of the GNU Lesser General Public
-  License as published by the Free Software Foundation; either
-  version 2.1 of the License, or (at your option) any later version.
-
-  This library is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  Lesser General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public
-  License along with this library; if not, write to the Free Software
-  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-#if defined(ARDUINO_SILABS)
-
-#include "HCISilabsTransport.h"
-#include "sl_string.h"
-
-extern "C" {
-#include "sl_btctrl_linklayer.h"
-#include "sl_hci_common_transport.h"
-}
-
-extern "C" int strcasecmp(char const *a, char const *b) {
-  return sl_strcasecmp(a, b);
-}
-
-static RingBufferN<512> buf;
-
-HCISilabsTransportClass::HCISilabsTransportClass()
-{
-}
-
-HCISilabsTransportClass::~HCISilabsTransportClass()
-{
-}
-
-int HCISilabsTransportClass::begin()
-{
-  if(!sl_btctrl_is_initialized()) {
-    sl_bt_controller_init(); 
-  }
-
-  /* Initialize adv & scan components */
-  sl_btctrl_init_adv();
-  sl_btctrl_init_scan();
-  sl_btctrl_init_conn(); 
-  sl_btctrl_init_adv_ext();
-  sl_btctrl_init_scan_ext();
-
-  /* Initialize HCI controller */
-  sl_bthci_init_upper(); 
-  sl_btctrl_hci_parser_init_default();
-  sl_btctrl_hci_parser_init_conn();
-  sl_btctrl_hci_parser_init_adv();
-  sl_btctrl_hci_parser_init_phy();
-
-  return 1;
-}
-
-void HCISilabsTransportClass::end()
-{
-  sl_bt_controller_deinit();
-}
-
-void HCISilabsTransportClass::wait(unsigned long timeout)
-{
-  for (unsigned long start = millis(); (millis() - start) < timeout;) {
-    if (available()) {
-      break;
-    }
-  }
-}
-
-int HCISilabsTransportClass::available()
-{
-  return buf.available();
-}
-
-int HCISilabsTransportClass::peek()
-{
-  return buf.peek();
-}
-
-int HCISilabsTransportClass::read()
-{
-  return buf.read_char();
-}
-
-size_t HCISilabsTransportClass::write(const uint8_t* data, size_t len)
-{
-  int ret = 0;
-  ret = hci_common_transport_receive((uint8_t *)data, len, true);
-
-  if (ret == 0) return len;
-
-  return 0;
-}
-
-extern "C" {
-  /**
-   * @brief Transmit HCI message using the currently used transport layer.
-   * The HCI calls this function to transmit a full HCI message.
-   * @param[in] data Packet type followed by HCI packet data.
-   * @param[in] len Length of the `data` parameter
-   * @return 0 - on success, or non-zero on failure.
-   */
-  uint32_t hci_common_transport_transmit(uint8_t *data, int16_t len)
-  {
-    for (int i = 0; i < len; i++) {
-      buf.store_char(data[i]);
-      if (buf.isFull()) return SL_STATUS_FAIL;
-    }
-    
-    sl_btctrl_hci_transmit_complete(0);
-    return 0;
-  }
-}
-
-HCISilabsTransportClass HCISilabsTransport;
-
-HCITransportInterface& HCITransport = HCISilabsTransport;
-
-#endif
diff --git a/src/utility/HCISilabsTransport.h b/src/utility/HCISilabsTransport.h
deleted file mode 100644
index 2061e782..00000000
--- a/src/utility/HCISilabsTransport.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
-  This file is part of the ArduinoBLE library.
-  Copyright (c) 2018 Arduino SA. All rights reserved.
-
-  This library is free software; you can redistribute it and/or
-  modify it under the terms of the GNU Lesser General Public
-  License as published by the Free Software Foundation; either
-  version 2.1 of the License, or (at your option) any later version.
-
-  This library is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  Lesser General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public
-  License along with this library; if not, write to the Free Software
-  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-#ifndef _HCI_SILABS_TRANSPORT_H_
-#define _HCI_SILABS_TRANSPORT_H_
-
-#include "HCITransport.h"
-
-class HCISilabsTransportClass : public HCITransportInterface {
-public:
-  HCISilabsTransportClass();
-  virtual ~HCISilabsTransportClass();
-
-  virtual int begin();
-  virtual void end();
-
-  virtual void wait(unsigned long timeout);
-
-  virtual int available();
-  virtual int peek();
-  virtual int read();
-
-  virtual size_t write(const uint8_t* data, size_t length);
-};
-
-#endif
\ No newline at end of file
diff --git a/src/utility/HCISpiTransport.cpp b/src/utility/HCISpiTransport.cpp
new file mode 100644
index 00000000..16b81623
--- /dev/null
+++ b/src/utility/HCISpiTransport.cpp
@@ -0,0 +1,1404 @@
+/*
+  This file is part of the STM32duinoBLE library.
+  Copyright (c) 2019 STMicroelectronics. All rights reserved.
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License, or (at your option) any later version.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+*/
+
+#if !defined(STM32WBxx) || defined(USE_BLE_SPI)
+#include "HCISpiTransport.h"
+
+#if defined(CUSTOM_BLE_SPI)
+SPIClass SpiHCI(BLE_SPI_MOSI, BLE_SPI_MISO, BLE_SPI_CLK);
+HCISpiTransportClass HCISpiTransport(SpiHCI, BLE_CHIP_TYPE, BLE_SPI_CS, BLE_SPI_IRQ, BLE_RESET, BLE_SPI_FREQ, BLE_SPI_MODE);
+#elif defined(ARDUINO_STEVAL_MKBOXPRO)
+/* STEVAL-MKBOXPRO */
+SPIClass SpiHCI(PA7, PA6, PA5);
+HCISpiTransportClass HCISpiTransport(SpiHCI, BLUENRG_LP, PA2, PB11, PD4, 1000000, SPI_MODE3);
+#elif defined(ARDUINO_STEVAL_MKSBOX1V1)
+/* STEVAL-MKSBOX1V1 */
+SPIClass SpiHCI(PC3, PD3, PD1);
+HCISpiTransportClass HCISpiTransport(SpiHCI, SPBTLE_1S, PD0, PD4, PA8, 1000000, SPI_MODE1);
+#elif defined(ARDUINO_B_L475E_IOT01A) || defined(ARDUINO_B_L4S5I_IOT01A)
+/* B-L475E-IOT01A1 or B_L4S5I_IOT01A */
+SPIClass SpiHCI(PC12, PC11, PC10);
+HCISpiTransportClass HCISpiTransport(SpiHCI, SPBTLE_RF, PD13, PE6, PA8, 8000000, SPI_MODE0);
+#elif defined(ARDUINO_STM32L562E_DK)
+/* STM32L562E-DK */
+SPIClass SpiHCI(PG4, PG3, PG2);
+HCISpiTransportClass HCISpiTransport(SpiHCI, BLUENRG_M0, PG5, PG6, PG8, 8000000, SPI_MODE0);
+#elif defined(IDB05A2_SPI_CLOCK_D3)
+/* Shield IDB05A2 with SPI clock on D3 */
+SPIClass SpiHCI(D11, D12, D3);
+HCISpiTransportClass HCISpiTransport(SpiHCI, BLUENRG_M0, A1, A0, D7, 8000000, SPI_MODE0);
+#elif defined(IDB05A2_SPI_CLOCK_D13)
+/* Shield IDB05A2 with SPI clock on D13 */
+#define SpiHCI SPI
+HCISpiTransportClass HCISpiTransport(SpiHCI, BLUENRG_M0, A1, A0, D7, 8000000, SPI_MODE0);
+#elif defined(IDB05A1_SPI_CLOCK_D3)
+/* Shield IDB05A1 with SPI clock on D3 */
+SPIClass SpiHCI(D11, D12, D3);
+HCISpiTransportClass HCISpiTransport(SpiHCI, SPBTLE_RF, A1, A0, D7, 8000000, SPI_MODE0);
+#elif defined(IDB05A1_SPI_CLOCK_D13)
+/* Shield IDB05A1 with SPI clock on D13 */
+#define SpiHCI SPI
+HCISpiTransportClass HCISpiTransport(SpiHCI, SPBTLE_RF, A1, A0, D7, 8000000, SPI_MODE0);
+#elif defined(BNRG2A1_SPI_CLOCK_D3)
+/* Shield BNRG2A1 with SPI clock on D3 */
+SPIClass SpiHCI(D11, D12, D3);
+HCISpiTransportClass HCISpiTransport(SpiHCI, BLUENRG_M2SP, A1, A0, D7, 1000000, SPI_MODE1);
+#elif defined(BNRG2A1_SPI_CLOCK_D13)
+/* Shield BNRG2A1 with SPI clock on D13 */
+#define SpiHCI SPI
+HCISpiTransportClass HCISpiTransport(SpiHCI, BLUENRG_M2SP, A1, A0, D7, 1000000, SPI_MODE1);
+#else
+#error "Unsupported board or shield selected!"
+#endif
+
+volatile int data_avail = 0;
+
+HCISpiTransportClass::HCISpiTransportClass(SPIClass &spi, BLEChip_t ble_chip, uint8_t cs_pin, uint8_t spi_irq, uint8_t ble_rst, uint32_t frequency, uint8_t spi_mode) :
+  _spi(&spi),
+  _ble_chip(ble_chip),
+  _cs_pin(cs_pin),
+  _spi_irq(spi_irq),
+  _ble_rst(ble_rst)
+{
+  _spiSettings = SPISettings(frequency, (BitOrder)BLE_SPI_BYTE_ORDER, spi_mode);
+  _read_index = 0;
+  _write_index = 0;
+  _write_index_initial = 0;
+  _initial_phase = 1;
+  _random_addr_done = false;
+}
+
+HCISpiTransportClass::~HCISpiTransportClass()
+{
+}
+
+extern "C" void SPI_Irq_Callback(void)
+{
+  data_avail = 1;
+}
+
+int HCISpiTransportClass::begin()
+{
+  _read_index = 0;
+  _write_index = 0;
+  _write_index_initial = 0;
+  _initial_phase = 1;
+  memset(_rxbuff, 0, sizeof(_rxbuff));
+  pinMode(_cs_pin, OUTPUT);
+  digitalWrite(_cs_pin, HIGH);
+
+  _spi->begin();
+
+  pinMode(_spi_irq, INPUT);
+  attachInterrupt(_spi_irq, SPI_Irq_Callback, RISING);
+
+  // Reset chip
+  pinMode(_ble_rst, OUTPUT);
+  digitalWrite(_ble_rst, LOW);
+  delay(5);
+  digitalWrite(_ble_rst, HIGH);
+  delay(5);
+
+  if (_ble_chip == SPBTLE_RF || _ble_chip == BLUENRG_M0 || _ble_chip == BLUENRG_LP || _ble_chip == BLUENRG_M2SP) {
+    // Wait for Blue Initialize
+    wait_for_blue_initialize();
+  } else if (_ble_chip == SPBTLE_1S) {
+    // Wait a while for the reset of the BLE module
+    delay(300);
+  } else {
+    // BLE chip not supported
+    return 0;
+  }
+
+  return 1;
+}
+
+void HCISpiTransportClass::end()
+{
+  detachInterrupt(_spi_irq);
+  _spi->end();
+}
+
+void HCISpiTransportClass::wait(unsigned long timeout)
+{
+  for (unsigned long start = millis(); (millis() - start) < timeout;) {
+    if (available()) {
+      break;
+    }
+  }
+}
+
+int HCISpiTransportClass::available()
+{
+  if (_ble_chip != SPBTLE_RF && _ble_chip != SPBTLE_1S && _ble_chip != BLUENRG_M2SP && _ble_chip != BLUENRG_M0 && _ble_chip != BLUENRG_LP) {
+    return 0;
+  }
+
+  if (_read_index != _write_index) {
+    return 1;
+  } else if (data_avail) {
+    int ble_reset = 0;
+
+    if (digitalRead(_spi_irq) == 0) {
+      return 0;
+    }
+
+    data_avail = 0;
+
+    // Wait for BlueNRG-LP to be ready (needs to be done after each HCI RESET)
+    if (_ble_chip == BLUENRG_LP && _initial_phase) {
+      delay(100);
+    }
+
+    while (digitalRead(_spi_irq) == 1 && _write_index != BLE_MODULE_SPI_BUFFER_SIZE) {
+      uint8_t header_master[5] = {0x0b, 0x00, 0x00, 0x00, 0x00};
+
+      if (_ble_chip == SPBTLE_1S || _ble_chip == BLUENRG_M2SP || _ble_chip == BLUENRG_LP) {
+        detachInterrupt(_spi_irq);
+      }
+
+      _spi->beginTransaction(_spiSettings);
+
+      digitalWrite(_cs_pin, LOW);
+
+      /* Write the header */
+      _spi->transfer(header_master, 5);
+
+      if (_ble_chip == SPBTLE_RF || _ble_chip == BLUENRG_M0) {
+        /* device is ready */
+        if (header_master[0] == 0x02) {
+          uint16_t byte_count = (header_master[4] << 8) | header_master[3];
+
+          if (byte_count > 0) {
+            if (_initial_phase) {
+              /* avoid to read more data that available size of the buffer */
+              if (byte_count > (BLE_MODULE_SPI_BUFFER_SIZE - _write_index_initial)) {
+                byte_count = (BLE_MODULE_SPI_BUFFER_SIZE - _write_index_initial);
+              }
+
+              /* Read the response */
+              for (int j = 0; j < byte_count; j++) {
+                _rxbuff[_write_index_initial] = _spi->transfer(0x00);
+                _write_index_initial++;
+              }
+
+              /* Check if the message is a Blue Initialize */
+              /* If so we need to send the command to enable LL_ONLY */
+              if (byte_count == 6) {
+                if (_rxbuff[_write_index_initial - 6] == 0x04 &&
+                    _rxbuff[_write_index_initial - 5] == 0xFF &&
+                    _rxbuff[_write_index_initial - 4] == 0x03 &&
+                    _rxbuff[_write_index_initial - 3] == 0x01 &&
+                    _rxbuff[_write_index_initial - 2] == 0x00 &&
+                    _rxbuff[_write_index_initial - 1] == 0x01) {
+                  ble_reset = 1;
+                }
+              }
+            } else {
+              /* avoid to read more data that available size of the buffer */
+              if (byte_count > (BLE_MODULE_SPI_BUFFER_SIZE - _write_index)) {
+                byte_count = (BLE_MODULE_SPI_BUFFER_SIZE - _write_index);
+                /* SPI buffer is full but we still have data to store, so we set the data_avail flag to true */
+                data_avail = 1;
+              }
+
+              /* Read the response */
+              for (int j = 0; j < byte_count; j++) {
+                _rxbuff[_write_index] = _spi->transfer(0x00);
+                _write_index++;
+              }
+            }
+          }
+        }
+      } else if (_ble_chip == SPBTLE_1S || _ble_chip == BLUENRG_M2SP || _ble_chip == BLUENRG_LP) {
+        uint16_t byte_count = (header_master[4] << 8) | header_master[3];
+
+        if (byte_count > 0) {
+          if (_initial_phase) {
+            /* avoid to read more data that available size of the buffer */
+            if (byte_count > (BLE_MODULE_SPI_BUFFER_SIZE - _write_index_initial)) {
+              byte_count = (BLE_MODULE_SPI_BUFFER_SIZE - _write_index_initial);
+            }
+
+            /* Read the response */
+            for (int j = 0; j < byte_count; j++) {
+              _rxbuff[_write_index_initial] = _spi->transfer(0x00);
+              _write_index_initial++;
+            }
+
+            /* Check if the message is a CMD_COMPLETE */
+            /* We suppose that the first CMD is always a HCI_RESET */
+            if (byte_count == 7) {
+              if (_rxbuff[_write_index_initial - 7] == 0x04 &&
+                  _rxbuff[_write_index_initial - 6] == 0x0E &&
+                  _rxbuff[_write_index_initial - 5] == 0x04 &&
+                  _rxbuff[_write_index_initial - 4] == 0x01 &&
+                  _rxbuff[_write_index_initial - 3] == 0x03 &&
+                  _rxbuff[_write_index_initial - 2] == 0x0C &&
+                  _rxbuff[_write_index_initial - 1] == 0x00) {
+                ble_reset = 1;
+              }
+            }
+          } else {
+            /* avoid to read more data that available size of the buffer */
+            if (byte_count > (BLE_MODULE_SPI_BUFFER_SIZE - _write_index)) {
+              byte_count = (BLE_MODULE_SPI_BUFFER_SIZE - _write_index);
+              /* SPI buffer is full but we still have data to store, so we set the data_avail flag to true */
+              data_avail = 1;
+            }
+
+            /* Read the response */
+            for (int j = 0; j < byte_count; j++) {
+              _rxbuff[_write_index] = _spi->transfer(0x00);
+              _write_index++;
+            }
+          }
+        }
+      }
+
+      digitalWrite(_cs_pin, HIGH);
+
+      _spi->endTransaction();
+
+      if (_ble_chip == SPBTLE_1S || _ble_chip == BLUENRG_M2SP || _ble_chip == BLUENRG_LP) {
+        attachInterrupt(_spi_irq, SPI_Irq_Callback, RISING);
+      }
+    }
+
+    if (ble_reset) {
+      if (_ble_chip == BLUENRG_M2SP) {
+        wait_for_blue_initialize();
+      }
+
+      if (_ble_chip == SPBTLE_RF || _ble_chip == BLUENRG_M0 || _ble_chip == BLUENRG_LP || _ble_chip == BLUENRG_M2SP) {
+        /* BLE chip was reset: we need to enable LL_ONLY */
+        enable_ll_only();
+        wait_for_enable_ll_only();
+      } else if (_ble_chip == SPBTLE_1S) {
+        /* BLE chip was reset: we need to wait for a while */
+        delay(300);
+      }
+
+      /* Call Gatt Init and Gap Init to activate the random BLE address */
+      if (!_random_addr_done) {
+        aci_gatt_init();
+        wait_for_aci_gatt_init();
+        aci_gap_init();
+        wait_for_aci_gap_init();
+        /* Call Read Config Parameter to retrieve the random BLE address */
+        aci_read_config_parameter();
+        wait_for_aci_read_config_parameter();
+        if (_ble_chip == BLUENRG_LP) {
+          hci_reset();
+          _read_index = _write_index = _write_index_initial = 0;
+          _initial_phase = 1;
+        } else {
+          /* Now we can update the write index and close the initial phase */
+          _write_index = _write_index_initial;
+          _initial_phase = 0;
+          _write_index_initial = 0;
+        }
+      } else {
+        set_address();
+        wait_for_set_address();
+        /* Now we can update the write index and close the initial phase */
+        _write_index = _write_index_initial;
+        _initial_phase = 0;
+        _write_index_initial = 0;
+      }
+    }
+
+    if (_read_index != _write_index) {
+      return 1;
+    } else {
+      return 0;
+    }
+  } else {
+    return 0;
+  }
+}
+
+int HCISpiTransportClass::peek()
+{
+  int peek_val = -1;
+
+  if (_read_index != _write_index) {
+    peek_val = _rxbuff[_read_index];
+  }
+
+  return peek_val;
+}
+
+int HCISpiTransportClass::read()
+{
+  int read_val = -1;
+
+  if (_read_index != _write_index) {
+    read_val = _rxbuff[_read_index];
+    _read_index++;
+    if (_read_index == _write_index) {
+      /* Reset buffer index */
+      _read_index = 0;
+      _write_index = 0;
+    }
+  }
+
+  return read_val;
+}
+
+size_t HCISpiTransportClass::write(const uint8_t *data, size_t length)
+{
+  uint8_t header_master[5] = {0x0a, 0x00, 0x00, 0x00, 0x00};
+  void *my_data = (void *)data;
+  int result = 0;
+  uint32_t tickstart = millis();
+
+  if (_ble_chip != SPBTLE_RF && _ble_chip != SPBTLE_1S && _ble_chip != BLUENRG_M2SP && _ble_chip != BLUENRG_M0 && _ble_chip != BLUENRG_LP) {
+    return 0;
+  }
+
+  do {
+    if (_ble_chip == SPBTLE_RF || _ble_chip == BLUENRG_M0) {
+      result = 0;
+
+      _spi->beginTransaction(_spiSettings);
+
+      digitalWrite(_cs_pin, LOW);
+
+      /* Write the header */
+      _spi->transfer(header_master, 5);
+
+      /* device is ready */
+      if (header_master[0] == 0x02) {
+        if (header_master[1] >= length) {
+          /* Write the data */
+          _spi->transfer(my_data, length);
+        } else {
+          result = -2;
+        }
+      } else {
+        result = -1;
+      }
+
+      digitalWrite(_cs_pin, HIGH);
+
+      _spi->endTransaction();
+
+      if ((millis() - tickstart) > 1000) {
+        result = -3;
+        break;
+      }
+    } else if (_ble_chip == SPBTLE_1S || _ble_chip == BLUENRG_M2SP || _ble_chip == BLUENRG_LP) {
+      uint32_t tickstart_data_available = millis();
+      result = 0;
+
+      detachInterrupt(_spi_irq);
+
+      _spi->beginTransaction(_spiSettings);
+
+      digitalWrite(_cs_pin, LOW);
+
+      /*
+       * Wait until BlueNRG-1 is ready.
+       * When ready it will raise the IRQ pin.
+       */
+      while (!(digitalRead(_spi_irq) == 1)) {
+        if ((millis() - tickstart_data_available) > 1000) {
+          result = -3;
+          break;
+        }
+      }
+
+      if (result == -3) {
+        digitalWrite(_cs_pin, HIGH);
+        _spi->endTransaction();
+        attachInterrupt(_spi_irq, SPI_Irq_Callback, RISING);
+        break;
+      }
+
+      /* Write the header */
+      _spi->transfer(header_master, 5);
+
+      if ((int)((((uint16_t)header_master[2]) << 8) | ((uint16_t)header_master[1])) >= (int)length) {
+        /* Write the data */
+        _spi->transfer(my_data, length);
+      } else {
+        result = -2;
+      }
+
+      digitalWrite(_cs_pin, HIGH);
+
+      _spi->endTransaction();
+
+      attachInterrupt(_spi_irq, SPI_Irq_Callback, RISING);
+
+      if ((millis() - tickstart) > 1000) {
+        result = -3;
+        break;
+      }
+    }
+  } while (result < 0);
+
+  if (result < 0) {
+    return 0;
+  } else {
+    return length;
+  }
+}
+
+void HCISpiTransportClass::wait_for_blue_initialize()
+{
+  int event_blue_initialize = 0;
+  uint8_t event[16];
+
+  do {
+    while (!data_avail);
+
+    if (digitalRead(_spi_irq) == 0) {
+      continue;
+    }
+
+    data_avail = 0;
+    while (digitalRead(_spi_irq) == 1) {
+      uint8_t header_master[5] = {0x0b, 0x00, 0x00, 0x00, 0x00};
+
+      if (_ble_chip == SPBTLE_1S || _ble_chip == BLUENRG_M2SP || _ble_chip == BLUENRG_LP) {
+        detachInterrupt(_spi_irq);
+      }
+
+      _spi->beginTransaction(_spiSettings);
+
+      digitalWrite(_cs_pin, LOW);
+
+      /* Write the header */
+      _spi->transfer(header_master, 5);
+
+      if (_ble_chip == SPBTLE_RF || _ble_chip == BLUENRG_M0) {
+        /* device is ready */
+        if (header_master[0] == 0x02) {
+          /* device is ready */
+          uint16_t byte_count = (header_master[4] << 8) | header_master[3];
+
+          if (byte_count > 0) {
+            /* Read the response */
+            if (byte_count == 6) {
+              for (int j = 0; j < byte_count; j++) {
+                event[j] = _spi->transfer(0x00);
+              }
+
+              if (event[0] == 0x04 &&
+                  event[1] == 0xFF &&
+                  event[2] == 0x03 &&
+                  event[3] == 0x01 &&
+                  event[4] == 0x00 &&
+                  event[5] == 0x01) {
+                event_blue_initialize = 1;
+              }
+            } else {
+              for (int j = 0; j < byte_count; j++) {
+                _spi->transfer(0x00);
+              }
+            }
+          }
+        }
+      } else if (_ble_chip == SPBTLE_1S || _ble_chip == BLUENRG_M2SP) {
+        uint16_t byte_count = (header_master[4] << 8) | header_master[3];
+
+        if (byte_count > 0) {
+          /* Read the response */
+          if (byte_count == 6) {
+            for (int j = 0; j < byte_count; j++) {
+              event[j] = _spi->transfer(0x00);
+            }
+
+            if (event[0] == 0x04 &&
+                event[1] == 0xFF &&
+                event[2] == 0x03 &&
+                event[3] == 0x01 &&
+                event[4] == 0x00 &&
+                event[5] == 0x01) {
+              event_blue_initialize = 1;
+            }
+          } else {
+            for (int j = 0; j < byte_count; j++) {
+              _spi->transfer(0x00);
+            }
+          }
+        }
+      } else if (_ble_chip == BLUENRG_LP) {
+        uint8_t byte_count = (header_master[4] << 8) | header_master[3];
+
+        if (byte_count > 0) {
+          /* Read the response */
+          if (byte_count == 7) {
+            for (int j = 0; j < byte_count; j++) {
+              event[j] = _spi->transfer(0x00);
+            }
+
+            if (event[0] == 0x82 &&
+                event[1] == 0xFF &&
+                event[2] == 0x03 &&
+                event[3] == 0x00 &&
+                event[4] == 0x01 &&
+                event[5] == 0x00 &&
+                event[6] == 0x01) {
+              event_blue_initialize = 1;
+            }
+          } else {
+            for (int j = 0; j < byte_count; j++) {
+              _spi->transfer(0x00);
+            }
+          }
+        }
+      }
+
+      digitalWrite(_cs_pin, HIGH);
+
+      _spi->endTransaction();
+
+      if (_ble_chip == SPBTLE_1S || _ble_chip == BLUENRG_M2SP || _ble_chip == BLUENRG_LP) {
+        attachInterrupt(_spi_irq, SPI_Irq_Callback, RISING);
+      }
+    }
+  } while (!event_blue_initialize);
+}
+
+void HCISpiTransportClass::wait_for_enable_ll_only()
+{
+  uint8_t data[8];
+  int status = 0;
+
+  do {
+    while (!data_avail);
+
+    if (digitalRead(_spi_irq) == 0) {
+      continue;
+    }
+
+    data_avail = 0;
+    while (digitalRead(_spi_irq) == 1) {
+      uint8_t header_master[5] = {0x0b, 0x00, 0x00, 0x00, 0x00};
+
+      if (_ble_chip == SPBTLE_1S || _ble_chip == BLUENRG_M2SP || _ble_chip == BLUENRG_LP) {
+        detachInterrupt(_spi_irq);
+      }
+
+      _spi->beginTransaction(_spiSettings);
+
+      digitalWrite(_cs_pin, LOW);
+
+      /* Write the header */
+      _spi->transfer(header_master, 5);
+
+      if (_ble_chip == SPBTLE_RF || _ble_chip == BLUENRG_M0) {
+        /* device is ready */
+        if (header_master[0] == 0x02) {
+          /* device is ready */
+          uint16_t byte_count = (header_master[4] << 8) | header_master[3];
+
+          if (byte_count > 0) {
+            /* Read the response */
+            for (int j = 0; j < byte_count; j++) {
+              data[j] = _spi->transfer(0x00);
+            }
+
+            if (byte_count >= 7) {
+              if (data[0] == 0x04 &&
+                  data[1] == 0x0E &&
+                  data[2] == 0x04 &&
+                  data[3] == 0x01 &&
+                  data[4] == 0x0C &&
+                  data[5] == 0xFC &&
+                  data[6] == 0x00) {
+                status = 1;
+              }
+            }
+          }
+        }
+      } else if (_ble_chip == SPBTLE_1S || _ble_chip == BLUENRG_M2SP || _ble_chip == BLUENRG_LP) {
+        uint16_t byte_count = (header_master[4] << 8) | header_master[3];
+
+        if (byte_count > 0) {
+          /* Read the response */
+          for (int j = 0; j < byte_count; j++) {
+            data[j] = _spi->transfer(0x00);
+          }
+
+          if (byte_count >= 7) {
+            if (data[0] == 0x04 &&
+                data[1] == 0x0E &&
+                data[2] == 0x04 &&
+                data[3] == 0x01 &&
+                data[4] == 0x0C &&
+                data[5] == 0xFC &&
+                data[6] == 0x00) {
+              status = 1;
+            }
+          }
+        }
+      }
+
+      digitalWrite(_cs_pin, HIGH);
+
+      _spi->endTransaction();
+
+      if (_ble_chip == SPBTLE_1S || _ble_chip == BLUENRG_M2SP || _ble_chip == BLUENRG_LP) {
+        attachInterrupt(_spi_irq, SPI_Irq_Callback, RISING);
+      }
+    }
+  } while (!status);
+}
+
+void HCISpiTransportClass::enable_ll_only()
+{
+  uint8_t header_master[5] = {0x0a, 0x00, 0x00, 0x00, 0x00};
+  uint8_t cmd[7] = {0x01, 0x0C, 0xFC, 0x03, 0x2C, 0x01, 0x01}; // Enable LL_ONLY
+  int result = 0;
+
+  do {
+    if (_ble_chip == SPBTLE_RF || _ble_chip == BLUENRG_M0) {
+      result = 0;
+
+      _spi->beginTransaction(_spiSettings);
+
+      digitalWrite(_cs_pin, LOW);
+
+      /* Write the header */
+      _spi->transfer(header_master, 5);
+
+      /* device is ready */
+      if (header_master[0] == 0x02) {
+        /* Write the data */
+        if (header_master[1] >= 7) {
+          /* Write the data */
+          _spi->transfer((void *)cmd, 7);
+        } else {
+          result = -2;
+        }
+      } else {
+        result = -1;
+      }
+
+      digitalWrite(_cs_pin, HIGH);
+
+      _spi->endTransaction();
+    } else if (_ble_chip == SPBTLE_1S || _ble_chip == BLUENRG_M2SP || _ble_chip == BLUENRG_LP) {
+      uint32_t tickstart_data_available = millis();
+      result = 0;
+
+      detachInterrupt(_spi_irq);
+
+      _spi->beginTransaction(_spiSettings);
+
+      digitalWrite(_cs_pin, LOW);
+
+      while (!(digitalRead(_spi_irq) == 1)) {
+        if ((millis() - tickstart_data_available) > 1000) {
+          result = -3;
+          break;
+        }
+      }
+
+      if (result == -3) {
+        digitalWrite(_cs_pin, HIGH);
+        _spi->endTransaction();
+        attachInterrupt(_spi_irq, SPI_Irq_Callback, RISING);
+        break;
+      }
+
+      /* Write the header */
+      _spi->transfer(header_master, 5);
+
+      if ((int)((((uint16_t)header_master[2]) << 8) | ((uint16_t)header_master[1])) >= 7) {
+        /* Write the data */
+        _spi->transfer((void *)cmd, 7);
+      } else {
+        result = -2;
+      }
+
+      digitalWrite(_cs_pin, HIGH);
+
+      _spi->endTransaction();
+
+      attachInterrupt(_spi_irq, SPI_Irq_Callback, RISING);
+    }
+  } while (result < 0);
+}
+
+void HCISpiTransportClass::wait_for_aci_gatt_init()
+{
+  uint8_t data[8];
+  int status = 0;
+
+  do {
+    while (!data_avail);
+
+    if (digitalRead(_spi_irq) == 0) {
+      continue;
+    }
+
+    data_avail = 0;
+    while (digitalRead(_spi_irq) == 1) {
+      uint8_t header_master[5] = {0x0b, 0x00, 0x00, 0x00, 0x00};
+
+      if (_ble_chip == SPBTLE_1S || _ble_chip == BLUENRG_M2SP || _ble_chip == BLUENRG_LP) {
+        detachInterrupt(_spi_irq);
+      }
+
+      _spi->beginTransaction(_spiSettings);
+
+      digitalWrite(_cs_pin, LOW);
+
+      /* Write the header */
+      _spi->transfer(header_master, 5);
+
+      if (_ble_chip == SPBTLE_RF || _ble_chip == BLUENRG_M0) {
+        /* device is ready */
+        if (header_master[0] == 0x02) {
+          /* device is ready */
+          uint16_t byte_count = (header_master[4] << 8) | header_master[3];
+
+          if (byte_count > 0) {
+            /* Read the response */
+            for (int j = 0; j < byte_count; j++) {
+              data[j] = _spi->transfer(0x00);
+            }
+
+            if (byte_count >= 7) {
+              if (data[0] == 0x04 &&
+                  data[1] == 0x0E &&
+                  data[2] == 0x04 &&
+                  data[3] == 0x01 &&
+                  data[4] == 0x01 &&
+                  data[5] == 0xFD &&
+                  data[6] == 0x00) {
+                status = 1;
+              }
+            }
+          }
+        }
+      } else if (_ble_chip == SPBTLE_1S || _ble_chip == BLUENRG_M2SP || _ble_chip == BLUENRG_LP) {
+        uint16_t byte_count = (header_master[4] << 8) | header_master[3];
+
+        if (byte_count > 0) {
+          /* Read the response */
+          for (int j = 0; j < byte_count; j++) {
+            data[j] = _spi->transfer(0x00);
+          }
+
+          if (byte_count >= 7) {
+            if (data[0] == 0x04 &&
+                data[1] == 0x0E &&
+                data[2] == 0x04 &&
+                data[3] == 0x01 &&
+                data[4] == 0x01 &&
+                data[5] == 0xFD &&
+                data[6] == 0x00) {
+              status = 1;
+            }
+          }
+        }
+      }
+
+      digitalWrite(_cs_pin, HIGH);
+
+      _spi->endTransaction();
+
+      if (_ble_chip == SPBTLE_1S || _ble_chip == BLUENRG_M2SP || _ble_chip == BLUENRG_LP) {
+        attachInterrupt(_spi_irq, SPI_Irq_Callback, RISING);
+      }
+    }
+  } while (!status);
+}
+
+void HCISpiTransportClass::aci_gatt_init()
+{
+  uint8_t header_master[5] = {0x0a, 0x00, 0x00, 0x00, 0x00};
+  uint8_t cmd[4] = {0x01, 0x01, 0xFD, 0x00}; // ACI_GATT_INIT
+  int result = 0;
+
+  do {
+    if (_ble_chip == SPBTLE_RF || _ble_chip == BLUENRG_M0) {
+      result = 0;
+
+      _spi->beginTransaction(_spiSettings);
+
+      digitalWrite(_cs_pin, LOW);
+
+      /* Write the header */
+      _spi->transfer(header_master, 5);
+
+      /* device is ready */
+      if (header_master[0] == 0x02) {
+        /* Write the data */
+        if (header_master[1] >= 4) {
+          /* Write the data */
+          _spi->transfer((void *)cmd, 4);
+        } else {
+          result = -2;
+        }
+      } else {
+        result = -1;
+      }
+
+      digitalWrite(_cs_pin, HIGH);
+
+      _spi->endTransaction();
+    } else if (_ble_chip == SPBTLE_1S || _ble_chip == BLUENRG_M2SP || _ble_chip == BLUENRG_LP) {
+      uint32_t tickstart_data_available = millis();
+      result = 0;
+
+      detachInterrupt(_spi_irq);
+
+      _spi->beginTransaction(_spiSettings);
+
+      digitalWrite(_cs_pin, LOW);
+
+      while (!(digitalRead(_spi_irq) == 1)) {
+        if ((millis() - tickstart_data_available) > 1000) {
+          result = -3;
+          break;
+        }
+      }
+
+      if (result == -3) {
+        digitalWrite(_cs_pin, HIGH);
+        _spi->endTransaction();
+        attachInterrupt(_spi_irq, SPI_Irq_Callback, RISING);
+        break;
+      }
+
+      /* Write the header */
+      _spi->transfer(header_master, 5);
+
+      if ((int)((((uint16_t)header_master[2]) << 8) | ((uint16_t)header_master[1])) >= 4) {
+        /* Write the data */
+        _spi->transfer((void *)cmd, 4);
+      } else {
+        result = -2;
+      }
+
+      digitalWrite(_cs_pin, HIGH);
+
+      _spi->endTransaction();
+
+      attachInterrupt(_spi_irq, SPI_Irq_Callback, RISING);
+    }
+  } while (result < 0);
+}
+
+void HCISpiTransportClass::wait_for_aci_gap_init()
+{
+  uint8_t data[14];
+  int status = 0;
+
+  do {
+    while (!data_avail);
+
+    if (digitalRead(_spi_irq) == 0) {
+      continue;
+    }
+
+    data_avail = 0;
+    while (digitalRead(_spi_irq) == 1) {
+      uint8_t header_master[5] = {0x0b, 0x00, 0x00, 0x00, 0x00};
+
+      if (_ble_chip == SPBTLE_1S || _ble_chip == BLUENRG_M2SP || _ble_chip == BLUENRG_LP) {
+        detachInterrupt(_spi_irq);
+      }
+
+      _spi->beginTransaction(_spiSettings);
+
+      digitalWrite(_cs_pin, LOW);
+
+      /* Write the header */
+      _spi->transfer(header_master, 5);
+
+      if (_ble_chip == SPBTLE_RF || _ble_chip == BLUENRG_M0) {
+        /* device is ready */
+        if (header_master[0] == 0x02) {
+          /* device is ready */
+          uint16_t byte_count = (header_master[4] << 8) | header_master[3];
+
+          if (byte_count > 0) {
+            /* Read the response */
+            for (int j = 0; j < byte_count; j++) {
+              data[j] = _spi->transfer(0x00);
+            }
+
+            if (byte_count >= 13) {
+              if (data[0] == 0x04 &&
+                  data[1] == 0x0E &&
+                  data[2] == 0x0A &&
+                  data[3] == 0x01 &&
+                  data[4] == 0x8A &&
+                  data[5] == 0xFC &&
+                  data[6] == 0x00) {
+                status = 1;
+              }
+            }
+          }
+        }
+      } else if (_ble_chip == SPBTLE_1S || _ble_chip == BLUENRG_M2SP || _ble_chip == BLUENRG_LP) {
+        uint16_t byte_count = (header_master[4] << 8) | header_master[3];
+
+        if (byte_count > 0) {
+          /* Read the response */
+          for (int j = 0; j < byte_count; j++) {
+            data[j] = _spi->transfer(0x00);
+          }
+
+          if (byte_count >= 13) {
+            if (data[0] == 0x04 &&
+                data[1] == 0x0E &&
+                data[2] == 0x0A &&
+                data[3] == 0x01 &&
+                data[4] == 0x8A &&
+                data[5] == 0xFC &&
+                data[6] == 0x00) {
+              status = 1;
+            }
+          }
+        }
+      }
+
+      digitalWrite(_cs_pin, HIGH);
+
+      _spi->endTransaction();
+
+      if (_ble_chip == SPBTLE_1S || _ble_chip == BLUENRG_M2SP || _ble_chip == BLUENRG_LP) {
+        attachInterrupt(_spi_irq, SPI_Irq_Callback, RISING);
+      }
+    }
+  } while (!status);
+}
+
+void HCISpiTransportClass::aci_gap_init()
+{
+  uint8_t header_master[5] = {0x0a, 0x00, 0x00, 0x00, 0x00};
+  uint8_t cmd_lp[8] = {0x01, 0x8A, 0xFC, 0x04, 0x0F, 0x00, 0x00, 0x00}; // ACI_GAP_INIT
+  uint8_t cmd_others[7] = {0x01, 0x8A, 0xFC, 0x03, 0x0F, 0x00, 0x00}; // ACI_GAP_INIT
+  uint8_t *cmd, cmd_size;
+  if (_ble_chip == BLUENRG_LP) {
+    cmd = cmd_lp;
+    cmd_size = 8;
+  } else {
+    cmd = cmd_others;
+    cmd_size = 7;
+  }
+  int result = 0;
+
+  do {
+    if (_ble_chip == SPBTLE_RF || _ble_chip == BLUENRG_M0) {
+      result = 0;
+
+      _spi->beginTransaction(_spiSettings);
+
+      digitalWrite(_cs_pin, LOW);
+
+      /* Write the header */
+      _spi->transfer(header_master, 5);
+
+      /* device is ready */
+      if (header_master[0] == 0x02) {
+        /* Write the data */
+        if (header_master[1] >= cmd_size) {
+          /* Write the data */
+          _spi->transfer((void *)cmd, cmd_size);
+        } else {
+          result = -2;
+        }
+      } else {
+        result = -1;
+      }
+
+      digitalWrite(_cs_pin, HIGH);
+
+      _spi->endTransaction();
+    } else if (_ble_chip == SPBTLE_1S || _ble_chip == BLUENRG_M2SP || _ble_chip == BLUENRG_LP) {
+      uint32_t tickstart_data_available = millis();
+      result = 0;
+
+      detachInterrupt(_spi_irq);
+
+      _spi->beginTransaction(_spiSettings);
+
+      digitalWrite(_cs_pin, LOW);
+
+      while (!(digitalRead(_spi_irq) == 1)) {
+        if ((millis() - tickstart_data_available) > 1000) {
+          result = -3;
+          break;
+        }
+      }
+
+      if (result == -3) {
+        digitalWrite(_cs_pin, HIGH);
+        _spi->endTransaction();
+        attachInterrupt(_spi_irq, SPI_Irq_Callback, RISING);
+        break;
+      }
+
+      /* Write the header */
+      _spi->transfer(header_master, 5);
+
+      if ((int)((((uint16_t)header_master[2]) << 8) | ((uint16_t)header_master[1])) >= cmd_size) {
+        /* Write the data */
+        _spi->transfer((void *)cmd, cmd_size);
+      } else {
+        result = -2;
+      }
+
+      digitalWrite(_cs_pin, HIGH);
+
+      _spi->endTransaction();
+
+      attachInterrupt(_spi_irq, SPI_Irq_Callback, RISING);
+    }
+  } while (result < 0);
+}
+
+void HCISpiTransportClass::wait_for_aci_read_config_parameter()
+{
+  uint8_t data[15];
+  int status = 0;
+
+  do {
+    while (!data_avail);
+
+    if (digitalRead(_spi_irq) == 0) {
+      continue;
+    }
+
+    data_avail = 0;
+    while (digitalRead(_spi_irq) == 1) {
+      uint8_t header_master[5] = {0x0b, 0x00, 0x00, 0x00, 0x00};
+
+      if (_ble_chip == SPBTLE_1S || _ble_chip == BLUENRG_M2SP || _ble_chip == BLUENRG_LP) {
+        detachInterrupt(_spi_irq);
+      }
+
+      _spi->beginTransaction(_spiSettings);
+
+      digitalWrite(_cs_pin, LOW);
+
+      /* Write the header */
+      _spi->transfer(header_master, 5);
+
+      if (_ble_chip == SPBTLE_RF || _ble_chip == BLUENRG_M0) {
+        /* device is ready */
+        if (header_master[0] == 0x02) {
+          /* device is ready */
+          uint16_t byte_count = (header_master[4] << 8) | header_master[3];
+
+          if (byte_count > 0) {
+            /* Read the response */
+            for (int j = 0; j < byte_count; j++) {
+              data[j] = _spi->transfer(0x00);
+            }
+
+            if (byte_count >= 13) {
+              if (data[0] == 0x04 &&
+                  data[1] == 0x0E &&
+                  data[2] == 0x0A &&
+                  data[3] == 0x01 &&
+                  data[4] == 0x0D &&
+                  data[5] == 0xFC &&
+                  data[6] == 0x00) {
+                memcpy(_random_addr, &data[7], 6);
+                status = 1;
+              }
+            }
+          }
+        }
+      } else if (_ble_chip == SPBTLE_1S || _ble_chip == BLUENRG_M2SP || _ble_chip == BLUENRG_LP) {
+        uint16_t byte_count = (header_master[4] << 8) | header_master[3];
+
+        if (byte_count > 0) {
+          /* Read the response */
+          for (int j = 0; j < byte_count; j++) {
+            data[j] = _spi->transfer(0x00);
+          }
+
+          if (byte_count >= 14) {
+            if (data[0] == 0x04 &&
+                data[1] == 0x0E &&
+                data[2] == 0x0B &&
+                data[3] == 0x01 &&
+                data[4] == 0x0D &&
+                data[5] == 0xFC &&
+                data[6] == 0x00) {
+              memcpy(_random_addr, &data[8], 6);
+              status = 1;
+              _random_addr_done = true;
+            }
+          }
+        }
+      }
+
+      digitalWrite(_cs_pin, HIGH);
+
+      _spi->endTransaction();
+
+      if (_ble_chip == SPBTLE_1S || _ble_chip == BLUENRG_M2SP || _ble_chip == BLUENRG_LP) {
+        attachInterrupt(_spi_irq, SPI_Irq_Callback, RISING);
+      }
+    }
+  } while (!status);
+}
+
+void HCISpiTransportClass::aci_read_config_parameter()
+{
+  uint8_t header_master[5] = {0x0a, 0x00, 0x00, 0x00, 0x00};
+  uint8_t cmd[5] = {0x01, 0x0D, 0xFC, 0x01, 0x80}; // ACI_READ_CONFIG_PARAMETER
+  int result = 0;
+
+  do {
+    if (_ble_chip == SPBTLE_RF || _ble_chip == BLUENRG_M0) {
+      result = 0;
+
+      _spi->beginTransaction(_spiSettings);
+
+      digitalWrite(_cs_pin, LOW);
+
+      /* Write the header */
+      _spi->transfer(header_master, 5);
+
+      /* device is ready */
+      if (header_master[0] == 0x02) {
+        /* Write the data */
+        if (header_master[1] >= 5) {
+          /* Write the data */
+          _spi->transfer((void *)cmd, 5);
+        } else {
+          result = -2;
+        }
+      } else {
+        result = -1;
+      }
+
+      digitalWrite(_cs_pin, HIGH);
+
+      _spi->endTransaction();
+    } else if (_ble_chip == SPBTLE_1S || _ble_chip == BLUENRG_M2SP || _ble_chip == BLUENRG_LP) {
+      uint32_t tickstart_data_available = millis();
+      result = 0;
+
+      detachInterrupt(_spi_irq);
+
+      _spi->beginTransaction(_spiSettings);
+
+      digitalWrite(_cs_pin, LOW);
+
+      while (!(digitalRead(_spi_irq) == 1)) {
+        if ((millis() - tickstart_data_available) > 1000) {
+          result = -3;
+          break;
+        }
+      }
+
+      if (result == -3) {
+        digitalWrite(_cs_pin, HIGH);
+        _spi->endTransaction();
+        attachInterrupt(_spi_irq, SPI_Irq_Callback, RISING);
+        break;
+      }
+
+      /* Write the header */
+      _spi->transfer(header_master, 5);
+
+      if ((int)((((uint16_t)header_master[2]) << 8) | ((uint16_t)header_master[1])) >= 5) {
+        /* Write the data */
+        _spi->transfer((void *)cmd, 5);
+      } else {
+        result = -2;
+      }
+
+      digitalWrite(_cs_pin, HIGH);
+
+      _spi->endTransaction();
+
+      attachInterrupt(_spi_irq, SPI_Irq_Callback, RISING);
+    }
+  } while (result < 0);
+}
+
+void HCISpiTransportClass::hci_reset()
+{
+  uint8_t header_master[5] = {0x0a, 0x00, 0x00, 0x00, 0x00};
+  uint8_t cmd[4] = {0x01, 0x03, 0x0C, 0x00}; // HCI_RESET
+  int result = 0;
+
+  do {
+    if (_ble_chip == BLUENRG_LP) {
+      uint32_t tickstart_data_available = millis();
+      result = 0;
+
+      detachInterrupt(_spi_irq);
+
+      _spi->beginTransaction(_spiSettings);
+
+      digitalWrite(_cs_pin, LOW);
+
+      while (!(digitalRead(_spi_irq) == 1)) {
+        if ((millis() - tickstart_data_available) > 1000) {
+          result = -3;
+          break;
+        }
+      }
+
+      if (result == -3) {
+        digitalWrite(_cs_pin, HIGH);
+        _spi->endTransaction();
+        attachInterrupt(_spi_irq, SPI_Irq_Callback, RISING);
+        break;
+      }
+
+      /* Write the header */
+      _spi->transfer(header_master, 5);
+
+      if ((int)((((uint16_t)header_master[2]) << 8) | ((uint16_t)header_master[1])) >= 4) {
+        /* Write the data */
+        _spi->transfer((void *)cmd, 4);
+      } else {
+        result = -2;
+      }
+
+      digitalWrite(_cs_pin, HIGH);
+
+      _spi->endTransaction();
+
+      attachInterrupt(_spi_irq, SPI_Irq_Callback, RISING);
+    }
+  } while (result < 0);
+}
+
+void HCISpiTransportClass::set_address()
+{
+  uint8_t header_master[5] = {0x0a, 0x00, 0x00, 0x00, 0x00};
+  uint8_t cmd[10] = {0x01, 0x05, 0x20, 0x06}; // SET ADDR
+  int result = 0;
+  memcpy(&cmd[4], _random_addr, 6);
+
+  do {
+    if (_ble_chip == BLUENRG_LP) {
+      uint32_t tickstart_data_available = millis();
+      result = 0;
+
+      detachInterrupt(_spi_irq);
+
+      _spi->beginTransaction(_spiSettings);
+
+      digitalWrite(_cs_pin, LOW);
+
+      while (!(digitalRead(_spi_irq) == 1)) {
+        if ((millis() - tickstart_data_available) > 1000) {
+          result = -3;
+          break;
+        }
+      }
+
+      if (result == -3) {
+        digitalWrite(_cs_pin, HIGH);
+        _spi->endTransaction();
+        attachInterrupt(_spi_irq, SPI_Irq_Callback, RISING);
+        break;
+      }
+
+      /* Write the header */
+      _spi->transfer(header_master, 5);
+
+      if ((int)((((uint16_t)header_master[2]) << 8) | ((uint16_t)header_master[1])) >= 10) {
+        /* Write the data */
+        _spi->transfer((void *)cmd, 10);
+      } else {
+        result = -2;
+      }
+
+      digitalWrite(_cs_pin, HIGH);
+
+      _spi->endTransaction();
+
+      attachInterrupt(_spi_irq, SPI_Irq_Callback, RISING);
+    }
+  } while (result < 0);
+}
+
+void HCISpiTransportClass::wait_for_set_address()
+{
+  uint8_t data[15];
+  int status = 0;
+
+  if (_ble_chip != BLUENRG_LP) {
+    return;
+  }
+
+  do {
+    while (!data_avail);
+
+    if (digitalRead(_spi_irq) == 0) {
+      continue;
+    }
+
+    data_avail = 0;
+    while (digitalRead(_spi_irq) == 1) {
+      uint8_t header_master[5] = {0x0b, 0x00, 0x00, 0x00, 0x00};
+      uint16_t byte_count = 0;
+
+      detachInterrupt(_spi_irq);
+
+      _spi->beginTransaction(_spiSettings);
+
+      digitalWrite(_cs_pin, LOW);
+
+      /* Write the header */
+      _spi->transfer(header_master, 5);
+
+      byte_count = (header_master[4] << 8) | header_master[3];
+
+      if (byte_count > 0) {
+        /* Read the response */
+        for (int j = 0; j < byte_count; j++) {
+          data[j] = _spi->transfer(0x00);
+        }
+
+        if (byte_count >= 7) { // 040E0401052000
+          if (data[0] == 0x04 &&
+              data[1] == 0x0E &&
+              data[2] == 0x04 &&
+              data[3] == 0x01 &&
+              data[4] == 0x05 &&
+              data[5] == 0x20 &&
+              data[6] == 0x00) {
+            status = 1;
+          }
+        }
+      }
+
+      digitalWrite(_cs_pin, HIGH);
+
+      _spi->endTransaction();
+
+      attachInterrupt(_spi_irq, SPI_Irq_Callback, RISING);
+    }
+  } while (!status);
+}
+
+HCITransportInterface& HCITransport = HCISpiTransport;
+#endif // !STM32WBxx || USE_BLE_SPI
diff --git a/src/utility/HCISpiTransport.h b/src/utility/HCISpiTransport.h
new file mode 100644
index 00000000..34af1aa9
--- /dev/null
+++ b/src/utility/HCISpiTransport.h
@@ -0,0 +1,83 @@
+/*
+  This file is part of the STM32duinoBLE library.
+  Copyright (c) 2019 STMicroelectronics. All rights reserved.
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License, or (at your option) any later version.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+*/
+
+#ifndef _HCI_SPI_TRANSPORT_H_
+#define _HCI_SPI_TRANSPORT_H_
+
+#include "HCITransport.h"
+#include "SPI.h"
+
+typedef enum BLEChip_s {
+  SPBTLE_RF,
+  SPBTLE_1S,
+  BLUENRG_M2SP,
+  BLUENRG_M0,
+  BLUENRG_LP
+} BLEChip_t;
+
+#ifndef BLE_SPI_BYTE_ORDER
+  #define BLE_SPI_BYTE_ORDER  MSBFIRST
+#endif
+#define BLE_MODULE_SPI_BUFFER_SIZE 128
+
+class HCISpiTransportClass : public HCITransportInterface {
+  public:
+    HCISpiTransportClass(SPIClass &spi, BLEChip_t ble_chip, uint8_t cs_pin, uint8_t spi_irq, uint8_t ble_rst, uint32_t frequency, uint8_t spi_mode);
+    virtual ~HCISpiTransportClass();
+
+    virtual int begin();
+    virtual void end();
+
+    virtual void wait(unsigned long timeout);
+
+    virtual int available();
+    virtual int peek();
+    virtual int read();
+
+    virtual size_t write(const uint8_t *data, size_t length);
+
+  private:
+    void wait_for_blue_initialize();
+    void wait_for_enable_ll_only();
+    void enable_ll_only();
+    void wait_for_aci_gatt_init();
+    void aci_gatt_init();
+    void wait_for_aci_gap_init();
+    void aci_gap_init();
+    void wait_for_aci_read_config_parameter();
+    void aci_read_config_parameter();
+    void hci_reset();
+    void set_address();
+    void wait_for_set_address();
+    SPIClass *_spi;
+    SPISettings _spiSettings;
+    BLEChip_t _ble_chip;
+    uint8_t _cs_pin;
+    uint8_t _spi_irq;
+    uint8_t _ble_rst;
+    uint8_t _rxbuff[BLE_MODULE_SPI_BUFFER_SIZE];
+    uint16_t _read_index;
+    uint16_t _write_index;
+    uint16_t _write_index_initial;
+    uint8_t _initial_phase;
+    uint8_t _random_addr[6];
+    bool _random_addr_done;
+};
+
+#endif /* _HCI_SPI_TRANSPORT_H_ */
diff --git a/src/utility/HCITransport.h b/src/utility/HCITransport.h
index d8aa6a95..02e7962f 100644
--- a/src/utility/HCITransport.h
+++ b/src/utility/HCITransport.h
@@ -22,6 +22,10 @@
 
 #include <Arduino.h>
 
+#if __has_include("ble_spi_conf.h")
+  #include "ble_spi_conf.h"
+#endif
+
 class HCITransportInterface {
 public:
   virtual int begin() = 0;
diff --git a/src/utility/HCIUartTransport.cpp b/src/utility/HCIUartTransport.cpp
deleted file mode 100644
index 191811a7..00000000
--- a/src/utility/HCIUartTransport.cpp
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
-  This file is part of the ArduinoBLE library.
-  Copyright (c) 2018 Arduino SA. All rights reserved.
-
-  This library is free software; you can redistribute it and/or
-  modify it under the terms of the GNU Lesser General Public
-  License as published by the Free Software Foundation; either
-  version 2.1 of the License, or (at your option) any later version.
-
-  This library is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  Lesser General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public
-  License along with this library; if not, write to the Free Software
-  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-#if !defined(ARDUINO_ARCH_MBED) && !defined(ESP32) && !defined(ARDUINO_SILABS) && !defined(ARDUINO_UNOR4_WIFI) || defined(TARGET_NANO_RP2040_CONNECT) //|| defined(CORE_CM4)
-
-#include "HCIUartTransport.h"
-
-#if defined(ARDUINO_SAMD_MKRWIFI1010) || defined(ARDUINO_AVR_UNO_WIFI_REV2)
-#define SerialHCI Serial2
-#elif defined(ARDUINO_SAMD_NANO_33_IOT) || defined(ARDUINO_NANO_RP2040_CONNECT)
-// SerialHCI is already defined in the variant
-#elif defined(ARDUINO_PORTENTA_H7_M4)
-// SerialHCI is already defined in the variant
-#elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION)
-#define SerialHCI Serial2
-#elif defined(ARDUINO_OPTA)
-#define SerialHCI Serial3
-#elif defined(ARDUINO_PORTENTA_C33)
-#define SerialHCI Serial5
-#elif defined(ARDUINO_GIGA)
-arduino::UART SerialHCI(CYBSP_BT_UART_TX, CYBSP_BT_UART_RX, CYBSP_BT_UART_RTS, CYBSP_BT_UART_CTS);
-#else
-#error "Unsupported board selected!"
-#endif
-
-HCIUartTransportClass::HCIUartTransportClass(HardwareSerial& uart, unsigned long baudrate) :
-  _uart(&uart),
-  _baudrate(baudrate)
-{
-}
-
-HCIUartTransportClass::~HCIUartTransportClass()
-{
-}
-
-int HCIUartTransportClass::begin()
-{
-  _uart->begin(_baudrate);
-
-  return 1;
-}
-
-void HCIUartTransportClass::end()
-{
-  _uart->end();
-}
-
-void HCIUartTransportClass::wait(unsigned long timeout)
-{
-  for (unsigned long start = millis(); (millis() - start) < timeout;) {
-    if (available()) {
-      break;
-    }
-  }
-}
-
-int HCIUartTransportClass::available()
-{
-  return _uart->available();
-}
-
-int HCIUartTransportClass::peek()
-{
-  return _uart->peek();
-}
-
-int HCIUartTransportClass::read()
-{
-  return _uart->read();
-}
-
-size_t HCIUartTransportClass::write(const uint8_t* data, size_t length)
-{
-#ifdef ARDUINO_AVR_UNO_WIFI_REV2
-  // wait while the CTS pin is low
-  while (digitalRead(NINA_CTS) == HIGH);
-#endif
-
-  size_t result = _uart->write(data, length);
-
-  _uart->flush();
-
-  return result;
-}
-
-#if defined(ARDUINO_AVR_UNO_WIFI_REV2) || defined(ARDUINO_NANO_RP2040_CONNECT)
-HCIUartTransportClass HCIUartTransport(SerialHCI, 119600);
-#else
-HCIUartTransportClass HCIUartTransport(SerialHCI, 912600);
-#endif
-HCITransportInterface& HCITransport = HCIUartTransport;
-
-#endif
diff --git a/src/utility/HCIUartTransport.h b/src/utility/HCIUartTransport.h
deleted file mode 100644
index ba70dff4..00000000
--- a/src/utility/HCIUartTransport.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
-  This file is part of the ArduinoBLE library.
-  Copyright (c) 2018 Arduino SA. All rights reserved.
-
-  This library is free software; you can redistribute it and/or
-  modify it under the terms of the GNU Lesser General Public
-  License as published by the Free Software Foundation; either
-  version 2.1 of the License, or (at your option) any later version.
-
-  This library is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  Lesser General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public
-  License along with this library; if not, write to the Free Software
-  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-#ifndef _HCI_UART_TRANSPORT_H_
-#define _HCI_UART_TRANSPORT_H_
-
-#include "HCITransport.h"
-
-class HCIUartTransportClass : public HCITransportInterface {
-public:
-  HCIUartTransportClass(HardwareSerial& uart, unsigned long baudrate);
-  virtual ~HCIUartTransportClass();
-
-  virtual int begin();
-  virtual void end();
-
-  virtual void wait(unsigned long timeout);
-
-  virtual int available();
-  virtual int peek();
-  virtual int read();
-
-  virtual size_t write(const uint8_t* data, size_t length);
-
-private:
-  HardwareSerial* _uart;
-  unsigned long _baudrate;
-};
-
-#endif
diff --git a/src/utility/HCIVirtualTransport.cpp b/src/utility/HCIVirtualTransport.cpp
deleted file mode 100644
index 509fafb5..00000000
--- a/src/utility/HCIVirtualTransport.cpp
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
-  This file is part of the ArduinoBLE library.
-  Copyright (c) 2018 Arduino SA. All rights reserved.
-
-  This library is free software; you can redistribute it and/or
-  modify it under the terms of the GNU Lesser General Public
-  License as published by the Free Software Foundation; either
-  version 2.1 of the License, or (at your option) any later version.
-
-  This library is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  Lesser General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public
-  License along with this library; if not, write to the Free Software
-  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-#if defined(ESP32)
-
-#include "HCIVirtualTransport.h"
-
-StreamBufferHandle_t rec_buffer;
-StreamBufferHandle_t send_buffer;
-TaskHandle_t bleHandle;
-
-
-static void notify_host_send_available(void)
-{
-}
-
-static int notify_host_recv(uint8_t *data, uint16_t length)
-{
-  xStreamBufferSend(rec_buffer,data,length,portMAX_DELAY);  // !!!potentially waiting forever
-  return 0;
-}
-
-static esp_vhci_host_callback_t vhci_host_cb = {
-  notify_host_send_available,
-  notify_host_recv
-};
-
-void bleTask(void *pvParameters)
-{
-  esp_vhci_host_register_callback(&vhci_host_cb);
-  size_t length;
-  uint8_t mybuf[258];
-
-  while(true){
-    length = xStreamBufferReceive(send_buffer,mybuf,258,portMAX_DELAY);
-    while (!esp_vhci_host_check_send_available()) {}
-    esp_vhci_host_send_packet(mybuf, length);
-  }
-}
-
-
-HCIVirtualTransportClass::HCIVirtualTransportClass()
-{
-}
-
-HCIVirtualTransportClass::~HCIVirtualTransportClass()
-{
-}
-
-int HCIVirtualTransportClass::begin()
-{
-  btStarted(); // this somehow stops the arduino ide from initializing bluedroid
-
-  rec_buffer = xStreamBufferCreate(258, 1);
-  send_buffer = xStreamBufferCreate(258, 1);
-
-  esp_err_t ret = nvs_flash_init();
-  if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND) {
-    ESP_ERROR_CHECK(nvs_flash_erase());
-    ret = nvs_flash_init();
-  }
-  esp_bt_controller_config_t bt_cfg = BT_CONTROLLER_INIT_CONFIG_DEFAULT();
-  
-#if CONFIG_IDF_TARGET_ESP32
-  bt_cfg.mode = ESP_BT_MODE_BLE; //original esp32 chip
-#else
-#if !(CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2)
-  bt_cfg.bluetooth_mode = ESP_BT_MODE_BLE; //different api for newer models
-#endif
-#endif
-
-  esp_bt_controller_mem_release(ESP_BT_MODE_CLASSIC_BT);
-  esp_bt_controller_init(&bt_cfg);
-  esp_bt_controller_enable(ESP_BT_MODE_BLE);
-  xTaskCreatePinnedToCore(&bleTask, "bleTask", 2048, NULL, 5, &bleHandle, 0);
-  return 1;
-}
-
-void HCIVirtualTransportClass::end()
-{
-  vStreamBufferDelete(rec_buffer);
-  vStreamBufferDelete(send_buffer);
-  esp_bt_controller_disable();
-  esp_bt_controller_deinit();
-  vTaskDelete(bleHandle);
-}
-
-void HCIVirtualTransportClass::wait(unsigned long timeout)
-{
-  for (unsigned long start = (esp_timer_get_time() / 1000ULL); ((esp_timer_get_time() / 1000ULL) - start) < timeout;) {
-    if (available()) {
-      break;
-    }
-  }
-}
-
-int HCIVirtualTransportClass::available()
-{
-  size_t bytes	= xStreamBufferBytesAvailable(rec_buffer);
-  return bytes;
-}
-
-// never called
-int HCIVirtualTransportClass::peek()
-{
-  return -1;
-}
-
-int HCIVirtualTransportClass::read()
-{
-  uint8_t c;
-  if(xStreamBufferReceive(rec_buffer, &c, 1, portMAX_DELAY)) {
-    return c;
-  }
-  return -1;
-}
-
-size_t HCIVirtualTransportClass::write(const uint8_t* data, size_t length)
-{
-  size_t result = xStreamBufferSend(send_buffer,data,length,portMAX_DELAY);
-  return result;
-}
-
-HCIVirtualTransportClass HCIVirtualTransport;
-
-HCITransportInterface& HCITransport = HCIVirtualTransport;
-
-#endif
diff --git a/src/utility/HCIVirtualTransport.h b/src/utility/HCIVirtualTransport.h
deleted file mode 100644
index 0da43cac..00000000
--- a/src/utility/HCIVirtualTransport.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
-  This file is part of the ArduinoBLE library.
-  Copyright (c) 2018 Arduino SA. All rights reserved.
-
-  This library is free software; you can redistribute it and/or
-  modify it under the terms of the GNU Lesser General Public
-  License as published by the Free Software Foundation; either
-  version 2.1 of the License, or (at your option) any later version.
-
-  This library is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  Lesser General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public
-  License along with this library; if not, write to the Free Software
-  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-#include "HCITransport.h"
-#include <stdint.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "freertos/FreeRTOS.h"
-#include "freertos/task.h"
-#include "freertos/stream_buffer.h"
-
-#include "esp_bt.h"
-#include "nvs_flash.h"
-
-#include "esp32-hal-bt.h" // this is needed to disable bluedroid
-
-
-class HCIVirtualTransportClass : public HCITransportInterface {
-public:
-  HCIVirtualTransportClass();
-  virtual ~HCIVirtualTransportClass();
-
-  virtual int begin();
-  virtual void end();
-
-  virtual void wait(unsigned long timeout);
-
-  virtual int available();
-  virtual int peek();
-  virtual int read();
-
-  virtual size_t write(const uint8_t* data, size_t length);
-};
\ No newline at end of file
diff --git a/src/utility/HCIVirtualTransportAT.cpp b/src/utility/HCIVirtualTransportAT.cpp
deleted file mode 100644
index 7b3a24a9..00000000
--- a/src/utility/HCIVirtualTransportAT.cpp
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
-  This file is part of the ArduinoBLE library.
-  Copyright (c) 2018 Arduino SA. All rights reserved.
-
-  This library is free software; you can redistribute it and/or
-  modify it under the terms of the GNU Lesser General Public
-  License as published by the Free Software Foundation; either
-  version 2.1 of the License, or (at your option) any later version.
-
-  This library is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  Lesser General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public
-  License along with this library; if not, write to the Free Software
-  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-#if defined(ARDUINO_UNOR4_WIFI)
-
-#include "HCIVirtualTransportAT.h"
-
-extern ModemClass modem;
-
-HCIVirtualTransportATClass::HCIVirtualTransportATClass()
-{
-}
-
-HCIVirtualTransportATClass::~HCIVirtualTransportATClass()
-{
-}
-
-static RingBufferN<258> buf;
-
-int HCIVirtualTransportATClass::begin()
-{
-  // TODO: add this helper
-  //modem.debug(Serial);
-  buf.clear();
-  //modem.debug(true);
-  std::string res = "";
-  modem.begin();
-  if (modem.write(std::string(PROMPT(_HCI_BEGIN)), res, CMD(_HCI_BEGIN))) {
-      return 1;
-  }
-  return 0;
-}
-
-void HCIVirtualTransportATClass::end()
-{
-}
-
-void HCIVirtualTransportATClass::wait(unsigned long timeout)
-{
-  std::string res = "";
-  modem.write(std::string(PROMPT(_HCI_WAIT)), res, "%d\n\r", CMD_WRITE(_HCI_WAIT), timeout);
-}
-
-int HCIVirtualTransportATClass::available()
-{
-  std::string res = "";
-  if (buf.available()) {
-    return buf.available();
-  }
-  if (modem.write(std::string(PROMPT(_HCI_AVAILABLE)), res, CMD_READ(_HCI_AVAILABLE))) {
-    return atoi(res.c_str());
-  }
-
-  return 0;
-}
-
-// never called
-int HCIVirtualTransportATClass::peek()
-{
-  return -1;
-}
-
-int HCIVirtualTransportATClass::read()
-{
-  uint8_t c;
-  std::string res = "";
-  if (buf.available()) {
-    return buf.read_char();
-  }
-  modem.avoid_trim_results();
-  modem.read_using_size();
-  if (modem.write(std::string(PROMPT(_HCI_READ)), res, CMD(_HCI_READ))) {
-    for(int i = 0; i < res.size(); i++) {
-      buf.store_char((uint8_t)res[i]);
-    }
-    return buf.read_char();
-  }
-
-  return -1;
-}
-
-size_t HCIVirtualTransportATClass::write(const uint8_t* data, size_t length)
-{
-  std::string res = "";
-  modem.write_nowait(std::string(PROMPT(_HCI_WRITE)), res, "%s%d\r\n" , CMD_WRITE(_HCI_WRITE), length);
-  if(modem.passthrough(data, length)) {
-    return length;
-  }
-  return 0;
-}
-
-HCIVirtualTransportATClass HCIVirtualTransportAT;
-
-HCITransportInterface& HCITransport = HCIVirtualTransportAT;
-
-#endif
diff --git a/src/utility/HCIVirtualTransportAT.h b/src/utility/HCIVirtualTransportAT.h
deleted file mode 100644
index 8e29801d..00000000
--- a/src/utility/HCIVirtualTransportAT.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
-  This file is part of the ArduinoBLE library.
-  Copyright (c) 2018 Arduino SA. All rights reserved.
-
-  This library is free software; you can redistribute it and/or
-  modify it under the terms of the GNU Lesser General Public
-  License as published by the Free Software Foundation; either
-  version 2.1 of the License, or (at your option) any later version.
-
-  This library is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  Lesser General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public
-  License along with this library; if not, write to the Free Software
-  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-#include "HCITransport.h"
-#include <stdint.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "WiFiS3.h"
-
-class HCIVirtualTransportATClass : public HCITransportInterface {
-public:
-  HCIVirtualTransportATClass();
-  virtual ~HCIVirtualTransportATClass();
-
-  virtual int begin();
-  virtual void end();
-
-  virtual void wait(unsigned long timeout);
-
-  virtual int available();
-  virtual int peek();
-  virtual int read();
-
-  virtual size_t write(const uint8_t* data, size_t length);
-};
\ No newline at end of file
diff --git a/src/utility/L2CAPSignaling.cpp b/src/utility/L2CAPSignaling.cpp
index a7582681..e88189cf 100644
--- a/src/utility/L2CAPSignaling.cpp
+++ b/src/utility/L2CAPSignaling.cpp
@@ -371,10 +371,12 @@ void L2CAPSignalingClass::smCalculateLTKandConfirm(uint16_t handle, uint8_t expe
   uint8_t localAddress[7];
   uint8_t remoteAddress[7];
   ATT.getPeerAddrWithType(handle, remoteAddress);
-  
-  HCI.readBdAddr();
+
+  // Address is taken directly from HCI.localaddress,
+  //  which is set when object DeviceLocal is created
+  // HCI.readBdAddr();
   memcpy(&localAddress[1],HCI.localAddr,6);
-  localAddress[0] = 0; // IOT 33 uses a static address // TODO: confirm for Nano BLE
+  localAddress[0] = ATT.getOwnBdaddrType(); // Adding bit with address type (e.g. Static random or public address)
 
   // Compute the LTK and MacKey
   uint8_t MacKey[16];
diff --git a/src/utility/STM32_WPAN/LICENSE.md b/src/utility/STM32_WPAN/LICENSE.md
new file mode 100644
index 00000000..4e70ee7c
--- /dev/null
+++ b/src/utility/STM32_WPAN/LICENSE.md
@@ -0,0 +1,108 @@
+## Overview
+
+
+This Software Bill Of Material (SBOM) lists the software components of this
+software package, including the copyright owner and license terms for each
+component.
+
+__SOFTWARE BILL OF MATERIALS__
+
+Component                | Copyright                                                         | License
+---------                | ----------------------------------------------------------------- | -------
+Bluetooth Low Energy     | STMicroelectronics                                                | SLA
+Bluetooth Low Energy LLD | STMicroelectronics                                                | SLA
+Interface                | STMicroelectronics                                                | SLA
+MAC 802.15.4             | STMicroelectronics                                                | SLA
+PHY                      | STMicroelectronics                                                | SLA
+OpenThread               | The OpenThread Authors                                            | BSD-3-Clause
+Utilities                | STMicroelectronics, Amazon.com Inc.                               | SLA, MIT
+Zigbee                   | Exegin Technologies Limited, STMicroelectronics, Dr Brian Gladman | SLA
+
+
+__Notes:__ If the license is an open source license, then you can access the
+terms at [www.opensource.org](https://opensource.org/). Otherwise, the full
+license terms are below. If a component is not listed in the SBOM, then the SLA
+shall apply unless other terms are clearly stated in the package.
+
+
+
+SLA0044 Rev5/February 2018
+
+## Software license agreement
+
+### __ULTIMATE LIBERTY SOFTWARE LICENSE AGREEMENT__
+
+BY INSTALLING, COPYING, DOWNLOADING, ACCESSING OR OTHERWISE USING THIS SOFTWARE
+OR ANY PART THEREOF (AND THE RELATED DOCUMENTATION) FROM STMICROELECTRONICS
+INTERNATIONAL N.V, SWISS BRANCH AND/OR ITS AFFILIATED COMPANIES
+(STMICROELECTRONICS), THE RECIPIENT, ON BEHALF OF HIMSELF OR HERSELF, OR ON
+BEHALF OF ANY ENTITY BY WHICH SUCH RECIPIENT IS EMPLOYED AND/OR ENGAGED AGREES
+TO BE BOUND BY THIS SOFTWARE LICENSE AGREEMENT.
+
+Under STMicroelectronics’ intellectual property rights, the redistribution,
+reproduction and use in source and binary forms of the software or any part
+thereof, with or without modification, are permitted provided that the following
+conditions are met:
+
+1. Redistribution of source code (modified or not) must retain any copyright
+notice, this list of conditions and the disclaimer set forth below as items 10
+and 11.
+
+2. Redistributions in binary form, except as embedded into microcontroller or
+microprocessor device manufactured by or for STMicroelectronics or a software
+update for such device, must reproduce any copyright notice provided with the
+binary code, this list of conditions, and the disclaimer set forth below as
+items 10 and 11, in documentation and/or other materials provided with the
+distribution.
+
+3. Neither the name of STMicroelectronics nor the names of other contributors to
+this software may be used to endorse or promote products derived from this
+software or part thereof without specific written permission.
+
+4. This software or any part thereof, including modifications and/or derivative
+works of this software, must be used and execute solely and exclusively on or in
+combination with a microcontroller or microprocessor device manufactured by or
+for STMicroelectronics.
+
+5. No use, reproduction or redistribution of this software partially or totally
+may be done in any manner that would subject this software to any Open Source
+Terms. “Open Source Terms” shall mean any open source license which requires as
+part of distribution of software that the source code of such software is
+distributed therewith or otherwise made available, or open source license that
+substantially complies with the Open Source definition specified at
+www.opensource.org and any other comparable open source license such as for
+example GNU General Public License (GPL), Eclipse Public License (EPL), Apache
+Software License, BSD license or MIT license.
+
+6. STMicroelectronics has no obligation to provide any maintenance, support or
+updates for the software.
+
+7. The software is and will remain the exclusive property of STMicroelectronics
+and its licensors. The recipient will not take any action that jeopardizes
+STMicroelectronics and its licensors' proprietary rights or acquire any rights
+in the software, except the limited rights specified hereunder.
+
+8. The recipient shall comply with all applicable laws and regulations affecting
+the use of the software or any part thereof including any applicable export
+control law or regulation.
+
+9. Redistribution and use of this software or any part thereof other than as
+permitted under this license is void and will automatically terminate your
+rights under this license.
+
+10. THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY RIGHTS, WHICH ARE
+DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT SHALL
+STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+11. EXCEPT AS EXPRESSLY PERMITTED HEREUNDER, NO LICENSE OR OTHER RIGHTS, WHETHER
+EXPRESS OR IMPLIED, ARE GRANTED UNDER ANY PATENT OR OTHER INTELLECTUAL PROPERTY
+RIGHTS OF STMICROELECTRONICS OR ANY THIRD PARTY.
diff --git a/src/utility/STM32_WPAN/README.md b/src/utility/STM32_WPAN/README.md
new file mode 100644
index 00000000..90f96452
--- /dev/null
+++ b/src/utility/STM32_WPAN/README.md
@@ -0,0 +1,6 @@
+
+## Source
+
+[STMicroelectronics/STM32CubeWB Release v1.22.0](https://github.com/STMicroelectronics/STM32CubeWB/releases/tag/v1.22.0)
+- Application: [BLE_TransparentMode](https://github.com/STMicroelectronics/STM32CubeWB/tree/v1.22.0/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode)
+
diff --git a/src/utility/STM32_WPAN/app_conf.h b/src/utility/STM32_WPAN/app_conf.h
new file mode 100644
index 00000000..3246393f
--- /dev/null
+++ b/src/utility/STM32_WPAN/app_conf.h
@@ -0,0 +1,20 @@
+//-----------------------------
+// @file app_conf.h
+// @author Kasper Meldgaard
+// @brief Wrapper for BLE app configuration based on comment by fpistm
+// (https://github.com/stm32duino/STM32duinoBLE/issues/34).
+// @date 15-11-2021
+// @copyright Copyright (c) 2021
+
+#ifndef APP_CONF_H
+#define APP_CONF_H
+
+#include "hw.h"
+#include "ble_bufsize.h"
+
+#if __has_include("app_conf_custom.h")
+  #include "app_conf_custom.h"
+#endif
+#include "app_conf_default.h"
+
+#endif /* APP_CONF_H */
diff --git a/src/utility/STM32_WPAN/app_conf_default.h b/src/utility/STM32_WPAN/app_conf_default.h
new file mode 100644
index 00000000..ff2dc017
--- /dev/null
+++ b/src/utility/STM32_WPAN/app_conf_default.h
@@ -0,0 +1,728 @@
+/* USER CODE BEGIN Header */
+/**
+  ******************************************************************************
+  * @file    app_conf_default.h
+  * @author  MCD Application Team
+  * @brief   Default application configuration file for STM32WPAN Middleware.
+  ******************************************************************************
+  * @attention
+  *
+  * Copyright (c) 2020-2021 STMicroelectronics.
+  * All rights reserved.
+  *
+  * This software is licensed under terms that can be found in the LICENSE file
+  * in the root directory of this software component.
+  * If no LICENSE file comes with this software, it is provided AS-IS.
+  *
+  ******************************************************************************
+  */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef APP_CONF_DEFAULT_H
+#define APP_CONF_DEFAULT_H
+
+#if 0
+#include "hw.h"
+#include "hw_conf.h"
+#include "hw_if.h"
+#include "ble_bufsize.h"
+#endif
+
+/******************************************************************************
+ * Application Config
+ ******************************************************************************/
+
+/**< generic parameters ******************************************************/
+/* HCI related defines */
+
+#define ACI_HAL_SET_TX_POWER_LEVEL 0xFC0F
+#define ACI_WRITE_CONFIG_DATA_OPCODE 0xFC0C
+#define ACI_READ_CONFIG_DATA_OPCODE 0xFC0D
+#define MAX_HCI_ACL_PACKET_SIZE (sizeof(TL_PacketHeader_t) + 5 + 251)
+#define HCI_RESET 0x0C03
+
+#ifndef BLE_SHARED_MEM_BYTE_ORDER
+  #define BLE_SHARED_MEM_BYTE_ORDER  MSBFIRST
+#endif
+#define BLE_MODULE_SHARED_MEM_BUFFER_SIZE 128
+
+/**
+ * Define Tx Power
+ */
+#ifndef CFG_TX_POWER
+  #define CFG_TX_POWER                        (0x18) /* -0.15dBm */
+#endif
+
+#if 0
+/**
+ * Define Secure Connections Support
+ */
+#define CFG_SECURE_NOT_SUPPORTED              (0x00)
+#define CFG_SECURE_OPTIONAL                   (0x01)
+#define CFG_SECURE_MANDATORY                  (0x02)
+
+#define CFG_SC_SUPPORT                        CFG_SECURE_OPTIONAL
+
+/**
+ * Define Keypress Notification Support
+ */
+#define CFG_KEYPRESS_NOT_SUPPORTED            (0x00)
+#define CFG_KEYPRESS_SUPPORTED                (0x01)
+
+#define CFG_KEYPRESS_NOTIFICATION_SUPPORT     CFG_KEYPRESS_NOT_SUPPORTED
+
+/**
+ * Numeric Comparison Answers
+ */
+#define YES (0x01)
+#define NO  (0x00)
+
+/**
+ * Device name configuration for Generic Access Service
+ */
+#define CFG_GAP_DEVICE_NAME             "TEMPLATE"
+#define CFG_GAP_DEVICE_NAME_LENGTH      (8)
+
+/**
+*   Identity root key used to derive IRK and DHK(Legacy)
+*/
+#define CFG_BLE_IR     {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0}
+
+/**
+* Encryption root key used to derive LTK(Legacy) and CSRK
+*/
+#define CFG_BLE_ER     {0xFE, 0xDC, 0xBA, 0x09, 0x87, 0x65, 0x43, 0x21, 0xFE, 0xDC, 0xBA, 0x09, 0x87, 0x65, 0x43, 0x21}
+
+/**
+ * SMPS supply
+ * SMPS not used when Set to 0
+ * SMPS used when Set to 1
+ */
+#define CFG_USE_SMPS    0
+
+/* USER CODE BEGIN Generic_Parameters */
+/* USER CODE END Generic_Parameters */
+
+/**< specific parameters */
+/*****************************************************/
+
+/* USER CODE BEGIN Specific_Parameters */
+#define PUSH_BUTTON_SW1_EXTI_IRQHandler                         EXTI4_IRQHandler
+
+/* USER CODE END Specific_Parameters */
+
+/******************************************************************************
+ * Information Table
+ *
+  * Version
+  * [0:3]   = Build - 0: Untracked - 15:Released - x: Tracked version
+  * [4:7]   = branch - 0: Mass Market - x: ...
+  * [8:15]  = Subversion
+  * [16:23] = Version minor
+  * [24:31] = Version major
+  *
+ ******************************************************************************/
+#define CFG_FW_MAJOR_VERSION      (0)
+#define CFG_FW_MINOR_VERSION      (0)
+#define CFG_FW_SUBVERSION         (1)
+#define CFG_FW_BRANCH             (0)
+#define CFG_FW_BUILD              (0)
+#endif
+
+/******************************************************************************
+ * BLE Stack
+ ******************************************************************************/
+/**
+ * Maximum number of simultaneous connections that the device will support.
+ * Valid values are from 1 to 8
+ */
+#ifndef CFG_BLE_NUM_LINK
+#ifdef STM32WB15xx
+  #define CFG_BLE_NUM_LINK            3
+#else
+  #define CFG_BLE_NUM_LINK            8
+#endif
+#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
+ */
+#ifndef CFG_BLE_NUM_GATT_SERVICES
+#ifdef STM32WB15xx
+  #define CFG_BLE_NUM_GATT_SERVICES   4
+#else
+  #define CFG_BLE_NUM_GATT_SERVICES   8
+#endif
+#endif
+
+/**
+ * Maximum number of Attributes
+ * (i.e. the number of characteristic + the number of characteristic values + the number of descriptors, excluding the services)
+ * that can be stored in the GATT database.
+ * Note that certain characteristics and relative descriptors are added automatically during device initialization
+ * so this parameters should be 9 plus the number of user Attributes
+ */
+#ifndef CFG_BLE_NUM_GATT_ATTRIBUTES
+#ifdef STM32WB15xx
+  #define CFG_BLE_NUM_GATT_ATTRIBUTES 30
+#else
+  #define CFG_BLE_NUM_GATT_ATTRIBUTES 68
+#endif
+#endif
+
+/**
+ * Maximum supported ATT_MTU size
+ * 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)
+
+/**
+ * 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:
+ *  - attribute value length
+ *  - 5, if UUID is 16 bit; 19, if UUID is 128 bit
+ *  - 2, if server configuration descriptor is used
+ *  - 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 has SHCI_C2_BLE_INIT_OPTIONS_LL_ONLY flag set
+ */
+#define CFG_BLE_ATT_VALUE_ARRAY_SIZE    (1344)
+
+/**
+ * Prepare Write List size in terms of number of packet
+ * 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)
+
+/**
+ * Number of allocated memory blocks
+ * 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))
+
+/**
+ * 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
+#endif
+
+/**
+ * Sleep clock accuracy in Peripheral mode (ppm value)
+ */
+#ifndef CFG_BLE_PERIPHERAL_SCA
+  #define CFG_BLE_PERIPHERAL_SCA   500
+#endif
+
+/**
+ * Sleep clock accuracy in Central mode
+ * 0 : 251 ppm to 500 ppm
+ * 1 : 151 ppm to 250 ppm
+ * 2 : 101 ppm to 150 ppm
+ * 3 : 76 ppm to 100 ppm
+ * 4 : 51 ppm to 75 ppm
+ * 5 : 31 ppm to 50 ppm
+ * 6 : 21 ppm to 30 ppm
+ * 7 : 0 ppm to 20 ppm
+ */
+#ifndef CFG_BLE_CENTRAL_SCA
+  #define CFG_BLE_CENTRAL_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: 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_LS_SOURCE
+  #if defined(STM32WB5Mxx)
+    #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_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
+#endif
+
+/**
+ * Maximum duration of the connection event when the device is in Peripheral 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)
+#endif
+
+/**
+ * Viterbi Mode
+ * 1 : enabled
+ * 0 : disabled
+ */
+#define CFG_BLE_VITERBI_MODE  1
+
+/**
+ * BLE stack Options flags to be configured with:
+ * - SHCI_C2_BLE_INIT_OPTIONS_LL_ONLY
+ * - SHCI_C2_BLE_INIT_OPTIONS_LL_HOST
+ * - SHCI_C2_BLE_INIT_OPTIONS_NO_SVC_CHANGE_DESC
+ * - SHCI_C2_BLE_INIT_OPTIONS_WITH_SVC_CHANGE_DESC
+ * - SHCI_C2_BLE_INIT_OPTIONS_DEVICE_NAME_RO
+ * - SHCI_C2_BLE_INIT_OPTIONS_DEVICE_NAME_RW
+ * - SHCI_C2_BLE_INIT_OPTIONS_EXT_ADV
+ * - 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
+ * which are used to set following configuration bits:
+ * (bit 0): 1: LL only
+ *          0: LL + host
+ * (bit 1): 1: no service change desc.
+ *          0: with service change desc.
+ * (bit 2): 1: device name Read-Only
+ *          0: device name R/W
+ * (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 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
+ * other bits: complete with Options_extension flag
+ */
+#define CFG_BLE_OPTIONS  (SHCI_C2_BLE_INIT_OPTIONS_LL_ONLY | 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)
+
+/**
+ * BLE stack Options_extension flags to be configured with:
+ * - 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: appearance Writable
+ *          0: appearance Read-Only
+ * (bit 1): 1: Enhanced ATT supported
+ *          0: Enhanced ATT not supported
+ * other bits: reserved (shall be set to 0)
+ */
+#define CFG_BLE_OPTIONS_EXT  (SHCI_C2_BLE_INIT_OPTIONS_APPEARANCE_READONLY | SHCI_C2_BLE_INIT_OPTIONS_ENHANCED_ATT_NOTSUPPORTED)
+
+#define CFG_BLE_MAX_COC_INITIATOR_NBR   (32)
+
+#define CFG_BLE_MIN_TX_POWER            (-40)
+
+#define CFG_BLE_MAX_TX_POWER            (6)
+
+/**
+ * BLE Rx model configuration flags to be configured with:
+ * - SHCI_C2_BLE_INIT_RX_MODEL_AGC_RSSI_LEGACY
+ * - SHCI_C2_BLE_INIT_RX_MODEL_AGC_RSSI_BLOCKER
+ * which are used to set following configuration bits:
+ * (bit 0): 1: agc_rssi model improved vs RF blockers
+ *          0: Legacy agc_rssi model
+ * other bits: reserved (shall be set to 0)
+ */
+
+#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
+ */
+
+#if defined(STM32WB15xx)
+  #define CFG_BLE_MAX_ADV_SET_NBR     (3)
+#else
+  #define CFG_BLE_MAX_ADV_SET_NBR     (8)
+#endif
+
+ /* 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
+ */
+
+#if defined(STM32WB15xx)
+  #define CFG_BLE_MAX_ADV_DATA_LEN    (414)
+#else
+  #define CFG_BLE_MAX_ADV_DATA_LEN    (207)
+#endif
+
+ /* 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)
+
+  /* BLE core version (16-bit signed integer).
+   * - SHCI_C2_BLE_INIT_BLE_CORE_5_2
+   * - SHCI_C2_BLE_INIT_BLE_CORE_5_3
+   * - SHCI_C2_BLE_INIT_BLE_CORE_5_4
+   * which are used to set: 11(5.2), 12(5.3), 13(5.4).
+   */
+
+#define CFG_BLE_CORE_VERSION   (SHCI_C2_BLE_INIT_BLE_CORE_5_4)
+
+#if 0
+/******************************************************************************
+ * Transport Layer
+ ******************************************************************************/
+/**
+ * Queue length of BLE Event
+ * This parameter defines the number of asynchronous events that can be stored in the HCI layer before
+ * being reported to the application. When a command is sent to the BLE core coprocessor, the HCI layer
+ * is waiting for the event with the Num_HCI_Command_Packets set to 1. The receive queue shall be large
+ * enough to store all asynchronous events received in between.
+ * When CFG_TLBLE_MOST_EVENT_PAYLOAD_SIZE is set to 27, this allow to store three 255 bytes long asynchronous events
+ * between the HCI command and its event.
+ * This parameter depends on the value given to CFG_TLBLE_MOST_EVENT_PAYLOAD_SIZE. When the queue size is to small,
+ * the system may hang if the queue is full with asynchronous events and the HCI layer is still waiting
+ * for a CC/CS event, In that case, the notification TL_BLE_HCI_ToNot() is called to indicate
+ * to the application a HCI command did not receive its command event within 30s (Default HCI Timeout).
+ */
+#define CFG_TLBLE_EVT_QUEUE_LENGTH 5
+/**
+ * This parameter should be set to fit most events received by the HCI layer. It defines the buffer size of each element
+ * allocated in the queue of received events and can be used to optimize the amount of RAM allocated by the Memory Manager.
+ * It should not exceed 255 which is the maximum HCI packet payload size (a greater value is a lost of memory as it will
+ * never be used)
+ * It shall be at least 4 to receive the command status event in one frame.
+ * The default value is set to 27 to allow receiving an event of MTU size in a single buffer. This value maybe reduced
+ * further depending on the application.
+ */
+#define CFG_TLBLE_MOST_EVENT_PAYLOAD_SIZE 255   /**< Set to 255 with the memory manager and the mailbox */
+
+#define TL_BLE_EVENT_FRAME_SIZE ( TL_EVT_HDR_SIZE + CFG_TLBLE_MOST_EVENT_PAYLOAD_SIZE )
+/******************************************************************************
+ * UART interfaces
+ ******************************************************************************/
+
+/**
+ * Select UART interfaces
+ */
+#define CFG_UART_GUI            hw_uart1
+#define CFG_DEBUG_TRACE_UART    0
+/******************************************************************************
+ * USB interface
+ ******************************************************************************/
+
+/**
+ * Enable/Disable USB interface
+ */
+#define CFG_USB_INTERFACE_ENABLE    0
+
+/******************************************************************************
+ * IPCC interface
+ ******************************************************************************/
+
+/**
+ * The IPCC is dedicated to the communication between the CPU2 and the CPU1
+ * and shall not be modified by the application
+ * The two following definitions shall not be modified
+ */
+#define HAL_IPCC_TX_IRQHandler(...)  HW_IPCC_Tx_Handler( )
+#define HAL_IPCC_RX_IRQHandler(...)  HW_IPCC_Rx_Handler( )
+
+/******************************************************************************
+ * Low Power
+ ******************************************************************************/
+/**
+ *  When set to 1, the low power mode is enable
+ *  When set to 0, the device stays in RUN mode
+ */
+#define CFG_LPM_SUPPORTED    1
+
+/******************************************************************************
+ * RTC interface
+ ******************************************************************************/
+#define HAL_RTCEx_WakeUpTimerIRQHandler(...)  HW_TS_RTC_Wakeup_Handler( )
+
+/******************************************************************************
+ * Timer Server
+ ******************************************************************************/
+/**
+ *  CFG_RTC_WUCKSEL_DIVIDER:  This sets the RTCCLK divider to the wakeup timer.
+ *  The lower is the value, the better is the power consumption and the accuracy of the timerserver
+ *  The higher is the value, the finest is the granularity
+ *
+ *  CFG_RTC_ASYNCH_PRESCALER: This sets the asynchronous prescaler of the RTC. It should as high as possible ( to output
+ *  clock as low as possible) but the output clock should be equal or higher frequency compare to the clock feeding
+ *  the wakeup timer. A lower clock speed would impact the accuracy of the timer server.
+ *
+ *  CFG_RTC_SYNCH_PRESCALER: This sets the synchronous prescaler of the RTC.
+ *  When the 1Hz calendar clock is required, it shall be sets according to other settings
+ *  When the 1Hz calendar clock is not needed, CFG_RTC_SYNCH_PRESCALER should be set to 0x7FFF (MAX VALUE)
+ *
+ *  CFG_RTCCLK_DIVIDER_CONF:
+ *  Shall be set to either 0,2,4,8,16
+ *  When set to either 2,4,8,16, the 1Hhz calendar is supported
+ *  When set to 0, the user sets its own configuration
+ *
+ *  The following settings are computed with LSI as input to the RTC
+ */
+
+#define CFG_RTCCLK_DIVIDER_CONF 0
+
+#if (CFG_RTCCLK_DIVIDER_CONF == 0)
+/**
+ * Custom configuration
+ * It does not support 1Hz calendar
+ * It divides the RTC CLK by 16
+ */
+
+#define CFG_RTCCLK_DIV            (16)
+#define CFG_RTC_WUCKSEL_DIVIDER   (0)
+#define CFG_RTC_ASYNCH_PRESCALER  (0x0F)
+#define CFG_RTC_SYNCH_PRESCALER   (0x7FFF)
+
+#else
+
+#if (CFG_RTCCLK_DIVIDER_CONF == 2)
+/**
+ * It divides the RTC CLK by 2
+ */
+#define CFG_RTC_WUCKSEL_DIVIDER (3)
+#endif
+
+#if (CFG_RTCCLK_DIVIDER_CONF == 4)
+/**
+ * It divides the RTC CLK by 4
+ */
+#define CFG_RTC_WUCKSEL_DIVIDER (2)
+#endif
+
+#if (CFG_RTCCLK_DIVIDER_CONF == 8)
+/**
+ * It divides the RTC CLK by 8
+ */
+#define CFG_RTC_WUCKSEL_DIVIDER (1)
+#endif
+
+#if (CFG_RTCCLK_DIVIDER_CONF == 16)
+/**
+ * It divides the RTC CLK by 16
+ */
+#define CFG_RTC_WUCKSEL_DIVIDER (0)
+#endif
+
+#define CFG_RTCCLK_DIV              CFG_RTCCLK_DIVIDER_CONF
+#define CFG_RTC_ASYNCH_PRESCALER    (CFG_RTCCLK_DIV - 1)
+#define CFG_RTC_SYNCH_PRESCALER     (DIVR( LSE_VALUE, (CFG_RTC_ASYNCH_PRESCALER+1) ) - 1 )
+
+#endif
+
+/** tick timer values */
+#define CFG_TS_TICK_VAL           DIVR( (CFG_RTCCLK_DIV * 1000000), LSE_VALUE )
+#define CFG_TS_TICK_VAL_PS        DIVR( ((uint64_t)CFG_RTCCLK_DIV * 1e12), (uint64_t)LSE_VALUE )
+
+typedef enum
+{
+  CFG_TIM_PROC_ID_ISR,
+  /* USER CODE BEGIN CFG_TimProcID_t */
+
+  /* USER CODE END CFG_TimProcID_t */
+} CFG_TimProcID_t;
+
+/******************************************************************************
+ * Debug
+ ******************************************************************************/
+/**
+ * When set, this resets some hw resources to put the device in the same state as at power up.
+ * It resets only register that may prevent the FW to run properly.
+ *
+ * This shall be set to 0 in a final product
+ *
+ */
+#define CFG_HW_RESET_BY_FW         0
+
+/**
+ * keep debugger enabled while in any low power mode when set to 1
+ * should be set to 0 in production
+ */
+#define CFG_DEBUGGER_SUPPORTED    0
+
+/**
+ * When set to 1, the traces are enabled in the BLE services
+ */
+#define CFG_DEBUG_BLE_TRACE     0
+
+/**
+ * Enable or Disable traces in application
+ */
+#define CFG_DEBUG_APP_TRACE     0
+
+#if (CFG_DEBUG_APP_TRACE != 0)
+#define APP_DBG_MSG                 PRINT_MESG_DBG
+#else
+#define APP_DBG_MSG                 PRINT_NO_MESG
+#endif
+
+#if ( (CFG_DEBUG_BLE_TRACE != 0) || (CFG_DEBUG_APP_TRACE != 0) )
+#define CFG_DEBUG_TRACE             1
+#endif
+
+#if (CFG_DEBUG_TRACE != 0)
+#undef CFG_LPM_SUPPORTED
+#undef CFG_DEBUGGER_SUPPORTED
+#define CFG_LPM_SUPPORTED           0
+#define CFG_DEBUGGER_SUPPORTED      1
+#endif
+
+/**
+ * When CFG_DEBUG_TRACE_FULL is set to 1, the trace are output with the API name, the file name and the line number
+ * When CFG_DEBUG_TRACE_LIGHT is set to 1, only the debug message is output
+ *
+ * When both are set to 0, no trace are output
+ * When both are set to 1,  CFG_DEBUG_TRACE_FULL is selected
+ */
+#define CFG_DEBUG_TRACE_LIGHT     0
+#define CFG_DEBUG_TRACE_FULL      0
+
+#if (( CFG_DEBUG_TRACE != 0 ) && ( CFG_DEBUG_TRACE_LIGHT == 0 ) && (CFG_DEBUG_TRACE_FULL == 0))
+#undef CFG_DEBUG_TRACE_FULL
+#undef CFG_DEBUG_TRACE_LIGHT
+#define CFG_DEBUG_TRACE_FULL      0
+#define CFG_DEBUG_TRACE_LIGHT     1
+#endif
+
+#if ( CFG_DEBUG_TRACE == 0 )
+#undef CFG_DEBUG_TRACE_FULL
+#undef CFG_DEBUG_TRACE_LIGHT
+#define CFG_DEBUG_TRACE_FULL      0
+#define CFG_DEBUG_TRACE_LIGHT     0
+#endif
+
+/**
+ * When not set, the traces is looping on sending the trace over UART
+ */
+#define DBG_TRACE_USE_CIRCULAR_QUEUE 1
+
+/**
+ * max buffer Size to queue data traces and max data trace allowed.
+ * Only Used if DBG_TRACE_USE_CIRCULAR_QUEUE is defined
+ */
+#define DBG_TRACE_MSG_QUEUE_SIZE 4096
+#define MAX_DBG_TRACE_MSG_SIZE   1024
+
+/* USER CODE BEGIN Defines */
+#define CFG_LED_SUPPORTED         1
+#define CFG_BUTTON_SUPPORTED      1
+
+#define PUSH_BUTTON_SW1_EXTI_IRQHandler     EXTI4_IRQHandler
+#define PUSH_BUTTON_SW2_EXTI_IRQHandler     EXTI0_IRQHandler
+#define PUSH_BUTTON_SW3_EXTI_IRQHandler     EXTI1_IRQHandler
+/* USER CODE END Defines */
+
+/******************************************************************************
+ * Scheduler
+ ******************************************************************************/
+
+/**
+ * These are the lists of task id registered to the scheduler
+ * Each task id shall be in the range [0:31]
+ * This mechanism allows to implement a generic code in the API TL_BLE_HCI_StatusNot() to comply with
+ * the requirement that a HCI/ACI command shall never be sent if there is already one pending
+ */
+
+/**< Add in that list all tasks that may send a ACI/HCI command */
+typedef enum
+{
+  CFG_TASK_BLE_HCI_CMD_ID,
+  CFG_TASK_SYS_HCI_CMD_ID,
+  CFG_TASK_HCI_ACL_DATA_ID,
+  CFG_TASK_SYS_LOCAL_CMD_ID,
+  CFG_TASK_TX_TO_HOST_ID,
+  /* USER CODE BEGIN CFG_Task_Id_With_HCI_Cmd_t */
+  CFG_TASK_SW1_BUTTON_PUSHED_ID,
+  CFG_TASK_SW2_BUTTON_PUSHED_ID,
+  CFG_TASK_SW3_BUTTON_PUSHED_ID,
+  /* USER CODE END CFG_Task_Id_With_HCI_Cmd_t */
+  CFG_LAST_TASK_ID_WITH_HCICMD,                                               /**< Shall be LAST in the list */
+} CFG_Task_Id_With_HCI_Cmd_t;
+
+/**< Add in that list all tasks that never send a ACI/HCI command */
+typedef enum
+{
+  CFG_FIRST_TASK_ID_WITH_NO_HCICMD = CFG_LAST_TASK_ID_WITH_HCICMD - 1,        /**< Shall be FIRST in the list */
+  CFG_TASK_SYSTEM_HCI_ASYNCH_EVT_ID,
+  /* USER CODE BEGIN CFG_Task_Id_With_NO_HCI_Cmd_t */
+
+  /* USER CODE END CFG_Task_Id_With_NO_HCI_Cmd_t */
+  CFG_LAST_TASK_ID_WITH_NO_HCICMD                                            /**< Shall be LAST in the list */
+} CFG_Task_Id_With_NO_HCI_Cmd_t;
+
+#define CFG_TASK_NBR    CFG_LAST_TASK_ID_WITH_NO_HCICMD
+
+/**
+ * This is the list of priority required by the application
+ * Each Id shall be in the range 0..31
+ */
+typedef enum
+{
+  CFG_SCH_PRIO_0,
+  /* USER CODE BEGIN CFG_SCH_Prio_Id_t */
+
+  /* USER CODE END CFG_SCH_Prio_Id_t */
+  CFG_SCH_PRIO_NBR
+} CFG_SCH_Prio_Id_t;
+
+/**
+ * This is a bit mapping over 32bits listing all events id supported in the application
+ */
+typedef enum
+{
+  CFG_IDLEEVT_SYSTEM_HCI_CMD_EVT_RSP_ID,
+  /* USER CODE BEGIN CFG_IdleEvt_Id_t */
+
+  /* USER CODE END CFG_IdleEvt_Id_t */
+} CFG_IdleEvt_Id_t;
+
+/******************************************************************************
+ * LOW POWER
+ ******************************************************************************/
+/**
+ * Supported requester to the MCU Low Power Manager - can be increased up  to 32
+ * It list a bit mapping of all user of the Low Power Manager
+ */
+typedef enum
+{
+  CFG_LPM_APP,
+  CFG_LPM_APP_BLE,
+  /* USER CODE BEGIN CFG_LPM_Id_t */
+
+  /* USER CODE END CFG_LPM_Id_t */
+} CFG_LPM_Id_t;
+
+/******************************************************************************
+ * OTP manager
+ ******************************************************************************/
+#define CFG_OTP_BASE_ADDRESS    OTP_AREA_BASE
+
+#define CFG_OTP_END_ADRESS      OTP_AREA_END_ADDR
+
+#endif
+#endif /*APP_CONF_DEFAULT_H */
diff --git a/src/utility/STM32_WPAN/ble_bufsize.h b/src/utility/STM32_WPAN/ble_bufsize.h
new file mode 100644
index 00000000..26551c09
--- /dev/null
+++ b/src/utility/STM32_WPAN/ble_bufsize.h
@@ -0,0 +1,182 @@
+/*****************************************************************************
+ * @file    ble_bufsize.h
+ *
+ * @brief   Definition of BLE stack buffers size
+ *****************************************************************************
+ * @attention
+ *
+ * Copyright (c) 2018-2025 STMicroelectronics.
+ * All rights reserved.
+ *
+ * This software is licensed under terms that can be found in the LICENSE file
+ * in the root directory of this software component.
+ * If no LICENSE file comes with this software, it is provided AS-IS.
+ *
+ *****************************************************************************
+ */
+
+#ifndef BLE_BUFSIZE_H__
+#define BLE_BUFSIZE_H__
+
+
+/*
+ * BLE_DEFAULT_ATT_MTU: minimum MTU value that GATT must support.
+ */
+#define BLE_DEFAULT_ATT_MTU                  23
+
+/*
+ * BLE_DEFAULT_MAX_ATT_SIZE: maximum attribute size.
+ */
+#define BLE_DEFAULT_MAX_ATT_SIZE            512
+
+/*
+ * BLE_PREP_WRITE_X_ATT: compute how many Prepare Write Request are needed to
+ * write a characteristic with size 'max_att' when the used ATT_MTU value is
+ * equal to BLE_DEFAULT_ATT_MTU (23).
+ */
+#define BLE_PREP_WRITE_X_ATT(max_att) \
+        (DIVC(max_att, BLE_DEFAULT_ATT_MTU - 5) * 2)
+
+/*
+ * BLE_DEFAULT_PREP_WRITE_LIST_SIZE: default minimum Prepare Write List size.
+ */
+#define BLE_DEFAULT_PREP_WRITE_LIST_SIZE \
+        BLE_PREP_WRITE_X_ATT(BLE_DEFAULT_MAX_ATT_SIZE)
+
+/*
+ * BLE_MEM_BLOCK_X_MTU: compute how many memory blocks are needed to compose
+ * an ATT packet with ATT_MTU=mtu.
+ */
+#define BLE_MEM_BLOCK_SIZE                   32
+
+#if (SLAVE_ONLY != 0) || (BASIC_FEATURES != 0)
+#define BLE_MEM_BLOCK_X_PTX(n_link)           0
+#else
+#define BLE_MEM_BLOCK_X_PTX(n_link)           (n_link)
+#endif
+
+#define BLE_MEM_BLOCK_X_TX(mtu) \
+        (DIVC((mtu) + 4U, BLE_MEM_BLOCK_SIZE) + 1)
+
+#define BLE_MEM_BLOCK_X_RX(mtu, n_link) \
+        ((DIVC((mtu) + 4U, BLE_MEM_BLOCK_SIZE) + 2U) * (n_link) + 1)
+
+#define BLE_MEM_BLOCK_X_MTU(mtu, n_link) \
+        (BLE_MEM_BLOCK_X_TX(mtu) + BLE_MEM_BLOCK_X_PTX(n_link) + \
+         BLE_MEM_BLOCK_X_RX(mtu, n_link))
+
+/*
+ * BLE_MBLOCKS_SECURE_CONNECTIONS: minimum number of blocks required for
+ * secure connections
+ */
+#define BLE_MBLOCKS_SECURE_CONNECTIONS        4
+
+/*
+ * BLE_MBLOCKS_CALC: minimum number of buffers needed by the stack.
+ * This is the minimum racomanded value and depends on:
+ *  - pw: size of Prepare Write List
+ *  - mtu: ATT_MTU size
+ *  - n_link: maximum number of simultaneous connections
+ */
+#define BLE_MBLOCKS_CALC(pw, mtu, n_link) \
+        ((pw) + MAX(BLE_MEM_BLOCK_X_MTU(mtu, n_link), \
+                    BLE_MBLOCKS_SECURE_CONNECTIONS))
+
+/*
+ * BLE_FIXED_BUFFER_SIZE_BYTES:
+ * 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 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  4200   /* Beacon only */
+#elif (LL_ONLY_BASIC != 0)
+#define BLE_FIXED_BUFFER_SIZE_BYTES  6040   /* LL only Basic*/
+#elif (LL_ONLY != 0)
+#define BLE_FIXED_BUFFER_SIZE_BYTES  6288   /* LL only Full */
+#elif (SLAVE_ONLY != 0)
+#define BLE_FIXED_BUFFER_SIZE_BYTES  6408   /* Peripheral only */
+#elif (BASIC_FEATURES != 0)
+#define BLE_FIXED_BUFFER_SIZE_BYTES  7184   /* Basic Features */
+#else
+#define BLE_FIXED_BUFFER_SIZE_BYTES  7468   /* Full stack */
+#endif
+
+/*
+ * BLE_PER_LINK_SIZE_BYTES: additional memory size used per link
+ */
+#if (BEACON_ONLY != 0)
+#define BLE_PER_LINK_SIZE_BYTES        76   /* Beacon only */
+#elif (LL_ONLY_BASIC != 0)
+#define BLE_PER_LINK_SIZE_BYTES       244   /* LL only Basic */
+#elif (LL_ONLY != 0)
+#define BLE_PER_LINK_SIZE_BYTES       244   /* LL only Full */
+#elif (SLAVE_ONLY != 0)
+#define BLE_PER_LINK_SIZE_BYTES       392   /* Peripheral only */
+#elif (BASIC_FEATURES != 0)
+#define BLE_PER_LINK_SIZE_BYTES       420   /* Basic Features */
+#else
+#define BLE_PER_LINK_SIZE_BYTES       432   /* Full stack */
+#endif
+
+/*
+ * BLE_TOTAL_BUFFER_SIZE: this macro returns the amount of memory, in bytes,
+ * needed for the storage of data structures (except GATT database elements)
+ * whose size depends on the number of supported connections.
+ *
+ * @param n_link: Maximum number of simultaneous connections that the device
+ * will support. Valid values are from 1 to 8.
+ *
+ * @param mblocks_count: Number of memory blocks allocated for packets.
+ */
+#define BLE_TOTAL_BUFFER_SIZE(n_link, mblocks_count) \
+        (16 + BLE_FIXED_BUFFER_SIZE_BYTES + \
+         (BLE_PER_LINK_SIZE_BYTES * (n_link)) + \
+         ((BLE_MEM_BLOCK_SIZE + 8) * (mblocks_count)))
+
+/*
+ * BLE_EXT_ADV_BUFFER_SIZE
+ * additional memory size used for Extended advertising;
+ * It has to be added to BLE_TOTAL_BUFFER_SIZE() if the Extended advertising
+ * feature is used.
+ *
+ * @param set_nbr: Maximum number of advertising sets.
+ * Valid values are from 1 to 8.
+ *
+ * @param data_len: Maximum size of advertising data.
+ * Valid values are from 31 to 1650.
+ */
+#define BLE_EXT_ADV_BUFFER_SIZE(set_nbr, data_len) \
+        (2512 + ((892 + (DIVC(data_len, 207) * 244)) * (set_nbr)))
+
+/*
+ * BLE_TOTAL_BUFFER_SIZE_GATT: this macro returns the amount of memory,
+ * in bytes, needed for the storage of GATT database elements.
+ *
+ * @param num_gatt_attributes: Maximum number of Attributes (i.e. the number
+ * of characteristic + the number of characteristic values + the number of
+ * descriptors, excluding the services) that can be stored in the GATT
+ * database. Note that certain characteristics and relative descriptors are
+ * added automatically during device initialization so this parameters should
+ * be 9 plus the number of user Attributes
+ *
+ * @param num_gatt_services: 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
+ *
+ * @param att_value_array_size: Size of the storage area for Attribute values.
+  */
+#define BLE_TOTAL_BUFFER_SIZE_GATT(num_gatt_attributes, num_gatt_services, att_value_array_size) \
+        (((((att_value_array_size) - 1) | 3) + 1) + \
+         (40 * (num_gatt_attributes)) + (48 * (num_gatt_services)))
+
+
+#endif /* BLE_BUFSIZE_H__ */
diff --git a/src/utility/STM32_WPAN/hw.h b/src/utility/STM32_WPAN/hw.h
new file mode 100644
index 00000000..1472a5e8
--- /dev/null
+++ b/src/utility/STM32_WPAN/hw.h
@@ -0,0 +1,114 @@
+/**
+  ******************************************************************************
+  * @file    hw.h
+  * @author  MCD Application Team
+  * @brief   Hardware
+  ******************************************************************************
+   * @attention
+  *
+  * Copyright (c) 2018-2021 STMicroelectronics.
+  * All rights reserved.
+  *
+  * This software is licensed under terms that can be found in the LICENSE file
+  * in the root directory of this software component.
+  * If no LICENSE file comes with this software, it is provided AS-IS.
+  *
+  ******************************************************************************
+ */
+
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __HW_H
+#define __HW_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+  /* Includes ------------------------------------------------------------------*/
+#include "stm32_def.h"
+#include "stm32wbxx_ll_bus.h"
+#include "stm32wbxx_ll_exti.h"
+#include "stm32wbxx_ll_system.h"
+#include "stm32wbxx_ll_rcc.h"
+#include "stm32wbxx_ll_ipcc.h"
+#include "stm32wbxx_ll_cortex.h"
+#include "stm32wbxx_ll_utils.h"
+#include "stm32wbxx_ll_pwr.h"
+
+  /******************************************************************************
+   * HW IPCC
+   ******************************************************************************/
+  void HW_IPCC_Enable( void );
+  void HW_IPCC_Init( void );
+#define HW_IPCC_Rx_Handler IPCC_C1_RX_IRQHandler
+#define HW_IPCC_Tx_Handler IPCC_C1_TX_IRQHandler
+
+  void HW_IPCC_BLE_Init( void );
+  void HW_IPCC_BLE_SendCmd( void );
+  void HW_IPCC_MM_SendFreeBuf( void (*cb)( void ) );
+  void HW_IPCC_BLE_RxEvtNot( void );
+  void HW_IPCC_BLE_SendAclData( void );
+  void HW_IPCC_BLE_AclDataAckNot( void );
+
+  void HW_IPCC_SYS_Init( void );
+  void HW_IPCC_SYS_SendCmd( void );
+  void HW_IPCC_SYS_CmdEvtNot( void );
+  void HW_IPCC_SYS_EvtNot( void );
+
+  void HW_IPCC_THREAD_Init( void );
+  void HW_IPCC_OT_SendCmd( void );
+  void HW_IPCC_CLI_SendCmd( void );
+  void HW_IPCC_THREAD_SendAck( void );
+  void HW_IPCC_OT_CmdEvtNot( void );
+  void HW_IPCC_CLI_CmdEvtNot( void );
+  void HW_IPCC_THREAD_EvtNot( void );
+  void HW_IPCC_THREAD_CliSendAck( void );
+  void HW_IPCC_THREAD_CliEvtNot( void );
+
+
+  void HW_IPCC_LLDTESTS_Init( void );
+  void HW_IPCC_LLDTESTS_SendCliCmd( void );
+  void HW_IPCC_LLDTESTS_ReceiveCliRsp( void );
+  void HW_IPCC_LLDTESTS_SendCliRspAck( void );
+  void HW_IPCC_LLDTESTS_ReceiveM0Cmd( void );
+  void HW_IPCC_LLDTESTS_SendM0CmdAck( void );
+
+
+  void HW_IPCC_BLE_LLD_Init( void );
+  void HW_IPCC_BLE_LLD_SendCliCmd( void );
+  void HW_IPCC_BLE_LLD_ReceiveCliRsp( void );
+  void HW_IPCC_BLE_LLD_SendCliRspAck( void );
+  void HW_IPCC_BLE_LLD_ReceiveM0Cmd( void );
+  void HW_IPCC_BLE_LLD_SendM0CmdAck( void );
+  void HW_IPCC_BLE_LLD_SendCmd( void );
+  void HW_IPCC_BLE_LLD_ReceiveRsp( void );
+  void HW_IPCC_BLE_LLD_SendRspAck( void );
+
+
+  void HW_IPCC_TRACES_Init( void );
+  void HW_IPCC_TRACES_EvtNot( void );
+
+  void HW_IPCC_MAC_802_15_4_Init( void );
+  void HW_IPCC_MAC_802_15_4_SendCmd( void );
+  void HW_IPCC_MAC_802_15_4_SendAck( void );
+  void HW_IPCC_MAC_802_15_4_CmdEvtNot( void );
+  void HW_IPCC_MAC_802_15_4_EvtNot( void );
+
+  void HW_IPCC_ZIGBEE_Init( void );
+
+  void HW_IPCC_ZIGBEE_SendM4RequestToM0(void); /* M4 Request to M0 */
+  void HW_IPCC_ZIGBEE_RecvAppliAckFromM0(void); /* Request ACK from M0 */
+
+  void HW_IPCC_ZIGBEE_RecvM0NotifyToM4(void); /* M0 Notify to M4 */
+  void HW_IPCC_ZIGBEE_SendM4AckToM0Notify(void); /* Notify ACK from M4 */
+  void HW_IPCC_ZIGBEE_RecvM0RequestToM4(void); /* M0 Request to M4 */
+  void HW_IPCC_ZIGBEE_SendM4AckToM0Request(void); /* Request ACK from M4 */
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*__HW_H */
+
diff --git a/src/utility/STM32_WPAN/hw_ipcc.c b/src/utility/STM32_WPAN/hw_ipcc.c
new file mode 100644
index 00000000..ad3c9d4c
--- /dev/null
+++ b/src/utility/STM32_WPAN/hw_ipcc.c
@@ -0,0 +1,749 @@
+/* USER CODE BEGIN Header */
+/**
+  ******************************************************************************
+  * @file    hw_ipcc.c
+  * @author  MCD Application Team
+  * @brief   Hardware IPCC source file for STM32WPAN Middleware.
+  ******************************************************************************
+  * @attention
+  *
+  * Copyright (c) 2020-2021 STMicroelectronics.
+  * All rights reserved.
+  *
+  * This software is licensed under terms that can be found in the LICENSE file
+  * in the root directory of this software component.
+  * If no LICENSE file comes with this software, it is provided AS-IS.
+  *
+  ******************************************************************************
+  */
+/* USER CODE END Header */
+
+#if defined(STM32WBxx)
+/* Includes ------------------------------------------------------------------*/
+#include "hw.h"
+#include "mbox_def.h"
+#include "utilities_conf.h"
+
+/* Global variables ---------------------------------------------------------*/
+/* Private defines -----------------------------------------------------------*/
+#define HW_IPCC_TX_PENDING( channel ) ( !(LL_C1_IPCC_IsActiveFlag_CHx( IPCC, channel )) ) &&  (((~(IPCC->C1MR)) & (channel << 16U)))
+#define HW_IPCC_RX_PENDING( channel )  (LL_C2_IPCC_IsActiveFlag_CHx( IPCC, channel )) && (((~(IPCC->C1MR)) & (channel << 0U)))
+
+/* Private macros ------------------------------------------------------------*/
+/* Private typedef -----------------------------------------------------------*/
+/* Private variables ---------------------------------------------------------*/
+static void (*FreeBufCb)( void );
+
+/* Private function prototypes -----------------------------------------------*/
+static void HW_IPCC_BLE_EvtHandler( void );
+static void HW_IPCC_BLE_AclDataEvtHandler( void );
+static void HW_IPCC_MM_FreeBufHandler( void );
+static void HW_IPCC_SYS_CmdEvtHandler( void );
+static void HW_IPCC_SYS_EvtHandler( void );
+static void HW_IPCC_TRACES_EvtHandler( void );
+
+#ifdef THREAD_WB
+static void HW_IPCC_OT_CmdEvtHandler( void );
+static void HW_IPCC_THREAD_NotEvtHandler( void );
+static void HW_IPCC_THREAD_CliNotEvtHandler( void );
+#endif
+
+#ifdef LLD_TESTS_WB
+static void HW_IPCC_LLDTESTS_ReceiveCliRspHandler( void );
+static void HW_IPCC_LLDTESTS_ReceiveM0CmdHandler( void );
+#endif
+#ifdef LLD_BLE_WB
+/*static void HW_IPCC_LLD_BLE_ReceiveCliRspHandler( void );*/
+static void HW_IPCC_LLD_BLE_ReceiveRspHandler( void );
+static void HW_IPCC_LLD_BLE_ReceiveM0CmdHandler( void );
+#endif
+
+#ifdef MAC_802_15_4_WB
+static void HW_IPCC_MAC_802_15_4_CmdEvtHandler( void );
+static void HW_IPCC_MAC_802_15_4_NotEvtHandler( void );
+#endif
+
+#ifdef ZIGBEE_WB
+static void HW_IPCC_ZIGBEE_CmdEvtHandler( void );
+static void HW_IPCC_ZIGBEE_StackNotifEvtHandler( void );
+static void HW_IPCC_ZIGBEE_StackM0RequestHandler( void );
+#endif
+
+/* Public function definition -----------------------------------------------*/
+
+/******************************************************************************
+ * INTERRUPT HANDLER
+ ******************************************************************************/
+void HW_IPCC_Rx_Handler( void )
+{
+  if (HW_IPCC_RX_PENDING( HW_IPCC_SYSTEM_EVENT_CHANNEL ))
+  {
+      HW_IPCC_SYS_EvtHandler();
+  }
+#ifdef MAC_802_15_4_WB
+  else if (HW_IPCC_RX_PENDING( HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL ))
+  {
+    HW_IPCC_MAC_802_15_4_NotEvtHandler();
+  }
+#endif /* MAC_802_15_4_WB */
+#ifdef THREAD_WB
+  else if (HW_IPCC_RX_PENDING( HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL ))
+  {
+    HW_IPCC_THREAD_NotEvtHandler();
+  }
+  else if (HW_IPCC_RX_PENDING( HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL ))
+  {
+    HW_IPCC_THREAD_CliNotEvtHandler();
+  }
+#endif /* THREAD_WB */
+#ifdef LLD_TESTS_WB
+  else if (HW_IPCC_RX_PENDING( HW_IPCC_LLDTESTS_CLI_RSP_CHANNEL ))
+  {
+    HW_IPCC_LLDTESTS_ReceiveCliRspHandler();
+  }
+  else if (HW_IPCC_RX_PENDING( HW_IPCC_LLDTESTS_M0_CMD_CHANNEL ))
+  {
+    HW_IPCC_LLDTESTS_ReceiveM0CmdHandler();
+  }
+#endif /* LLD_TESTS_WB */
+#ifdef LLD_BLE_WB
+  else if (HW_IPCC_RX_PENDING( HW_IPCC_LLD_BLE_RSP_CHANNEL ))
+  {
+    HW_IPCC_LLD_BLE_ReceiveRspHandler();
+  }
+  else if (HW_IPCC_RX_PENDING( HW_IPCC_LLD_BLE_M0_CMD_CHANNEL ))
+  {
+    HW_IPCC_LLD_BLE_ReceiveM0CmdHandler();
+  }
+#endif /* LLD_TESTS_WB */
+#ifdef ZIGBEE_WB
+  else if (HW_IPCC_RX_PENDING( HW_IPCC_ZIGBEE_APPLI_NOTIF_ACK_CHANNEL ))
+  {
+    HW_IPCC_ZIGBEE_StackNotifEvtHandler();
+  }
+  else if (HW_IPCC_RX_PENDING( HW_IPCC_ZIGBEE_M0_REQUEST_CHANNEL ))
+  {
+    HW_IPCC_ZIGBEE_StackM0RequestHandler();
+  }
+#endif /* ZIGBEE_WB */
+  else if (HW_IPCC_RX_PENDING( HW_IPCC_BLE_EVENT_CHANNEL ))
+  {
+    HW_IPCC_BLE_EvtHandler();
+  }
+  else if (HW_IPCC_RX_PENDING( HW_IPCC_TRACES_CHANNEL ))
+  {
+    HW_IPCC_TRACES_EvtHandler();
+  }
+
+  return;
+}
+
+void HW_IPCC_Tx_Handler( void )
+{
+  if (HW_IPCC_TX_PENDING( HW_IPCC_SYSTEM_CMD_RSP_CHANNEL ))
+  {
+    HW_IPCC_SYS_CmdEvtHandler();
+  }
+#ifdef MAC_802_15_4_WB
+  else if (HW_IPCC_TX_PENDING( HW_IPCC_MAC_802_15_4_CMD_RSP_CHANNEL ))
+  {
+    HW_IPCC_MAC_802_15_4_CmdEvtHandler();
+  }
+#endif /* MAC_802_15_4_WB */
+#ifdef THREAD_WB
+  else if (HW_IPCC_TX_PENDING( HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL ))
+  {
+    HW_IPCC_OT_CmdEvtHandler();
+  }
+#endif /* THREAD_WB */
+#ifdef LLD_TESTS_WB
+// No TX handler for LLD tests
+#endif /* LLD_TESTS_WB */
+#ifdef ZIGBEE_WB
+  if (HW_IPCC_TX_PENDING( HW_IPCC_ZIGBEE_CMD_APPLI_CHANNEL ))
+  {
+      HW_IPCC_ZIGBEE_CmdEvtHandler();
+  }
+#endif /* ZIGBEE_WB */
+  else if (HW_IPCC_TX_PENDING( HW_IPCC_MM_RELEASE_BUFFER_CHANNEL ))
+  {
+    HW_IPCC_MM_FreeBufHandler();
+  }
+  else if (HW_IPCC_TX_PENDING( HW_IPCC_HCI_ACL_DATA_CHANNEL ))
+  {
+    HW_IPCC_BLE_AclDataEvtHandler();
+  }
+
+  return;
+}
+/******************************************************************************
+ * GENERAL
+ ******************************************************************************/
+void HW_IPCC_Enable( void )
+{
+  /**
+  * Such as IPCC IP available to the CPU2, it is required to keep the IPCC clock running
+  * when FUS is running on CPU2 and CPU1 enters deep sleep mode
+  */
+  LL_C2_AHB3_GRP1_EnableClock(LL_C2_AHB3_GRP1_PERIPH_IPCC);
+
+  /**
+  * When the device is out of standby, it is required to use the EXTI mechanism to wakeup CPU2
+  */
+  LL_EXTI_EnableRisingTrig_32_63( LL_EXTI_LINE_41 );
+  /* It is required to have at least a system clock cycle before a SEV after LL_EXTI_EnableRisingTrig_32_63() */
+  LL_C2_EXTI_EnableEvent_32_63( LL_EXTI_LINE_41 );
+
+  /**
+   * In case the SBSFU is implemented, it may have already set the C2BOOT bit to startup the CPU2.
+   * In that case, to keep the mechanism transparent to the user application, it shall call the system command
+   * SHCI_C2_Reinit( ) before jumping to the application.
+   * When the CPU2 receives that command, it waits for its event input to be set to restart the CPU2 firmware.
+   * This is required because once C2BOOT has been set once, a clear/set on C2BOOT has no effect.
+   * When SHCI_C2_Reinit( ) is not called, generating an event to the CPU2 does not have any effect
+   * So, by default, the application shall both set the event flag and set the C2BOOT bit.
+   */
+  __SEV( );       /* Set the internal event flag and send an event to the CPU2 */
+  __WFE( );       /* Clear the internal event flag */
+  LL_PWR_EnableBootC2( );
+
+  return;
+}
+
+void HW_IPCC_Init( void )
+{
+  LL_AHB3_GRP1_EnableClock( LL_AHB3_GRP1_PERIPH_IPCC );
+
+  LL_C1_IPCC_EnableIT_RXO( IPCC );
+  LL_C1_IPCC_EnableIT_TXF( IPCC );
+
+  HAL_NVIC_EnableIRQ(IPCC_C1_RX_IRQn);
+  HAL_NVIC_EnableIRQ(IPCC_C1_TX_IRQn);
+
+  return;
+}
+
+/******************************************************************************
+ * BLE
+ ******************************************************************************/
+void HW_IPCC_BLE_Init( void )
+{
+  UTILS_ENTER_CRITICAL_SECTION();
+  LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_BLE_EVENT_CHANNEL );
+  UTILS_EXIT_CRITICAL_SECTION();
+
+  return;
+}
+
+void HW_IPCC_BLE_SendCmd( void )
+{
+  LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_BLE_CMD_CHANNEL );
+
+  return;
+}
+
+static void HW_IPCC_BLE_EvtHandler( void )
+{
+  HW_IPCC_BLE_RxEvtNot();
+
+  LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_BLE_EVENT_CHANNEL );
+
+  return;
+}
+
+void HW_IPCC_BLE_SendAclData( void )
+{
+  LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_HCI_ACL_DATA_CHANNEL );
+  UTILS_ENTER_CRITICAL_SECTION();
+  LL_C1_IPCC_EnableTransmitChannel( IPCC, HW_IPCC_HCI_ACL_DATA_CHANNEL );
+  UTILS_EXIT_CRITICAL_SECTION();
+
+  return;
+}
+
+static void HW_IPCC_BLE_AclDataEvtHandler( void )
+{
+  UTILS_ENTER_CRITICAL_SECTION();
+  LL_C1_IPCC_DisableTransmitChannel( IPCC, HW_IPCC_HCI_ACL_DATA_CHANNEL );
+  UTILS_EXIT_CRITICAL_SECTION();
+
+  HW_IPCC_BLE_AclDataAckNot();
+
+  return;
+}
+
+__weak void HW_IPCC_BLE_AclDataAckNot( void ){};
+__weak void HW_IPCC_BLE_RxEvtNot( void ){};
+
+/******************************************************************************
+ * SYSTEM
+ ******************************************************************************/
+void HW_IPCC_SYS_Init( void )
+{
+  UTILS_ENTER_CRITICAL_SECTION();
+  LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_SYSTEM_EVENT_CHANNEL );
+  UTILS_EXIT_CRITICAL_SECTION();
+
+  return;
+}
+
+void HW_IPCC_SYS_SendCmd( void )
+{
+  LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_SYSTEM_CMD_RSP_CHANNEL );
+  UTILS_ENTER_CRITICAL_SECTION();
+  LL_C1_IPCC_EnableTransmitChannel( IPCC, HW_IPCC_SYSTEM_CMD_RSP_CHANNEL );
+  UTILS_EXIT_CRITICAL_SECTION();
+
+  return;
+}
+
+static void HW_IPCC_SYS_CmdEvtHandler( void )
+{
+  UTILS_ENTER_CRITICAL_SECTION();
+  LL_C1_IPCC_DisableTransmitChannel( IPCC, HW_IPCC_SYSTEM_CMD_RSP_CHANNEL );
+  UTILS_EXIT_CRITICAL_SECTION();
+
+  HW_IPCC_SYS_CmdEvtNot();
+
+  return;
+}
+
+static void HW_IPCC_SYS_EvtHandler( void )
+{
+  HW_IPCC_SYS_EvtNot();
+
+  LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_SYSTEM_EVENT_CHANNEL );
+
+  return;
+}
+
+__weak void HW_IPCC_SYS_CmdEvtNot( void ){};
+__weak void HW_IPCC_SYS_EvtNot( void ){};
+
+/******************************************************************************
+ * MAC 802.15.4
+ ******************************************************************************/
+#ifdef MAC_802_15_4_WB
+void HW_IPCC_MAC_802_15_4_Init( void )
+{
+  UTILS_ENTER_CRITICAL_SECTION();
+  LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL );
+  UTILS_EXIT_CRITICAL_SECTION();
+
+  return;
+}
+
+void HW_IPCC_MAC_802_15_4_SendCmd( void )
+{
+  LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_MAC_802_15_4_CMD_RSP_CHANNEL );
+  UTILS_ENTER_CRITICAL_SECTION();
+  LL_C1_IPCC_EnableTransmitChannel( IPCC, HW_IPCC_MAC_802_15_4_CMD_RSP_CHANNEL );
+  UTILS_EXIT_CRITICAL_SECTION();
+
+  return;
+}
+
+void HW_IPCC_MAC_802_15_4_SendAck( void )
+{
+  LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL );
+  UTILS_ENTER_CRITICAL_SECTION();
+  LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL );
+  UTILS_EXIT_CRITICAL_SECTION();
+
+  return;
+}
+
+static void HW_IPCC_MAC_802_15_4_CmdEvtHandler( void )
+{
+  UTILS_ENTER_CRITICAL_SECTION();
+  LL_C1_IPCC_DisableTransmitChannel( IPCC, HW_IPCC_MAC_802_15_4_CMD_RSP_CHANNEL );
+  UTILS_EXIT_CRITICAL_SECTION();
+
+  HW_IPCC_MAC_802_15_4_CmdEvtNot();
+
+  return;
+}
+
+static void HW_IPCC_MAC_802_15_4_NotEvtHandler( void )
+{
+  UTILS_ENTER_CRITICAL_SECTION();
+  LL_C1_IPCC_DisableReceiveChannel( IPCC, HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL );
+  UTILS_EXIT_CRITICAL_SECTION();
+
+  HW_IPCC_MAC_802_15_4_EvtNot();
+
+  return;
+}
+__weak void HW_IPCC_MAC_802_15_4_CmdEvtNot( void ){};
+__weak void HW_IPCC_MAC_802_15_4_EvtNot( void ){};
+#endif
+
+/******************************************************************************
+ * THREAD
+ ******************************************************************************/
+#ifdef THREAD_WB
+void HW_IPCC_THREAD_Init( void )
+{
+  UTILS_ENTER_CRITICAL_SECTION();
+  LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+  LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL );
+  UTILS_EXIT_CRITICAL_SECTION();
+
+  return;
+}
+
+void HW_IPCC_OT_SendCmd( void )
+{
+  LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL );
+  UTILS_ENTER_CRITICAL_SECTION();
+  LL_C1_IPCC_EnableTransmitChannel( IPCC, HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL );
+  UTILS_EXIT_CRITICAL_SECTION();
+
+  return;
+}
+
+void HW_IPCC_CLI_SendCmd( void )
+{
+  LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_THREAD_CLI_CMD_CHANNEL );
+
+  return;
+}
+
+void HW_IPCC_THREAD_SendAck( void )
+{
+  LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+  UTILS_ENTER_CRITICAL_SECTION();
+  LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+  UTILS_EXIT_CRITICAL_SECTION();
+
+  return;
+}
+
+void HW_IPCC_THREAD_CliSendAck( void )
+{
+  LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL );
+  UTILS_ENTER_CRITICAL_SECTION();
+  LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL );
+  UTILS_EXIT_CRITICAL_SECTION();
+
+  return;
+}
+
+static void HW_IPCC_OT_CmdEvtHandler( void )
+{
+  UTILS_ENTER_CRITICAL_SECTION();
+  LL_C1_IPCC_DisableTransmitChannel( IPCC, HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL );
+  UTILS_EXIT_CRITICAL_SECTION();
+
+  HW_IPCC_OT_CmdEvtNot();
+
+  return;
+}
+
+static void HW_IPCC_THREAD_NotEvtHandler( void )
+{
+  UTILS_ENTER_CRITICAL_SECTION();
+  LL_C1_IPCC_DisableReceiveChannel( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+  UTILS_EXIT_CRITICAL_SECTION();
+
+  HW_IPCC_THREAD_EvtNot();
+
+  return;
+}
+
+static void HW_IPCC_THREAD_CliNotEvtHandler( void )
+{
+  UTILS_ENTER_CRITICAL_SECTION();
+  LL_C1_IPCC_DisableReceiveChannel( IPCC, HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL );
+  UTILS_EXIT_CRITICAL_SECTION();
+
+  HW_IPCC_THREAD_CliEvtNot();
+
+  return;
+}
+
+__weak void HW_IPCC_OT_CmdEvtNot( void ){};
+__weak void HW_IPCC_CLI_CmdEvtNot( void ){};
+__weak void HW_IPCC_THREAD_EvtNot( void ){};
+
+#endif /* THREAD_WB */
+
+/******************************************************************************
+ * LLD TESTS
+ ******************************************************************************/
+#ifdef LLD_TESTS_WB
+void HW_IPCC_LLDTESTS_Init( void )
+{
+  UTILS_ENTER_CRITICAL_SECTION();
+  LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_LLDTESTS_CLI_RSP_CHANNEL );
+  LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_LLDTESTS_M0_CMD_CHANNEL );
+  UTILS_EXIT_CRITICAL_SECTION();
+  return;
+}
+
+void HW_IPCC_LLDTESTS_SendCliCmd( void )
+{
+  LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_LLDTESTS_CLI_CMD_CHANNEL );
+  return;
+}
+
+static void HW_IPCC_LLDTESTS_ReceiveCliRspHandler( void )
+{
+  UTILS_ENTER_CRITICAL_SECTION();
+  LL_C1_IPCC_DisableReceiveChannel( IPCC, HW_IPCC_LLDTESTS_CLI_RSP_CHANNEL );
+  UTILS_EXIT_CRITICAL_SECTION();
+
+  HW_IPCC_LLDTESTS_ReceiveCliRsp();
+  return;
+}
+
+void HW_IPCC_LLDTESTS_SendCliRspAck( void )
+{
+  LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_LLDTESTS_CLI_RSP_CHANNEL );
+  UTILS_ENTER_CRITICAL_SECTION();
+  LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_LLDTESTS_CLI_RSP_CHANNEL );
+  UTILS_EXIT_CRITICAL_SECTION();
+  return;
+}
+
+static void HW_IPCC_LLDTESTS_ReceiveM0CmdHandler( void )
+{
+  UTILS_ENTER_CRITICAL_SECTION();
+  LL_C1_IPCC_DisableReceiveChannel( IPCC, HW_IPCC_LLDTESTS_M0_CMD_CHANNEL );
+  UTILS_EXIT_CRITICAL_SECTION();
+  HW_IPCC_LLDTESTS_ReceiveM0Cmd();
+  return;
+}
+
+void HW_IPCC_LLDTESTS_SendM0CmdAck( void )
+{
+  LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_LLDTESTS_M0_CMD_CHANNEL );
+  UTILS_ENTER_CRITICAL_SECTION();
+  LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_LLDTESTS_M0_CMD_CHANNEL );
+  UTILS_EXIT_CRITICAL_SECTION();
+  return;
+}
+__weak void HW_IPCC_LLDTESTS_ReceiveCliRsp( void ){};
+__weak void HW_IPCC_LLDTESTS_ReceiveM0Cmd( void ){};
+#endif /* LLD_TESTS_WB */
+
+/******************************************************************************
+ * LLD BLE
+ ******************************************************************************/
+#ifdef LLD_BLE_WB
+void HW_IPCC_LLD_BLE_Init( void )
+{
+  UTILS_ENTER_CRITICAL_SECTION();
+  LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_LLD_BLE_RSP_CHANNEL );
+  LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_LLD_BLE_M0_CMD_CHANNEL );
+  UTILS_EXIT_CRITICAL_SECTION();
+  return;
+}
+
+void HW_IPCC_LLD_BLE_SendCliCmd( void )
+{
+  LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_LLD_BLE_CLI_CMD_CHANNEL );
+  return;
+}
+
+/*static void HW_IPCC_LLD_BLE_ReceiveCliRspHandler( void )
+{
+  UTILS_ENTER_CRITICAL_SECTION();
+  LL_C1_IPCC_DisableReceiveChannel( IPCC, HW_IPCC_LLD_BLE_CLI_RSP_CHANNEL );
+  UTILS_EXIT_CRITICAL_SECTION();
+  HW_IPCC_LLD_BLE_ReceiveCliRsp();
+  return;
+}*/
+
+void HW_IPCC_LLD_BLE_SendCliRspAck( void )
+{
+  LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_LLD_BLE_CLI_RSP_CHANNEL );
+  UTILS_ENTER_CRITICAL_SECTION();
+  LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_LLD_BLE_CLI_RSP_CHANNEL );
+  UTILS_EXIT_CRITICAL_SECTION();
+  return;
+}
+
+static void HW_IPCC_LLD_BLE_ReceiveM0CmdHandler( void )
+{
+  //LL_C1_IPCC_DisableReceiveChannel( IPCC, HW_IPCC_LLD_BLE_M0_CMD_CHANNEL );
+  HW_IPCC_LLD_BLE_ReceiveM0Cmd();
+  return;
+}
+
+void HW_IPCC_LLD_BLE_SendM0CmdAck( void )
+{
+  LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_LLD_BLE_M0_CMD_CHANNEL );
+  //LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_LLD_BLE_M0_CMD_CHANNEL );
+  return;
+}
+__weak void HW_IPCC_LLD_BLE_ReceiveCliRsp( void ){};
+__weak void HW_IPCC_LLD_BLE_ReceiveM0Cmd( void ){};
+
+/* Transparent Mode */
+void HW_IPCC_LLD_BLE_SendCmd( void )
+{
+  LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_LLD_BLE_CMD_CHANNEL );
+  return;
+}
+
+static void HW_IPCC_LLD_BLE_ReceiveRspHandler( void )
+{
+  UTILS_ENTER_CRITICAL_SECTION();
+  LL_C1_IPCC_DisableReceiveChannel( IPCC, HW_IPCC_LLD_BLE_RSP_CHANNEL );
+  UTILS_EXIT_CRITICAL_SECTION();
+  HW_IPCC_LLD_BLE_ReceiveRsp();
+  return;
+}
+
+void HW_IPCC_LLD_BLE_SendRspAck( void )
+{
+  LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_LLD_BLE_RSP_CHANNEL );
+  UTILS_ENTER_CRITICAL_SECTION();
+  LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_LLD_BLE_RSP_CHANNEL );
+  UTILS_EXIT_CRITICAL_SECTION();
+  return;
+}
+
+#endif /* LLD_BLE_WB */
+
+/******************************************************************************
+ * ZIGBEE
+ ******************************************************************************/
+#ifdef ZIGBEE_WB
+void HW_IPCC_ZIGBEE_Init( void )
+{
+  UTILS_ENTER_CRITICAL_SECTION();
+  LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_ZIGBEE_APPLI_NOTIF_ACK_CHANNEL );
+  LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_ZIGBEE_M0_REQUEST_CHANNEL );
+  UTILS_EXIT_CRITICAL_SECTION();
+
+  return;
+}
+
+void HW_IPCC_ZIGBEE_SendM4RequestToM0( void )
+{
+  LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_ZIGBEE_CMD_APPLI_CHANNEL );
+  UTILS_ENTER_CRITICAL_SECTION();
+  LL_C1_IPCC_EnableTransmitChannel( IPCC, HW_IPCC_ZIGBEE_CMD_APPLI_CHANNEL );
+  UTILS_EXIT_CRITICAL_SECTION();
+
+  return;
+}
+
+void HW_IPCC_ZIGBEE_SendM4AckToM0Notify( void )
+{
+  LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_ZIGBEE_APPLI_NOTIF_ACK_CHANNEL );
+  UTILS_ENTER_CRITICAL_SECTION();
+  LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_ZIGBEE_APPLI_NOTIF_ACK_CHANNEL );
+  UTILS_EXIT_CRITICAL_SECTION();
+
+  return;
+}
+
+static void HW_IPCC_ZIGBEE_CmdEvtHandler( void )
+{
+  UTILS_ENTER_CRITICAL_SECTION();
+  LL_C1_IPCC_DisableTransmitChannel( IPCC, HW_IPCC_ZIGBEE_CMD_APPLI_CHANNEL );
+  UTILS_EXIT_CRITICAL_SECTION();
+
+  HW_IPCC_ZIGBEE_RecvAppliAckFromM0();
+
+  return;
+}
+
+static void HW_IPCC_ZIGBEE_StackNotifEvtHandler( void )
+{
+  UTILS_ENTER_CRITICAL_SECTION();
+  LL_C1_IPCC_DisableReceiveChannel( IPCC, HW_IPCC_ZIGBEE_APPLI_NOTIF_ACK_CHANNEL );
+  UTILS_EXIT_CRITICAL_SECTION();
+
+  HW_IPCC_ZIGBEE_RecvM0NotifyToM4();
+
+  return;
+}
+
+static void HW_IPCC_ZIGBEE_StackM0RequestHandler( void )
+{
+  UTILS_ENTER_CRITICAL_SECTION();
+  LL_C1_IPCC_DisableReceiveChannel( IPCC, HW_IPCC_ZIGBEE_M0_REQUEST_CHANNEL );
+  UTILS_EXIT_CRITICAL_SECTION();
+
+  HW_IPCC_ZIGBEE_RecvM0RequestToM4();
+
+  return;
+}
+
+void HW_IPCC_ZIGBEE_SendM4AckToM0Request( void )
+{
+  LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_ZIGBEE_M0_REQUEST_CHANNEL );
+  UTILS_ENTER_CRITICAL_SECTION();
+  LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_ZIGBEE_M0_REQUEST_CHANNEL );
+  UTILS_EXIT_CRITICAL_SECTION();
+
+  return;
+}
+
+__weak void HW_IPCC_ZIGBEE_RecvAppliAckFromM0( void ){};
+__weak void HW_IPCC_ZIGBEE_RecvM0NotifyToM4( void ){};
+__weak void HW_IPCC_ZIGBEE_RecvM0RequestToM4( void ){};
+#endif /* ZIGBEE_WB */
+
+/******************************************************************************
+ * MEMORY MANAGER
+ ******************************************************************************/
+void HW_IPCC_MM_SendFreeBuf( void (*cb)( void ) )
+{
+  if ( LL_C1_IPCC_IsActiveFlag_CHx( IPCC, HW_IPCC_MM_RELEASE_BUFFER_CHANNEL ) )
+  {
+    FreeBufCb = cb;
+    UTILS_ENTER_CRITICAL_SECTION();
+    LL_C1_IPCC_EnableTransmitChannel( IPCC, HW_IPCC_MM_RELEASE_BUFFER_CHANNEL );
+    UTILS_EXIT_CRITICAL_SECTION();
+  }
+  else
+  {
+    cb();
+
+    LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_MM_RELEASE_BUFFER_CHANNEL );
+  }
+
+  return;
+}
+
+static void HW_IPCC_MM_FreeBufHandler( void )
+{
+  UTILS_ENTER_CRITICAL_SECTION();
+  LL_C1_IPCC_DisableTransmitChannel( IPCC, HW_IPCC_MM_RELEASE_BUFFER_CHANNEL );
+  UTILS_EXIT_CRITICAL_SECTION();
+
+  FreeBufCb();
+
+  LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_MM_RELEASE_BUFFER_CHANNEL );
+
+  return;
+}
+
+/******************************************************************************
+ * TRACES
+ ******************************************************************************/
+void HW_IPCC_TRACES_Init( void )
+{
+  UTILS_ENTER_CRITICAL_SECTION();
+  LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_TRACES_CHANNEL );
+  UTILS_EXIT_CRITICAL_SECTION();
+
+  return;
+}
+
+static void HW_IPCC_TRACES_EvtHandler( void )
+{
+  HW_IPCC_TRACES_EvtNot();
+
+  LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_TRACES_CHANNEL );
+
+  return;
+}
+
+__weak void HW_IPCC_TRACES_EvtNot( void ){};
+#endif /* STM32WBxx */
diff --git a/src/utility/STM32_WPAN/mbox_def.h b/src/utility/STM32_WPAN/mbox_def.h
new file mode 100644
index 00000000..68b71f9c
--- /dev/null
+++ b/src/utility/STM32_WPAN/mbox_def.h
@@ -0,0 +1,280 @@
+/**
+ ******************************************************************************
+ * @file    mbox_def.h
+ * @author  MCD Application Team
+ * @brief   Mailbox definition
+ ******************************************************************************
+ * @attention
+ *
+ * Copyright (c) 2018-2021 STMicroelectronics.
+ * All rights reserved.
+ *
+ * This software is licensed under terms that can be found in the LICENSE file
+ * in the root directory of this software component.
+ * If no LICENSE file comes with this software, it is provided AS-IS.
+ *
+ ******************************************************************************
+ */
+
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __MBOX_H
+#define __MBOX_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "stm32_wpan_common.h"
+
+  /**
+   * This file shall be identical between the CPU1 and the CPU2
+   */
+
+  /**
+   *********************************************************************************
+   * TABLES
+   *********************************************************************************
+   */
+
+  /**
+   * Version
+   * [0:3]   = Build - 0: Untracked - 15:Released - x: Tracked version
+   * [4:7]   = branch - 0: Mass Market - x: ...
+   * [8:15]  = Subversion
+   * [16:23] = Version minor
+   * [24:31] = Version major
+   *
+   * Memory Size
+   * [0:7]   = Flash ( Number of 4k sector)
+   * [8:15]  = Reserved ( Shall be set to 0 - may be used as flash extension )
+   * [16:23] = SRAM2b ( Number of 1k sector)
+   * [24:31] = SRAM2a ( Number of 1k sector)
+   */
+  typedef PACKED_STRUCT
+  {
+    uint32_t    Version;
+  } MB_SafeBootInfoTable_t;
+
+  typedef PACKED_STRUCT
+  {
+    uint32_t    Version;
+    uint32_t    MemorySize;
+    uint32_t    FusInfo;
+  } MB_FusInfoTable_t;
+
+  typedef PACKED_STRUCT
+  {
+    uint32_t    Version;
+    uint32_t    MemorySize;
+    uint32_t    InfoStack;
+    uint32_t    Reserved;
+  } MB_WirelessFwInfoTable_t;
+
+  typedef struct
+  {
+    MB_SafeBootInfoTable_t      SafeBootInfoTable;
+    MB_FusInfoTable_t           FusInfoTable;
+    MB_WirelessFwInfoTable_t    WirelessFwInfoTable;
+  } MB_DeviceInfoTable_t;
+
+  typedef struct
+  {
+    uint8_t     *pcmd_buffer;
+    uint8_t     *pcs_buffer;
+    uint8_t     *pevt_queue;
+    uint8_t     *phci_acl_data_buffer;
+  } MB_BleTable_t;
+
+  typedef struct
+  {
+    uint8_t   *notack_buffer;
+    uint8_t   *clicmdrsp_buffer;
+    uint8_t   *otcmdrsp_buffer;
+    uint8_t   *clinot_buffer;
+  } MB_ThreadTable_t;
+
+  typedef struct
+  {
+    uint8_t   *clicmdrsp_buffer;
+    uint8_t   *m0cmd_buffer;
+  } MB_LldTestsTable_t;
+
+  typedef struct
+  {
+    uint8_t   *cmdrsp_buffer;
+    uint8_t   *m0cmd_buffer;
+  } MB_BleLldTable_t;
+
+  typedef struct
+  {
+    uint8_t   *notifM0toM4_buffer;
+    uint8_t   *appliCmdM4toM0_buffer;
+    uint8_t   *requestM0toM4_buffer;
+  } MB_ZigbeeTable_t;
+  /**
+   * msg
+   * [0:7]   = cmd/evt
+   * [8:31] = Reserved
+   */
+  typedef struct
+  {
+    uint8_t   *pcmd_buffer;
+    uint8_t   *sys_queue;
+  } MB_SysTable_t;
+
+  typedef struct
+  {
+    uint8_t     *spare_ble_buffer;
+    uint8_t     *spare_sys_buffer;
+    uint8_t     *blepool;
+    uint32_t    blepoolsize;
+    uint8_t     *pevt_free_buffer_queue;
+    uint8_t     *traces_evt_pool;
+    uint32_t    tracespoolsize;
+  } MB_MemManagerTable_t;
+
+  typedef struct
+  {
+    uint8_t   *traces_queue;
+  } MB_TracesTable_t;
+
+  typedef struct
+  {
+    uint8_t   *p_cmdrsp_buffer;
+    uint8_t   *p_notack_buffer;
+    uint8_t   *evt_queue;
+  } MB_Mac_802_15_4_t;
+
+  typedef struct
+  {
+    MB_DeviceInfoTable_t    *p_device_info_table;
+    MB_BleTable_t           *p_ble_table;
+    MB_ThreadTable_t        *p_thread_table;
+    MB_SysTable_t           *p_sys_table;
+    MB_MemManagerTable_t    *p_mem_manager_table;
+    MB_TracesTable_t        *p_traces_table;
+    MB_Mac_802_15_4_t       *p_mac_802_15_4_table;
+    MB_ZigbeeTable_t        *p_zigbee_table;
+    MB_LldTestsTable_t      *p_lld_tests_table;
+    MB_BleLldTable_t        *p_ble_lld_table;
+} MB_RefTable_t;
+
+/**
+ * This table shall be used only in the case the CPU2 runs the FUS.
+ * It is used by the command SHCI_GetWirelessFwInfo()
+ */
+typedef struct
+{
+  uint32_t  DeviceInfoTableState;
+  uint8_t   Reserved1;
+  uint8_t   LastFusActiveState;
+  uint8_t   LastWirelessStackState;
+  uint8_t   CurrentWirelessStackType;
+  uint32_t  SafeBootVersion;
+  uint32_t  FusVersion;
+  uint32_t  FusMemorySize;
+  uint32_t  WirelessStackVersion;
+  uint32_t  WirelessStackMemorySize;
+  uint32_t  WirelessFirmwareBleInfo;
+  uint32_t  WirelessFirmwareThreadInfo;
+  uint32_t  Reserved2;
+  uint64_t  UID64;
+  uint16_t  DeviceId;
+} MB_FUS_DeviceInfoTable_t ;
+
+#ifdef __cplusplus
+}
+#endif
+
+/**
+ *********************************************************************************
+ * IPCC CHANNELS
+ *********************************************************************************
+ */
+
+/*  CPU1                                             CPU2
+ *   |             (SYSTEM)                            |
+ *   |----HW_IPCC_SYSTEM_CMD_RSP_CHANNEL-------------->|
+ *   |                                                 |
+ *   |<---HW_IPCC_SYSTEM_EVENT_CHANNEL-----------------|
+ *   |                                                 |
+ *   |            (ZIGBEE)                             |
+ *   |----HW_IPCC_ZIGBEE_CMD_APPLI_CHANNEL------------>|
+ *   |                                                 |
+ *   |----HW_IPCC_ZIGBEE_CMD_CLI_CHANNEL-------------->|
+ *   |                                                 |
+ *   |<---HW_IPCC_ZIGBEE_APPLI_NOTIF_ACK_CHANNEL-------|
+ *   |                                                 |
+ *   |<---HW_IPCC_ZIGBEE_CLI_NOTIF_ACK_CHANNEL---------|
+ *   |                                                 |
+ *   |             (THREAD)                            |
+ *   |----HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL----------->|
+ *   |                                                 |
+ *   |----HW_IPCC_THREAD_CLI_CMD_CHANNEL-------------->|
+ *   |                                                 |
+ *   |<---HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL------|
+ *   |                                                 |
+ *   |<---HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL--|
+ *   |                                                 |
+ *   |             (BLE)                               |
+ *   |----HW_IPCC_BLE_CMD_CHANNEL--------------------->|
+ *   |                                                 |
+ *   |----HW_IPCC_HCI_ACL_DATA_CHANNEL---------------->|
+ *   |                                                 |
+ *   |<---HW_IPCC_BLE_EVENT_CHANNEL--------------------|
+ *   |                                                 |
+ *   |             (BLE LLD)                           |
+ *   |----HW_IPCC_BLE_LLD_CMD_CHANNEL----------------->|
+ *   |                                                 |
+ *   |<---HW_IPCC_BLE_LLD_RSP_CHANNEL------------------|
+ *   |                                                 |
+ *   |<---HW_IPCC_BLE_LLD_M0_CMD_CHANNEL---------------|
+ *   |                                                 |
+ *   |             (MAC)                               |
+ *   |----HW_IPCC_MAC_802_15_4_CMD_RSP_CHANNEL-------->|
+ *   |                                                 |
+ *   |<---HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL|
+ *   |                                                 |
+ *   |             (BUFFER)                            |
+ *   |----HW_IPCC_MM_RELEASE_BUFFER_CHANNE------------>|
+ *   |                                                 |
+ *   |             (TRACE)                             |
+ *   |<----HW_IPCC_TRACES_CHANNEL----------------------|
+ *   |                                                 |
+ *
+ *
+ *
+ */
+
+
+
+/** CPU1 */
+#define HW_IPCC_BLE_CMD_CHANNEL                         LL_IPCC_CHANNEL_1
+#define HW_IPCC_SYSTEM_CMD_RSP_CHANNEL                  LL_IPCC_CHANNEL_2
+#define HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL               LL_IPCC_CHANNEL_3
+#define HW_IPCC_ZIGBEE_CMD_APPLI_CHANNEL                LL_IPCC_CHANNEL_3
+#define HW_IPCC_MAC_802_15_4_CMD_RSP_CHANNEL            LL_IPCC_CHANNEL_3
+#define HW_IPCC_MM_RELEASE_BUFFER_CHANNEL               LL_IPCC_CHANNEL_4
+#define HW_IPCC_THREAD_CLI_CMD_CHANNEL                  LL_IPCC_CHANNEL_5
+#define HW_IPCC_LLDTESTS_CLI_CMD_CHANNEL                LL_IPCC_CHANNEL_5
+#define HW_IPCC_BLE_LLD_CLI_CMD_CHANNEL                 LL_IPCC_CHANNEL_5
+#define HW_IPCC_BLE_LLD_CMD_CHANNEL                     LL_IPCC_CHANNEL_5
+#define HW_IPCC_HCI_ACL_DATA_CHANNEL                    LL_IPCC_CHANNEL_6
+
+/** CPU2 */
+#define HW_IPCC_BLE_EVENT_CHANNEL                       LL_IPCC_CHANNEL_1
+#define HW_IPCC_SYSTEM_EVENT_CHANNEL                    LL_IPCC_CHANNEL_2
+#define HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL         LL_IPCC_CHANNEL_3
+#define HW_IPCC_ZIGBEE_APPLI_NOTIF_ACK_CHANNEL          LL_IPCC_CHANNEL_3
+#define HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL   LL_IPCC_CHANNEL_3
+#define HW_IPCC_LLDTESTS_M0_CMD_CHANNEL                 LL_IPCC_CHANNEL_3
+#define HW_IPCC_BLE_LLD_M0_CMD_CHANNEL                  LL_IPCC_CHANNEL_3
+#define HW_IPCC_TRACES_CHANNEL                          LL_IPCC_CHANNEL_4
+#define HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL     LL_IPCC_CHANNEL_5
+#define HW_IPCC_LLDTESTS_CLI_RSP_CHANNEL                LL_IPCC_CHANNEL_5
+#define HW_IPCC_BLE_LLD_CLI_RSP_CHANNEL                 LL_IPCC_CHANNEL_5
+#define HW_IPCC_BLE_LLD_RSP_CHANNEL                     LL_IPCC_CHANNEL_5
+#define HW_IPCC_ZIGBEE_M0_REQUEST_CHANNEL               LL_IPCC_CHANNEL_5
+#endif /*__MBOX_H */
+
diff --git a/src/utility/STM32_WPAN/shci.c b/src/utility/STM32_WPAN/shci.c
new file mode 100644
index 00000000..40110f42
--- /dev/null
+++ b/src/utility/STM32_WPAN/shci.c
@@ -0,0 +1,763 @@
+/**
+ ******************************************************************************
+ * @file    shci.c
+ * @author  MCD Application Team
+ * @brief   HCI command for the system channel
+ ******************************************************************************
+ * @attention
+ *
+ * Copyright (c) 2018-2021 STMicroelectronics.
+ * All rights reserved.
+ *
+ * This software is licensed under terms that can be found in the LICENSE file
+ * in the root directory of this software component.
+ * If no LICENSE file comes with this software, it is provided AS-IS.
+ *
+ ******************************************************************************
+ */
+
+
+#if defined(STM32WBxx)
+/* Includes ------------------------------------------------------------------*/
+#include "stm32_wpan_common.h"
+
+#include "shci_tl.h"
+#include "shci.h"
+#include "stm32wbxx.h"
+
+/* Private typedef -----------------------------------------------------------*/
+/* Private defines -----------------------------------------------------------*/
+/* Private macros ------------------------------------------------------------*/
+/* Private variables ---------------------------------------------------------*/
+/* Global variables ----------------------------------------------------------*/
+/* Private function prototypes -----------------------------------------------*/
+/* Local Functions Definition ------------------------------------------------------*/
+/* Public Functions Definition ------------------------------------------------------*/
+
+/**
+ *  C2 COMMAND
+ *  These commands are sent to the CPU2
+ */
+uint8_t SHCI_C2_FUS_GetState( SHCI_FUS_GetState_ErrorCode_t *p_error_code )
+{
+  /**
+   * Buffer is large enough to hold command complete with payload
+   */
+  uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE + 1];
+  TL_EvtPacket_t * p_rsp;
+
+  p_rsp = (TL_EvtPacket_t *)local_buffer;
+
+  shci_send( SHCI_OPCODE_C2_FUS_GET_STATE,
+             0,
+             0,
+             p_rsp );
+
+  if(p_error_code != 0)
+  {
+    *p_error_code = (SHCI_FUS_GetState_ErrorCode_t)(((TL_CcEvt_t*)(p_rsp->evtserial.evt.payload))->payload[1]);
+  }
+
+  return (((TL_CcEvt_t*)(p_rsp->evtserial.evt.payload))->payload[0]);
+}
+
+SHCI_CmdStatus_t SHCI_C2_FUS_FwUpgrade( uint32_t fw_src_add,  uint32_t fw_dest_add )
+{
+  /**
+   * TL_BLEEVT_CC_BUFFER_SIZE is 16 bytes so it is large enough to hold the 8 bytes of command parameters
+   * Buffer is large enough to hold command complete without payload
+   */
+  uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE];
+  TL_EvtPacket_t * p_rsp;
+  uint32_t *p_cmd;
+  uint8_t cmd_length;
+
+  p_cmd = (uint32_t*)local_buffer;
+  cmd_length = 0;
+
+  if(fw_src_add != 0)
+  {
+    *p_cmd = fw_src_add;
+    cmd_length += 4;
+  }
+
+  if(fw_dest_add != 0)
+  {
+    *(p_cmd+1) = fw_dest_add;
+    cmd_length += 4;
+  }
+
+  p_rsp = (TL_EvtPacket_t *)local_buffer;
+
+  shci_send( SHCI_OPCODE_C2_FUS_FW_UPGRADE,
+             cmd_length,
+             local_buffer,
+             p_rsp );
+
+  return (SHCI_CmdStatus_t)(((TL_CcEvt_t*)(p_rsp->evtserial.evt.payload))->payload[0]);
+}
+
+SHCI_CmdStatus_t SHCI_C2_FUS_FwDelete( void )
+{
+  /**
+   * Buffer is large enough to hold command complete without payload
+   */
+  uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE];
+  TL_EvtPacket_t * p_rsp;
+
+  p_rsp = (TL_EvtPacket_t *)local_buffer;
+
+  shci_send( SHCI_OPCODE_C2_FUS_FW_DELETE,
+             0,
+             0,
+             p_rsp );
+
+  return (SHCI_CmdStatus_t)(((TL_CcEvt_t*)(p_rsp->evtserial.evt.payload))->payload[0]);
+}
+
+SHCI_CmdStatus_t SHCI_C2_FUS_UpdateAuthKey( SHCI_C2_FUS_UpdateAuthKey_Cmd_Param_t *pParam )
+{
+  /**
+   * Buffer is large enough to hold command complete without payload
+   */
+  uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE];
+  TL_EvtPacket_t * p_rsp;
+
+  p_rsp = (TL_EvtPacket_t *)local_buffer;
+
+  shci_send( SHCI_OPCODE_C2_FUS_UPDATE_AUTH_KEY,
+             sizeof( SHCI_C2_FUS_UpdateAuthKey_Cmd_Param_t ),
+             (uint8_t*)pParam,
+             p_rsp );
+
+  return (SHCI_CmdStatus_t)(((TL_CcEvt_t*)(p_rsp->evtserial.evt.payload))->payload[0]);
+}
+
+SHCI_CmdStatus_t SHCI_C2_FUS_LockAuthKey( void )
+{
+  /**
+   * Buffer is large enough to hold command complete without payload
+   */
+  uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE];
+  TL_EvtPacket_t * p_rsp;
+
+  p_rsp = (TL_EvtPacket_t *)local_buffer;
+
+  shci_send( SHCI_OPCODE_C2_FUS_LOCK_AUTH_KEY,
+             0,
+             0,
+             p_rsp );
+
+  return (SHCI_CmdStatus_t)(((TL_CcEvt_t*)(p_rsp->evtserial.evt.payload))->payload[0]);
+}
+
+SHCI_CmdStatus_t SHCI_C2_FUS_StoreUsrKey( SHCI_C2_FUS_StoreUsrKey_Cmd_Param_t *pParam, uint8_t *p_key_index )
+{
+  /**
+   * Buffer is large enough to hold command complete with payload
+   */
+  uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE + 1];
+  TL_EvtPacket_t * p_rsp;
+  uint8_t local_payload_len;
+
+  if(pParam->KeyType == KEYTYPE_ENCRYPTED)
+  {
+    /**
+     * When the key is encrypted, the 12 bytes IV Key is included in the payload as well
+     * The IV key is always 12 bytes
+     */
+    local_payload_len = pParam->KeySize + 2 + 12;
+  }
+  else
+  {
+    local_payload_len = pParam->KeySize + 2;
+  }
+
+  p_rsp = (TL_EvtPacket_t *)local_buffer;
+
+  shci_send( SHCI_OPCODE_C2_FUS_STORE_USR_KEY,
+             local_payload_len ,
+             (uint8_t*)pParam,
+             p_rsp );
+
+  *p_key_index = (((TL_CcEvt_t*)(p_rsp->evtserial.evt.payload))->payload[1]);
+
+  return (SHCI_CmdStatus_t)(((TL_CcEvt_t*)(p_rsp->evtserial.evt.payload))->payload[0]);
+}
+
+SHCI_CmdStatus_t SHCI_C2_FUS_LoadUsrKey( uint8_t key_index )
+{
+  /**
+   * Buffer is large enough to hold command complete without payload
+   */
+  uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE];
+  TL_EvtPacket_t * p_rsp;
+
+  p_rsp = (TL_EvtPacket_t *)local_buffer;
+
+  local_buffer[0] = key_index;
+
+  shci_send( SHCI_OPCODE_C2_FUS_LOAD_USR_KEY,
+             1,
+             local_buffer,
+             p_rsp );
+
+  return (SHCI_CmdStatus_t)(((TL_CcEvt_t*)(p_rsp->evtserial.evt.payload))->payload[0]);
+}
+
+SHCI_CmdStatus_t SHCI_C2_FUS_StartWs( void )
+{
+  /**
+   * Buffer is large enough to hold command complete without payload
+   */
+  uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE];
+  TL_EvtPacket_t * p_rsp;
+
+  p_rsp = (TL_EvtPacket_t *)local_buffer;
+
+  shci_send( SHCI_OPCODE_C2_FUS_START_WS,
+             0,
+             0,
+             p_rsp );
+
+  return (SHCI_CmdStatus_t)(((TL_CcEvt_t*)(p_rsp->evtserial.evt.payload))->payload[0]);
+}
+
+SHCI_CmdStatus_t SHCI_C2_FUS_LockUsrKey( uint8_t key_index )
+{
+  /**
+   * Buffer is large enough to hold command complete without payload
+   */
+  uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE];
+  TL_EvtPacket_t * p_rsp;
+
+  p_rsp = (TL_EvtPacket_t *)local_buffer;
+
+  local_buffer[0] = key_index;
+
+  shci_send( SHCI_OPCODE_C2_FUS_LOCK_USR_KEY,
+             1,
+             local_buffer,
+             p_rsp );
+
+  return (SHCI_CmdStatus_t)(((TL_CcEvt_t*)(p_rsp->evtserial.evt.payload))->payload[0]);
+}
+
+SHCI_CmdStatus_t SHCI_C2_FUS_UnloadUsrKey( uint8_t key_index )
+{
+  /**
+   * Buffer is large enough to hold command complete without payload
+   */
+  uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE];
+  TL_EvtPacket_t * p_rsp;
+
+  p_rsp = (TL_EvtPacket_t *)local_buffer;
+
+  local_buffer[0] = key_index;
+
+  shci_send( SHCI_OPCODE_C2_FUS_UNLOAD_USR_KEY,
+             1,
+             local_buffer,
+             p_rsp );
+
+  return (SHCI_CmdStatus_t)(((TL_CcEvt_t*)(p_rsp->evtserial.evt.payload))->payload[0]);
+}
+
+SHCI_CmdStatus_t SHCI_C2_FUS_ActivateAntiRollback( void )
+{
+  /**
+   * Buffer is large enough to hold command complete without payload
+   */
+  uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE];
+  TL_EvtPacket_t * p_rsp;
+
+  p_rsp = (TL_EvtPacket_t *)local_buffer;
+
+  shci_send( SHCI_OPCODE_C2_FUS_ACTIVATE_ANTIROLLBACK,
+             0,
+             0,
+             p_rsp );
+
+  return (SHCI_CmdStatus_t)(((TL_CcEvt_t*)(p_rsp->evtserial.evt.payload))->payload[0]);
+}
+
+SHCI_CmdStatus_t SHCI_C2_BLE_Init( SHCI_C2_Ble_Init_Cmd_Packet_t *pCmdPacket )
+{
+  /**
+   * Buffer is large enough to hold command complete without payload
+   */
+  uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE];
+  TL_EvtPacket_t * p_rsp;
+
+  p_rsp = (TL_EvtPacket_t *)local_buffer;
+
+ shci_send( SHCI_OPCODE_C2_BLE_INIT,
+            sizeof( SHCI_C2_Ble_Init_Cmd_Param_t ),
+            (uint8_t*)&pCmdPacket->Param,
+            p_rsp );
+
+  return (SHCI_CmdStatus_t)(((TL_CcEvt_t*)(p_rsp->evtserial.evt.payload))->payload[0]);
+}
+
+SHCI_CmdStatus_t SHCI_C2_THREAD_Init( void )
+{
+  /**
+   * Buffer is large enough to hold command complete without payload
+   */
+  uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE];
+  TL_EvtPacket_t * p_rsp;
+
+  p_rsp = (TL_EvtPacket_t *)local_buffer;
+
+  shci_send( SHCI_OPCODE_C2_THREAD_INIT,
+             0,
+             0,
+             p_rsp );
+
+  return (SHCI_CmdStatus_t)(((TL_CcEvt_t*)(p_rsp->evtserial.evt.payload))->payload[0]);
+}
+
+SHCI_CmdStatus_t SHCI_C2_LLDTESTS_Init( uint8_t param_size, uint8_t * p_param )
+{
+  /**
+   * Buffer is large enough to hold command complete without payload
+   */
+  uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE];
+  TL_EvtPacket_t * p_rsp;
+
+  p_rsp = (TL_EvtPacket_t *)local_buffer;
+
+  shci_send( SHCI_OPCODE_C2_LLD_TESTS_INIT,
+             param_size,
+             p_param,
+             p_rsp );
+
+  return (SHCI_CmdStatus_t)(((TL_CcEvt_t*)(p_rsp->evtserial.evt.payload))->payload[0]);
+}
+
+SHCI_CmdStatus_t SHCI_C2_BLE_LLD_Init( uint8_t param_size, uint8_t * p_param )
+{
+  /**
+   * Buffer is large enough to hold command complete without payload
+   */
+  uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE];
+  TL_EvtPacket_t * p_rsp;
+
+  p_rsp = (TL_EvtPacket_t *)local_buffer;
+
+  shci_send( SHCI_OPCODE_C2_BLE_LLD_INIT,
+             param_size,
+             p_param,
+             p_rsp );
+
+  return (SHCI_CmdStatus_t)(((TL_CcEvt_t*)(p_rsp->evtserial.evt.payload))->payload[0]);
+}
+
+SHCI_CmdStatus_t SHCI_C2_ZIGBEE_Init( void )
+{
+  /**
+   * Buffer is large enough to hold command complete without payload
+   */
+  uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE];
+  TL_EvtPacket_t * p_rsp;
+
+  p_rsp = (TL_EvtPacket_t *)local_buffer;
+
+  shci_send( SHCI_OPCODE_C2_ZIGBEE_INIT,
+             0,
+             0,
+             p_rsp );
+
+  return (SHCI_CmdStatus_t)(((TL_CcEvt_t*)(p_rsp->evtserial.evt.payload))->payload[0]);
+}
+
+SHCI_CmdStatus_t SHCI_C2_DEBUG_Init( SHCI_C2_DEBUG_Init_Cmd_Packet_t *pCmdPacket  )
+{
+  /**
+   * Buffer is large enough to hold command complete without payload
+   */
+  uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE];
+  TL_EvtPacket_t * p_rsp;
+
+  p_rsp = (TL_EvtPacket_t *)local_buffer;
+
+  shci_send( SHCI_OPCODE_C2_DEBUG_INIT,
+             sizeof( SHCI_C2_DEBUG_init_Cmd_Param_t ),
+             (uint8_t*)&pCmdPacket->Param,
+             p_rsp );
+
+  return (SHCI_CmdStatus_t)(((TL_CcEvt_t*)(p_rsp->evtserial.evt.payload))->payload[0]);
+}
+
+SHCI_CmdStatus_t SHCI_C2_FLASH_EraseActivity( SHCI_EraseActivity_t erase_activity )
+{
+  /**
+   * Buffer is large enough to hold command complete without payload
+   */
+  uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE];
+  TL_EvtPacket_t * p_rsp;
+
+  p_rsp = (TL_EvtPacket_t *)local_buffer;
+
+  local_buffer[0] = erase_activity;
+
+  shci_send( SHCI_OPCODE_C2_FLASH_ERASE_ACTIVITY,
+             1,
+             local_buffer,
+             p_rsp );
+
+  return (SHCI_CmdStatus_t)(((TL_CcEvt_t*)(p_rsp->evtserial.evt.payload))->payload[0]);
+}
+
+SHCI_CmdStatus_t SHCI_C2_CONCURRENT_SetMode( SHCI_C2_CONCURRENT_Mode_Param_t Mode )
+{
+  /**
+   * Buffer is large enough to hold command complete without payload
+   */
+  uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE];
+  TL_EvtPacket_t * p_rsp;
+
+  p_rsp = (TL_EvtPacket_t *)local_buffer;
+
+  local_buffer[0] = Mode;
+
+  shci_send( SHCI_OPCODE_C2_CONCURRENT_SET_MODE,
+             1,
+             local_buffer,
+             p_rsp );
+
+  return (SHCI_CmdStatus_t)(((TL_CcEvt_t*)(p_rsp->evtserial.evt.payload))->payload[0]);
+}
+
+SHCI_CmdStatus_t SHCI_C2_CONCURRENT_GetNextBleEvtTime( SHCI_C2_CONCURRENT_GetNextBleEvtTime_Param_t *pParam )
+{
+  /**
+   * Buffer is large enough to hold command complete with payload
+   */
+  uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE+4];
+  TL_EvtPacket_t * p_rsp;
+
+  p_rsp = (TL_EvtPacket_t *)local_buffer;
+
+  shci_send( SHCI_OPCODE_C2_CONCURRENT_GET_NEXT_BLE_EVT_TIME,
+             0,
+             0,
+             p_rsp );
+
+  memcpy((void*)&(pParam->relative_time), (void*)&((TL_CcEvt_t*)(p_rsp->evtserial.evt.payload))->payload[1], sizeof(pParam->relative_time));
+
+  return (SHCI_CmdStatus_t)(((TL_CcEvt_t*)(p_rsp->evtserial.evt.payload))->payload[0]);
+}
+
+SHCI_CmdStatus_t SHCI_C2_CONCURRENT_EnableNext_802154_EvtNotification( void )
+{
+  /**
+   * Buffer is large enough to hold command complete without payload
+   */
+  uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE];
+  TL_EvtPacket_t * p_rsp;
+
+  p_rsp = (TL_EvtPacket_t *)local_buffer;
+
+  shci_send( SHCI_OPCODE_C2_CONCURRENT_ENABLE_NEXT_802154_EVT_NOTIFICATION,
+             0,
+             0,
+             p_rsp );
+
+  return (SHCI_CmdStatus_t)(((TL_CcEvt_t*)(p_rsp->evtserial.evt.payload))->payload[0]);
+}
+
+SHCI_CmdStatus_t SHCI_C2_FLASH_StoreData( SHCI_C2_FLASH_Ip_t Ip )
+{
+  /**
+   * Buffer is large enough to hold command complete without payload
+   */
+  uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE];
+  TL_EvtPacket_t * p_rsp;
+
+  p_rsp = (TL_EvtPacket_t *)local_buffer;
+
+  local_buffer[0] = Ip;
+
+  shci_send( SHCI_OPCODE_C2_FLASH_STORE_DATA,
+             1,
+             local_buffer,
+             p_rsp );
+
+  return (SHCI_CmdStatus_t)(((TL_CcEvt_t*)(p_rsp->evtserial.evt.payload))->payload[0]);
+}
+
+SHCI_CmdStatus_t SHCI_C2_FLASH_EraseData( SHCI_C2_FLASH_Ip_t Ip )
+{
+  /**
+   * Buffer is large enough to hold command complete without payload
+   */
+  uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE];
+  TL_EvtPacket_t * p_rsp;
+
+  p_rsp = (TL_EvtPacket_t *)local_buffer;
+
+  local_buffer[0] = Ip;
+
+  shci_send( SHCI_OPCODE_C2_FLASH_ERASE_DATA,
+             1,
+             local_buffer,
+             p_rsp );
+
+  return (SHCI_CmdStatus_t)(((TL_CcEvt_t*)(p_rsp->evtserial.evt.payload))->payload[0]);
+}
+
+SHCI_CmdStatus_t SHCI_C2_RADIO_AllowLowPower( SHCI_C2_FLASH_Ip_t Ip,uint8_t  FlagRadioLowPowerOn)
+{
+  /**
+   * Buffer is large enough to hold command complete without payload
+   */
+  uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE];
+  TL_EvtPacket_t * p_rsp;
+
+  p_rsp = (TL_EvtPacket_t *)local_buffer;
+
+  local_buffer[0] = Ip;
+  local_buffer[1] = FlagRadioLowPowerOn;
+
+  shci_send( SHCI_OPCODE_C2_RADIO_ALLOW_LOW_POWER,
+             2,
+             local_buffer,
+             p_rsp );
+
+  return (SHCI_CmdStatus_t)(((TL_CcEvt_t*)(p_rsp->evtserial.evt.payload))->payload[0]);
+}
+
+SHCI_CmdStatus_t SHCI_C2_MAC_802_15_4_Init( void )
+{
+  /**
+   * Buffer is large enough to hold command complete without payload
+   */
+  uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE];
+  TL_EvtPacket_t * p_rsp;
+
+  p_rsp = (TL_EvtPacket_t *)local_buffer;
+
+  shci_send( SHCI_OPCODE_C2_MAC_802_15_4_INIT,
+             0,
+             0,
+             p_rsp );
+
+  return (SHCI_CmdStatus_t)(((TL_CcEvt_t*)(p_rsp->evtserial.evt.payload))->payload[0]);
+}
+
+SHCI_CmdStatus_t SHCI_C2_Reinit( void )
+{
+  /**
+   * Buffer is large enough to hold command complete without payload
+   */
+  uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE];
+  TL_EvtPacket_t * p_rsp;
+
+  p_rsp = (TL_EvtPacket_t *)local_buffer;
+
+  shci_send( SHCI_OPCODE_C2_REINIT,
+             0,
+             0,
+             p_rsp );
+
+  return (SHCI_CmdStatus_t)(((TL_CcEvt_t*)(p_rsp->evtserial.evt.payload))->payload[0]);
+}
+
+SHCI_CmdStatus_t SHCI_C2_ExtpaConfig(uint32_t gpio_port, uint16_t gpio_pin_number, uint8_t gpio_polarity, uint8_t gpio_status)
+{
+  /**
+   * TL_BLEEVT_CC_BUFFER_SIZE is 16 bytes so it is large enough to hold the 8 bytes of command parameters
+   * Buffer is large enough to hold command complete without payload
+   */
+  uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE];
+  TL_EvtPacket_t * p_rsp;
+
+  p_rsp = (TL_EvtPacket_t *)local_buffer;
+
+  ((SHCI_C2_EXTPA_CONFIG_Cmd_Param_t*)local_buffer)->gpio_port = gpio_port;
+  ((SHCI_C2_EXTPA_CONFIG_Cmd_Param_t*)local_buffer)->gpio_pin_number = gpio_pin_number;
+  ((SHCI_C2_EXTPA_CONFIG_Cmd_Param_t*)local_buffer)->gpio_polarity = gpio_polarity;
+  ((SHCI_C2_EXTPA_CONFIG_Cmd_Param_t*)local_buffer)->gpio_status = gpio_status;
+
+  shci_send( SHCI_OPCODE_C2_EXTPA_CONFIG,
+             8,
+             local_buffer,
+             p_rsp );
+
+  return (SHCI_CmdStatus_t)(((TL_CcEvt_t*)(p_rsp->evtserial.evt.payload))->payload[0]);
+}
+
+SHCI_CmdStatus_t SHCI_C2_SetFlashActivityControl(SHCI_C2_SET_FLASH_ACTIVITY_CONTROL_Source_t Source)
+{
+  /**
+   * TL_BLEEVT_CC_BUFFER_SIZE is 16 bytes so it is large enough to hold the 1 byte of command parameter
+   * Buffer is large enough to hold command complete without payload
+   */
+  uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE];
+  TL_EvtPacket_t * p_rsp;
+
+  p_rsp = (TL_EvtPacket_t *)local_buffer;
+
+  local_buffer[0] = (uint8_t)Source;
+
+  shci_send( SHCI_OPCODE_C2_SET_FLASH_ACTIVITY_CONTROL,
+             1,
+             local_buffer,
+             p_rsp );
+
+  return (SHCI_CmdStatus_t)(((TL_CcEvt_t*)(p_rsp->evtserial.evt.payload))->payload[0]);
+}
+
+SHCI_CmdStatus_t SHCI_C2_Config(SHCI_C2_CONFIG_Cmd_Param_t *pCmdPacket)
+{
+  /**
+   * Buffer is large enough to hold command complete without payload
+   */
+  uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE];
+  TL_EvtPacket_t * p_rsp;
+
+  p_rsp = (TL_EvtPacket_t *)local_buffer;
+
+  shci_send( SHCI_OPCODE_C2_CONFIG,
+             sizeof(SHCI_C2_CONFIG_Cmd_Param_t),
+             (uint8_t*)pCmdPacket,
+             p_rsp );
+
+  return (SHCI_CmdStatus_t)(((TL_CcEvt_t*)(p_rsp->evtserial.evt.payload))->payload[0]);
+}
+
+SHCI_CmdStatus_t SHCI_C2_802_15_4_DeInit( void )
+{
+  /**
+   * Buffer is large enough to hold command complete without payload
+   */
+  uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE];
+  TL_EvtPacket_t * p_rsp;
+
+  p_rsp = (TL_EvtPacket_t *)local_buffer;
+
+  shci_send( SHCI_OPCODE_C2_802_15_4_DEINIT,
+             0,
+             0,
+             p_rsp );
+
+  return (SHCI_CmdStatus_t)(((TL_CcEvt_t*)(p_rsp->evtserial.evt.payload))->payload[0]);
+}
+
+SHCI_CmdStatus_t SHCI_C2_SetSystemClock( SHCI_C2_SET_SYSTEM_CLOCK_Cmd_Param_t clockSel )
+{
+  /**
+   * Buffer is large enough to hold command complete without payload
+   */
+  uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE];
+  TL_EvtPacket_t * p_rsp;
+
+  p_rsp = (TL_EvtPacket_t *)local_buffer;
+
+  local_buffer[0] = (uint8_t)clockSel;
+
+  shci_send( SHCI_OPCODE_C2_SET_SYSTEM_CLOCK,
+             1,
+             local_buffer,
+             p_rsp );
+
+  return (SHCI_CmdStatus_t)(((TL_CcEvt_t*)(p_rsp->evtserial.evt.payload))->payload[0]);
+}
+
+/**
+ *  Local System COMMAND
+ *  These commands are NOT sent to the CPU2
+ */
+
+SHCI_CmdStatus_t SHCI_GetWirelessFwInfo( WirelessFwInfo_t* pWirelessInfo )
+{
+  uint32_t ipccdba = 0;
+  MB_RefTable_t * p_RefTable = NULL;
+  uint32_t wireless_firmware_version = 0;
+  uint32_t wireless_firmware_memorySize = 0;
+  uint32_t wireless_firmware_infoStack = 0;
+  MB_FUS_DeviceInfoTable_t * p_fus_device_info_table = NULL;
+  uint32_t fus_version = 0;
+  uint32_t fus_memorySize = 0;
+
+  ipccdba = READ_BIT( FLASH->IPCCBR, FLASH_IPCCBR_IPCCDBA );
+
+  /**
+   * The Device Info Table mapping depends on which firmware is running on CPU2.
+   * If the FUS is running on CPU2, FUS_DEVICE_INFO_TABLE_VALIDITY_KEYWORD shall be written in the table.
+   * Otherwise, it means the Wireless Firmware is running on the CPU2
+   */
+  p_fus_device_info_table = (MB_FUS_DeviceInfoTable_t*)(*(uint32_t*)((ipccdba<<2) + SRAM2A_BASE));
+
+  if(p_fus_device_info_table->DeviceInfoTableState == FUS_DEVICE_INFO_TABLE_VALIDITY_KEYWORD)
+  {
+    /* The FUS is running on CPU2 */
+    /**
+     *  Retrieve the WirelessFwInfoTable
+     *  This table is stored in RAM at startup during the TL (transport layer) initialization
+     */
+    wireless_firmware_version =  p_fus_device_info_table->WirelessStackVersion;
+    wireless_firmware_memorySize =  p_fus_device_info_table->WirelessStackMemorySize;
+    wireless_firmware_infoStack =  p_fus_device_info_table->WirelessFirmwareBleInfo;
+
+    /**
+     *  Retrieve the FusInfoTable
+     *  This table is stored in RAM at startup during the TL (transport layer) initialization
+     */
+    fus_version =  p_fus_device_info_table->FusVersion;
+    fus_memorySize =  p_fus_device_info_table->FusMemorySize;
+  }
+  else
+  {
+    /* The Wireless Firmware is running on CPU2 */
+    p_RefTable = (MB_RefTable_t*)((ipccdba<<2) + SRAM2A_BASE);
+
+    /**
+     *  Retrieve the WirelessFwInfoTable
+     *  This table is stored in RAM at startup during the TL (transport layer) initialization
+     */
+    wireless_firmware_version =  p_RefTable->p_device_info_table->WirelessFwInfoTable.Version;
+    wireless_firmware_memorySize =  p_RefTable->p_device_info_table->WirelessFwInfoTable.MemorySize;
+    wireless_firmware_infoStack =  p_RefTable->p_device_info_table->WirelessFwInfoTable.InfoStack;
+
+    /**
+     *  Retrieve the FusInfoTable
+     *  This table is stored in RAM at startup during the TL (transport layer) initialization
+     */
+    fus_version =  p_RefTable->p_device_info_table->FusInfoTable.Version;
+    fus_memorySize =  p_RefTable->p_device_info_table->FusInfoTable.MemorySize;
+  }
+
+  /**
+   *  Retrieve the WirelessFwInfoTable
+   *  This table is stored in RAM at startup during the TL (transport layer) initialization
+   */
+  pWirelessInfo->VersionMajor       = ((wireless_firmware_version & INFO_VERSION_MAJOR_MASK) >> INFO_VERSION_MAJOR_OFFSET);
+  pWirelessInfo->VersionMinor       = ((wireless_firmware_version & INFO_VERSION_MINOR_MASK) >> INFO_VERSION_MINOR_OFFSET);
+  pWirelessInfo->VersionSub         = ((wireless_firmware_version & INFO_VERSION_SUB_MASK) >> INFO_VERSION_SUB_OFFSET);
+  pWirelessInfo->VersionBranch      = ((wireless_firmware_version & INFO_VERSION_BRANCH_MASK) >> INFO_VERSION_BRANCH_OFFSET);
+  pWirelessInfo->VersionReleaseType = ((wireless_firmware_version & INFO_VERSION_TYPE_MASK) >> INFO_VERSION_TYPE_OFFSET);
+
+  pWirelessInfo->MemorySizeSram2B   = ((wireless_firmware_memorySize & INFO_SIZE_SRAM2B_MASK) >> INFO_SIZE_SRAM2B_OFFSET);
+  pWirelessInfo->MemorySizeSram2A   = ((wireless_firmware_memorySize & INFO_SIZE_SRAM2A_MASK) >> INFO_SIZE_SRAM2A_OFFSET);
+  pWirelessInfo->MemorySizeSram1    = ((wireless_firmware_memorySize & INFO_SIZE_SRAM1_MASK) >> INFO_SIZE_SRAM1_OFFSET);
+  pWirelessInfo->MemorySizeFlash    = ((wireless_firmware_memorySize & INFO_SIZE_FLASH_MASK) >> INFO_SIZE_FLASH_OFFSET);
+
+  pWirelessInfo->StackType          = ((wireless_firmware_infoStack & INFO_STACK_TYPE_MASK) >> INFO_STACK_TYPE_OFFSET);
+
+  /**
+   *  Retrieve the FusInfoTable
+   *  This table is stored in RAM at startup during the TL (transport layer) initialization
+   */
+  pWirelessInfo->FusVersionMajor       = ((fus_version & INFO_VERSION_MAJOR_MASK) >> INFO_VERSION_MAJOR_OFFSET);
+  pWirelessInfo->FusVersionMinor       = ((fus_version & INFO_VERSION_MINOR_MASK) >> INFO_VERSION_MINOR_OFFSET);
+  pWirelessInfo->FusVersionSub         = ((fus_version & INFO_VERSION_SUB_MASK) >> INFO_VERSION_SUB_OFFSET);
+
+  pWirelessInfo->FusMemorySizeSram2B   = ((fus_memorySize & INFO_SIZE_SRAM2B_MASK) >> INFO_SIZE_SRAM2B_OFFSET);
+  pWirelessInfo->FusMemorySizeSram2A   = ((fus_memorySize & INFO_SIZE_SRAM2A_MASK) >> INFO_SIZE_SRAM2A_OFFSET);
+  pWirelessInfo->FusMemorySizeFlash    = ((fus_memorySize & INFO_SIZE_FLASH_MASK) >> INFO_SIZE_FLASH_OFFSET);
+
+  return (SHCI_Success);
+}
+#endif /* STM32WBxx */
diff --git a/src/utility/STM32_WPAN/shci.h b/src/utility/STM32_WPAN/shci.h
new file mode 100644
index 00000000..59c6fd46
--- /dev/null
+++ b/src/utility/STM32_WPAN/shci.h
@@ -0,0 +1,1402 @@
+/**
+ ******************************************************************************
+ * @file    shci.h
+ * @author  MCD Application Team
+ * @brief   HCI command for the system channel
+ ******************************************************************************
+ * @attention
+ *
+ * Copyright (c) 2018-2021 STMicroelectronics.
+ * All rights reserved.
+ *
+ * This software is licensed under terms that can be found in the LICENSE file
+ * in the root directory of this software component.
+ * If no LICENSE file comes with this software, it is provided AS-IS.
+ *
+ ******************************************************************************
+ */
+
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __SHCI_H
+#define __SHCI_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+  /* Includes ------------------------------------------------------------------*/
+#include "mbox_def.h" /* Requested to expose the MB_WirelessFwInfoTable_t structure */
+
+  /* Exported types ------------------------------------------------------------*/
+
+  /* SYSTEM EVENT */
+  typedef enum
+  {
+    WIRELESS_FW_RUNNING = 0x00,
+    FUS_FW_RUNNING = 0x01,
+  } SHCI_SysEvt_Ready_Rsp_t;
+
+  /* ERROR CODES
+   *
+   * These error codes are detected on CPU2 side and are send back to the CPU1 via a system
+   * notification message. It is up to the application running on CPU1 to manage these errors
+   *
+   * These errors can be generated by all layers (low level driver, stack, framework infrastructure, etc..)
+   */
+   typedef enum
+   {
+     ERR_BLE_INIT = 0,                 /* This event is currently not reported by the CPU2                    */
+     ERR_THREAD_LLD_FATAL_ERROR = 125, /* The LLD driver used on 802_15_4 detected a fatal error              */
+     ERR_THREAD_UNKNOWN_CMD = 126,     /* The command send by the CPU1 to control the Thread stack is unknown */
+     ERR_ZIGBEE_UNKNOWN_CMD = 200,     /* The command send by the CPU1 to control the Zigbee stack is unknown */
+   } SCHI_SystemErrCode_t;
+
+#define SHCI_EVTCODE                    ( 0xFF )
+#define SHCI_SUB_EVT_CODE_BASE          ( 0x9200 )
+
+  /**
+   * THE ORDER SHALL NOT BE CHANGED TO GUARANTEE COMPATIBILITY WITH THE CPU1 DEFINITION
+   */
+  typedef enum
+  {
+    SHCI_SUB_EVT_CODE_READY =  SHCI_SUB_EVT_CODE_BASE,
+    SHCI_SUB_EVT_ERROR_NOTIF,
+    SHCI_SUB_EVT_BLE_NVM_RAM_UPDATE,
+    SHCI_SUB_EVT_THREAD_NVM_RAM_UPDATE,
+    SHCI_SUB_EVT_NVM_START_WRITE,
+    SHCI_SUB_EVT_NVM_END_WRITE,
+    SHCI_SUB_EVT_NVM_START_ERASE,
+    SHCI_SUB_EVT_NVM_END_ERASE,
+    SHCI_SUB_EVT_CODE_CONCURRENT_802154_EVT,
+  } SHCI_SUB_EVT_CODE_t;
+
+  /**
+   * SHCI_SUB_EVT_CODE_READY
+   * This notifies the CPU1 that the CPU2 is now ready to receive commands
+   * It reports as well which firmware is running on CPU2 : The wireless stack of the FUS (previously named RSS)
+   */
+  typedef PACKED_STRUCT{
+    SHCI_SysEvt_Ready_Rsp_t sysevt_ready_rsp;
+  } SHCI_C2_Ready_Evt_t;
+
+  /**
+   * SHCI_SUB_EVT_ERROR_NOTIF
+   * This reports to the CPU1 some error form the CPU2
+   */
+  typedef PACKED_STRUCT{
+    SCHI_SystemErrCode_t errorCode;
+  } SHCI_C2_ErrorNotif_Evt_t;
+
+  /**
+   * SHCI_SUB_EVT_BLE_NVM_RAM_UPDATE
+   * This notifies the CPU1 which part of the BLE NVM RAM has been updated so that only the modified
+   * section could be written in Flash/NVM
+   * StartAddress : Start address of the section that has been modified
+   * Size : Size (in bytes) of the section that has been modified
+   */
+  typedef PACKED_STRUCT{
+    uint32_t StartAddress;
+    uint32_t Size;
+  } SHCI_C2_BleNvmRamUpdate_Evt_t;
+
+  /**
+   * SHCI_SUB_EVT_THREAD_NVM_RAM_UPDATE
+   * This notifies the CPU1 which part of the OT NVM RAM has been updated so that only the modified
+   * section could be written in Flash/NVM
+   * StartAddress : Start address of the section that has been modified
+   * Size : Size (in bytes) of the section that has been modified
+   */
+  typedef PACKED_STRUCT{
+    uint32_t StartAddress;
+    uint32_t Size;
+  } SHCI_C2_ThreadNvmRamUpdate_Evt_t;
+
+  /**
+   * SHCI_SUB_EVT_NVM_START_WRITE
+   * This notifies the CPU1 that the CPU2 has started a write procedure in Flash
+   * NumberOfWords : The number of 64bits data the CPU2 needs to write in Flash.
+   *                 For each 64bits data, the algorithm as described in AN5289 is executed.
+   *                 When this number is reported to 0, it means the Number of 64bits to be written
+   *                 was unknown when the procedure has started.
+   * When all data are written, the SHCI_SUB_EVT_NVM_END_WRITE event is reported
+   */
+  typedef PACKED_STRUCT{
+    uint32_t NumberOfWords;
+  } SHCI_C2_NvmStartWrite_Evt_t;
+
+  /**
+   * SHCI_SUB_EVT_NVM_END_WRITE
+   * This notifies the CPU1 that the CPU2 has written all expected data in Flash
+   */
+
+  /**
+   * SHCI_SUB_EVT_NVM_START_ERASE
+   * This notifies the CPU1 that the CPU2 has started a erase procedure in Flash
+   * NumberOfSectors : The number of sectors the CPU2 needs to erase in Flash.
+   *                   For each sector, the algorithm as described in AN5289 is executed.
+   *                   When this number is reported to 0, it means the Number of sectors to be erased
+   *                   was unknown when the procedure has started.
+   * When all sectors are erased, the SHCI_SUB_EVT_NVM_END_ERASE event is reported
+   */
+  typedef PACKED_STRUCT{
+    uint32_t NumberOfSectors;
+  } SHCI_C2_NvmStartErase_Evt_t;
+
+  /**
+   * SHCI_SUB_EVT_NVM_END_ERASE
+   * This notifies the CPU1 that the CPU2 has erased all expected flash sectors
+   */
+
+  /* SYSTEM COMMAND */
+  typedef PACKED_STRUCT
+  {
+    /**
+     * MetaData holds :
+     * 2*32bits for chaining list
+     * 1*32bits with BLE header (type + Opcode + Length)
+     */
+    uint32_t MetaData[3];
+  } SHCI_Header_t;
+
+  typedef enum
+  {
+    SHCI_Success = 0x00,
+    SHCI_UNKNOWN_CMD = 0x01,
+    SHCI_MEMORY_CAPACITY_EXCEEDED_ERR_CODE=  0x07,
+    SHCI_ERR_UNSUPPORTED_FEATURE = 0x11,
+    SHCI_ERR_INVALID_HCI_CMD_PARAMS = 0x12,
+    SHCI_ERR_INVALID_PARAMS = 0x42,    /* only used for release < v1.13.0 */
+    SHCI_ERR_INVALID_PARAMS_V2 = 0x92, /* available for release >= v1.13.0 */
+    SHCI_FUS_CMD_NOT_SUPPORTED = 0xFF,
+  } SHCI_CmdStatus_t;
+
+  typedef enum
+  {
+    SHCI_8BITS =  0x01,
+    SHCI_16BITS = 0x02,
+    SHCI_32BITS = 0x04,
+  } SHCI_Busw_t;
+
+#define SHCI_OGF                        ( 0x3F )
+#define SHCI_OCF_BASE                   ( 0x50 )
+
+  /**
+   * THE ORDER SHALL NOT BE CHANGED TO GUARANTEE COMPATIBILITY WITH THE CPU2 DEFINITION
+   */
+  typedef enum
+  {
+    SHCI_OCF_C2_RESERVED1 =  SHCI_OCF_BASE,
+    SHCI_OCF_C2_RESERVED2,
+    SHCI_OCF_C2_FUS_GET_STATE,
+    SHCI_OCF_C2_FUS_RESERVED1,
+    SHCI_OCF_C2_FUS_FW_UPGRADE,
+    SHCI_OCF_C2_FUS_FW_DELETE,
+    SHCI_OCF_C2_FUS_UPDATE_AUTH_KEY,
+    SHCI_OCF_C2_FUS_LOCK_AUTH_KEY,
+    SHCI_OCF_C2_FUS_STORE_USR_KEY,
+    SHCI_OCF_C2_FUS_LOAD_USR_KEY,
+    SHCI_OCF_C2_FUS_START_WS,
+    SHCI_OCF_C2_FUS_RESERVED2,
+    SHCI_OCF_C2_FUS_RESERVED3,
+    SHCI_OCF_C2_FUS_LOCK_USR_KEY,
+    SHCI_OCF_C2_FUS_UNLOAD_USR_KEY,
+    SHCI_OCF_C2_FUS_ACTIVATE_ANTIROLLBACK,
+    SHCI_OCF_C2_FUS_RESERVED7,
+    SHCI_OCF_C2_FUS_RESERVED8,
+    SHCI_OCF_C2_FUS_RESERVED9,
+    SHCI_OCF_C2_FUS_RESERVED10,
+    SHCI_OCF_C2_FUS_RESERVED11,
+    SHCI_OCF_C2_FUS_RESERVED12,
+    SHCI_OCF_C2_BLE_INIT,
+    SHCI_OCF_C2_THREAD_INIT,
+    SHCI_OCF_C2_DEBUG_INIT,
+    SHCI_OCF_C2_FLASH_ERASE_ACTIVITY,
+    SHCI_OCF_C2_CONCURRENT_SET_MODE,
+    SHCI_OCF_C2_FLASH_STORE_DATA,
+    SHCI_OCF_C2_FLASH_ERASE_DATA,
+    SHCI_OCF_C2_RADIO_ALLOW_LOW_POWER,
+    SHCI_OCF_C2_MAC_802_15_4_INIT,
+    SHCI_OCF_C2_REINIT,
+    SHCI_OCF_C2_ZIGBEE_INIT,
+    SHCI_OCF_C2_LLD_TESTS_INIT,
+    SHCI_OCF_C2_EXTPA_CONFIG,
+    SHCI_OCF_C2_SET_FLASH_ACTIVITY_CONTROL,
+    SHCI_OCF_C2_BLE_LLD_INIT,
+    SHCI_OCF_C2_CONFIG,
+    SHCI_OCF_C2_CONCURRENT_GET_NEXT_BLE_EVT_TIME,
+    SHCI_OCF_C2_CONCURRENT_ENABLE_NEXT_802154_EVT_NOTIFICATION,
+    SHCI_OCF_C2_802_15_4_DEINIT,
+    SHCI_OCF_C2_SET_SYSTEM_CLOCK,
+  } SHCI_OCF_t;
+
+#define SHCI_OPCODE_C2_FUS_GET_STATE         (( SHCI_OGF << 10) + SHCI_OCF_C2_FUS_GET_STATE)
+/** No command parameters */
+/** Response parameters*/
+/** It responds a 1 byte value holding FUS State error code when the FUS State value is 0xFF (FUS_STATE_VALUE_ERROR) */
+  typedef enum
+  {
+    FUS_STATE_ERROR_NO_ERROR =  0x00,
+    FUS_STATE_ERROR_IMG_NOT_FOUND = 0x01,
+    FUS_STATE_ERROR_IMG_CORRUPT = 0x02,
+    FUS_STATE_ERROR_IMG_NOT_AUTHENTIC = 0x03,
+    FUS_STATE_ERROR_IMG_NOT_ENOUGH_SPACE = 0x04,
+    FUS_STATE_ERROR_IMAGE_USRABORT = 0x05,
+    FUS_STATE_ERROR_IMAGE_ERSERROR = 0x06,
+    FUS_STATE_ERROR_IMAGE_WRTERROR = 0x07,
+    FUS_STATE_ERROR_AUTH_TAG_ST_NOTFOUND = 0x08,
+    FUS_STATE_ERROR_AUTH_TAG_CUST_NOTFOUND = 0x09,
+    FUS_STATE_ERROR_AUTH_KEY_LOCKED = 0x0A,
+    FUS_STATE_ERROR_FW_ROLLBACK_ERROR = 0x11,
+    FUS_STATE_ERROR_STATE_NOT_RUNNING = 0xFE,
+    FUS_STATE_ERROR_ERR_UNKNOWN = 0xFF,
+  } SHCI_FUS_GetState_ErrorCode_t;
+
+  enum
+  {
+    FUS_STATE_VALUE_IDLE =  0x00,
+    FUS_STATE_VALUE_FW_UPGRD_ONGOING =  0x10,
+    FUS_STATE_VALUE_FW_UPGRD_ONGOING_END = 0x1F,    /* All values between 0x10 and 0x1F has the same meaning */
+    FUS_STATE_VALUE_FUS_UPGRD_ONGOING =  0x20,
+    FUS_STATE_VALUE_FUS_UPGRD_ONGOING_END =  0x2F,  /* All values between 0x20 and 0x2F has the same meaning */
+    FUS_STATE_VALUE_SERVICE_ONGOING =  0x30,
+    FUS_STATE_VALUE_SERVICE_ONGOING_END =  0x3F,    /* All values between 0x30 and 0x3F has the same meaning */
+    FUS_STATE_VALUE_ERROR =  0xFF,
+  };
+
+#define SHCI_OPCODE_C2_FUS_RESERVED1         (( SHCI_OGF << 10) + SHCI_OCF_C2_FUS_RESERVED1)
+/** No command parameters */
+/** No response parameters*/
+
+#define SHCI_OPCODE_C2_FUS_FW_UPGRADE   (( SHCI_OGF << 10) + SHCI_OCF_C2_FUS_FW_UPGRADE)
+  /** No structure for command parameters */
+  /** No response parameters*/
+
+#define SHCI_OPCODE_C2_FUS_FW_DELETE   (( SHCI_OGF << 10) + SHCI_OCF_C2_FUS_FW_DELETE)
+/** No command parameters */
+/** No response parameters*/
+
+#define SHCI_OPCODE_C2_FUS_UPDATE_AUTH_KEY    (( SHCI_OGF << 10) + SHCI_OCF_C2_FUS_UPDATE_AUTH_KEY)
+  typedef PACKED_STRUCT{
+  uint8_t KeySize;
+  uint8_t KeyData[64];
+  } SHCI_C2_FUS_UpdateAuthKey_Cmd_Param_t;
+
+  /** No response parameters*/
+
+#define SHCI_OPCODE_C2_FUS_LOCK_AUTH_KEY    (( SHCI_OGF << 10) + SHCI_OCF_C2_FUS_LOCK_AUTH_KEY)
+/** No command parameters */
+/** No response parameters*/
+
+#define SHCI_OPCODE_C2_FUS_STORE_USR_KEY    (( SHCI_OGF << 10) + SHCI_OCF_C2_FUS_STORE_USR_KEY)
+  /** Command parameters */
+  /* List of supported key type */
+  enum
+  {
+    KEYTYPE_NONE =  0x00,
+    KEYTYPE_SIMPLE = 0x01,
+    KEYTYPE_MASTER = 0x02,
+    KEYTYPE_ENCRYPTED = 0x03,
+  };
+
+  /* List of supported key size */
+  enum
+  {
+    KEYSIZE_16 =  16,
+    KEYSIZE_32 = 32,
+  };
+
+  typedef PACKED_STRUCT{
+  uint8_t KeyType;
+  uint8_t KeySize;
+  uint8_t KeyData[32 + 12];
+  } SHCI_C2_FUS_StoreUsrKey_Cmd_Param_t;
+
+  /** Response parameters*/
+  /** It responds a 1 byte value holding the index given for the stored key */
+
+#define SHCI_OPCODE_C2_FUS_LOAD_USR_KEY         (( SHCI_OGF << 10) + SHCI_OCF_C2_FUS_LOAD_USR_KEY)
+  /** Command parameters */
+  /** 1 byte holding the key index value */
+
+  /** No response parameters*/
+
+#define SHCI_OPCODE_C2_FUS_START_WS             (( SHCI_OGF << 10) + SHCI_OCF_C2_FUS_START_WS)
+/** No command parameters */
+/** No response parameters*/
+
+#define SHCI_OPCODE_C2_FUS_RESERVED2            (( SHCI_OGF << 10) + SHCI_OCF_C2_FUS_RESERVED2)
+/** No command parameters */
+/** No response parameters*/
+
+#define SHCI_OPCODE_C2_FUS_RESERVED3            (( SHCI_OGF << 10) + SHCI_OCF_C2_FUS_RESERVED3)
+/** No command parameters */
+/** No response parameters*/
+
+#define SHCI_OPCODE_C2_FUS_LOCK_USR_KEY         (( SHCI_OGF << 10) + SHCI_OCF_C2_FUS_LOCK_USR_KEY)
+  /** Command parameters */
+  /** 1 byte holding the key index value */
+
+  /** No response parameters*/
+
+#define SHCI_OPCODE_C2_FUS_UNLOAD_USR_KEY       (( SHCI_OGF << 10) + SHCI_OCF_C2_FUS_UNLOAD_USR_KEY)
+/** No command parameters */
+/** 1 byte holding the key index value */
+
+#define SHCI_OPCODE_C2_FUS_ACTIVATE_ANTIROLLBACK  (( SHCI_OGF << 10) + SHCI_OCF_C2_FUS_ACTIVATE_ANTIROLLBACK)
+/** No command parameters */
+/** No response parameters*/
+
+#define SHCI_OPCODE_C2_FUS_RESERVED7            (( SHCI_OGF << 10) + SHCI_OCF_C2_FUS_RESERVED7)
+/** No command parameters */
+/** No response parameters*/
+
+#define SHCI_OPCODE_C2_FUS_RESERVED8            (( SHCI_OGF << 10) + SHCI_OCF_C2_FUS_RESERVED8)
+/** No command parameters */
+/** No response parameters*/
+
+#define SHCI_OPCODE_C2_FUS_RESERVED9            (( SHCI_OGF << 10) + SHCI_OCF_C2_FUS_RESERVED9)
+/** No command parameters */
+/** No response parameters*/
+
+#define SHCI_OPCODE_C2_FUS_RESERVED10           (( SHCI_OGF << 10) + SHCI_OCF_C2_FUS_RESERVED10)
+/** No command parameters */
+/** No response parameters*/
+
+#define SHCI_OPCODE_C2_FUS_RESERVED11           (( SHCI_OGF << 10) + SHCI_OCF_C2_FUS_RESERVED11)
+/** No command parameters */
+/** No response parameters*/
+
+#define SHCI_OPCODE_C2_FUS_RESERVED12           (( SHCI_OGF << 10) + SHCI_OCF_C2_FUS_RESERVED12)
+/** No command parameters */
+/** No response parameters*/
+
+#define SHCI_OPCODE_C2_BLE_INIT                 (( SHCI_OGF << 10) + SHCI_OCF_C2_BLE_INIT)
+  /** THE ORDER SHALL NOT BE CHANGED    */
+  typedef PACKED_STRUCT{
+  uint8_t* pBleBufferAddress;   /**< NOT USED - shall be set to 0 */
+  uint32_t BleBufferSize;       /**< NOT USED - shall be set to 0 */
+
+  /**
+   * NumAttrRecord
+   * Maximum number of attribute records related to all the required characteristics (excluding the services)
+   * that can be stored in the GATT database, for the specific BLE user application.
+   * For each characteristic, the number of attribute records goes from two to five depending on the characteristic properties:
+   *    - minimum of two (one for declaration and one for the value)
+   *    - add one more record for each additional property: notify or indicate, broadcast, extended property.
+   * The total calculated value must be increased by 9, due to the records related to the standard attribute profile and
+   * GAP service characteristics, and automatically added when initializing GATT and GAP layers
+   *  - Min value: <number of user attributes> + 9
+   *  - Max value: depending on the GATT database defined by user application
+   */
+  uint16_t NumAttrRecord;
+
+  /**
+   * NumAttrServ
+   * Defines the maximum number of services that can be stored in the GATT database. Note that the GAP and GATT services
+   * are automatically added at initialization so this parameter must be the number of user services increased by two.
+   *    - Min value: <number of user service> + 2
+   *    - Max value: depending GATT database defined by user application
+   */
+  uint16_t NumAttrServ;
+
+  /**
+   * AttrValueArrSize
+   * NOTE: This parameter is ignored by the CPU2 when the parameter "Options" is set to "LL_only" ( see Options description in that structure )
+   *
+   * Size of the storage area for the attribute values.
+   * Each characteristic contributes to the attrValueArrSize value as follows:
+   *    - Characteristic value length plus:
+   *        + 5 bytes if characteristic UUID is 16 bits
+   *        + 19 bytes if characteristic UUID is 128 bits
+   *        + 2 bytes if characteristic has a server configuration descriptor
+   *        + 2 bytes * NumOfLinks if the characteristic has a client configuration descriptor
+   *        + 2 bytes if the characteristic has extended properties
+   * Each descriptor contributes to the attrValueArrSize value as follows:
+   *    - Descriptor length
+   */
+  uint16_t AttrValueArrSize;
+
+  /**
+   * NumOfLinks
+   * Maximum number of BLE links supported
+   *    - Min value: 1
+   *    - Max value: 8
+   */
+  uint8_t NumOfLinks;
+
+  /**
+   * ExtendedPacketLengthEnable
+   * Disable/enable the extended packet length BLE 5.0 feature
+   *    - Disable: 0
+   *    - Enable: 1
+   */
+  uint8_t ExtendedPacketLengthEnable;
+
+  /**
+   * PrWriteListSize
+   * NOTE: This parameter is ignored by the CPU2 when the parameter "Options" is set to "LL_only" ( see Options description in that structure )
+   *
+   * Maximum number of supported "prepare write request"
+   *    - Min value: given by the macro DEFAULT_PREP_WRITE_LIST_SIZE
+   *    - Max value: a value higher than the minimum required can be specified, but it is not recommended
+   */
+  uint8_t PrWriteListSize;
+
+  /**
+   * MblockCount
+   * NOTE: This parameter is overwritten by the CPU2 with an hardcoded optimal value when the parameter "Options" is set to "LL_only"
+   * ( see Options description in that structure )
+   *
+   * Number of allocated memory blocks for the BLE stack
+   *     - Min value: given by the macro MBLOCKS_CALC
+   *     - Max value: a higher value can improve data throughput performance, but uses more memory
+   */
+  uint8_t MblockCount;
+
+  /**
+   * AttMtu
+   * NOTE: This parameter is ignored by the CPU2 when the parameter "Options" is set to "LL_only" ( see Options description in that structure )
+   *
+   * Maximum ATT MTU size supported
+   *     - Min value: 23
+   *     - Max value: 512
+   */
+  uint16_t AttMtu;
+
+  /**
+   * PeripheralSca
+   * The sleep clock accuracy (ppm value) that used in BLE connected Peripheral mode to calculate the window widening
+   * (in combination with the sleep clock accuracy sent by master in CONNECT_REQ PDU),
+   * refer to BLE 5.0 specifications - Vol 6 - Part B - chap 4.5.7 and 4.2.2
+   *     - Min value: 0
+   *     - Max value: 500 (worst possible admitted by specification)
+   */
+  uint16_t PeripheralSca;
+
+  /**
+   * CentralSca
+   * The sleep clock accuracy handled in Central mode. It is used to determine the connection and advertising events timing.
+   * It is transmitted to the slave in CONNEC_REQ PDU used by the slave to calculate the window widening,
+   * see PeripheralSca and Bluetooth Core Specification v5.0 Vol 6 - Part B - chap 4.5.7 and 4.2.2
+   * Possible values:
+   *    - 251 ppm to 500 ppm: 0
+   *    - 151 ppm to 250 ppm: 1
+   *    - 101 ppm to 150 ppm: 2
+   *    - 76 ppm to 100 ppm: 3
+   *    - 51 ppm to 75 ppm: 4
+   *    - 31 ppm to 50 ppm: 5
+   *    - 21 ppm to 30 ppm: 6
+   *    - 0 ppm to 20 ppm: 7
+   */
+  uint8_t CentralSca;
+
+  /**
+   * 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 2:   1: HSE/1024 Clock config                               0: LSE Clock config
+   */
+  uint8_t LsSource;
+
+  /**
+   * MaxConnEventLength
+   * This parameter determines the maximum duration of a slave connection event. When this duration is reached the slave closes
+   * the current connections event (whatever is the CE_length parameter specified by the master in HCI_CREATE_CONNECTION HCI command),
+   * expressed in units of 625/256 us (~2.44 us)
+   *    - Min value: 0 (if 0 is specified, the master and slave perform only a single TX-RX exchange per connection event)
+   *    - Max value: 1638400 (4000 ms). A higher value can be specified (max 0xFFFFFFFF) but results in a maximum connection time
+   *      of 4000 ms as specified. In this case the parameter is not applied, and the predicted CE length calculated on slave is not shortened
+   */
+  uint32_t MaxConnEventLength;
+
+  /**
+   * HsStartupTime
+   * Startup time of the high speed (16 or 32 MHz) crystal oscillator in units of 625/256 us (~2.44 us).
+   *    - Min value: 0
+   *    - Max value:  820 (~2 ms). A higher value can be specified, but the value that implemented in stack is forced to ~2 ms
+   */
+  uint16_t HsStartupTime;
+
+  /**
+   * ViterbiEnable
+   * Viterbi implementation in BLE LL reception.
+   *    - 0: Enable
+   *    - 1: Disable
+   */
+  uint8_t ViterbiEnable;
+
+  /**
+   * Options flags
+   * - bit 0:   1: LL only                          0: LL + host
+   * - bit 1:   1: no service change desc.          0: with service change desc.
+   * - bit 2:   1: device name Read-Only            0: device name R/W
+   * - 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 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
+   * - other bits: complete with Options_extension flag
+   */
+  uint8_t Options;
+
+  /**
+   * HwVersion
+   * Reserved for future use - shall be set to 0
+   */
+  uint8_t HwVersion;
+
+  /**
+   * Maximum number of connection-oriented channels in initiator mode.
+   * Range: 0 .. 64
+   */
+  uint8_t max_coc_initiator_nbr;
+
+  /**
+   * Minimum transmit power in dBm supported by the Controller.
+   * Range: -127 .. 20
+   */
+  int8_t min_tx_power;
+
+  /**
+   * Maximum transmit power in dBm supported by the Controller.
+   * Range: -127 .. 20
+   */
+  int8_t max_tx_power;
+
+   /**
+   * RX model configuration
+   * - bit 0:   1: agc_rssi model improved vs RF blockers    0: Legacy agc_rssi model
+   * - other bits: reserved ( shall be set to 0)
+   */
+  uint8_t rx_model_config;
+
+  /* Maximum number of advertising sets.
+   * Range: 1 .. 8 with limitation:
+   * This parameter is linked to 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 Options has SHCI_C2_BLE_INIT_OPTIONS_EXT_ADV flag set
+   */
+  uint8_t max_adv_set_nbr;
+
+  /* Maximum advertising data length (in bytes)
+   * Range: 31 .. 1650 with limitation:
+   * This parameter is linked to 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 Options has SHCI_C2_BLE_INIT_OPTIONS_EXT_ADV flag set
+   */
+  uint16_t max_adv_data_len;
+
+  /* RF TX Path Compensation Value (16-bit signed integer). Units: 0.1 dB.
+   * Range: -1280 .. 1280
+   */
+  int16_t tx_path_compens;
+
+  /* RF RX Path Compensation Value (16-bit signed integer). Units: 0.1 dB.
+   * Range: -1280 .. 1280
+   */
+  int16_t rx_path_compens;
+
+  /* BLE core specification version (8-bit unsigned integer).
+   * values as: 11(5.2), 12(5.3), 13(5.4)
+   */
+  uint8_t ble_core_version;
+
+   /**
+   * Options flags extension
+   * - bit 0:   1: appearance Writable              0: appearance Read-Only
+   * - bit 1:   1: Enhanced ATT supported           0: Enhanced ATT not supported
+   * - other bits: reserved ( shall be set to 0)
+   */
+  uint8_t Options_extension;
+
+      } SHCI_C2_Ble_Init_Cmd_Param_t;
+
+  typedef PACKED_STRUCT{
+    SHCI_Header_t Header;       /** Does not need to be initialized by the user */
+    SHCI_C2_Ble_Init_Cmd_Param_t Param;
+  } SHCI_C2_Ble_Init_Cmd_Packet_t;
+
+  /**
+   * Options
+   * Each definition below may be added together to build the Options value
+   * WARNING : Only one definition per bit shall be added to build the Options value
+   */
+#define SHCI_C2_BLE_INIT_OPTIONS_LL_ONLY                              (1<<0)
+#define SHCI_C2_BLE_INIT_OPTIONS_LL_HOST                              (0<<0)
+
+#define SHCI_C2_BLE_INIT_OPTIONS_NO_SVC_CHANGE_DESC                   (1<<1)
+#define SHCI_C2_BLE_INIT_OPTIONS_WITH_SVC_CHANGE_DESC                 (0<<1)
+
+#define SHCI_C2_BLE_INIT_OPTIONS_DEVICE_NAME_RO                       (1<<2)
+#define SHCI_C2_BLE_INIT_OPTIONS_DEVICE_NAME_RW                       (0<<2)
+
+#define SHCI_C2_BLE_INIT_OPTIONS_EXT_ADV                              (1<<3)
+#define SHCI_C2_BLE_INIT_OPTIONS_NO_EXT_ADV                           (0<<3)
+
+#define SHCI_C2_BLE_INIT_OPTIONS_CS_ALGO2                             (1<<4)
+#define SHCI_C2_BLE_INIT_OPTIONS_NO_CS_ALGO2                          (0<<4)
+
+#define SHCI_C2_BLE_INIT_OPTIONS_REDUC_GATTDB_NVM                     (1<<5)
+#define SHCI_C2_BLE_INIT_OPTIONS_FULL_GATTDB_NVM                      (0<<5)
+
+#define SHCI_C2_BLE_INIT_OPTIONS_GATT_CACHING_USED                    (1<<6)
+#define SHCI_C2_BLE_INIT_OPTIONS_GATT_CACHING_NOTUSED                 (0<<6)
+
+#define SHCI_C2_BLE_INIT_OPTIONS_POWER_CLASS_1                        (1<<7)
+#define SHCI_C2_BLE_INIT_OPTIONS_POWER_CLASS_2_3                      (0<<7)
+
+  /**
+   * Options extension
+   * Each definition below may be added together to build the Options value
+   * WARNING : Only one definition per bit shall be added to build the Options value
+   */
+#define SHCI_C2_BLE_INIT_OPTIONS_APPEARANCE_WRITABLE                  (1<<0)
+#define SHCI_C2_BLE_INIT_OPTIONS_APPEARANCE_READONLY                  (0<<0)
+
+#define SHCI_C2_BLE_INIT_OPTIONS_ENHANCED_ATT_SUPPORTED               (1<<1)
+#define SHCI_C2_BLE_INIT_OPTIONS_ENHANCED_ATT_NOTSUPPORTED            (0<<1)
+
+    /**
+   * RX models configuration
+   */
+#define SHCI_C2_BLE_INIT_RX_MODEL_AGC_RSSI_LEGACY                     (0<<0)
+#define SHCI_C2_BLE_INIT_RX_MODEL_AGC_RSSI_BLOCKER                    (1<<0)
+
+  /**
+   * BLE core version
+   */
+#define SHCI_C2_BLE_INIT_BLE_CORE_5_2               11
+#define SHCI_C2_BLE_INIT_BLE_CORE_5_3               12
+#define SHCI_C2_BLE_INIT_BLE_CORE_5_4               13
+
+   /**
+   * LsSource information
+   */
+#define SHCI_C2_BLE_INIT_CFG_BLE_LS_NOCALIB                     (0<<0)
+#define SHCI_C2_BLE_INIT_CFG_BLE_LS_CALIB                       (1<<0)
+#define SHCI_C2_BLE_INIT_CFG_BLE_LS_OTHER_DEV                   (0<<1)
+#define SHCI_C2_BLE_INIT_CFG_BLE_LS_MOD5MM_DEV                  (1<<1)
+#define SHCI_C2_BLE_INIT_CFG_BLE_LS_CLK_LSE                     (0<<2)
+#define SHCI_C2_BLE_INIT_CFG_BLE_LS_CLK_HSE_1024                (1<<2)
+
+#define SHCI_OPCODE_C2_THREAD_INIT              (( SHCI_OGF << 10) + SHCI_OCF_C2_THREAD_INIT)
+/** No command parameters */
+/** No response parameters*/
+
+#define SHCI_OPCODE_C2_DEBUG_INIT              (( SHCI_OGF << 10) + SHCI_OCF_C2_DEBUG_INIT)
+  /** Command parameters */
+    typedef PACKED_STRUCT
+    {
+      uint8_t thread_config;
+      uint8_t ble_config;
+      uint8_t mac_802_15_4_config;
+      uint8_t zigbee_config;
+    } SHCI_C2_DEBUG_TracesConfig_t;
+
+    typedef PACKED_STRUCT
+    {
+      uint8_t ble_dtb_cfg;
+  /**
+   * sys_dbg_cfg1 options flag
+   * - bit 0:   0: IP BLE core in LP mode    1: IP BLE core in run mode (no LP supported)
+   * - bit 1:   0: CPU2 STOP mode Enable     1: CPU2 STOP mode Disable
+   * - bit [2-7]: bits reserved ( shall be set to 0)
+   */
+      uint8_t sys_dbg_cfg1;
+      uint8_t reserved[2];
+      uint16_t STBY_DebugGpioaPinList;
+      uint16_t STBY_DebugGpiobPinList;
+      uint16_t STBY_DebugGpiocPinList;
+      uint16_t STBY_DtbGpioaPinList;
+      uint16_t STBY_DtbGpiobPinList;
+    } SHCI_C2_DEBUG_GeneralConfig_t;
+
+    typedef PACKED_STRUCT{
+      uint8_t *pGpioConfig;
+      uint8_t *pTracesConfig;
+      uint8_t *pGeneralConfig;
+      uint8_t GpioConfigSize;
+      uint8_t TracesConfigSize;
+      uint8_t GeneralConfigSize;
+    } SHCI_C2_DEBUG_init_Cmd_Param_t;
+
+    typedef PACKED_STRUCT{
+      SHCI_Header_t Header;       /** Does not need to be initialized by the user */
+      SHCI_C2_DEBUG_init_Cmd_Param_t Param;
+    } SHCI_C2_DEBUG_Init_Cmd_Packet_t;
+    /** No response parameters*/
+
+    /**
+   * Options
+   * Each definition below may be added together to build the Options value
+   * WARNING : Only one definition per bit shall be added to build the Options value
+   */
+#define SHCI_C2_DEBUG_OPTIONS_IPCORE_LP                              (0<<0)
+#define SHCI_C2_DEBUG_OPTIONS_IPCORE_NO_LP                           (1<<0)
+
+#define SHCI_C2_DEBUG_OPTIONS_CPU2_STOP_EN                           (0<<1)
+#define SHCI_C2_DEBUG_OPTIONS_CPU2_STOP_DIS                          (1<<1)
+
+
+#define SHCI_OPCODE_C2_FLASH_ERASE_ACTIVITY     (( SHCI_OGF << 10) + SHCI_OCF_C2_FLASH_ERASE_ACTIVITY)
+  /** Command parameters */
+    typedef enum
+    {
+      ERASE_ACTIVITY_OFF =  0x00,
+      ERASE_ACTIVITY_ON = 0x01,
+    } SHCI_EraseActivity_t;
+
+    /** No response parameters*/
+
+#define SHCI_OPCODE_C2_CONCURRENT_SET_MODE          (( SHCI_OGF << 10) + SHCI_OCF_C2_CONCURRENT_SET_MODE)
+/** command parameters */
+    typedef enum
+    {
+      BLE_ENABLE,
+      THREAD_ENABLE,
+      ZIGBEE_ENABLE,
+      MAC_ENABLE,
+    } SHCI_C2_CONCURRENT_Mode_Param_t;
+      /** No response parameters*/
+
+#define SHCI_OPCODE_C2_CONCURRENT_GET_NEXT_BLE_EVT_TIME          (( SHCI_OGF << 10) + SHCI_OCF_C2_CONCURRENT_GET_NEXT_BLE_EVT_TIME)
+/** command parameters */
+    typedef PACKED_STRUCT
+    {
+      uint32_t relative_time;
+    } SHCI_C2_CONCURRENT_GetNextBleEvtTime_Param_t;
+      /** No response parameters*/
+
+#define SHCI_OPCODE_C2_CONCURRENT_ENABLE_NEXT_802154_EVT_NOTIFICATION    (( SHCI_OGF << 10) + SHCI_OCF_C2_CONCURRENT_ENABLE_NEXT_802154_EVT_NOTIFICATION)
+    /** No command parameters */
+    /** No response parameters*/
+
+#define SHCI_OPCODE_C2_FLASH_STORE_DATA          (( SHCI_OGF << 10) + SHCI_OCF_C2_FLASH_STORE_DATA)
+#define SHCI_OPCODE_C2_FLASH_ERASE_DATA          (( SHCI_OGF << 10) + SHCI_OCF_C2_FLASH_ERASE_DATA)
+/** command parameters */
+    typedef enum
+    {
+      BLE_IP,
+      THREAD_IP,
+      ZIGBEE_IP,
+    } SHCI_C2_FLASH_Ip_t;
+      /** No response parameters*/
+
+#define SHCI_OPCODE_C2_RADIO_ALLOW_LOW_POWER    (( SHCI_OGF << 10) + SHCI_OCF_C2_RADIO_ALLOW_LOW_POWER)
+
+#define SHCI_OPCODE_C2_MAC_802_15_4_INIT        (( SHCI_OGF << 10) + SHCI_OCF_C2_MAC_802_15_4_INIT)
+
+#define SHCI_OPCODE_C2_REINIT                   (( SHCI_OGF << 10) + SHCI_OCF_C2_REINIT)
+
+#define SHCI_OPCODE_C2_ZIGBEE_INIT              (( SHCI_OGF << 10) + SHCI_OCF_C2_ZIGBEE_INIT)
+
+#define SHCI_OPCODE_C2_LLD_TESTS_INIT           (( SHCI_OGF << 10) + SHCI_OCF_C2_LLD_TESTS_INIT)
+
+#define SHCI_OPCODE_C2_BLE_LLD_INIT             (( SHCI_OGF << 10) + SHCI_OCF_C2_BLE_LLD_INIT)
+
+#define SHCI_OPCODE_C2_EXTPA_CONFIG             (( SHCI_OGF << 10) + SHCI_OCF_C2_EXTPA_CONFIG)
+  /** Command parameters */
+    enum
+    {
+      EXT_PA_ENABLED_LOW,
+      EXT_PA_ENABLED_HIGH,
+    }/* gpio_polarity */;
+
+    enum
+    {
+      EXT_PA_DISABLED,
+      EXT_PA_ENABLED,
+    }/* gpio_status */;
+
+    typedef PACKED_STRUCT{
+      uint32_t gpio_port;
+      uint16_t gpio_pin_number;
+      uint8_t gpio_polarity;
+      uint8_t gpio_status;
+    } SHCI_C2_EXTPA_CONFIG_Cmd_Param_t;
+
+    /** No response parameters*/
+
+#define SHCI_OPCODE_C2_SET_FLASH_ACTIVITY_CONTROL   (( SHCI_OGF << 10) + SHCI_OCF_C2_SET_FLASH_ACTIVITY_CONTROL)
+  /** Command parameters */
+    typedef enum
+    {
+      FLASH_ACTIVITY_CONTROL_PES,
+      FLASH_ACTIVITY_CONTROL_SEM7,
+    }SHCI_C2_SET_FLASH_ACTIVITY_CONTROL_Source_t;
+
+    /** No response parameters*/
+
+#define SHCI_OPCODE_C2_CONFIG   (( SHCI_OGF << 10) + SHCI_OCF_C2_CONFIG)
+
+  /** Command parameters */
+    typedef PACKED_STRUCT{
+      uint8_t PayloadCmdSize;
+      uint8_t Config1;
+      uint8_t EvtMask1;
+      uint8_t Spare1;
+      uint32_t BleNvmRamAddress;
+      uint32_t ThreadNvmRamAddress;
+      uint16_t RevisionID;
+      uint16_t DeviceID;
+    } SHCI_C2_CONFIG_Cmd_Param_t;
+
+#define SHCI_OPCODE_C2_802_15_4_DEINIT    (( SHCI_OGF << 10) + SHCI_OCF_C2_802_15_4_DEINIT)
+
+#define SHCI_OPCODE_C2_SET_SYSTEM_CLOCK   (( SHCI_OGF << 10) + SHCI_OCF_C2_SET_SYSTEM_CLOCK)
+  /** Command parameters */
+    typedef enum
+    {
+      SET_SYSTEM_CLOCK_HSE_TO_PLL,
+      SET_SYSTEM_CLOCK_PLL_ON_TO_HSE,
+      SET_SYSTEM_CLOCK_PLL_OFF_TO_HSE,
+    }SHCI_C2_SET_SYSTEM_CLOCK_Cmd_Param_t;
+
+/**
+ * PayloadCmdSize
+ * Value that shall be used
+ */
+#define SHCI_C2_CONFIG_PAYLOAD_CMD_SIZE   (sizeof(SHCI_C2_CONFIG_Cmd_Param_t) - 1)
+
+/**
+ * Device revision ID
+ */
+#define SHCI_C2_CONFIG_CUT2_0                        (0x2000)
+#define SHCI_C2_CONFIG_CUT2_1                        (0x2001)
+#define SHCI_C2_CONFIG_CUT2_2                        (0x2003)
+
+/**
+ * Device ID
+ */
+#define SHCI_C2_CONFIG_STM32WB55xx                    (0x495)
+#define SHCI_C2_CONFIG_STM32WB15xx                    (0x494)
+
+/**
+ * Config1
+ * Each definition below may be added together to build the Config1 value
+ * WARNING : Only one definition per bit shall be added to build the Config1 value
+ */
+#define SHCI_C2_CONFIG_CONFIG1_BIT0_BLE_NVM_DATA_TO_INTERNAL_FLASH    (0<<0)
+#define SHCI_C2_CONFIG_CONFIG1_BIT0_BLE_NVM_DATA_TO_SRAM              (1<<0)
+#define SHCI_C2_CONFIG_CONFIG1_BIT1_THREAD_NVM_DATA_TO_INTERNAL_FLASH (0<<1)
+#define SHCI_C2_CONFIG_CONFIG1_BIT1_THREAD_NVM_DATA_TO_SRAM           (1<<1)
+#define SHCI_C2_CONFIG_CONFIG1_BIT2_SET_EUI64_FORMAT                  (1<<2)
+
+/**
+ * EvtMask1
+ * Each definition below may be added together to build the EvtMask1 value
+ */
+#define SHCI_C2_CONFIG_EVTMASK1_BIT0_ERROR_NOTIF_ENABLE               (1<<0)
+#define SHCI_C2_CONFIG_EVTMASK1_BIT1_BLE_NVM_RAM_UPDATE_ENABLE        (1<<1)
+#define SHCI_C2_CONFIG_EVTMASK1_BIT2_THREAD_NVM_RAM_UPDATE_ENABLE     (1<<2)
+#define SHCI_C2_CONFIG_EVTMASK1_BIT3_NVM_START_WRITE_ENABLE           (1<<3)
+#define SHCI_C2_CONFIG_EVTMASK1_BIT4_NVM_END_WRITE_ENABLE             (1<<4)
+#define SHCI_C2_CONFIG_EVTMASK1_BIT5_NVM_START_ERASE_ENABLE           (1<<5)
+#define SHCI_C2_CONFIG_EVTMASK1_BIT6_NVM_END_ERASE_ENABLE             (1<<6)
+
+/**
+ * BleNvmRamAddress
+ * The buffer shall have a size of BLE_NVM_SRAM_SIZE number of 32bits
+ * The buffer shall be allocated in SRAM2
+ */
+#define BLE_NVM_SRAM_SIZE (507)
+
+/**
+ * ThreadNvmRamAddress
+ * The buffer shall have a size of THREAD_NVM_SRAM_SIZE number of 32bits
+ * The buffer shall be allocated in SRAM2
+ */
+#define THREAD_NVM_SRAM_SIZE (1016)
+
+
+  /** No response parameters*/
+
+ /* Exported type --------------------------------------------------------*/
+#define FUS_DEVICE_INFO_TABLE_VALIDITY_KEYWORD    (0xA94656B9)
+
+/*
+  *   At startup, the information relative to the wireless binary are stored in RAM through a structure defined by
+  *   MB_WirelessFwInfoTable_t.This structure contains 4 fields (Version,MemorySize, Stack_info and a reserved part)
+  *   each of those coded on 32 bits as shown on the table below:
+  *
+  *
+  *               |7 |6 |5 |4 |3 |2 |1 |0 |7 |6 |5 |4 |3 |2 |1 |0 |7 |6 |5 |4 |3 |2 |1 |0 |7 |6 |5 |4 |3 |2 |1 |0 |
+  *               -------------------------------------------------------------------------------------------------
+  * Version       |   Major version       |    Minor version      |    Sub version        | Branch    |ReleaseType|
+  *               -------------------------------------------------------------------------------------------------
+  * MemorySize    |   SRAM2B (kB)         |    SRAM2A (kB)        |    SRAM1 (kB)         | FLASH (4kb)           |
+  *               -------------------------------------------------------------------------------------------------
+  * Info stack    |   Reserved            |    Reserved           |    Reserved           | Type (MAC,Thread,BLE) |
+  *               -------------------------------------------------------------------------------------------------
+  * Reserved      |   Reserved            |    Reserved           |    Reserved           | Reserved              |
+  *               -------------------------------------------------------------------------------------------------
+  *
+  */
+
+/* Field Version */
+#define INFO_VERSION_MAJOR_OFFSET                   24
+#define INFO_VERSION_MAJOR_MASK                     0xff000000
+#define INFO_VERSION_MINOR_OFFSET                   16
+#define INFO_VERSION_MINOR_MASK                     0x00ff0000
+#define INFO_VERSION_SUB_OFFSET                     8
+#define INFO_VERSION_SUB_MASK                       0x0000ff00
+#define INFO_VERSION_BRANCH_OFFSET                  4
+#define INFO_VERSION_BRANCH_MASK                    0x0000000f0
+#define INFO_VERSION_TYPE_OFFSET                    0
+#define INFO_VERSION_TYPE_MASK                      0x00000000f
+
+#define INFO_VERSION_TYPE_RELEASE                   1
+
+/* Field Memory */
+#define INFO_SIZE_SRAM2B_OFFSET                     24
+#define INFO_SIZE_SRAM2B_MASK                       0xff000000
+#define INFO_SIZE_SRAM2A_OFFSET                     16
+#define INFO_SIZE_SRAM2A_MASK                       0x00ff0000
+#define INFO_SIZE_SRAM1_OFFSET                      8
+#define INFO_SIZE_SRAM1_MASK                        0x0000ff00
+#define INFO_SIZE_FLASH_OFFSET                      0
+#define INFO_SIZE_FLASH_MASK                        0x000000ff
+
+/* Field stack information */
+#define INFO_STACK_TYPE_OFFSET                      0
+#define INFO_STACK_TYPE_MASK                        0x000000ff
+#define INFO_STACK_TYPE_NONE                        0
+
+#define INFO_STACK_TYPE_BLE_FULL                    0x01
+#define INFO_STACK_TYPE_BLE_HCI                     0x02
+#define INFO_STACK_TYPE_BLE_LIGHT                   0x03
+#define INFO_STACK_TYPE_BLE_BEACON                  0x04
+#define INFO_STACK_TYPE_BLE_BASIC                   0x05
+#define INFO_STACK_TYPE_BLE_FULL_EXT_ADV            0x06
+#define INFO_STACK_TYPE_BLE_HCI_EXT_ADV             0x07
+#define INFO_STACK_TYPE_THREAD_FTD                  0x10
+#define INFO_STACK_TYPE_THREAD_MTD                  0x11
+#define INFO_STACK_TYPE_ZIGBEE_FFD                  0x30
+#define INFO_STACK_TYPE_ZIGBEE_RFD                  0x31
+#define INFO_STACK_TYPE_MAC                         0x40
+#define INFO_STACK_TYPE_BLE_THREAD_FTD_STATIC       0x50
+#define INFO_STACK_TYPE_BLE_THREAD_FTD_DYNAMIC      0x51
+#define INFO_STACK_TYPE_BLE_THREAD_LIGHT_DYNAMIC    0x52
+#define INFO_STACK_TYPE_802154_LLD_TESTS            0x60
+#define INFO_STACK_TYPE_802154_PHY_VALID            0x61
+#define INFO_STACK_TYPE_BLE_PHY_VALID               0x62
+#define INFO_STACK_TYPE_BLE_LLD_TESTS               0x63
+#define INFO_STACK_TYPE_BLE_RLV                     0x64
+#define INFO_STACK_TYPE_802154_RLV                  0x65
+#define INFO_STACK_TYPE_BLE_ZIGBEE_FFD_STATIC       0x70
+#define INFO_STACK_TYPE_BLE_ZIGBEE_RFD_STATIC       0x71
+#define INFO_STACK_TYPE_BLE_ZIGBEE_FFD_DYNAMIC      0x78
+#define INFO_STACK_TYPE_BLE_ZIGBEE_RFD_DYNAMIC      0x79
+#define INFO_STACK_TYPE_RLV                         0x80
+#define INFO_STACK_TYPE_BLE_MAC_STATIC              0x90
+
+typedef struct {
+/**
+ * Wireless Info
+ */
+  uint8_t VersionMajor;
+  uint8_t VersionMinor;
+  uint8_t VersionSub;
+  uint8_t VersionBranch;
+  uint8_t VersionReleaseType;
+  uint8_t MemorySizeSram2B;     /*< Multiple of 1K */
+  uint8_t MemorySizeSram2A;     /*< Multiple of 1K */
+  uint8_t MemorySizeSram1;      /*< Multiple of 1K */
+  uint8_t MemorySizeFlash;      /*< Multiple of 4K */
+  uint8_t StackType;
+/**
+ * Fus Info
+ */
+  uint8_t FusVersionMajor;
+  uint8_t FusVersionMinor;
+  uint8_t FusVersionSub;
+  uint8_t FusMemorySizeSram2B;  /*< Multiple of 1K */
+  uint8_t FusMemorySizeSram2A;  /*< Multiple of 1K */
+  uint8_t FusMemorySizeFlash;   /*< Multiple of 4K */
+}WirelessFwInfo_t;
+
+
+/* Exported functions ------------------------------------------------------- */
+
+  /**
+  * SHCI_C2_FUS_GetState
+  * @brief Read the FUS State
+  *        If the user is not interested by the Error code response, a null value may
+  *        be passed as parameter
+  *
+  *        Note:  This command is fully supported only by the FUS.
+  *               When the wireless firmware receives that command, it responds SHCI_FUS_CMD_NOT_SUPPORTED the first time.
+  *               When the wireless firmware receives that command a second time, it reboots the full device with the FUS running on CPU2
+  *
+  * @param  p_rsp : return the error code when the FUS State Value = 0xFF
+  * @retval FUS State Values
+  */
+  uint8_t SHCI_C2_FUS_GetState( SHCI_FUS_GetState_ErrorCode_t *p_rsp );
+
+  /**
+  * SHCI_C2_FUS_FwUpgrade
+  * @brief Request the FUS to install the CPU2 firmware update
+  *        Note:  This command is only supported by the FUS.
+  *
+  * @param  fw_src_add: Address of the firmware image location
+  * @param  fw_dest_add: Address of the firmware destination
+  * @retval Status
+  */
+  SHCI_CmdStatus_t SHCI_C2_FUS_FwUpgrade( uint32_t fw_src_add,  uint32_t fw_dest_add );
+
+  /**
+  * SHCI_C2_FUS_FwDelete
+  * @brief Delete the wireless stack on CPU2
+  *        Note:  This command is only supported by the FUS.
+  *
+  * @param  None
+  * @retval Status
+  */
+  SHCI_CmdStatus_t SHCI_C2_FUS_FwDelete( void );
+
+  /**
+  * SHCI_C2_FUS_UpdateAuthKey
+  * @brief Request the FUS to update the authentication key
+  *        Note:  This command is only supported by the FUS.
+  *
+  * @param  pCmdPacket
+  * @retval Status
+  */
+  SHCI_CmdStatus_t SHCI_C2_FUS_UpdateAuthKey( SHCI_C2_FUS_UpdateAuthKey_Cmd_Param_t *pParam );
+
+  /**
+  * SHCI_C2_FUS_LockAuthKey
+  * @brief Request the FUS to prevent any future update of the authentication key
+  *        Note:  This command is only supported by the FUS.
+  *
+  * @param  None
+  * @retval Status
+  */
+  SHCI_CmdStatus_t SHCI_C2_FUS_LockAuthKey( void );
+
+  /**
+  * SHCI_C2_FUS_StoreUsrKey
+  * @brief Request the FUS to store the user key
+  *        Note:  This command is supported by both the FUS and the wireless stack.
+  *
+  * @param  pParam : command parameter
+  * @param  p_key_index : Index allocated by the FUS to the stored key
+  *
+  * @retval Status
+  */
+  SHCI_CmdStatus_t SHCI_C2_FUS_StoreUsrKey( SHCI_C2_FUS_StoreUsrKey_Cmd_Param_t *pParam, uint8_t *p_key_index );
+
+  /**
+  * SHCI_C2_FUS_LoadUsrKey
+  * @brief Request the FUS to load the user key into the AES
+  *        Note:  This command is supported by both the FUS and the wireless stack.
+  *
+  * @param  key_index : index of the user key to load in AES1
+  * @retval Status
+  */
+  SHCI_CmdStatus_t SHCI_C2_FUS_LoadUsrKey( uint8_t key_index );
+
+  /**
+  * SHCI_C2_FUS_StartWs
+  * @brief Request the FUS to reboot on the wireless stack
+  *        Note:  This command is only supported by the FUS.
+  *
+  * @param  None
+  * @retval Status
+  */
+  SHCI_CmdStatus_t SHCI_C2_FUS_StartWs( void );
+
+  /**
+  * SHCI_C2_FUS_LockUsrKey
+  * @brief Request the FUS to lock the user key so that it cannot be updated later on
+  *        Note:  This command is supported by both the FUS and the wireless stack.
+  *
+  * @param  key_index : index of the user key to lock
+  * @retval Status
+  */
+  SHCI_CmdStatus_t SHCI_C2_FUS_LockUsrKey( uint8_t key_index );
+
+  /**
+  * SHCI_C2_FUS_UnloadUsrKey
+  * @brief Request the FUS to Unload the user key so that the CPU1 may use the AES with another Key
+  *        Note:  This command is supported by both the FUS and the wireless stack.
+  *
+  * @param  key_index : index of the user key to unload
+  * @retval Status
+  */
+  SHCI_CmdStatus_t SHCI_C2_FUS_UnloadUsrKey( uint8_t key_index );
+
+  /**
+  * SHCI_C2_FUS_ActivateAntiRollback
+  * @brief Request the FUS to enable the AntiRollback feature so that it is not possible to update the wireless firmware
+  *        with an older version than the current one.
+  *        Note:
+  *               - This command is only supported by the FUS.
+  *               - Once this feature is enabled, it is not possible anymore to disable it.
+  *
+  * @param  None
+  * @retval Status
+  */
+  SHCI_CmdStatus_t SHCI_C2_FUS_ActivateAntiRollback( void );
+
+  /**
+  * SHCI_C2_BLE_Init
+  * @brief Provides parameters and starts the BLE Stack
+  *
+  * @param  pCmdPacket : Parameters are described SHCI_C2_Ble_Init_Cmd_Packet_t declaration
+  * @retval Status
+  */
+  SHCI_CmdStatus_t SHCI_C2_BLE_Init( SHCI_C2_Ble_Init_Cmd_Packet_t *pCmdPacket );
+
+  /**
+  * SHCI_C2_THREAD_Init
+  * @brief Starts the THREAD Stack
+  *
+  * @param  None
+  * @retval Status
+  */
+  SHCI_CmdStatus_t SHCI_C2_THREAD_Init( void );
+
+  /**
+  * SHCI_C2_LLDTESTS_Init
+  * @brief Starts the LLD tests CLI
+  *
+  * @param  param_size : Nb of bytes
+  * @param  p_param : pointer with data to give from M4 to M0
+  * @retval Status
+  */
+  SHCI_CmdStatus_t SHCI_C2_LLDTESTS_Init( uint8_t param_size, uint8_t * p_param );
+
+    /**
+  * SHCI_C2_BLE_LLD_Init
+  * @brief Starts the LLD tests BLE
+  *
+  * @param  param_size : Nb of bytes
+  * @param  p_param : pointer with data to give from M4 to M0
+  * @retval Status
+  */
+  SHCI_CmdStatus_t SHCI_C2_BLE_LLD_Init( uint8_t param_size, uint8_t * p_param );
+
+    /**
+  * SHCI_C2_ZIGBEE_Init
+  * @brief Starts the Zigbee Stack
+  *
+  * @param  None
+  * @retval Status
+  */
+  SHCI_CmdStatus_t SHCI_C2_ZIGBEE_Init( void );
+
+  /**
+  * SHCI_C2_DEBUG_Init
+  * @brief Starts the Traces
+  *
+  * @param  None
+  * @retval Status
+  */
+  SHCI_CmdStatus_t SHCI_C2_DEBUG_Init( SHCI_C2_DEBUG_Init_Cmd_Packet_t *pCmdPacket );
+
+  /**
+  * SHCI_C2_FLASH_EraseActivity
+  * @brief Provides the information of the start and the end of a flash erase window on the CPU1
+  *        The protection will be active until next end of radio event.
+  *
+  * @param  erase_activity: Start/End of erase activity
+  * @retval Status
+  */
+  SHCI_CmdStatus_t SHCI_C2_FLASH_EraseActivity( SHCI_EraseActivity_t erase_activity );
+
+  /**
+  * SHCI_C2_CONCURRENT_SetMode
+  * @brief Enable/Disable Thread on CPU2 (M0+)
+  *
+  * @param  Mode: BLE or Thread enable flag
+  * @retval Status
+  */
+  SHCI_CmdStatus_t SHCI_C2_CONCURRENT_SetMode( SHCI_C2_CONCURRENT_Mode_Param_t Mode );
+
+  /**
+  * SHCI_C2_CONCURRENT_GetNextBleEvtTime
+  * @brief Get the next BLE event date (relative time)
+  *
+  * @param  Command Packet
+  * @retval None
+  */
+  SHCI_CmdStatus_t SHCI_C2_CONCURRENT_GetNextBleEvtTime( SHCI_C2_CONCURRENT_GetNextBleEvtTime_Param_t *pParam );
+
+  /**
+  * SHCI_C2_CONCURRENT_EnableNext_802154_EvtNotification
+  * @brief Activate the next 802.15.4 event notification (one shot)
+  *
+  * @param  None
+  * @retval None
+  */
+  SHCI_CmdStatus_t SHCI_C2_CONCURRENT_EnableNext_802154_EvtNotification( void );
+
+  /**
+  * SHCI_C2_FLASH_StoreData
+  * @brief Store Data in Flash
+  *
+  * @param  Ip: BLE or THREAD
+  * @retval Status
+  */
+  SHCI_CmdStatus_t SHCI_C2_FLASH_StoreData( SHCI_C2_FLASH_Ip_t Ip );
+
+  /**
+  * SHCI_C2_FLASH_EraseData
+  * @brief Erase Data in Flash
+  *
+  * @param  Ip: BLE or THREAD
+  * @retval Status
+  */
+  SHCI_CmdStatus_t SHCI_C2_FLASH_EraseData( SHCI_C2_FLASH_Ip_t Ip );
+
+  /**
+  * SHCI_C2_RADIO_AllowLowPower
+  * @brief Allow or forbid IP_radio (802_15_4 or BLE) to enter in low power mode.
+  *
+  * @param  Ip: BLE or 802_15_5
+  * @param  FlagRadioLowPowerOn: True or false
+  * @retval Status
+  */
+  SHCI_CmdStatus_t SHCI_C2_RADIO_AllowLowPower( SHCI_C2_FLASH_Ip_t Ip,uint8_t  FlagRadioLowPowerOn);
+
+
+  /**
+  * SHCI_C2_MAC_802_15_4_Init
+  * @brief Starts the MAC 802.15.4 on M0
+  *
+  * @param  None
+  * @retval Status
+  */
+  SHCI_CmdStatus_t SHCI_C2_MAC_802_15_4_Init( void );
+
+  /**
+   * SHCI_GetWirelessFwInfo
+   * @brief This function read back the information relative to the wireless binary loaded.
+   *         Refer yourself to MB_WirelessFwInfoTable_t structure to get the significance
+   *         of the different parameters returned.
+   * @param  pWirelessInfo : Pointer to WirelessFwInfo_t.
+   *
+   * @retval SHCI_Success
+   */
+  SHCI_CmdStatus_t SHCI_GetWirelessFwInfo( WirelessFwInfo_t* pWirelessInfo );
+
+  /**
+  * SHCI_C2_Reinit
+  * @brief This is required to allow the CPU1 to fake a set C2BOOT when it has already been set.
+  *        In order to fake a C2BOOT, the CPU1 shall :
+  *        - Send SHCI_C2_Reinit()
+  *        - call SEV instruction
+  *        WARNING:
+  *        This function is intended to be used by the SBSFU
+  *
+  * @param  None
+  * @retval Status
+  */
+  SHCI_CmdStatus_t SHCI_C2_Reinit( void );
+
+  /**
+  * SHCI_C2_ExtpaConfig
+  * @brief Send the Ext PA configuration
+  *        When the CPU2 receives the command, it controls the Ext PA as requested by the configuration
+  *        This configures only which IO is used to enable/disable the ExtPA and the associated polarity
+  *        This command has no effect on the other IO that is used to control the mode of the Ext PA (Rx/Tx)
+  *
+  * @param gpio_port: GPIOx where x can be (A..F) to select the GPIO peripheral for STM32WBxx family
+  * @param gpio_pin_number: This parameter can be one of GPIO_PIN_x (= LL_GPIO_PIN_x)  where x can be (0..15).
+  * @param gpio_polarity: This parameter can be either
+  *                       - EXT_PA_ENABLED_LOW: ExtPA is enabled when GPIO is low
+  *                       - EXT_PA_ENABLED_HIGH: ExtPA is enabled when GPIO is high
+  * @param gpio_status: This parameter can be either
+  *                       - EXT_PA_DISABLED: Stop driving the ExtPA
+  *                       - EXT_PA_ENABLED: Drive the ExtPA according to radio activity
+  *                                          (ON before the Event and OFF at the end of the event)
+  * @retval Status
+  */
+  SHCI_CmdStatus_t SHCI_C2_ExtpaConfig(uint32_t gpio_port, uint16_t gpio_pin_number, uint8_t gpio_polarity, uint8_t gpio_status);
+
+  /**
+  * SHCI_C2_SetFlashActivityControl
+  * @brief Set the mechanism to be used on CPU2 to prevent the CPU1 to either write or erase in flash
+  *
+  * @param Source: It can be one of the following list
+  *                -  FLASH_ACTIVITY_CONTROL_PES : The CPU2 set the PES bit to prevent the CPU1 to either read or write in flash
+  *                -  FLASH_ACTIVITY_CONTROL_SEM7 : The CPU2 gets the semaphore 7 to prevent the CPU1 to either read or write in flash.
+  *                                                 This requires the CPU1 to first get semaphore 7 before erasing or writing the flash.
+  *
+  * @retval Status
+  */
+  SHCI_CmdStatus_t SHCI_C2_SetFlashActivityControl(SHCI_C2_SET_FLASH_ACTIVITY_CONTROL_Source_t Source);
+
+  /**
+  * SHCI_C2_Config
+  * @brief Send the system configuration to the CPU2
+  *
+  * @param pCmdPacket: address of the buffer holding following parameters
+  *                    uint8_t PayloadCmdSize : Size of the payload - shall be SHCI_C2_CONFIG_PAYLOAD_CMD_SIZE
+  *                    uint8_t Config1 :
+  *                     - bit0 :  0 - BLE NVM Data  data are flushed in internal secure flash
+  *                               1 - BLE NVM Data are written in SRAM cache pointed by BleNvmRamAddress
+  *                     - bit1 :  0 - THREAD NVM Data  data are flushed in internal secure flash
+  *                               1 - THREAD NVM Data are written in SRAM cache pointed by ThreadNvmRamAddress
+  *                     - bit2 :  0 - Thread EUI64 is set to new (and current) format
+  *                               1 - Thread EUI64 is set to old format
+  *                     - bit3 to bit7 : Unused, shall be set to 0
+  *                    uint8_t EvtMask1 :
+  *                            When a bit is set to 0, the event is not reported
+  *                            bit0 : Asynchronous Event with Sub Evt Code 0x9201 (= SHCI_SUB_EVT_ERROR_NOTIF)
+  *                            ...
+  *                            bit31 : Asynchronous Event with Sub Evt Code 0x9220
+  *                    uint8_t Spare1 : Unused, shall be set to 0
+  *                    uint32_t BleNvmRamAddress :
+  *                               Only considered when Config1.bit0 = 1
+  *                               When set to 0, data are kept in internal SRAM on CPU2
+  *                               Otherwise, data are copied in the cache pointed by BleNvmRamAddress
+  *                               The size of the buffer shall be BLE_NVM_SRAM_SIZE (number of 32bits)
+  *                               The buffer shall be allocated in SRAM2
+  *                    uint32_t ThreadNvmRamAddress :
+  *                               Only considered when Config1.bit1 = 1
+  *                               When set to 0, data are kept in internal SRAM on CPU2
+  *                               Otherwise, data are copied in the cache pointed by ThreadNvmRamAddress
+  *                               The size of the buffer shall be THREAD_NVM_SRAM_SIZE (number of 32bits)
+  *                               The buffer shall be allocated in SRAM1
+  *
+  *                    Please check macro definition to be used for this function
+  *                    They are defined in this file next to the definition of SHCI_OPCODE_C2_CONFIG
+  *
+  * @retval Status
+  */
+  SHCI_CmdStatus_t SHCI_C2_Config(SHCI_C2_CONFIG_Cmd_Param_t *pCmdPacket);
+
+  /**
+   * SHCI_C2_802_15_4_DeInit
+   * @brief Deinit 802.15.4 layer (to be used before entering StandBy mode)
+   *
+   * @param  None
+   * @retval Status
+   */
+  SHCI_CmdStatus_t SHCI_C2_802_15_4_DeInit( void );
+
+  /**
+  * SHCI_C2_SetSystemClock
+  * @brief Request CPU2 to change system clock
+  *
+  * @param clockSel: It can be one of the following list
+  *                -  SET_SYSTEM_CLOCK_HSE_TO_PLL : CPU2 set system clock to PLL, PLL must be configured and started before.
+  *                -  SET_SYSTEM_CLOCK_PLL_ON_TO_HSE : CPU2 set System clock to HSE, PLL is still ON after command execution.
+  *                -  SET_SYSTEM_CLOCK_PLL_OFF_TO_HSE : CPU2 set System clock to HSE, PLL is turned OFF after command execution.
+  *
+  * @retval Status
+  */
+  SHCI_CmdStatus_t SHCI_C2_SetSystemClock( SHCI_C2_SET_SYSTEM_CLOCK_Cmd_Param_t clockSel );
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*__SHCI_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/src/utility/STM32_WPAN/shci_tl.c b/src/utility/STM32_WPAN/shci_tl.c
new file mode 100644
index 00000000..25e1a214
--- /dev/null
+++ b/src/utility/STM32_WPAN/shci_tl.c
@@ -0,0 +1,271 @@
+/**
+ ******************************************************************************
+ * @file    shci.c
+ * @author  MCD Application Team
+ * @brief   System HCI command implementation
+ ******************************************************************************
+ * @attention
+ *
+ * Copyright (c) 2018-2021 STMicroelectronics.
+ * All rights reserved.
+ *
+ * This software is licensed under terms that can be found in the LICENSE file
+ * in the root directory of this software component.
+ * If no LICENSE file comes with this software, it is provided AS-IS.
+ *
+ ******************************************************************************
+ */
+
+
+#if defined(STM32WBxx)
+/* Includes ------------------------------------------------------------------*/
+#include "stm32_wpan_common.h"
+
+#include "stm_list.h"
+#include "shci_tl.h"
+#include "stm32_def.h"
+#include "wiring_time.h"
+
+/* Private typedef -----------------------------------------------------------*/
+typedef enum
+{
+  SHCI_TL_CMD_RESP_RELEASE,
+  SHCI_TL_CMD_RESP_WAIT,
+} SHCI_TL_CmdRespStatus_t;
+
+/* Private defines -----------------------------------------------------------*/
+/**
+ * The default System HCI layer timeout is set to 33s
+ */
+#define SHCI_TL_DEFAULT_TIMEOUT (33000)
+
+/* Private macros ------------------------------------------------------------*/
+/* Public variables ---------------------------------------------------------*/
+/* Private variables ---------------------------------------------------------*/
+/**
+ * START of Section SYSTEM_DRIVER_CONTEXT
+ */
+PLACE_IN_SECTION("SYSTEM_DRIVER_CONTEXT") static tListNode SHciAsynchEventQueue;
+PLACE_IN_SECTION("SYSTEM_DRIVER_CONTEXT") static volatile SHCI_TL_CmdStatus_t SHCICmdStatus;
+PLACE_IN_SECTION("SYSTEM_DRIVER_CONTEXT") static TL_CmdPacket_t *pCmdBuffer;
+PLACE_IN_SECTION("SYSTEM_DRIVER_CONTEXT") SHCI_TL_UserEventFlowStatus_t SHCI_TL_UserEventFlow;
+/**
+ * END of Section SYSTEM_DRIVER_CONTEXT
+ */
+
+static tSHciContext shciContext;
+static void (* StatusNotCallBackFunction) (SHCI_TL_CmdStatus_t status);
+
+static volatile SHCI_TL_CmdRespStatus_t CmdRspStatusFlag;
+
+/* Private function prototypes -----------------------------------------------*/
+static void Cmd_SetStatus(SHCI_TL_CmdStatus_t shcicmdstatus);
+static void TlCmdEvtReceived(TL_EvtPacket_t *shcievt);
+static void TlUserEvtReceived(TL_EvtPacket_t *shcievt);
+static void TlInit( TL_CmdPacket_t * p_cmdbuffer );
+
+/* Interface ------- ---------------------------------------------------------*/
+void shci_init(void(* UserEvtRx)(void* pData), void* pConf)
+{
+  StatusNotCallBackFunction = ((SHCI_TL_HciInitConf_t *)pConf)->StatusNotCallBack;
+  shciContext.UserEvtRx = UserEvtRx;
+
+  shci_register_io_bus (&shciContext.io);
+
+  TlInit((TL_CmdPacket_t *)(((SHCI_TL_HciInitConf_t *)pConf)->p_cmdbuffer));
+
+  return;
+}
+
+void shci_user_evt_proc(void)
+{
+  TL_EvtPacket_t *phcievtbuffer;
+  tSHCI_UserEvtRxParam UserEvtRxParam;
+
+  /**
+   * Up to release version v1.2.0, a while loop was implemented to read out events from the queue as long as
+   * it is not empty. However, in a bare metal implementation, this leads to calling in a "blocking" mode
+   * shci_user_evt_proc() as long as events are received without giving the opportunity to run other tasks
+   * in the background.
+   * From now, the events are reported one by one. When it is checked there is still an event pending in the queue,
+   * a request to the user is made to call again shci_user_evt_proc().
+   * This gives the opportunity to the application to run other background tasks between each event.
+   */
+
+  /**
+   * It is more secure to use LST_remove_head()/LST_insert_head() compare to LST_get_next_node()/LST_remove_node()
+   * in case the user overwrite the header where the next/prev pointers are located
+   */
+  if((LST_is_empty(&SHciAsynchEventQueue) == FALSE) && (SHCI_TL_UserEventFlow != SHCI_TL_UserEventFlow_Disable))
+  {
+    LST_remove_head ( &SHciAsynchEventQueue, (tListNode **)&phcievtbuffer );
+
+    if (shciContext.UserEvtRx != NULL)
+    {
+      UserEvtRxParam.pckt = phcievtbuffer;
+      UserEvtRxParam.status = SHCI_TL_UserEventFlow_Enable;
+      shciContext.UserEvtRx((void *)&UserEvtRxParam);
+      SHCI_TL_UserEventFlow = UserEvtRxParam.status;
+    }
+    else
+    {
+      SHCI_TL_UserEventFlow = SHCI_TL_UserEventFlow_Enable;
+    }
+
+    if(SHCI_TL_UserEventFlow != SHCI_TL_UserEventFlow_Disable)
+    {
+      TL_MM_EvtDone( phcievtbuffer );
+    }
+    else
+    {
+      /**
+       * put back the event in the queue
+       */
+      LST_insert_head ( &SHciAsynchEventQueue, (tListNode *)phcievtbuffer );
+    }
+  }
+
+  if((LST_is_empty(&SHciAsynchEventQueue) == FALSE) && (SHCI_TL_UserEventFlow != SHCI_TL_UserEventFlow_Disable))
+  {
+    shci_notify_asynch_evt((void*) &SHciAsynchEventQueue);
+  }
+
+
+  return;
+}
+
+void shci_resume_flow( void )
+{
+  SHCI_TL_UserEventFlow = SHCI_TL_UserEventFlow_Enable;
+
+  /**
+   * It is better to go through the background process as it is not sure from which context this API may
+   * be called
+   */
+  shci_notify_asynch_evt((void*) &SHciAsynchEventQueue);
+
+  return;
+}
+
+void shci_send( uint16_t cmd_code, uint8_t len_cmd_payload, uint8_t * p_cmd_payload, TL_EvtPacket_t * p_rsp )
+{
+  Cmd_SetStatus(SHCI_TL_CmdBusy);
+
+  pCmdBuffer->cmdserial.cmd.cmdcode = cmd_code;
+  pCmdBuffer->cmdserial.cmd.plen = len_cmd_payload;
+
+  memcpy(pCmdBuffer->cmdserial.cmd.payload, p_cmd_payload, len_cmd_payload );
+  CmdRspStatusFlag = SHCI_TL_CMD_RESP_WAIT;
+  shciContext.io.Send(0,0);
+
+  shci_cmd_resp_wait(SHCI_TL_DEFAULT_TIMEOUT);
+
+  /**
+   * The command complete of a system command does not have the header
+   * It starts immediately with the evtserial field
+   */
+  memcpy( &(p_rsp->evtserial), pCmdBuffer, ((TL_EvtSerial_t*)pCmdBuffer)->evt.plen + TL_EVT_HDR_SIZE );
+
+  Cmd_SetStatus(SHCI_TL_CmdAvailable);
+
+  return;
+}
+
+void shci_notify_asynch_evt(void *pdata)
+{
+  UNUSED(pdata);
+  /* Need to parse data in future version */
+  shci_user_evt_proc();
+}
+
+void shci_register_io_bus(tSHciIO *fops)
+{
+  /* Register IO bus services */
+  fops->Init    = TL_SYS_Init;
+  fops->Send    = TL_SYS_SendCmd;
+}
+
+/* Private functions ---------------------------------------------------------*/
+static void TlInit( TL_CmdPacket_t * p_cmdbuffer )
+{
+  TL_SYS_InitConf_t Conf;
+
+  pCmdBuffer = p_cmdbuffer;
+
+  LST_init_head (&SHciAsynchEventQueue);
+
+  Cmd_SetStatus(SHCI_TL_CmdAvailable);
+
+  SHCI_TL_UserEventFlow = SHCI_TL_UserEventFlow_Enable;
+
+  /* Initialize low level driver */
+  if (shciContext.io.Init)
+  {
+
+    Conf.p_cmdbuffer = (uint8_t *)p_cmdbuffer;
+    Conf.IoBusCallBackCmdEvt = TlCmdEvtReceived;
+    Conf.IoBusCallBackUserEvt = TlUserEvtReceived;
+    shciContext.io.Init(&Conf);
+  }
+
+  return;
+}
+
+static void Cmd_SetStatus(SHCI_TL_CmdStatus_t shcicmdstatus)
+{
+  if(shcicmdstatus == SHCI_TL_CmdBusy)
+  {
+    if(StatusNotCallBackFunction != 0)
+    {
+      StatusNotCallBackFunction( SHCI_TL_CmdBusy );
+    }
+    SHCICmdStatus = SHCI_TL_CmdBusy;
+  }
+  else
+  {
+    SHCICmdStatus = SHCI_TL_CmdAvailable;
+    if(StatusNotCallBackFunction != 0)
+    {
+      StatusNotCallBackFunction( SHCI_TL_CmdAvailable );
+    }
+  }
+
+  return;
+}
+
+static void TlCmdEvtReceived(TL_EvtPacket_t *shcievt)
+{
+  (void)(shcievt);
+  shci_cmd_resp_release(0); /**< Notify the application the Cmd response has been received */
+
+  return;
+}
+
+static void TlUserEvtReceived(TL_EvtPacket_t *shcievt)
+{
+  LST_insert_tail(&SHciAsynchEventQueue, (tListNode *)shcievt);
+  shci_notify_asynch_evt((void*) &SHciAsynchEventQueue); /**< Notify the application a full HCI event has been received */
+
+  return;
+}
+
+/* Weak implementation ----------------------------------------------------------------*/
+__WEAK void shci_cmd_resp_wait(uint32_t timeout)
+{
+  for (unsigned long start = millis(); (millis() - start) < timeout;) {
+    if (CmdRspStatusFlag == SHCI_TL_CMD_RESP_RELEASE) {
+      break;
+    }
+  }
+  return;
+}
+
+__WEAK void shci_cmd_resp_release(uint32_t flag)
+{
+  (void)flag;
+
+  CmdRspStatusFlag = SHCI_TL_CMD_RESP_RELEASE;
+
+  return;
+}
+#endif /* STM32WBxx */
diff --git a/src/utility/STM32_WPAN/shci_tl.h b/src/utility/STM32_WPAN/shci_tl.h
new file mode 100644
index 00000000..74d0ff38
--- /dev/null
+++ b/src/utility/STM32_WPAN/shci_tl.h
@@ -0,0 +1,173 @@
+/**
+ ******************************************************************************
+ * @file    shci_tl.h
+ * @author  MCD Application Team
+ * @brief   System HCI command header for the system channel
+ ******************************************************************************
+ * @attention
+ *
+ * Copyright (c) 2018-2021 STMicroelectronics.
+ * All rights reserved.
+ *
+ * This software is licensed under terms that can be found in the LICENSE file
+ * in the root directory of this software component.
+ * If no LICENSE file comes with this software, it is provided AS-IS.
+ *
+ ******************************************************************************
+ */
+
+#ifndef __SHCI_TL_H_
+#define __SHCI_TL_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "tl.h"
+
+/* Exported defines -----------------------------------------------------------*/
+typedef enum
+{
+  SHCI_TL_UserEventFlow_Disable,
+  SHCI_TL_UserEventFlow_Enable,
+} SHCI_TL_UserEventFlowStatus_t;
+
+typedef enum
+{
+  SHCI_TL_CmdBusy,
+  SHCI_TL_CmdAvailable
+} SHCI_TL_CmdStatus_t;
+
+/**
+ * @brief Structure used to manage the BUS IO operations.
+ *        All the structure fields will point to functions defined at user level.
+ * @{
+ */ 
+typedef struct
+{                
+  int32_t (* Init)    (void* pConf); /**< Pointer to SHCI TL function for the IO Bus initialization */
+  int32_t (* DeInit)  (void); /**< Pointer to SHCI TL function for the IO Bus de-initialization */
+  int32_t (* Reset)   (void); /**< Pointer to SHCI TL function for the IO Bus reset */
+  int32_t (* Receive) (uint8_t*, uint16_t); /**< Pointer to SHCI TL function for the IO Bus data reception */
+  int32_t (* Send)    (uint8_t*, uint16_t); /**< Pointer to SHCI TL function for the IO Bus data transmission */
+  int32_t (* DataAck) (uint8_t*, uint16_t* len); /**< Pointer to SHCI TL function for the IO Bus data ack reception */
+  int32_t (* GetTick) (void); /**< Pointer to BSP function for getting the HAL time base timestamp */    
+} tSHciIO;
+/**
+ * @}
+ */
+
+/**
+ * @brief Contain the SHCI context
+ * @{
+ */
+typedef struct
+{   
+  tSHciIO io; /**< Manage the BUS IO operations */
+  void (* UserEvtRx) (void * pData); /**< User System events callback function pointer */
+} tSHciContext;
+
+typedef struct
+{
+  SHCI_TL_UserEventFlowStatus_t status;
+  TL_EvtPacket_t *pckt;
+} tSHCI_UserEvtRxParam;
+
+typedef struct
+{
+  uint8_t *p_cmdbuffer;
+  void (* StatusNotCallBack) (SHCI_TL_CmdStatus_t status);
+} SHCI_TL_HciInitConf_t;
+
+/**
+  * shci_send
+  * @brief  Send an System HCI Command
+  *
+  * @param : cmd_code = Opcode of the command
+  * @param : len_cmd_payload = Length of the command payload
+  * @param : p_cmd_payload = Address of the command payload
+  * @param : p_rsp_status = Address of the full buffer holding the command complete event
+  * @retval : None
+  */
+void shci_send( uint16_t cmd_code, uint8_t len_cmd_payload, uint8_t * p_cmd_payload, TL_EvtPacket_t * p_rsp_status );
+ 
+/**
+ * @brief  Register IO bus services.
+ * @param  fops The SHCI IO structure managing the IO BUS
+ * @retval None
+ */
+void shci_register_io_bus(tSHciIO* fops);
+
+/**
+ * @brief  Interrupt service routine that must be called when the system channel
+ *         reports a packet has been received
+ *
+ * @param  pdata Packet or event pointer
+ * @retval None
+ */
+void shci_notify_asynch_evt(void* pdata);
+
+/**
+ * @brief  This function resume the User Event Flow which has been stopped on return 
+ *         from UserEvtRx() when the User Event has not been processed.
+ *
+ * @param  None
+ * @retval None
+ */
+void shci_resume_flow(void);
+
+
+/**
+ * @brief  This function is called when an System HCI Command is sent to the CPU2 and the response is waited.
+ *         It is called from the same context the System HCI command has been sent.
+ *         It shall not return until the command response notified by shci_cmd_resp_release() is received.
+ *         A weak implementation is available in shci_tl.c based on polling mechanism
+ *         The user may re-implement this function in the application to improve performance :
+ *         - It may use UTIL_SEQ_WaitEvt() API when using the Sequencer
+ *         - It may use a semaphore when using cmsis_os interface
+ *
+ * @param  timeout: Waiting timeout
+ * @retval None
+ */
+void shci_cmd_resp_wait(uint32_t timeout);
+
+/**
+ * @brief  This function is called when an System HCI command is received from the CPU2.
+ *         A weak implementation is available in shci_tl.c based on polling mechanism
+ *         The user may re-implement this function in the application to improve performance :
+ *         - It may use UTIL_SEQ_SetEvt() API when using the Sequencer
+ *         - It may use a semaphore when using cmsis_os interface
+ *
+ *
+ * @param  flag: Release flag
+ * @retval None
+ */
+void shci_cmd_resp_release(uint32_t flag);
+
+
+/**
+ * @brief  This process shall be called each time the shci_notify_asynch_evt notification is received
+ *
+ * @param  None
+ * @retval None
+ */
+
+void shci_user_evt_proc(void);
+
+/**
+ * @brief Initialize the System Host Controller Interface.
+ *        This function must be called before any communication on the System Channel
+ *
+ * @param  UserEvtRx: System events callback function pointer
+ *         This callback is triggered when an user event is received on
+ *         the System Channel from CPU2.
+ * @param  pConf: Configuration structure pointer
+ * @retval None
+ */
+void shci_init(void(* UserEvtRx)(void* pData), void* pConf);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __SHCI_TL_H_ */
diff --git a/src/utility/STM32_WPAN/stm32_wpan_common.h b/src/utility/STM32_WPAN/stm32_wpan_common.h
new file mode 100644
index 00000000..f407bb98
--- /dev/null
+++ b/src/utility/STM32_WPAN/stm32_wpan_common.h
@@ -0,0 +1,171 @@
+/**
+ ******************************************************************************
+ * @file    stm32_wpan_common.h
+ * @author  MCD Application Team
+ * @brief   Common file to utilities
+ ******************************************************************************
+ * @attention
+ *
+ * Copyright (c) 2018-2021 STMicroelectronics.
+ * All rights reserved.
+ *
+ * This software is licensed under terms that can be found in the LICENSE file
+ * in the root directory of this software component.
+ * If no LICENSE file comes with this software, it is provided AS-IS.
+ *
+ ******************************************************************************
+ */
+
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __STM32_WPAN_COMMON_H
+#define __STM32_WPAN_COMMON_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if   defined ( __CC_ARM )||defined (__ARMCC_VERSION)
+ #define __ASM            __asm                                      /*!< asm keyword for ARM Compiler          */
+ #define __INLINE         __inline                                   /*!< inline keyword for ARM Compiler       */
+ #define __STATIC_INLINE  static __inline
+#elif defined ( __ICCARM__ )
+ #define __ASM            __asm                                      /*!< asm keyword for IAR Compiler          */
+ #define __INLINE         inline                                     /*!< inline keyword for IAR Compiler. Only available in High optimization mode! */
+ #define __STATIC_INLINE  static inline
+#elif defined ( __GNUC__ )
+ #define __ASM            __asm                                      /*!< asm keyword for GNU Compiler          */
+ #define __INLINE         inline                                     /*!< inline keyword for GNU Compiler       */
+ #define __STATIC_INLINE  static inline
+#endif
+
+#include <stdint.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include "cmsis_compiler.h"
+
+  /* -------------------------------- *
+   *  Basic definitions               *
+   * -------------------------------- */
+
+#undef NULL
+#define NULL                    0U
+
+#undef FALSE
+#define FALSE                   0U
+
+#undef TRUE
+#define TRUE                    (!0U)
+
+  /* -------------------------------- *
+   *  Critical Section definition     *
+   * -------------------------------- */
+#undef BACKUP_PRIMASK
+#define BACKUP_PRIMASK()    uint32_t primask_bit= __get_PRIMASK()
+
+#undef DISABLE_IRQ
+#define DISABLE_IRQ()       __disable_irq()
+
+#undef RESTORE_PRIMASK
+#define RESTORE_PRIMASK()   __set_PRIMASK(primask_bit)
+
+  /* -------------------------------- *
+   *  Macro delimiters                *
+   * -------------------------------- */
+#undef M_BEGIN
+#define M_BEGIN     do {
+
+#undef  M_END
+#define M_END       } while(0)
+
+  /* -------------------------------- *
+   *  Some useful macro definitions   *
+   * -------------------------------- */
+#undef MAX
+#define MAX(a, b)  (((a) > (b)) ? (a) : (b))
+
+#undef MIN
+#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
+
+#undef MODINC
+#define MODINC( a, m )       M_BEGIN  (a)++;  if ((a)>=(m)) (a)=0;  M_END
+
+#undef MODDEC
+#define MODDEC( a, m )       M_BEGIN  if ((a)==0) (a)=(m);  (a)--;  M_END
+
+#undef MODADD
+#define MODADD( a, b, m )    M_BEGIN  (a)+=(b);  if ((a)>=(m)) (a)-=(m);  M_END
+
+#undef MODSUB
+#define MODSUB( a, b, m )    MODADD( a, (m)-(b), m )
+
+#undef ALIGN
+#ifdef WIN32
+#define ALIGN(n)
+#else
+#define ALIGN(n)             __attribute__((aligned(n)))
+#endif
+
+#undef PAUSE
+#define PAUSE( t )           M_BEGIN \
+                               volatile int _i; \
+                               for ( _i = t; _i > 0; _i -- ); \
+                             M_END
+#undef DIVF
+#define DIVF( x, y )         ((x)/(y))
+
+#undef DIVC
+#define DIVC( x, y )         (((x)+(y)-1)/(y))
+
+#undef DIVR
+#define DIVR( x, y )         (((x)+((y)/2))/(y))
+
+#undef SHRR
+#define SHRR( x, n )         ((((x)>>((n)-1))+1)>>1)
+
+#undef BITN
+#define BITN( w, n )         (((w)[(n)/32] >> ((n)%32)) & 1)
+
+#undef BITNSET
+#define BITNSET( w, n, b )   M_BEGIN (w)[(n)/32] |= ((U32)(b))<<((n)%32); M_END
+
+/* -------------------------------- *
+ *  Section attribute               *
+ * -------------------------------- */
+#undef PLACE_IN_SECTION
+#define PLACE_IN_SECTION( __x__ )  __attribute__((section (__x__)))
+
+/* ----------------------------------- *
+ *  Packed usage (compiler dependent)  *
+ * ----------------------------------- */
+#undef PACKED__
+#undef PACKED_STRUCT
+
+#if defined ( __CC_ARM )
+  #if defined ( __GNUC__ )
+    /* GNU extension */
+    #define PACKED__ __attribute__((packed))
+    #define PACKED_STRUCT struct PACKED__
+  #elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050U)
+    #define PACKED__ __attribute__((packed))
+    #define PACKED_STRUCT struct PACKED__
+  #else
+    #define PACKED__(TYPE) __packed TYPE
+    #define PACKED_STRUCT PACKED__(struct)
+  #endif
+#elif defined   ( __GNUC__ )
+  #define PACKED__ __attribute__((packed))
+  #define PACKED_STRUCT struct PACKED__
+#elif defined (__ICCARM__)
+  #define PACKED_STRUCT __packed struct
+#else
+  #define PACKED_STRUCT __packed struct
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*__STM32_WPAN_COMMON_H */
diff --git a/src/utility/STM32_WPAN/stm_list.c b/src/utility/STM32_WPAN/stm_list.c
new file mode 100644
index 00000000..df6c2155
--- /dev/null
+++ b/src/utility/STM32_WPAN/stm_list.c
@@ -0,0 +1,210 @@
+/**
+ ******************************************************************************
+  * @file    stm_list.c
+  * @author  MCD Application Team
+  * @brief   TCircular Linked List Implementation.
+  ******************************************************************************
+  * @attention
+  *
+  * Copyright (c) 2018-2021 STMicroelectronics.
+  * All rights reserved.
+  *
+  * This software is licensed under terms that can be found in the LICENSE file
+  * in the root directory of this software component.
+  * If no LICENSE file comes with this software, it is provided AS-IS.
+  *
+  ******************************************************************************
+  */
+
+
+#if defined(STM32WBxx)
+/******************************************************************************
+ * Include Files
+ ******************************************************************************/
+#include "stdint.h"
+#include "cmsis_gcc.h"
+#include "stm32_wpan_common.h"
+
+#include "stm_list.h"
+
+/******************************************************************************
+ * Function Definitions
+ ******************************************************************************/
+void LST_init_head (tListNode * listHead)
+{
+  listHead->next = listHead;
+  listHead->prev = listHead;
+}
+
+uint8_t LST_is_empty (tListNode * listHead)
+{
+  uint32_t primask_bit;
+  uint8_t return_value;
+
+  primask_bit = __get_PRIMASK();  /**< backup PRIMASK bit */
+  __disable_irq();                  /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
+  if(listHead->next == listHead)
+  {
+    return_value = TRUE;
+  }
+  else
+  {
+    return_value = FALSE;
+  }
+  __set_PRIMASK(primask_bit);     /**< Restore PRIMASK bit*/
+
+  return return_value;
+}
+
+void LST_insert_head (tListNode * listHead, tListNode * node)
+{
+  uint32_t primask_bit;
+
+  primask_bit = __get_PRIMASK();  /**< backup PRIMASK bit */
+  __disable_irq();                  /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
+
+  node->next = listHead->next;
+  node->prev = listHead;
+  listHead->next = node;
+  (node->next)->prev = node;
+
+  __set_PRIMASK(primask_bit);     /**< Restore PRIMASK bit*/
+}
+
+
+void LST_insert_tail (tListNode * listHead, tListNode * node)
+{
+  uint32_t primask_bit;
+
+  primask_bit = __get_PRIMASK();  /**< backup PRIMASK bit */
+  __disable_irq();                  /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
+
+  node->next = listHead;
+  node->prev = listHead->prev;
+  listHead->prev = node;
+  (node->prev)->next = node;
+
+  __set_PRIMASK(primask_bit);     /**< Restore PRIMASK bit*/
+}
+
+
+void LST_remove_node (tListNode * node)
+{
+  uint32_t primask_bit;
+
+  primask_bit = __get_PRIMASK();  /**< backup PRIMASK bit */
+  __disable_irq();                  /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
+
+  (node->prev)->next = node->next;
+  (node->next)->prev = node->prev;
+
+  __set_PRIMASK(primask_bit);     /**< Restore PRIMASK bit*/
+}
+
+
+void LST_remove_head (tListNode * listHead, tListNode ** node )
+{
+  uint32_t primask_bit;
+
+  primask_bit = __get_PRIMASK();  /**< backup PRIMASK bit */
+  __disable_irq();                  /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
+
+  *node = listHead->next;
+  LST_remove_node (listHead->next);
+
+  __set_PRIMASK(primask_bit);     /**< Restore PRIMASK bit*/
+}
+
+
+void LST_remove_tail (tListNode * listHead, tListNode ** node )
+{
+  uint32_t primask_bit;
+
+  primask_bit = __get_PRIMASK();  /**< backup PRIMASK bit */
+  __disable_irq();                  /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
+
+  *node = listHead->prev;
+  LST_remove_node (listHead->prev);
+
+  __set_PRIMASK(primask_bit);     /**< Restore PRIMASK bit*/
+}
+
+
+void LST_insert_node_after (tListNode * node, tListNode * ref_node)
+{
+  uint32_t primask_bit;
+
+  primask_bit = __get_PRIMASK();  /**< backup PRIMASK bit */
+  __disable_irq();                  /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
+
+  node->next = ref_node->next;
+  node->prev = ref_node;
+  ref_node->next = node;
+  (node->next)->prev = node;
+
+  __set_PRIMASK(primask_bit);     /**< Restore PRIMASK bit*/
+}
+
+
+void LST_insert_node_before (tListNode * node, tListNode * ref_node)
+{
+  uint32_t primask_bit;
+
+  primask_bit = __get_PRIMASK();  /**< backup PRIMASK bit */
+  __disable_irq();                  /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
+
+  node->next = ref_node;
+  node->prev = ref_node->prev;
+  ref_node->prev = node;
+  (node->prev)->next = node;
+
+  __set_PRIMASK(primask_bit);     /**< Restore PRIMASK bit*/
+}
+
+
+int LST_get_size (tListNode * listHead)
+{
+  int size = 0;
+  tListNode * temp;
+  uint32_t primask_bit;
+
+  primask_bit = __get_PRIMASK();  /**< backup PRIMASK bit */
+  __disable_irq();                  /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
+
+  temp = listHead->next;
+  while (temp != listHead)
+  {
+    size++;
+    temp = temp->next;
+  }
+
+  __set_PRIMASK(primask_bit);     /**< Restore PRIMASK bit*/
+
+  return (size);
+}
+
+void LST_get_next_node (tListNode * ref_node, tListNode ** node)
+{
+  uint32_t primask_bit;
+
+  primask_bit = __get_PRIMASK();  /**< backup PRIMASK bit */
+  __disable_irq();                  /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
+
+  *node = ref_node->next;
+
+  __set_PRIMASK(primask_bit);     /**< Restore PRIMASK bit*/
+}
+
+
+void LST_get_prev_node (tListNode * ref_node, tListNode ** node)
+{
+  uint32_t primask_bit;
+
+  primask_bit = __get_PRIMASK();  /**< backup PRIMASK bit */
+  __disable_irq();                  /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
+
+  *node = ref_node->prev;
+
+  __set_PRIMASK(primask_bit);      /**< Restore PRIMASK bit*/
+}
+#endif /* STM32WBxx */
diff --git a/src/utility/STM32_WPAN/stm_list.h b/src/utility/STM32_WPAN/stm_list.h
new file mode 100644
index 00000000..b7c3254c
--- /dev/null
+++ b/src/utility/STM32_WPAN/stm_list.h
@@ -0,0 +1,55 @@
+/**
+  ******************************************************************************
+  * @file    stm_list.h
+  * @author  MCD Application Team
+  * @brief   Header file for linked list library.
+  ******************************************************************************
+  * @attention
+  *
+  * Copyright (c) 2018-2021 STMicroelectronics.
+  * All rights reserved.
+  *
+  * This software is licensed under terms that can be found in the LICENSE file
+  * in the root directory of this software component.
+  * If no LICENSE file comes with this software, it is provided AS-IS.
+  *
+  ******************************************************************************
+  */
+
+
+#ifndef _STM_LIST_H_
+#define _STM_LIST_H_
+
+/* Includes ------------------------------------------------------------------*/
+#include "stm32_wpan_common.h"
+
+typedef PACKED_STRUCT _tListNode {
+    struct _tListNode * next;
+    struct _tListNode * prev;
+} tListNode;
+
+void LST_init_head (tListNode * listHead);
+
+uint8_t LST_is_empty (tListNode * listHead);
+
+void LST_insert_head (tListNode * listHead, tListNode * node);
+
+void LST_insert_tail (tListNode * listHead, tListNode * node);
+
+void LST_remove_node (tListNode * node);
+
+void LST_remove_head (tListNode * listHead, tListNode ** node );
+
+void LST_remove_tail (tListNode * listHead, tListNode ** node );
+
+void LST_insert_node_after (tListNode * node, tListNode * ref_node);
+
+void LST_insert_node_before (tListNode * node, tListNode * ref_node);
+
+int LST_get_size (tListNode * listHead);
+
+void LST_get_next_node (tListNode * ref_node, tListNode ** node);
+
+void LST_get_prev_node (tListNode * ref_node, tListNode ** node);
+
+#endif /* _STM_LIST_H_ */
diff --git a/src/utility/STM32_WPAN/tl.h b/src/utility/STM32_WPAN/tl.h
new file mode 100644
index 00000000..74520878
--- /dev/null
+++ b/src/utility/STM32_WPAN/tl.h
@@ -0,0 +1,372 @@
+/**
+ ******************************************************************************
+ * @file    tl.h
+ * @author  MCD Application Team
+ * @brief   Header for tl module
+ ******************************************************************************
+ * @attention
+ *
+ * Copyright (c) 2018-2021 STMicroelectronics.
+ * All rights reserved.
+ *
+ * This software is licensed under terms that can be found in the LICENSE file
+ * in the root directory of this software component.
+ * If no LICENSE file comes with this software, it is provided AS-IS.
+ *
+ ******************************************************************************
+ */
+
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __TL_H
+#define __TL_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* Includes ------------------------------------------------------------------*/
+#include "stm32_wpan_common.h"
+
+/* Exported defines -----------------------------------------------------------*/
+#define TL_BLECMD_PKT_TYPE             ( 0x01 )
+#define TL_ACL_DATA_PKT_TYPE           ( 0x02 )
+#define TL_BLEEVT_PKT_TYPE             ( 0x04 )
+#define TL_OTCMD_PKT_TYPE              ( 0x08 )
+#define TL_OTRSP_PKT_TYPE              ( 0x09 )
+#define TL_CLICMD_PKT_TYPE             ( 0x0A )
+#define TL_OTNOT_PKT_TYPE              ( 0x0C )
+#define TL_OTACK_PKT_TYPE              ( 0x0D )
+#define TL_CLINOT_PKT_TYPE             ( 0x0E )
+#define TL_CLIACK_PKT_TYPE             ( 0x0F )
+#define TL_SYSCMD_PKT_TYPE             ( 0x10 )
+#define TL_SYSRSP_PKT_TYPE             ( 0x11 )
+#define TL_SYSEVT_PKT_TYPE             ( 0x12 )
+#define TL_CLIRESP_PKT_TYPE            ( 0x15 )
+#define TL_M0CMD_PKT_TYPE              ( 0x16 )
+#define TL_LOCCMD_PKT_TYPE             ( 0x20 )
+#define TL_LOCRSP_PKT_TYPE             ( 0x21 )
+#define TL_TRACES_APP_PKT_TYPE         ( 0x40 )
+#define TL_TRACES_WL_PKT_TYPE          ( 0x41 )
+
+#define TL_CMD_HDR_SIZE                (4)
+#define TL_EVT_HDR_SIZE                (3)
+#define TL_EVT_CS_PAYLOAD_SIZE         (4)
+
+#define TL_BLEEVT_CC_OPCODE            (0x0E)
+#define TL_BLEEVT_CS_OPCODE            (0x0F)
+#define TL_BLEEVT_VS_OPCODE            (0xFF)
+
+#define TL_BLEEVT_CC_PACKET_SIZE       (TL_EVT_HDR_SIZE + sizeof(TL_CcEvt_t))
+#define TL_BLEEVT_CC_BUFFER_SIZE       (sizeof(TL_PacketHeader_t) + TL_BLEEVT_CC_PACKET_SIZE)
+/* Exported types ------------------------------------------------------------*/
+/**< Packet header */
+typedef PACKED_STRUCT
+{
+  uint32_t *next;
+  uint32_t *prev;
+} TL_PacketHeader_t;
+
+/*******************************************************************************
+ * Event type
+ */
+
+/**
+ * This the payload of TL_Evt_t for a command status event
+ */
+typedef PACKED_STRUCT
+{
+  uint8_t   status;
+  uint8_t   numcmd;
+  uint16_t  cmdcode;
+} TL_CsEvt_t;
+
+/**
+ * This the payload of TL_Evt_t for a command complete event, only used a pointer
+ */
+typedef PACKED_STRUCT
+{
+  uint8_t   numcmd;
+  uint16_t  cmdcode;
+  uint8_t   payload[2];
+} TL_CcEvt_t;
+
+/**
+ * This the payload of TL_Evt_t for an asynchronous event, only used a pointer
+ */
+typedef PACKED_STRUCT
+{
+  uint16_t  subevtcode;
+  uint8_t   payload[2];
+} TL_AsynchEvt_t;
+
+/**
+ * This the payload of TL_Evt_t, only used a pointer
+ */
+typedef PACKED_STRUCT
+{
+  uint8_t   evtcode;
+  uint8_t   plen;
+  uint8_t   payload[4];
+} TL_Evt_t;
+
+typedef PACKED_STRUCT
+{
+  uint8_t   type;
+  TL_Evt_t  evt;
+} TL_EvtSerial_t;
+
+/**
+ * This format shall be used for all events (asynchronous and command response) reported
+ * by the CPU2 except for the command response of a system command where the header is not there
+ * and the format to be used shall be TL_EvtSerial_t.
+ * Note: Be careful that the asynchronous events reported by the CPU2 on the system channel do
+ * include the header and shall use TL_EvtPacket_t format. Only the command response format on the
+ * system channel is different.
+ */
+typedef PACKED_STRUCT
+{
+  TL_PacketHeader_t  header;
+  TL_EvtSerial_t     evtserial;
+} TL_EvtPacket_t;
+
+/*****************************************************************************************
+ * Command type
+ */
+
+typedef PACKED_STRUCT
+{
+  uint16_t   cmdcode;
+  uint8_t   plen;
+  uint8_t   payload[255];
+} TL_Cmd_t;
+
+typedef PACKED_STRUCT
+{
+  uint8_t   type;
+  TL_Cmd_t  cmd;
+} TL_CmdSerial_t;
+
+typedef PACKED_STRUCT
+{
+  TL_PacketHeader_t  header;
+  TL_CmdSerial_t     cmdserial;
+} TL_CmdPacket_t;
+
+/*****************************************************************************************
+ * HCI ACL DATA type
+ */
+typedef PACKED_STRUCT
+{
+  uint8_t   type;
+  uint16_t  handle;
+  uint16_t  length;
+  uint8_t   acl_data[1];
+} TL_AclDataSerial_t;
+
+typedef PACKED_STRUCT
+{
+  TL_PacketHeader_t  header;
+  TL_AclDataSerial_t   AclDataSerial;
+} TL_AclDataPacket_t;
+
+typedef struct
+{
+  uint8_t  *p_BleSpareEvtBuffer;
+  uint8_t  *p_SystemSpareEvtBuffer;
+  uint8_t  *p_AsynchEvtPool;
+  uint32_t AsynchEvtPoolSize;
+  uint8_t  *p_TracesEvtPool;
+  uint32_t TracesEvtPoolSize;
+} TL_MM_Config_t;
+
+typedef struct
+{
+  uint8_t *p_ThreadOtCmdRspBuffer;
+  uint8_t *p_ThreadCliRspBuffer;
+  uint8_t *p_ThreadNotAckBuffer;
+  uint8_t *p_ThreadCliNotBuffer;
+} TL_TH_Config_t;
+
+typedef struct
+{
+  uint8_t *p_LldTestsCliCmdRspBuffer;
+  uint8_t *p_LldTestsM0CmdBuffer;
+} TL_LLD_tests_Config_t;
+
+typedef struct
+{
+  uint8_t *p_BleLldCmdRspBuffer;
+  uint8_t *p_BleLldM0CmdBuffer;
+} TL_BLE_LLD_Config_t;
+
+typedef struct
+{
+  uint8_t *p_Mac_802_15_4_CmdRspBuffer;
+  uint8_t *p_Mac_802_15_4_NotAckBuffer;
+} TL_MAC_802_15_4_Config_t;
+
+typedef struct
+{
+  uint8_t *p_ZigbeeOtCmdRspBuffer;
+  uint8_t *p_ZigbeeNotAckBuffer;
+  uint8_t *p_ZigbeeNotifRequestBuffer;
+} TL_ZIGBEE_Config_t;
+
+/**
+ * @brief Contain the BLE HCI Init Configuration
+ * @{
+ */
+typedef struct
+{
+  void (* IoBusEvtCallBack) ( TL_EvtPacket_t *phcievt );
+  void (* IoBusAclDataTxAck) ( void );
+  uint8_t *p_cmdbuffer;
+  uint8_t *p_AclDataBuffer;
+} TL_BLE_InitConf_t;
+
+/**
+ * @brief Contain the SYSTEM HCI Init Configuration
+ * @{
+ */
+typedef struct
+{
+  void (* IoBusCallBackCmdEvt) (TL_EvtPacket_t *phcievt);
+  void (* IoBusCallBackUserEvt) (TL_EvtPacket_t *phcievt);
+  uint8_t *p_cmdbuffer;
+} TL_SYS_InitConf_t;
+
+/*****************************************************************************************
+ * Event type copied from ble_legacy.h
+ */
+
+typedef PACKED_STRUCT
+{
+  uint8_t type;
+  uint8_t data[1];
+} hci_uart_pckt;
+
+typedef PACKED_STRUCT
+{
+  uint8_t         evt;
+  uint8_t         plen;
+  uint8_t         data[1];
+} hci_event_pckt;
+
+typedef PACKED_STRUCT
+{
+  uint8_t         subevent;
+  uint8_t         data[1];
+} evt_le_meta_event;
+
+/**
+ * Vendor specific event for BLE core.
+ */
+typedef PACKED_STRUCT
+{
+  uint16_t ecode; /**< One of the BLE core event codes. */
+  uint8_t  data[1];
+} evt_blecore_aci;
+
+/* Bluetooth 48 bit address (in little-endian order).
+ */
+typedef	uint8_t	tBDAddr[6];
+
+
+/* Exported constants --------------------------------------------------------*/
+/* External variables --------------------------------------------------------*/
+/* Exported macros -----------------------------------------------------------*/
+/* Exported functions ------------------------------------------------------- */
+
+/******************************************************************************
+ * GENERAL
+ ******************************************************************************/
+void TL_Enable( void );
+void TL_Init( void );
+
+/******************************************************************************
+ * BLE
+ ******************************************************************************/
+int32_t TL_BLE_Init( void* pConf );
+int32_t TL_BLE_SendCmd( uint8_t* buffer, uint16_t size );
+int32_t TL_BLE_SendAclData( uint8_t* buffer, uint16_t size );
+
+/******************************************************************************
+ * SYSTEM
+ ******************************************************************************/
+int32_t TL_SYS_Init( void* pConf  );
+int32_t TL_SYS_SendCmd( uint8_t* buffer, uint16_t size );
+
+/******************************************************************************
+ * THREAD
+ ******************************************************************************/
+void TL_THREAD_Init( TL_TH_Config_t *p_Config );
+void TL_OT_SendCmd( void );
+void TL_CLI_SendCmd( void );
+void TL_OT_CmdEvtReceived( TL_EvtPacket_t * Otbuffer );
+void TL_THREAD_NotReceived( TL_EvtPacket_t * Notbuffer );
+void TL_THREAD_SendAck ( void );
+void TL_THREAD_CliSendAck ( void );
+void TL_THREAD_CliNotReceived( TL_EvtPacket_t * Notbuffer );
+
+/******************************************************************************
+ * LLD TESTS
+ ******************************************************************************/
+void TL_LLDTESTS_Init( TL_LLD_tests_Config_t *p_Config );
+void TL_LLDTESTS_SendCliCmd( void );
+void TL_LLDTESTS_ReceiveCliRsp( TL_CmdPacket_t * Notbuffer );
+void TL_LLDTESTS_SendCliRspAck( void );
+void TL_LLDTESTS_ReceiveM0Cmd( TL_CmdPacket_t * Notbuffer );
+void TL_LLDTESTS_SendM0CmdAck( void );
+
+/******************************************************************************
+ * BLE LLD
+ ******************************************************************************/
+void TL_BLE_LLD_Init( TL_BLE_LLD_Config_t *p_Config );
+void TL_BLE_LLD_SendCliCmd( void );
+void TL_BLE_LLD_ReceiveCliRsp( TL_CmdPacket_t * Notbuffer );
+void TL_BLE_LLD_SendCliRspAck( void );
+void TL_BLE_LLD_ReceiveM0Cmd( TL_CmdPacket_t * Notbuffer );
+void TL_BLE_LLD_SendM0CmdAck( void );
+void TL_BLE_LLD_SendCmd( void );
+void TL_BLE_LLD_ReceiveRsp( TL_CmdPacket_t * Notbuffer );
+void TL_BLE_LLD_SendRspAck( void );
+/******************************************************************************
+ * MEMORY MANAGER
+ ******************************************************************************/
+void TL_MM_Init( TL_MM_Config_t *p_Config );
+void TL_MM_EvtDone( TL_EvtPacket_t * hcievt );
+
+/******************************************************************************
+ * TRACES
+ ******************************************************************************/
+void TL_TRACES_Init( void );
+void TL_TRACES_EvtReceived( TL_EvtPacket_t * hcievt );
+
+/******************************************************************************
+ * MAC 802.15.4
+ ******************************************************************************/
+void TL_MAC_802_15_4_Init( TL_MAC_802_15_4_Config_t *p_Config );
+void TL_MAC_802_15_4_SendCmd( void );
+void TL_MAC_802_15_4_CmdEvtReceived( TL_EvtPacket_t * Otbuffer );
+void TL_MAC_802_15_4_NotReceived( TL_EvtPacket_t * Notbuffer );
+void TL_MAC_802_15_4_SendAck ( void );
+
+/******************************************************************************
+ * ZIGBEE
+ ******************************************************************************/
+void TL_ZIGBEE_Init( TL_ZIGBEE_Config_t *p_Config );
+void TL_ZIGBEE_SendM4RequestToM0( void );
+void TL_ZIGBEE_SendM4AckToM0Notify ( void );
+void TL_ZIGBEE_NotReceived( TL_EvtPacket_t * Notbuffer );
+void TL_ZIGBEE_CmdEvtReceived( TL_EvtPacket_t * Otbuffer );
+void TL_ZIGBEE_M0RequestReceived(TL_EvtPacket_t * Otbuffer );
+void TL_ZIGBEE_SendM4AckToM0Request(void);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /*__TL_H */
+
diff --git a/src/utility/STM32_WPAN/tl_dbg_conf.h b/src/utility/STM32_WPAN/tl_dbg_conf.h
new file mode 100644
index 00000000..841d1968
--- /dev/null
+++ b/src/utility/STM32_WPAN/tl_dbg_conf.h
@@ -0,0 +1,140 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+  * File Name          : tl_dbg_conf.h
+  * Description        : Debug configuration file for stm32wpan transport layer interface.
+  *
+ ******************************************************************************
+  * @attention
+  *
+  * Copyright (c) 2019-2021 STMicroelectronics.
+  * All rights reserved.
+  *
+  * This software is licensed under terms that can be found in the LICENSE file
+  * in the root directory of this software component.
+  * If no LICENSE file comes with this software, it is provided AS-IS.
+  *
+  ******************************************************************************
+  */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef TL_DBG_CONF_H
+#define TL_DBG_CONF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* USER CODE BEGIN Tl_Conf */
+
+/* Includes ------------------------------------------------------------------*/
+#include "core_debug.h"
+
+/**
+ * Enable or Disable traces
+ * The raw data output is the hci binary packet format as specified by the BT specification *
+ */
+#ifndef TL_SHCI_CMD_DBG_EN
+#define TL_SHCI_CMD_DBG_EN      1   /* Reports System commands sent to CPU2 and the command response */
+#endif
+
+#ifndef TL_SHCI_EVT_DBG_EN
+#define TL_SHCI_EVT_DBG_EN      1   /* Reports System Asynchronous Events received from CPU2 */
+#endif
+
+#ifndef TL_HCI_CMD_DBG_EN
+#define TL_HCI_CMD_DBG_EN       1   /* Reports BLE command sent to CPU2 and the command response */
+#endif
+
+#ifndef TL_HCI_EVT_DBG_EN
+#define TL_HCI_EVT_DBG_EN       1   /* Reports BLE Asynchronous Events received from CPU2 */
+#endif
+
+#ifndef TL_MM_DBG_EN
+#define TL_MM_DBG_EN            1   /* Reports the information of the buffer released to CPU2 */
+#endif
+
+/**
+ * Macro definition
+ */
+
+/**
+ * System Transport Layer
+ */
+#if (TL_SHCI_CMD_DBG_EN != 0)
+#define TL_SHCI_CMD_DBG_MSG             core_debug
+#define TL_SHCI_CMD_DBG_BUF             PRINT_LOG_BUFF_DBG
+#else
+#define TL_SHCI_CMD_DBG_MSG(...)
+#define TL_SHCI_CMD_DBG_BUF(...)
+#endif
+
+#define TL_SHCI_CMD_DBG_RAW(...)
+
+#if (TL_SHCI_EVT_DBG_EN != 0)
+#define TL_SHCI_EVT_DBG_MSG             core_debug
+#define TL_SHCI_EVT_DBG_BUF             PRINT_LOG_BUFF_DBG
+#else
+#define TL_SHCI_EVT_DBG_MSG(...)
+#define TL_SHCI_EVT_DBG_BUF(...)
+#endif
+
+#define TL_SHCI_EVT_DBG_RAW(...)
+
+/**
+ * BLE Transport Layer
+ */
+#if (TL_HCI_CMD_DBG_EN != 0)
+#define TL_HCI_CMD_DBG_MSG             core_debug
+#define TL_HCI_CMD_DBG_BUF             PRINT_LOG_BUFF_DBG
+#else
+#define TL_HCI_CMD_DBG_MSG(...)
+#define TL_HCI_CMD_DBG_BUF(...)
+#endif
+
+#define TL_HCI_CMD_DBG_RAW(...)
+
+#if (TL_HCI_EVT_DBG_EN != 0)
+#define TL_HCI_EVT_DBG_MSG             core_debug
+#define TL_HCI_EVT_DBG_BUF             PRINT_LOG_BUFF_DBG
+#else
+#define TL_HCI_EVT_DBG_MSG(...)
+#define TL_HCI_EVT_DBG_BUF(...)
+#endif
+
+#define TL_HCI_EVT_DBG_RAW(...)
+
+/**
+ * Memory Manager - Released buffer tracing
+ */
+#if (TL_MM_DBG_EN != 0)
+#define TL_MM_DBG_MSG             core_debug
+#else
+#define TL_MM_DBG_MSG(...)
+#endif
+
+
+#define PRINT_LOG_BUFF_DBG(...) DbgTraceBuffer(__VA_ARGS__)
+
+void DbgTraceBuffer(const void *pBuffer, uint32_t u32Length, const char *strFormat, ...)
+{
+  va_list vaArgs;
+  uint32_t u32Index;
+  va_start(vaArgs, strFormat);
+  vprintf(strFormat, vaArgs);
+  va_end(vaArgs);
+  for (u32Index = 0; u32Index < u32Length; u32Index ++)
+  {
+    core_debug(" %02X", ((const uint8_t *) pBuffer)[u32Index]);
+  }
+}
+
+/* USER CODE END Tl_Conf */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* TL_DBG_CONF_H */
+
diff --git a/src/utility/STM32_WPAN/tl_mbox.c b/src/utility/STM32_WPAN/tl_mbox.c
new file mode 100644
index 00000000..9a2a2973
--- /dev/null
+++ b/src/utility/STM32_WPAN/tl_mbox.c
@@ -0,0 +1,855 @@
+/**
+ ******************************************************************************
+ * @file    tl_mbox.c
+ * @author  MCD Application Team
+ * @brief   Transport layer for the mailbox interface
+ ******************************************************************************
+ * @attention
+ *
+ * Copyright (c) 2018-2021 STMicroelectronics.
+ * All rights reserved.
+ *
+ * This software is licensed under terms that can be found in the LICENSE file
+ * in the root directory of this software component.
+ * If no LICENSE file comes with this software, it is provided AS-IS.
+ *
+ ******************************************************************************
+ */
+
+#if defined(STM32WBxx)
+/* Includes ------------------------------------------------------------------*/
+#include "stm32_wpan_common.h"
+#include "hw.h"
+
+#include "stm_list.h"
+#include "tl.h"
+#include "mbox_def.h"
+#include "tl_dbg_conf.h"
+
+/* Private typedef -----------------------------------------------------------*/
+typedef enum
+{
+  TL_MB_MM_RELEASE_BUFFER,
+  TL_MB_BLE_CMD,
+  TL_MB_BLE_CMD_RSP,
+  TL_MB_BLE_ASYNCH_EVT,
+  TL_MB_SYS_CMD,
+  TL_MB_SYS_CMD_RSP,
+  TL_MB_SYS_ASYNCH_EVT,
+} TL_MB_PacketType_t;
+
+/* Private defines -----------------------------------------------------------*/
+/* Private macros ------------------------------------------------------------*/
+/* Private variables ---------------------------------------------------------*/
+
+/**< reference table */
+PLACE_IN_SECTION("MAPPING_TABLE") static volatile MB_RefTable_t TL_RefTable;
+PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_DeviceInfoTable_t TL_DeviceInfoTable;
+PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_BleTable_t TL_BleTable;
+PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_ThreadTable_t TL_ThreadTable;
+PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_LldTestsTable_t TL_LldTestsTable;
+PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_BleLldTable_t TL_BleLldTable;
+PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_SysTable_t TL_SysTable;
+PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_MemManagerTable_t TL_MemManagerTable;
+PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_TracesTable_t TL_TracesTable;
+#if 0
+PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_Mac_802_15_4_t TL_Mac_802_15_4_Table;
+PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_ZigbeeTable_t TL_Zigbee_Table;
+#endif
+
+/**< tables */
+PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static tListNode  FreeBufQueue;
+PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static tListNode  TracesEvtQueue;
+PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static uint8_t    CsBuffer[sizeof(TL_PacketHeader_t) + TL_EVT_HDR_SIZE + sizeof(TL_CsEvt_t)];
+PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static tListNode  EvtQueue;
+PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static tListNode  SystemEvtQueue;
+
+
+static tListNode  LocalFreeBufQueue;
+static void (* BLE_IoBusEvtCallBackFunction) (TL_EvtPacket_t *phcievt);
+static void (* BLE_IoBusAclDataTxAck) ( void );
+static void (* SYS_CMD_IoBusCallBackFunction) (TL_EvtPacket_t *phcievt);
+static void (* SYS_EVT_IoBusCallBackFunction) (TL_EvtPacket_t *phcievt);
+
+
+/* Global variables ----------------------------------------------------------*/
+/* Private function prototypes -----------------------------------------------*/
+static void SendFreeBuf( void );
+static void OutputDbgTrace(TL_MB_PacketType_t packet_type, uint8_t* buffer);
+
+/* Public Functions Definition ------------------------------------------------------*/
+
+/******************************************************************************
+ * GENERAL - refer to AN5289 for functions description.
+ ******************************************************************************/
+void TL_Enable( void )
+{
+  HW_IPCC_Enable();
+
+  return;
+}
+
+
+void TL_Init( void )
+{
+  TL_RefTable.p_device_info_table = &TL_DeviceInfoTable;
+  TL_RefTable.p_ble_table = &TL_BleTable;
+  TL_RefTable.p_thread_table = &TL_ThreadTable;
+  TL_RefTable.p_lld_tests_table = &TL_LldTestsTable;
+  TL_RefTable.p_ble_lld_table = &TL_BleLldTable;
+  TL_RefTable.p_sys_table = &TL_SysTable;
+  TL_RefTable.p_mem_manager_table = &TL_MemManagerTable;
+  TL_RefTable.p_traces_table = &TL_TracesTable;
+#if 0
+  TL_RefTable.p_mac_802_15_4_table = &TL_Mac_802_15_4_Table;
+  TL_RefTable.p_zigbee_table = &TL_Zigbee_Table;
+#endif
+  HW_IPCC_Init();
+
+  return;
+}
+
+/******************************************************************************
+ * BLE
+ ******************************************************************************/
+int32_t TL_BLE_Init( void* pConf )
+{
+  MB_BleTable_t  * p_bletable;
+
+  TL_BLE_InitConf_t *pInitHciConf = (TL_BLE_InitConf_t *) pConf;
+
+  LST_init_head (&EvtQueue);
+
+  p_bletable = TL_RefTable.p_ble_table;
+
+  p_bletable->pcmd_buffer = pInitHciConf->p_cmdbuffer;
+  p_bletable->phci_acl_data_buffer = pInitHciConf->p_AclDataBuffer;
+  p_bletable->pcs_buffer  = (uint8_t*)CsBuffer;
+  p_bletable->pevt_queue  = (uint8_t*)&EvtQueue;
+
+  HW_IPCC_BLE_Init();
+
+  BLE_IoBusEvtCallBackFunction = pInitHciConf->IoBusEvtCallBack;
+  BLE_IoBusAclDataTxAck = pInitHciConf->IoBusAclDataTxAck;
+
+  return 0;
+}
+
+int32_t TL_BLE_SendCmd( uint8_t* buffer, uint16_t size )
+{
+  (void)(buffer);
+  (void)(size);
+
+  ((TL_CmdPacket_t*)(TL_RefTable.p_ble_table->pcmd_buffer))->cmdserial.type = TL_BLECMD_PKT_TYPE;
+
+  OutputDbgTrace(TL_MB_BLE_CMD, TL_RefTable.p_ble_table->pcmd_buffer);
+
+  HW_IPCC_BLE_SendCmd();
+
+  return 0;
+}
+
+void HW_IPCC_BLE_RxEvtNot(void)
+{
+  TL_EvtPacket_t *phcievt;
+
+  while(LST_is_empty(&EvtQueue) == FALSE)
+  {
+    LST_remove_head (&EvtQueue, (tListNode **)&phcievt);
+
+    if ( ((phcievt->evtserial.evt.evtcode) == TL_BLEEVT_CS_OPCODE) || ((phcievt->evtserial.evt.evtcode) == TL_BLEEVT_CC_OPCODE ) )
+    {
+      OutputDbgTrace(TL_MB_BLE_CMD_RSP, (uint8_t*)phcievt);
+    }
+    else
+    {
+      OutputDbgTrace(TL_MB_BLE_ASYNCH_EVT, (uint8_t*)phcievt);
+    }
+
+    BLE_IoBusEvtCallBackFunction(phcievt);
+  }
+
+  return;
+}
+
+int32_t TL_BLE_SendAclData( uint8_t* buffer, uint16_t size )
+{
+  (void)(buffer);
+  (void)(size);
+
+  ((TL_AclDataPacket_t *)(TL_RefTable.p_ble_table->phci_acl_data_buffer))->AclDataSerial.type = TL_ACL_DATA_PKT_TYPE;
+
+  HW_IPCC_BLE_SendAclData();
+
+  return 0;
+}
+
+void HW_IPCC_BLE_AclDataAckNot(void)
+{
+  BLE_IoBusAclDataTxAck( );
+
+  return;
+}
+
+/******************************************************************************
+ * SYSTEM
+ ******************************************************************************/
+int32_t TL_SYS_Init( void* pConf  )
+{
+  MB_SysTable_t  * p_systable;
+
+  TL_SYS_InitConf_t *pInitHciConf = (TL_SYS_InitConf_t *) pConf;
+
+  LST_init_head (&SystemEvtQueue);
+  p_systable = TL_RefTable.p_sys_table;
+  p_systable->pcmd_buffer = pInitHciConf->p_cmdbuffer;
+  p_systable->sys_queue = (uint8_t*)&SystemEvtQueue;
+
+  HW_IPCC_SYS_Init();
+
+  SYS_CMD_IoBusCallBackFunction = pInitHciConf->IoBusCallBackCmdEvt;
+  SYS_EVT_IoBusCallBackFunction = pInitHciConf->IoBusCallBackUserEvt;
+
+  return 0;
+}
+
+int32_t TL_SYS_SendCmd( uint8_t* buffer, uint16_t size )
+{
+  (void)(buffer);
+  (void)(size);
+
+  ((TL_CmdPacket_t *)(TL_RefTable.p_sys_table->pcmd_buffer))->cmdserial.type = TL_SYSCMD_PKT_TYPE;
+
+  OutputDbgTrace(TL_MB_SYS_CMD, TL_RefTable.p_sys_table->pcmd_buffer);
+
+  HW_IPCC_SYS_SendCmd();
+
+  return 0;
+}
+
+void HW_IPCC_SYS_CmdEvtNot(void)
+{
+  OutputDbgTrace(TL_MB_SYS_CMD_RSP, (uint8_t*)(TL_RefTable.p_sys_table->pcmd_buffer) );
+
+  SYS_CMD_IoBusCallBackFunction( (TL_EvtPacket_t*)(TL_RefTable.p_sys_table->pcmd_buffer) );
+
+  return;
+}
+
+void HW_IPCC_SYS_EvtNot( void )
+{
+  TL_EvtPacket_t *p_evt;
+
+  while(LST_is_empty(&SystemEvtQueue) == FALSE)
+  {
+    LST_remove_head (&SystemEvtQueue, (tListNode **)&p_evt);
+
+    OutputDbgTrace(TL_MB_SYS_ASYNCH_EVT, (uint8_t*)p_evt );
+
+    SYS_EVT_IoBusCallBackFunction( p_evt );
+  }
+
+  return;
+}
+
+/******************************************************************************
+ * THREAD
+ ******************************************************************************/
+#ifdef THREAD_WB
+void TL_THREAD_Init( TL_TH_Config_t *p_Config )
+{
+  MB_ThreadTable_t  * p_thread_table;
+
+  p_thread_table = TL_RefTable.p_thread_table;
+
+  p_thread_table->clicmdrsp_buffer = p_Config->p_ThreadCliRspBuffer;
+  p_thread_table->otcmdrsp_buffer = p_Config->p_ThreadOtCmdRspBuffer;
+  p_thread_table->notack_buffer = p_Config->p_ThreadNotAckBuffer;
+  p_thread_table->clinot_buffer = p_Config->p_ThreadCliNotBuffer;
+
+  HW_IPCC_THREAD_Init();
+
+  return;
+}
+
+void TL_OT_SendCmd( void )
+{
+  ((TL_CmdPacket_t *)(TL_RefTable.p_thread_table->otcmdrsp_buffer))->cmdserial.type = TL_OTCMD_PKT_TYPE;
+
+  HW_IPCC_OT_SendCmd();
+
+  return;
+}
+
+void TL_CLI_SendCmd( void )
+{
+  ((TL_CmdPacket_t *)(TL_RefTable.p_thread_table->clicmdrsp_buffer))->cmdserial.type = TL_CLICMD_PKT_TYPE;
+
+  HW_IPCC_CLI_SendCmd();
+
+  return;
+}
+
+void TL_THREAD_SendAck ( void )
+{
+  ((TL_CmdPacket_t *)(TL_RefTable.p_thread_table->notack_buffer))->cmdserial.type = TL_OTACK_PKT_TYPE;
+
+  HW_IPCC_THREAD_SendAck();
+
+  return;
+}
+
+void TL_THREAD_CliSendAck ( void )
+{
+  ((TL_CmdPacket_t *)(TL_RefTable.p_thread_table->notack_buffer))->cmdserial.type = TL_OTACK_PKT_TYPE;
+
+  HW_IPCC_THREAD_CliSendAck();
+
+  return;
+}
+
+void HW_IPCC_OT_CmdEvtNot(void)
+{
+  TL_OT_CmdEvtReceived( (TL_EvtPacket_t*)(TL_RefTable.p_thread_table->otcmdrsp_buffer) );
+
+  return;
+}
+
+void HW_IPCC_THREAD_EvtNot( void )
+{
+  TL_THREAD_NotReceived( (TL_EvtPacket_t*)(TL_RefTable.p_thread_table->notack_buffer) );
+
+  return;
+}
+
+void HW_IPCC_THREAD_CliEvtNot( void )
+{
+  TL_THREAD_CliNotReceived( (TL_EvtPacket_t*)(TL_RefTable.p_thread_table->clinot_buffer) );
+
+  return;
+}
+
+__WEAK void TL_OT_CmdEvtReceived( TL_EvtPacket_t * Otbuffer  ){};
+__WEAK void TL_THREAD_NotReceived( TL_EvtPacket_t * Notbuffer ){};
+__WEAK void TL_THREAD_CliNotReceived( TL_EvtPacket_t * Notbuffer ){};
+
+#endif /* THREAD_WB */
+
+/******************************************************************************
+ * LLD TESTS
+ ******************************************************************************/
+#ifdef LLD_TESTS_WB
+void TL_LLDTESTS_Init( TL_LLD_tests_Config_t *p_Config )
+{
+  MB_LldTestsTable_t  * p_lld_tests_table;
+
+  p_lld_tests_table = TL_RefTable.p_lld_tests_table;
+  p_lld_tests_table->clicmdrsp_buffer = p_Config->p_LldTestsCliCmdRspBuffer;
+  p_lld_tests_table->m0cmd_buffer = p_Config->p_LldTestsM0CmdBuffer;
+  HW_IPCC_LLDTESTS_Init();
+  return;
+}
+
+void TL_LLDTESTS_SendCliCmd( void )
+{
+  ((TL_CmdPacket_t *)(TL_RefTable.p_lld_tests_table->clicmdrsp_buffer))->cmdserial.type = TL_CLICMD_PKT_TYPE;
+  HW_IPCC_LLDTESTS_SendCliCmd();
+  return;
+}
+
+void HW_IPCC_LLDTESTS_ReceiveCliRsp( void )
+{
+  TL_LLDTESTS_ReceiveCliRsp( (TL_CmdPacket_t*)(TL_RefTable.p_lld_tests_table->clicmdrsp_buffer) );
+  return;
+}
+
+void TL_LLDTESTS_SendCliRspAck( void )
+{
+  HW_IPCC_LLDTESTS_SendCliRspAck();
+  return;
+}
+
+void HW_IPCC_LLDTESTS_ReceiveM0Cmd( void )
+{
+  TL_LLDTESTS_ReceiveM0Cmd( (TL_CmdPacket_t*)(TL_RefTable.p_lld_tests_table->m0cmd_buffer) );
+  return;
+}
+
+
+void TL_LLDTESTS_SendM0CmdAck( void )
+{
+  HW_IPCC_LLDTESTS_SendM0CmdAck();
+  return;
+}
+
+__WEAK void TL_LLDTESTS_ReceiveCliRsp( TL_CmdPacket_t * Notbuffer ){};
+__WEAK void TL_LLDTESTS_ReceiveM0Cmd( TL_CmdPacket_t * Notbuffer ){};
+#endif /* LLD_TESTS_WB */
+
+/******************************************************************************
+ * BLE LLD
+ ******************************************************************************/
+#ifdef BLE_LLD_WB
+void TL_BLE_LLD_Init( TL_BLE_LLD_Config_t *p_Config )
+{
+  MB_BleLldTable_t  * p_ble_lld_table;
+
+  p_ble_lld_table = TL_RefTable.p_ble_lld_table;
+  p_ble_lld_table->cmdrsp_buffer = p_Config->p_BleLldCmdRspBuffer;
+  p_ble_lld_table->m0cmd_buffer = p_Config->p_BleLldM0CmdBuffer;
+  HW_IPCC_BLE_LLD_Init();
+  return;
+}
+
+void TL_BLE_LLD_SendCliCmd( void )
+{
+  ((TL_CmdPacket_t *)(TL_RefTable.p_ble_lld_table->cmdrsp_buffer))->cmdserial.type = TL_CLICMD_PKT_TYPE;
+  HW_IPCC_BLE_LLD_SendCliCmd();
+  return;
+}
+
+void HW_IPCC_BLE_LLD_ReceiveCliRsp( void )
+{
+  TL_BLE_LLD_ReceiveCliRsp( (TL_CmdPacket_t*)(TL_RefTable.p_ble_lld_table->cmdrsp_buffer) );
+  return;
+}
+
+void TL_BLE_LLD_SendCliRspAck( void )
+{
+  HW_IPCC_BLE_LLD_SendCliRspAck();
+  return;
+}
+
+void HW_IPCC_BLE_LLD_ReceiveM0Cmd( void )
+{
+  TL_BLE_LLD_ReceiveM0Cmd( (TL_CmdPacket_t*)(TL_RefTable.p_ble_lld_table->m0cmd_buffer) );
+  return;
+}
+
+
+void TL_BLE_LLD_SendM0CmdAck( void )
+{
+  HW_IPCC_BLE_LLD_SendM0CmdAck();
+  return;
+}
+
+__WEAK void TL_BLE_LLD_ReceiveCliRsp( TL_CmdPacket_t * Notbuffer ){};
+__WEAK void TL_BLE_LLD_ReceiveM0Cmd( TL_CmdPacket_t * Notbuffer ){};
+
+/* Transparent Mode */
+void TL_BLE_LLD_SendCmd( void )
+{
+  ((TL_CmdPacket_t *)(TL_RefTable.p_ble_lld_table->cmdrsp_buffer))->cmdserial.type = TL_CLICMD_PKT_TYPE;
+  HW_IPCC_BLE_LLD_SendCmd();
+  return;
+}
+
+void HW_IPCC_BLE_LLD_ReceiveRsp( void )
+{
+  TL_BLE_LLD_ReceiveRsp( (TL_CmdPacket_t*)(TL_RefTable.p_ble_lld_table->cmdrsp_buffer) );
+  return;
+}
+
+void TL_BLE_LLD_SendRspAck( void )
+{
+  HW_IPCC_BLE_LLD_SendRspAck();
+  return;
+}
+#endif /* BLE_LLD_WB */
+
+#ifdef MAC_802_15_4_WB
+/******************************************************************************
+ * MAC 802.15.4
+ ******************************************************************************/
+void TL_MAC_802_15_4_Init( TL_MAC_802_15_4_Config_t *p_Config )
+{
+  MB_Mac_802_15_4_t  * p_mac_802_15_4_table;
+
+  p_mac_802_15_4_table = TL_RefTable.p_mac_802_15_4_table;
+
+  p_mac_802_15_4_table->p_cmdrsp_buffer = p_Config->p_Mac_802_15_4_CmdRspBuffer;
+  p_mac_802_15_4_table->p_notack_buffer = p_Config->p_Mac_802_15_4_NotAckBuffer;
+
+  HW_IPCC_MAC_802_15_4_Init();
+
+  return;
+}
+
+void TL_MAC_802_15_4_SendCmd( void )
+{
+  ((TL_CmdPacket_t *)(TL_RefTable.p_mac_802_15_4_table->p_cmdrsp_buffer))->cmdserial.type = TL_OTCMD_PKT_TYPE;
+
+  HW_IPCC_MAC_802_15_4_SendCmd();
+
+  return;
+}
+
+void TL_MAC_802_15_4_SendAck ( void )
+{
+  ((TL_CmdPacket_t *)(TL_RefTable.p_mac_802_15_4_table->p_notack_buffer))->cmdserial.type = TL_OTACK_PKT_TYPE;
+
+  HW_IPCC_MAC_802_15_4_SendAck();
+
+  return;
+}
+
+void HW_IPCC_MAC_802_15_4_CmdEvtNot(void)
+{
+  TL_MAC_802_15_4_CmdEvtReceived( (TL_EvtPacket_t*)(TL_RefTable.p_mac_802_15_4_table->p_cmdrsp_buffer) );
+
+  return;
+}
+
+void HW_IPCC_MAC_802_15_4_EvtNot( void )
+{
+  TL_MAC_802_15_4_NotReceived( (TL_EvtPacket_t*)(TL_RefTable.p_mac_802_15_4_table->p_notack_buffer) );
+
+  return;
+}
+
+__WEAK void TL_MAC_802_15_4_CmdEvtReceived( TL_EvtPacket_t * Otbuffer  ){};
+__WEAK void TL_MAC_802_15_4_NotReceived( TL_EvtPacket_t * Notbuffer ){};
+#endif
+
+#ifdef ZIGBEE_WB
+/******************************************************************************
+ * ZIGBEE
+ ******************************************************************************/
+void TL_ZIGBEE_Init( TL_ZIGBEE_Config_t *p_Config )
+{
+  MB_ZigbeeTable_t  * p_zigbee_table;
+
+  p_zigbee_table = TL_RefTable.p_zigbee_table;
+  p_zigbee_table->appliCmdM4toM0_buffer = p_Config->p_ZigbeeOtCmdRspBuffer;
+  p_zigbee_table->notifM0toM4_buffer = p_Config->p_ZigbeeNotAckBuffer;
+  p_zigbee_table->requestM0toM4_buffer = p_Config->p_ZigbeeNotifRequestBuffer;
+
+  HW_IPCC_ZIGBEE_Init();
+
+  return;
+}
+
+/* Zigbee M4 to M0 Request */
+void TL_ZIGBEE_SendM4RequestToM0( void )
+{
+  ((TL_CmdPacket_t *)(TL_RefTable.p_zigbee_table->appliCmdM4toM0_buffer))->cmdserial.type = TL_OTCMD_PKT_TYPE;
+
+  HW_IPCC_ZIGBEE_SendM4RequestToM0();
+
+  return;
+}
+
+/* Used to receive an ACK from the M0 */
+void HW_IPCC_ZIGBEE_RecvAppliAckFromM0(void)
+{
+  TL_ZIGBEE_CmdEvtReceived( (TL_EvtPacket_t*)(TL_RefTable.p_zigbee_table->appliCmdM4toM0_buffer) );
+
+  return;
+}
+
+/* Zigbee notification from M0 to M4 */
+void HW_IPCC_ZIGBEE_RecvM0NotifyToM4( void )
+{
+  TL_ZIGBEE_NotReceived( (TL_EvtPacket_t*)(TL_RefTable.p_zigbee_table->notifM0toM4_buffer) );
+
+  return;
+}
+
+/* Send an ACK to the M0 for a Notification */
+void TL_ZIGBEE_SendM4AckToM0Notify ( void )
+{
+  ((TL_CmdPacket_t *)(TL_RefTable.p_zigbee_table->notifM0toM4_buffer))->cmdserial.type = TL_OTACK_PKT_TYPE;
+
+  HW_IPCC_ZIGBEE_SendM4AckToM0Notify();
+
+  return;
+}
+
+/* Zigbee M0 to M4 Request */
+void HW_IPCC_ZIGBEE_RecvM0RequestToM4( void )
+{
+  TL_ZIGBEE_M0RequestReceived( (TL_EvtPacket_t*)(TL_RefTable.p_zigbee_table->requestM0toM4_buffer) );
+
+  return;
+}
+
+/* Send an ACK to the M0 for a Request */
+void TL_ZIGBEE_SendM4AckToM0Request(void)
+{
+  ((TL_CmdPacket_t *)(TL_RefTable.p_zigbee_table->requestM0toM4_buffer))->cmdserial.type = TL_OTACK_PKT_TYPE;
+
+  HW_IPCC_ZIGBEE_SendM4AckToM0Request();
+
+  return;
+}
+
+
+__WEAK void TL_ZIGBEE_CmdEvtReceived( TL_EvtPacket_t * Otbuffer  ){};
+__WEAK void TL_ZIGBEE_NotReceived( TL_EvtPacket_t * Notbuffer ){};
+#endif
+
+
+
+/******************************************************************************
+ * MEMORY MANAGER
+ ******************************************************************************/
+void TL_MM_Init( TL_MM_Config_t *p_Config )
+{
+  static MB_MemManagerTable_t  * p_mem_manager_table;
+
+  LST_init_head (&FreeBufQueue);
+  LST_init_head (&LocalFreeBufQueue);
+
+  p_mem_manager_table = TL_RefTable.p_mem_manager_table;
+
+  p_mem_manager_table->blepool = p_Config->p_AsynchEvtPool;
+  p_mem_manager_table->blepoolsize = p_Config->AsynchEvtPoolSize;
+  p_mem_manager_table->pevt_free_buffer_queue = (uint8_t*)&FreeBufQueue;
+  p_mem_manager_table->spare_ble_buffer = p_Config->p_BleSpareEvtBuffer;
+  p_mem_manager_table->spare_sys_buffer = p_Config->p_SystemSpareEvtBuffer;
+  p_mem_manager_table->traces_evt_pool = p_Config->p_TracesEvtPool;
+  p_mem_manager_table->tracespoolsize = p_Config->TracesEvtPoolSize;
+
+  return;
+}
+
+void TL_MM_EvtDone(TL_EvtPacket_t * phcievt)
+{
+  LST_insert_tail(&LocalFreeBufQueue, (tListNode *)phcievt);
+
+  OutputDbgTrace(TL_MB_MM_RELEASE_BUFFER, (uint8_t*)phcievt);
+
+  HW_IPCC_MM_SendFreeBuf( SendFreeBuf );
+
+  return;
+}
+
+static void SendFreeBuf( void )
+{
+  tListNode *p_node;
+
+  while ( FALSE == LST_is_empty (&LocalFreeBufQueue) )
+  {
+    LST_remove_head( &LocalFreeBufQueue, (tListNode **)&p_node );
+    LST_insert_tail( (tListNode*)(TL_RefTable.p_mem_manager_table->pevt_free_buffer_queue), p_node );
+  }
+
+  return;
+}
+
+/******************************************************************************
+ * TRACES
+ ******************************************************************************/
+void TL_TRACES_Init( void )
+{
+  LST_init_head (&TracesEvtQueue);
+
+  TL_RefTable.p_traces_table->traces_queue = (uint8_t*)&TracesEvtQueue;
+
+  HW_IPCC_TRACES_Init();
+
+  return;
+}
+
+void HW_IPCC_TRACES_EvtNot(void)
+{
+  TL_EvtPacket_t *phcievt;
+
+  while(LST_is_empty(&TracesEvtQueue) == FALSE)
+  {
+    LST_remove_head (&TracesEvtQueue, (tListNode **)&phcievt);
+    TL_TRACES_EvtReceived( phcievt );
+  }
+
+  return;
+}
+
+__WEAK void TL_TRACES_EvtReceived( TL_EvtPacket_t * hcievt )
+{
+  (void)(hcievt);
+}
+
+/******************************************************************************
+ * DEBUG INFORMATION
+ ******************************************************************************/
+static void OutputDbgTrace(TL_MB_PacketType_t packet_type, uint8_t* buffer)
+{
+  TL_EvtPacket_t *p_evt_packet;
+  TL_CmdPacket_t *p_cmd_packet;
+  TL_EvtSerial_t *p_cmd_rsp_packet;
+
+  switch(packet_type)
+  {
+    case TL_MB_MM_RELEASE_BUFFER:
+      p_evt_packet = (TL_EvtPacket_t*)buffer;
+      switch(p_evt_packet->evtserial.evt.evtcode)
+      {
+        case TL_BLEEVT_CS_OPCODE:
+          TL_MM_DBG_MSG("mm evt released: 0x%02X", p_evt_packet->evtserial.evt.evtcode);
+          TL_MM_DBG_MSG(" cmd opcode: 0x%04X", ((TL_CsEvt_t*)(p_evt_packet->evtserial.evt.payload))->cmdcode);
+          TL_MM_DBG_MSG(" buffer addr: 0x%08X", p_evt_packet);
+          break;
+
+        case TL_BLEEVT_CC_OPCODE:
+          TL_MM_DBG_MSG("mm evt released: 0x%02X", p_evt_packet->evtserial.evt.evtcode);
+          TL_MM_DBG_MSG(" cmd opcode: 0x%04X", ((TL_CcEvt_t*)(p_evt_packet->evtserial.evt.payload))->cmdcode);
+          TL_MM_DBG_MSG(" buffer addr: 0x%08X", p_evt_packet);
+          break;
+
+        case TL_BLEEVT_VS_OPCODE:
+          TL_MM_DBG_MSG("mm evt released: 0x%02X", p_evt_packet->evtserial.evt.evtcode);
+          TL_MM_DBG_MSG(" subevtcode: 0x%04X", ((TL_AsynchEvt_t*)(p_evt_packet->evtserial.evt.payload))->subevtcode);
+          TL_MM_DBG_MSG(" buffer addr: 0x%08X", p_evt_packet);
+          break;
+
+        default:
+          TL_MM_DBG_MSG("mm evt released: 0x%02X", p_evt_packet->evtserial.evt.evtcode);
+          TL_MM_DBG_MSG(" buffer addr: 0x%08X", p_evt_packet);
+          break;
+      }
+
+      TL_MM_DBG_MSG("\r\n");
+      break;
+
+    case TL_MB_BLE_CMD:
+      p_cmd_packet = (TL_CmdPacket_t*)buffer;
+      TL_HCI_CMD_DBG_MSG("ble cmd: 0x%04X", p_cmd_packet->cmdserial.cmd.cmdcode);
+      if(p_cmd_packet->cmdserial.cmd.plen != 0)
+      {
+        TL_HCI_CMD_DBG_MSG(" payload:");
+        TL_HCI_CMD_DBG_BUF(p_cmd_packet->cmdserial.cmd.payload, p_cmd_packet->cmdserial.cmd.plen, "");
+      }
+      TL_HCI_CMD_DBG_MSG("\r\n");
+
+      TL_HCI_CMD_DBG_RAW(&p_cmd_packet->cmdserial, p_cmd_packet->cmdserial.cmd.plen+TL_CMD_HDR_SIZE);
+      break;
+
+    case TL_MB_BLE_CMD_RSP:
+      p_evt_packet = (TL_EvtPacket_t*)buffer;
+      switch(p_evt_packet->evtserial.evt.evtcode)
+      {
+        case TL_BLEEVT_CS_OPCODE:
+          TL_HCI_CMD_DBG_MSG("ble rsp: 0x%02X", p_evt_packet->evtserial.evt.evtcode);
+          TL_HCI_CMD_DBG_MSG(" cmd opcode: 0x%04X", ((TL_CsEvt_t*)(p_evt_packet->evtserial.evt.payload))->cmdcode);
+          TL_HCI_CMD_DBG_MSG(" numhci: 0x%02X", ((TL_CsEvt_t*)(p_evt_packet->evtserial.evt.payload))->numcmd);
+          TL_HCI_CMD_DBG_MSG(" status: 0x%02X", ((TL_CsEvt_t*)(p_evt_packet->evtserial.evt.payload))->status);
+          break;
+
+        case TL_BLEEVT_CC_OPCODE:
+          TL_HCI_CMD_DBG_MSG("ble rsp: 0x%02X", p_evt_packet->evtserial.evt.evtcode);
+          TL_HCI_CMD_DBG_MSG(" cmd opcode: 0x%04X", ((TL_CcEvt_t*)(p_evt_packet->evtserial.evt.payload))->cmdcode);
+          TL_HCI_CMD_DBG_MSG(" numhci: 0x%02X", ((TL_CcEvt_t*)(p_evt_packet->evtserial.evt.payload))->numcmd);
+          TL_HCI_CMD_DBG_MSG(" status: 0x%02X", ((TL_CcEvt_t*)(p_evt_packet->evtserial.evt.payload))->payload[0]);
+          if((p_evt_packet->evtserial.evt.plen-4) != 0)
+          {
+            TL_HCI_CMD_DBG_MSG(" payload:");
+            TL_HCI_CMD_DBG_BUF(&((TL_CcEvt_t*)(p_evt_packet->evtserial.evt.payload))->payload[1], p_evt_packet->evtserial.evt.plen-4, "");
+          }
+          break;
+
+        default:
+          TL_HCI_CMD_DBG_MSG("unknown ble rsp received: %02X", p_evt_packet->evtserial.evt.evtcode);
+          break;
+      }
+
+      TL_HCI_CMD_DBG_MSG("\r\n");
+
+      TL_HCI_CMD_DBG_RAW(&p_evt_packet->evtserial, p_evt_packet->evtserial.evt.plen+TL_EVT_HDR_SIZE);
+      break;
+
+    case TL_MB_BLE_ASYNCH_EVT:
+      p_evt_packet = (TL_EvtPacket_t*)buffer;
+      if(p_evt_packet->evtserial.evt.evtcode != TL_BLEEVT_VS_OPCODE)
+      {
+        TL_HCI_EVT_DBG_MSG("ble evt: 0x%02X", p_evt_packet->evtserial.evt.evtcode);
+        if((p_evt_packet->evtserial.evt.plen) != 0)
+        {
+          TL_HCI_EVT_DBG_MSG(" payload:");
+          TL_HCI_EVT_DBG_BUF(p_evt_packet->evtserial.evt.payload, p_evt_packet->evtserial.evt.plen, "");
+        }
+      }
+      else
+      {
+        TL_HCI_EVT_DBG_MSG("ble evt: 0x%02X", p_evt_packet->evtserial.evt.evtcode);
+        TL_HCI_EVT_DBG_MSG(" subevtcode: 0x%04X", ((TL_AsynchEvt_t*)(p_evt_packet->evtserial.evt.payload))->subevtcode);
+        if((p_evt_packet->evtserial.evt.plen-2) != 0)
+        {
+          TL_HCI_EVT_DBG_MSG(" payload:");
+          TL_HCI_EVT_DBG_BUF(((TL_AsynchEvt_t*)(p_evt_packet->evtserial.evt.payload))->payload, p_evt_packet->evtserial.evt.plen-2, "");
+        }
+      }
+
+      TL_HCI_EVT_DBG_MSG("\r\n");
+
+      TL_HCI_EVT_DBG_RAW(&p_evt_packet->evtserial, p_evt_packet->evtserial.evt.plen+TL_EVT_HDR_SIZE);
+      break;
+
+    case TL_MB_SYS_CMD:
+      p_cmd_packet = (TL_CmdPacket_t*)buffer;
+
+      TL_SHCI_CMD_DBG_MSG("sys cmd: 0x%04X", p_cmd_packet->cmdserial.cmd.cmdcode);
+
+      if(p_cmd_packet->cmdserial.cmd.plen != 0)
+      {
+        TL_SHCI_CMD_DBG_MSG(" payload:");
+        TL_SHCI_CMD_DBG_BUF(p_cmd_packet->cmdserial.cmd.payload, p_cmd_packet->cmdserial.cmd.plen, "");
+      }
+      TL_SHCI_CMD_DBG_MSG("\r\n");
+
+      TL_SHCI_CMD_DBG_RAW(&p_cmd_packet->cmdserial, p_cmd_packet->cmdserial.cmd.plen+TL_CMD_HDR_SIZE);
+      break;
+
+    case TL_MB_SYS_CMD_RSP:
+      p_cmd_rsp_packet = (TL_EvtSerial_t*)buffer;
+      switch(p_cmd_rsp_packet->evt.evtcode)
+      {
+        case TL_BLEEVT_CC_OPCODE:
+          TL_SHCI_CMD_DBG_MSG("sys rsp: 0x%02X", p_cmd_rsp_packet->evt.evtcode);
+          TL_SHCI_CMD_DBG_MSG(" cmd opcode: 0x%02X", ((TL_CcEvt_t*)(p_cmd_rsp_packet->evt.payload))->cmdcode);
+          TL_SHCI_CMD_DBG_MSG(" status: 0x%02X", ((TL_CcEvt_t*)(p_cmd_rsp_packet->evt.payload))->payload[0]);
+          if((p_cmd_rsp_packet->evt.plen-4) != 0)
+          {
+            TL_SHCI_CMD_DBG_MSG(" payload:");
+            TL_SHCI_CMD_DBG_BUF(&((TL_CcEvt_t*)(p_cmd_rsp_packet->evt.payload))->payload[1], p_cmd_rsp_packet->evt.plen-4, "");
+          }
+          break;
+
+        default:
+          TL_SHCI_CMD_DBG_MSG("unknown sys rsp received: %02X", p_cmd_rsp_packet->evt.evtcode);
+          break;
+      }
+
+      TL_SHCI_CMD_DBG_MSG("\r\n");
+
+      TL_SHCI_CMD_DBG_RAW(&p_cmd_rsp_packet->evt, p_cmd_rsp_packet->evt.plen+TL_EVT_HDR_SIZE);
+      break;
+
+    case  TL_MB_SYS_ASYNCH_EVT:
+      p_evt_packet = (TL_EvtPacket_t*)buffer;
+      if(p_evt_packet->evtserial.evt.evtcode != TL_BLEEVT_VS_OPCODE)
+      {
+        TL_SHCI_EVT_DBG_MSG("unknown sys evt received: %02X", p_evt_packet->evtserial.evt.evtcode);
+      }
+      else
+      {
+        TL_SHCI_EVT_DBG_MSG("sys evt: 0x%02X", p_evt_packet->evtserial.evt.evtcode);
+        TL_SHCI_EVT_DBG_MSG(" subevtcode: 0x%04X", ((TL_AsynchEvt_t*)(p_evt_packet->evtserial.evt.payload))->subevtcode);
+        if((p_evt_packet->evtserial.evt.plen-2) != 0)
+        {
+          TL_SHCI_EVT_DBG_MSG(" payload:");
+          TL_SHCI_EVT_DBG_BUF(((TL_AsynchEvt_t*)(p_evt_packet->evtserial.evt.payload))->payload, p_evt_packet->evtserial.evt.plen-2, "");
+        }
+      }
+
+      TL_SHCI_EVT_DBG_MSG("\r\n");
+
+      TL_SHCI_EVT_DBG_RAW(&p_evt_packet->evtserial, p_evt_packet->evtserial.evt.plen+TL_EVT_HDR_SIZE);
+      break;
+
+    default:
+      break;
+  }
+
+  return;
+}
+#endif /* STM32WBxx */
diff --git a/src/utility/STM32_WPAN/utilities_conf.h b/src/utility/STM32_WPAN/utilities_conf.h
new file mode 100644
index 00000000..d6221a73
--- /dev/null
+++ b/src/utility/STM32_WPAN/utilities_conf.h
@@ -0,0 +1,66 @@
+/* USER CODE BEGIN Header */
+/**
+  ******************************************************************************
+  * @file    utilities_conf.h
+  * @author  MCD Application Team
+  * @brief   Configuration file for STM32 Utilities.
+  ******************************************************************************
+  * @attention
+  *
+  * Copyright (c) 2019-2021 STMicroelectronics.
+  * All rights reserved.
+  *
+  * This software is licensed under terms that can be found in the LICENSE file
+  * in the root directory of this software component.
+  * If no LICENSE file comes with this software, it is provided AS-IS.
+  *
+  ******************************************************************************
+  */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef UTILITIES_CONF_H
+#define UTILITIES_CONF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "cmsis_compiler.h"
+#include "string.h"
+#include "app_conf.h"
+
+/******************************************************************************
+ * common
+ ******************************************************************************/
+#define UTILS_ENTER_CRITICAL_SECTION( )   uint32_t primask_bit = __get_PRIMASK( );\
+                                          __disable_irq( )
+
+#define UTILS_EXIT_CRITICAL_SECTION( )          __set_PRIMASK( primask_bit )
+
+#define UTILS_MEMSET8( dest, value, size )      memset( dest, value, size);
+
+/******************************************************************************
+ * tiny low power manager
+ * (any macro that does not need to be modified can be removed)
+ ******************************************************************************/
+#define UTIL_LPM_INIT_CRITICAL_SECTION( )
+#define UTIL_LPM_ENTER_CRITICAL_SECTION( )      UTILS_ENTER_CRITICAL_SECTION( )
+#define UTIL_LPM_EXIT_CRITICAL_SECTION( )       UTILS_EXIT_CRITICAL_SECTION( )
+
+/******************************************************************************
+ * sequencer
+ * (any macro that does not need to be modified can be removed)
+ ******************************************************************************/
+#define UTIL_SEQ_INIT_CRITICAL_SECTION( )
+#define UTIL_SEQ_ENTER_CRITICAL_SECTION( )      UTILS_ENTER_CRITICAL_SECTION( )
+#define UTIL_SEQ_EXIT_CRITICAL_SECTION( )       UTILS_EXIT_CRITICAL_SECTION( )
+#define UTIL_SEQ_CONF_TASK_NBR                  (32)
+#define UTIL_SEQ_CONF_PRIO_NBR                  CFG_SCH_PRIO_NBR
+#define UTIL_SEQ_MEMSET8( dest, value, size )   UTILS_MEMSET8( dest, value, size )
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*UTILITIES_CONF_H */
diff --git a/src/utility/btct.cpp b/src/utility/btct.cpp
index 77a5e818..cb67fdf5 100644
--- a/src/utility/btct.cpp
+++ b/src/utility/btct.cpp
@@ -1,7 +1,7 @@
 #include "btct.h"
 #include <Arduino.h>
 #include "HCI.h"
-#include "ArduinoBLE.h"
+#include "STM32duinoBLE.h"
 BluetoothCryptoToolbox::BluetoothCryptoToolbox(){}
 //    In step 1, AES-128 with key K is applied to an all-zero input block.
 //    In step 2, K1 is derived through the following operation:
@@ -37,6 +37,9 @@ void BluetoothCryptoToolbox::printBytes(uint8_t bytes[], uint8_t length){
         Serial.print(bytes[i],HEX);
     }
     Serial.print('\n');
+#else
+    (void)bytes;
+    (void)length;
 #endif
 }
 
@@ -130,7 +133,7 @@ int BluetoothCryptoToolbox::ah(uint8_t k[16], uint8_t r[3], uint8_t* result)
 }
 void BluetoothCryptoToolbox::testAh()
 {
-    uint8_t irk[16] = {0xec,0x02,0x34,0xa3,0x57,0xc8,0xad,0x05,0x34,0x10,0x10,0xa6,0x0a,0x39,0x7d,0x9b};         
+    uint8_t irk[16] = {0xec,0x02,0x34,0xa3,0x57,0xc8,0xad,0x05,0x34,0x10,0x10,0xa6,0x0a,0x39,0x7d,0x9b};
     uint8_t expected_final[3] = {0x0d,0xfb,0xaa};
     uint8_t ourResult[3];
     ah(irk, expected_final, ourResult);
@@ -165,14 +168,12 @@ void BluetoothCryptoToolbox::testg2(){
     uint8_t Y[16] = {0xa6,0xe8,0xe7,0xcc,0x25,0xa7,0x5f,0x6e,0x21,0x65,0x83,0xf7,0xff,0x3d,0xc4,0xcf};
     uint8_t out[4];
 
-    uint32_t expected = 0;
     g2(U,V,X,Y,out);
     uint32_t result = 0;
     for(int i=0; i<4; i++) result += out[i] << 8*i;
 
 #ifdef _BLE_TRACE_
-    Serial.print("Expected :     ");
-    Serial.println(expected);
+    Serial.println("Expected :     0");
     Serial.print("Result   : ");
     Serial.println(result);
     Serial.println();
@@ -383,4 +384,4 @@ void BluetoothCryptoToolbox::xor_128(unsigned char *a, unsigned char *b, unsigne
         out[i] = a[i] ^ b[i];
     }
 }
-BluetoothCryptoToolbox btct;
\ No newline at end of file
+BluetoothCryptoToolbox btct;