-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lib: hci: Add stm32wba BLE controller library
Make required changes to port STM32WBA BLE controller library on Zephyr. This work is made of two parts: - Configure zephyr/module.yaml to allow importation of the 2 required binary blobs that are required to get a BLE stack working with STM32WBA A copy of the license required to use these binary blobs (ST ULTIMATE LIBERTY) is made available as part of this commit - Import bluetooth controller related files that are needed to implement a BLE controller library. These files are provided with OSI approved Licenses (BSD-3 of MIT depending on the case). Signed-off-by: Erwan Gouriou <[email protected]>
- Loading branch information
1 parent
3990379
commit 57bcb4f
Showing
59 changed files
with
23,581 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Copyright 2019-2021 STMicroelectronics. | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without modification, | ||
are permitted provided that the following conditions are met: | ||
|
||
1. Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
|
||
2. Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation and/or | ||
other materials provided with the distribution. | ||
|
||
3. Neither the name of the copyright holder nor the names of its contributors | ||
may be used to endorse or promote products derived from this software without | ||
specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
STM32WBA BLE controller interfacing library | ||
########################################### | ||
|
||
Origin: | ||
ST Microelectronics | ||
https://github.com/STMicroelectronics/STM32CubeWBA | ||
|
||
Status: | ||
version v1.1.2 | ||
|
||
Purpose: | ||
This library is used on STM32WBA series to port BLE controller library in | ||
a hosting environment (Zephyr RTOS in current case). | ||
|
||
Description: | ||
|
||
This library is using the following files extracted the STM32CubeWBA package: | ||
Middlewares/ST/STM32_WPAN/ble/stack/include/auto/ble_types.h | ||
Middlewares/ST/STM32_WPAN/ble/stack/include/ble_bufsize.h | ||
Middlewares/ST/STM32_WPAN/ble/stack/include/ble_const.h | ||
Middlewares/ST/STM32_WPAN/ble/stack/include/ble_defs.h | ||
Middlewares/ST/STM32_WPAN/ble/stack/include/ble_std.h | ||
Middlewares/ST/STM32_WPAN/ble/stack/include/bleplat.h | ||
Middlewares/ST/STM32_WPAN/ble/stack/include/blestack.h | ||
Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/inc/_40nm_reg_files/DWC_ble154combo.h | ||
Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/inc/bsp.h | ||
Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/inc/common_types.h | ||
Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/inc/event_manager.h | ||
Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/inc/evnt_schdlr_gnrc_if.h | ||
Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/inc/hci.h | ||
Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/inc/ll_intf.h | ||
Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/inc/mem_intf.h | ||
Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/inc/os_wrapper.h | ||
Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/inc/power_table.h | ||
Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/config/ble_full/ll_fw_config.h | ||
Middlewares/ST/STM32_WPAN/link_layer/ll_sys/inc/linklayer_plat.h | ||
Middlewares/ST/STM32_WPAN/link_layer/ll_sys/inc/ll_sys.h | ||
Middlewares/ST/STM32_WPAN/link_layer/ll_sys/src/ll_sys_cs.c | ||
Middlewares/ST/STM32_WPAN/link_layer/ll_sys/src/ll_sys_dp_slp.c | ||
Middlewares/ST/STM32_WPAN/link_layer/ll_sys/src/ll_sys_intf.c | ||
Middlewares/ST/STM32_WPAN/link_layer/ll_sys/src/ll_sys_startup.c | ||
Middlewares/ST/STM32_WPAN/link_layer/ll_sys/inc/ll_sys_startup.h | ||
Middlewares/ST/STM32_WPAN/stm32_wpan_common.h | ||
Projects/NUCLEO-WBA52CG/Applications/BLE/BLE_HeartRate/Core/Inc/app_common.h | ||
Projects/NUCLEO-WBA52CG/Applications/BLE/BLE_HeartRate/Core/Inc/app_conf.h | ||
Projects/NUCLEO-WBA52CG/Applications/BLE/BLE_HeartRate/Core/Inc/app_entry.h | ||
Projects/NUCLEO-WBA52CG/Applications/BLE/BLE_HeartRate/Core/Inc/utilities_conf.h | ||
Projects/NUCLEO-WBA52CG/Applications/BLE/BLE_HeartRate/Core/Inc/main.h | ||
Projects/NUCLEO-WBA52CG/Applications/BLE/BLE_HeartRate/System/Modules/RTDebug/debug_signals.h | ||
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_HeartRate/System/Modules/RTDebug/RTDebug.c | ||
Projects/NUCLEO-WBA52CG/Applications/BLE/BLE_HeartRate/System/Modules/RTDebug/RTDebug.h | ||
Projects/NUCLEO-WBA52CG/Applications/BLE/BLE_HeartRate/System/Modules/RTDebug/local_debug_tables.h | ||
Projects/NUCLEO-WBA52CG/Applications/BLE/BLE_HeartRate/System/Modules/scm.c | ||
Projects/NUCLEO-WBA52CG/Applications/BLE/BLE_HeartRate/System/Modules/scm.h | ||
Projects/NUCLEO-WBA52CG/Applications/BLE/BLE_HeartRate/System/Modules/utilities_common.h | ||
Projects/NUCLEO-WBA52CG/Applications/BLE/BLE_HeartRate/System/Interfaces/hw.h | ||
Projects/NUCLEO-WBA52CG/Applications/BLE/BLE_HeartRate/System/Interfaces/hw_aes.c | ||
Projects/NUCLEO-WBA52CG/Applications/BLE/BLE_HeartRate/System/Interfaces/hw_if.h | ||
Projects/NUCLEO-WBA52CG/Applications/BLE/BLE_HeartRate/System/Interfaces/hw_pka.c | ||
Projects/NUCLEO-WBA52CG/Applications/BLE/BLE_HeartRate/System/Interfaces/pka_p256.c | ||
Projects/NUCLEO-WBA52CG/Applications/BLE/BLE_HeartRate/System/Config/Log/log_module.c | ||
Projects/NUCLEO-WBA52CG/Applications/BLE/BLE_HeartRate/System/Config/Log/log_module.h | ||
Projects/NUCLEO-WBA52CG/Applications/BLE/BLE_HeartRate/System/Config/Debug_GPIO/app_debug.h | ||
Projects/NUCLEO-WBA52CG/Applications/BLE/BLE_HeartRate/System/Config/Debug_GPIO/debug_config.h | ||
Projects/NUCLEO-WBA52CG/Applications/BLE/BLE_HeartRate/STM32_WPAN/Target/power_table.c | ||
Projects/NUCLEO-WBA52CG/Applications/BLE/BLE_HeartRate/STM32_WPAN/Target/bpka.c | ||
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_HeartRate/STM32_WPAN/Target/bpka.h | ||
Utilities/trace/adv_trace/stm32_adv_trace.h | ||
Utilities/misc/stm32_mem.h | ||
Utilities/tim_serv/stm32_timer.h | ||
Utilities/misc/stm32_tiny_vsnprintf.h | ||
|
||
Dependencies: | ||
This library depends on STM32Cube HAL API. | ||
It is available in stm32cube/stm32wbaxx/drivers | ||
|
||
URL: | ||
https://github.com/STMicroelectronics/STM32CubeWBA | ||
|
||
commit: | ||
v1.2.0 | ||
|
||
Maintained-by: | ||
External | ||
|
||
License: | ||
BSD-3-Clause | ||
MIT | ||
|
||
License Link: | ||
opensource.org/licenses/BSD-3-Clause | ||
opensource.org/license/mit | ||
|
||
Patch List: | ||
|
||
* NA |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
/* USER CODE BEGIN Header */ | ||
/** | ||
****************************************************************************** | ||
* @file RTDebug.c | ||
* @author MCD Application Team | ||
* @brief Real Time Debug module API definition | ||
****************************************************************************** | ||
* @attention | ||
* | ||
* Copyright (c) 2022 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 */ | ||
#include "RTDebug.h" | ||
#include "local_debug_tables.h" | ||
#include "stm32wbaxx_hal.h" | ||
#include <assert.h> | ||
|
||
#if(CFG_RT_DEBUG_GPIO_MODULE == 1) | ||
static_assert((sizeof(general_debug_table)/sizeof(st_gpio_debug_t)) == RT_DEBUG_SIGNALS_TOTAL_NUM, | ||
"Debug signals number is different from debug signal table size." | ||
); | ||
#endif /* CFG_RT_DEBUG_GPIO_MODULE */ | ||
|
||
/***********************/ | ||
/** System debug APIs **/ | ||
/***********************/ | ||
|
||
void SYSTEM_DEBUG_SIGNAL_SET(system_debug_signal_t signal) | ||
{ | ||
#if(CFG_RT_DEBUG_GPIO_MODULE == 1) | ||
GENERIC_DEBUG_GPIO_SET(signal, system_debug_table); | ||
#endif /* CFG_RT_DEBUG_GPIO_MODULE */ | ||
} | ||
|
||
void SYSTEM_DEBUG_SIGNAL_RESET(system_debug_signal_t signal) | ||
{ | ||
#if(CFG_RT_DEBUG_GPIO_MODULE == 1) | ||
GENERIC_DEBUG_GPIO_RESET(signal, system_debug_table); | ||
#endif /* CFG_RT_DEBUG_GPIO_MODULE */ | ||
} | ||
|
||
void SYSTEM_DEBUG_SIGNAL_TOGGLE(system_debug_signal_t signal) | ||
{ | ||
#if(CFG_RT_DEBUG_GPIO_MODULE == 1) | ||
GENERIC_DEBUG_GPIO_TOGGLE(signal, system_debug_table); | ||
#endif /* CFG_RT_DEBUG_GPIO_MODULE */ | ||
} | ||
|
||
/***************************/ | ||
/** Link Layer debug APIs **/ | ||
/***************************/ | ||
|
||
/* Link Layer debug API definition */ | ||
void LINKLAYER_DEBUG_SIGNAL_SET(linklayer_debug_signal_t signal) | ||
{ | ||
#if(CFG_RT_DEBUG_GPIO_MODULE == 1) | ||
GENERIC_DEBUG_GPIO_SET(signal, linklayer_debug_table); | ||
#endif /* CFG_RT_DEBUG_GPIO_MODULE */ | ||
} | ||
|
||
void LINKLAYER_DEBUG_SIGNAL_RESET(linklayer_debug_signal_t signal) | ||
{ | ||
#if(CFG_RT_DEBUG_GPIO_MODULE == 1) | ||
GENERIC_DEBUG_GPIO_RESET(signal, linklayer_debug_table); | ||
#endif /* CFG_RT_DEBUG_GPIO_MODULE */ | ||
} | ||
|
||
void LINKLAYER_DEBUG_SIGNAL_TOGGLE(linklayer_debug_signal_t signal) | ||
{ | ||
#if(CFG_RT_DEBUG_GPIO_MODULE == 1) | ||
GENERIC_DEBUG_GPIO_TOGGLE(signal, linklayer_debug_table); | ||
#endif /* CFG_RT_DEBUG_GPIO_MODULE */ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
/* USER CODE BEGIN Header */ | ||
/** | ||
****************************************************************************** | ||
* @file RTDebug.h | ||
* @author MCD Application Team | ||
* @brief Real Time Debug module API declaration | ||
****************************************************************************** | ||
* @attention | ||
* | ||
* Copyright (c) 2022 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 */ | ||
#ifndef SYSTEM_DEBUG_H | ||
#define SYSTEM_DEBUG_H | ||
|
||
#include "debug_config.h" | ||
|
||
#if(CFG_RT_DEBUG_GPIO_MODULE == 1) | ||
|
||
/**************************************************************/ | ||
/** Generic macros for local signal table index recuperation **/ | ||
/** and global signal table GPIO manipulation **/ | ||
/**************************************************************/ | ||
|
||
#define GENERIC_DEBUG_GPIO_SET(signal, table) do { \ | ||
uint32_t debug_table_idx = 0; \ | ||
if(signal >= sizeof(table)) \ | ||
{ \ | ||
return; \ | ||
} \ | ||
debug_table_idx = table[signal]; \ | ||
if(debug_table_idx != RT_DEBUG_SIGNAL_UNUSED) \ | ||
{ \ | ||
HAL_GPIO_WritePin(general_debug_table[debug_table_idx].GPIO_port, \ | ||
general_debug_table[debug_table_idx].GPIO_pin, \ | ||
GPIO_PIN_SET); \ | ||
} \ | ||
} while(0) | ||
|
||
#define GENERIC_DEBUG_GPIO_RESET(signal, table) do { \ | ||
uint32_t debug_table_idx = 0; \ | ||
if(signal >= sizeof(table)) \ | ||
{ \ | ||
return; \ | ||
} \ | ||
debug_table_idx = table[signal]; \ | ||
if(debug_table_idx != RT_DEBUG_SIGNAL_UNUSED) \ | ||
{ \ | ||
HAL_GPIO_WritePin(general_debug_table[debug_table_idx].GPIO_port, \ | ||
general_debug_table[debug_table_idx].GPIO_pin, \ | ||
GPIO_PIN_RESET); \ | ||
} \ | ||
} while(0) | ||
|
||
#define GENERIC_DEBUG_GPIO_TOGGLE(signal, table) do { \ | ||
uint32_t debug_table_idx = 0; \ | ||
if(signal >= sizeof(table)) \ | ||
{ \ | ||
return; \ | ||
} \ | ||
debug_table_idx = table[signal]; \ | ||
if(debug_table_idx != RT_DEBUG_SIGNAL_UNUSED) \ | ||
{ \ | ||
HAL_GPIO_TogglePin(general_debug_table[debug_table_idx].GPIO_port, \ | ||
general_debug_table[debug_table_idx].GPIO_pin); \ | ||
} \ | ||
} while(0) | ||
|
||
#endif /* CFG_RT_DEBUG_GPIO_MODULE */ | ||
|
||
/* System debug API definition */ | ||
void SYSTEM_DEBUG_SIGNAL_SET(system_debug_signal_t signal); | ||
void SYSTEM_DEBUG_SIGNAL_RESET(system_debug_signal_t signal); | ||
void SYSTEM_DEBUG_SIGNAL_TOGGLE(system_debug_signal_t signal); | ||
|
||
/* Link Layer debug API definition */ | ||
void LINKLAYER_DEBUG_SIGNAL_SET(linklayer_debug_signal_t signal); | ||
void LINKLAYER_DEBUG_SIGNAL_RESET(linklayer_debug_signal_t signal); | ||
void LINKLAYER_DEBUG_SIGNAL_TOGGLE(linklayer_debug_signal_t signal); | ||
|
||
#endif /* SYSTEM_DEBUG_H */ |
Oops, something went wrong.