Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Align lib/stm32wba with STM32CubeWBA structure and with BLE_TransparentMode application #244

Merged
merged 5 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,71 +35,6 @@
******************************************************************************/
/**< generic parameters ******************************************************/

/**
* Define Tx Power
*/
#define CFG_TX_POWER (0x19) /* 0x19 <=> -0.3 dBm */

/**
* Definition of public BD Address,
* when CFG_BD_ADDRESS = 0x000000000000 the BD address is generated based on Unique Device Number.
*/
#define CFG_BD_ADDRESS (0x0000000000000)

/**
* Define BD_ADDR type: define proper address. Can only be GAP_PUBLIC_ADDR (0x00) or GAP_STATIC_RANDOM_ADDR (0x01)
*/
#define CFG_BD_ADDRESS_DEVICE (GAP_PUBLIC_ADDR)

/**
* Define privacy: PRIVACY_DISABLED or PRIVACY_ENABLED
*/
#define CFG_PRIVACY (PRIVACY_DISABLED)

/**
* Define BLE Address Type
* Bluetooth address types defined in ble_legacy.h
* if CFG_PRIVACY equals PRIVACY_DISABLED, CFG_BLE_ADDRESS_TYPE has 2 allowed values: GAP_PUBLIC_ADDR or GAP_STATIC_RANDOM_ADDR
* if CFG_PRIVACY equals PRIVACY_ENABLED, CFG_BLE_ADDRESS_TYPE has 2 allowed values: GAP_RESOLVABLE_PRIVATE_ADDR or GAP_NON_RESOLVABLE_PRIVATE_ADDR
*/
#define CFG_BD_ADDRESS_TYPE (GAP_PUBLIC_ADDR)

#define ADV_INTERVAL_MIN (0x0080)
#define ADV_INTERVAL_MAX (0x00A0)
#define ADV_LP_INTERVAL_MIN (0x0640)
#define ADV_LP_INTERVAL_MAX (0x0FA0)
#define ADV_TYPE ADV_IND
#define ADV_FILTER NO_WHITE_LIST_USE

/**
* Define IO Authentication
*/
#define CFG_BONDING_MODE (1)
#define CFG_USED_FIXED_PIN (0) /* 0->fixed pin is used ; 1->No fixed pin used*/
#define CFG_FIXED_PIN (111111)
#define CFG_ENCRYPTION_KEY_SIZE_MAX (16)
#define CFG_ENCRYPTION_KEY_SIZE_MIN (8)

/**
* Define Input Output capabilities
*/
#define CFG_IO_CAPABILITY (IO_CAP_DISPLAY_YES_NO)

/**
* Define Man In The Middle modes
*/
#define CFG_MITM_PROTECTION (MITM_PROTECTION_REQUIRED)

/**
* Define Secure Connections Support
*/
#define CFG_SC_SUPPORT (SC_PAIRING_OPTIONAL)

/**
* Define Keypress Notification Support
*/
#define CFG_KEYPRESS_NOTIFICATION_SUPPORT (KEYPRESS_NOT_SUPPORTED)

/**
* Identity root key used to derive IRK and DHK(Legacy)
*/
Expand Down Expand Up @@ -228,7 +163,7 @@
* - 0 : Standby is not used, so stop mode 1 is used as low power mode.
*
******************************************************************************/
#define CFG_LPM_LEVEL (2)
#define CFG_LPM_LEVEL (1)
#define CFG_LPM_STDBY_SUPPORTED (1)

/* Defines time to wake up from standby before radio event to meet timings */
Expand All @@ -248,6 +183,7 @@ typedef enum
CFG_LPM_LOG,
CFG_LPM_LL_DEEPSLEEP,
CFG_LPM_LL_HW_RCO_CLBR,
CFG_LPM_APP_BLE,
/* USER CODE BEGIN CFG_LPM_Id_t */

/* USER CODE END CFG_LPM_Id_t */
Expand Down Expand Up @@ -322,7 +258,12 @@ typedef enum
{
CFG_TASK_HW_RNG,
CFG_TASK_LINK_LAYER,
CFG_TASK_HCI_ASYNCH_EVT_ID,
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,
CFG_TASK_NOTIFY_EVENT_ID,
CFG_TASK_TEMP_MEAS,
CFG_TASK_BLE_HOST,
CFG_TASK_AMM,
Expand All @@ -333,8 +274,6 @@ typedef enum
TASK_BUTTON_1,
TASK_BUTTON_2,
TASK_BUTTON_3,
CFG_TASK_MEAS_REQ_ID,
CFG_TASK_ADV_LP_REQ_ID,
/* USER CODE END CFG_Task_Id_t */
CFG_TASK_NBR /* Shall be LAST in the list */
} CFG_Task_Id_t;
Expand All @@ -360,17 +299,6 @@ typedef enum
/* Sequencer configuration */
#define UTIL_SEQ_CONF_PRIO_NBR CFG_SEQ_PRIO_NBR

/**
* This is a bit mapping over 32bits listing all events id supported in the application
*/
typedef enum
{
CFG_IDLEEVT_PROC_GAP_COMPLETE,
/* USER CODE BEGIN CFG_IdleEvt_Id_t */

/* USER CODE END CFG_IdleEvt_Id_t */
} CFG_IdleEvt_Id_t;

/**
* These are the lists of events id registered to the sequencer
* Each event id shall be in the range [0:31]
Expand Down Expand Up @@ -419,7 +347,7 @@ typedef enum
* - 2 : Debugger available in low power mode.
*
******************************************************************************/
#define CFG_DEBUGGER_LEVEL (0)
erwango marked this conversation as resolved.
Show resolved Hide resolved
#define CFG_DEBUGGER_LEVEL (2)

/******************************************************************************
* RealTime GPIO debug module configuration
Expand Down Expand Up @@ -464,7 +392,7 @@ typedef enum
* 0 -> RF TX output level from -20 dBm to +10 dBm
* 1 -> RF TX output level from -20 dBm to +3 dBm
*/
#define CFG_RF_TX_POWER_TABLE_ID (1)
#define CFG_RF_TX_POWER_TABLE_ID (0)

/* Custom LSE sleep clock accuracy to use if both conditions are met:
* - LSE is selected as Link Layer sleep clock source
Expand Down Expand Up @@ -511,7 +439,7 @@ typedef enum
* When CFG_BUTTON_SUPPORTED is set, the push button are activated if requested
*/

#define CFG_LED_SUPPORTED (0)
#define CFG_LED_SUPPORTED (1)
#define CFG_BUTTON_SUPPORTED (1)

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ extern "C" {
/* Exported constants --------------------------------------------------------*/
#define WPAN_SUCCESS 0u

/* USER CODE BEGIN EC */
/******************************************************************************
* Information Table
*
Expand All @@ -56,9 +55,12 @@ extern "C" {
******************************************************************************/
#define CFG_FW_BUILD (0)
#define CFG_FW_BRANCH (0)
#define CFG_FW_SUBVERSION (1)
#define CFG_FW_SUBVERSION (0)
#define CFG_FW_MINOR_VERSION (4)
#define CFG_FW_MAJOR_VERSION (1)

/* USER CODE BEGIN EC */

/* USER CODE END EC */

/* Exported variables --------------------------------------------------------*/
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
64 changes: 41 additions & 23 deletions lib/stm32wba/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,49 @@ endif()

zephyr_compile_definitions( -DBLE )

zephyr_include_directories(hci)
zephyr_include_directories(hci/ll)

zephyr_sources(hci/ll_sys_cs.c)
zephyr_sources(hci/ll_sys_intf.c)
zephyr_sources(hci/ll_sys_dp_slp.c)
zephyr_sources(hci/ll_sys_startup.c)
zephyr_sources(hci/RTDebug.c)
zephyr_sources(hci/hw_pka.c)
zephyr_sources(hci/pka_p256.c)
zephyr_sources(hci/bpka.c)
zephyr_sources(hci/power_table.c)
zephyr_sources(hci/scm.c)
zephyr_sources(hci/log_module.c)
zephyr_sources(hci/linklayer_plat.c)
zephyr_sources(hci/ll_sys_if.c)
zephyr_include_directories(BLE_TransparentMode/Core/Inc)
zephyr_include_directories(BLE_TransparentMode/STM32_WPAN/Target)
zephyr_include_directories(BLE_TransparentMode/System/Config/Debug_GPIO)
zephyr_include_directories(BLE_TransparentMode/System/Config/Log)
zephyr_include_directories(BLE_TransparentMode/System/Interfaces)
zephyr_include_directories(BLE_TransparentMode/System/Modules)
zephyr_include_directories(BLE_TransparentMode/System/Modules/Flash)
zephyr_include_directories(BLE_TransparentMode/System/Modules/RTDebug)
zephyr_include_directories(STM32_WPAN)
zephyr_include_directories(STM32_WPAN/ble/stack/include)
zephyr_include_directories(STM32_WPAN/ble/stack/include/auto)
zephyr_include_directories(STM32_WPAN/link_layer/ll_cmd_lib/config/ble_full)
zephyr_include_directories(STM32_WPAN/link_layer/ll_cmd_lib/inc)
zephyr_include_directories(STM32_WPAN/link_layer/ll_cmd_lib/inc/_40nm_reg_files)
zephyr_include_directories(STM32_WPAN/link_layer/ll_sys/inc)
zephyr_include_directories(Utilities/misc)
zephyr_include_directories(Utilities/tim_serv)
zephyr_include_directories(Utilities/trace/adv_trace)

zephyr_sources(BLE_TransparentMode/STM32_WPAN/Target/bpka.c)
zephyr_sources(BLE_TransparentMode/STM32_WPAN/Target/linklayer_plat.c)
zephyr_sources(BLE_TransparentMode/STM32_WPAN/Target/ll_sys_if.c)
zephyr_sources(BLE_TransparentMode/STM32_WPAN/Target/power_table.c)
zephyr_sources(BLE_TransparentMode/System/Config/Log/log_module.c)
zephyr_sources(BLE_TransparentMode/System/Interfaces/hw_pka.c)
zephyr_sources(BLE_TransparentMode/System/Interfaces/pka_p256.c)
zephyr_sources(BLE_TransparentMode/System/Modules/scm.c)
zephyr_sources(BLE_TransparentMode/System/Modules/RTDebug/RTDebug.c)
zephyr_sources(STM32_WPAN/link_layer/ll_sys/src/ll_sys_cs.c)
zephyr_sources(STM32_WPAN/link_layer/ll_sys/src/ll_sys_dp_slp.c)
zephyr_sources(STM32_WPAN/link_layer/ll_sys/src/ll_sys_intf.c)
zephyr_sources(STM32_WPAN/link_layer/ll_sys/src/ll_sys_startup.c)

if(CONFIG_FLASH)
zephyr_sources(hci/flash_manager.c)
zephyr_sources(hci/flash_driver.c)
zephyr_sources(hci/stm_list.c)
zephyr_sources(hci/rf_timing_synchro.c)
zephyr_sources(BLE_TransparentMode/System/Modules/Flash/flash_manager.c)
zephyr_sources(BLE_TransparentMode/System/Modules/Flash/flash_driver.c)
zephyr_sources(BLE_TransparentMode/System/Modules/stm_list.c)
zephyr_sources(BLE_TransparentMode/System/Modules/Flash/rf_timing_synchro.c)
endif()

set(STM32WBA_BLE_LIB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../zephyr/blobs/stm32wba/lib)
set(STM32WBA_BLE_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/hci)
set(STM32WBA_BLE_LIB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/STM32_WPAN/ble/stack)
set(STM32WBA_LL_LIB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/STM32_WPAN/link_layer/ll_cmd_lib)

add_library(stm32wba_ble_lib STATIC IMPORTED GLOBAL)
add_library(stm32wba_ll_lib STATIC IMPORTED GLOBAL)
Expand All @@ -48,8 +66,8 @@ set_target_properties(
stm32wba_ll_lib PROPERTIES IMPORTED_LOCATION ${STM32WBA_BLE_LIB_DIR}/LinkLayer_BLE_Full_lib.a
)

set_target_properties(stm32wba_ble_lib PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${STM32WBA_BLE_INCLUDE_DIR})
set_target_properties(stm32wba_ll_lib PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${STM32WBA_BLE_INCLUDE_DIR})
set_target_properties(stm32wba_ble_lib PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${STM32WBA_BLE_LIB_INCLUDE_DIR})
set_target_properties(stm32wba_ll_lib PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${STM32WBA_LL_LIB_INCLUDE_DIR})

target_link_libraries(app PUBLIC stm32wba_ble_lib)
target_link_libraries(app PUBLIC stm32wba_ll_lib)
File renamed without changes.
68 changes: 34 additions & 34 deletions lib/stm32wba/hci/README → lib/stm32wba/README
Original file line number Diff line number Diff line change
Expand Up @@ -43,40 +43,40 @@ Description:
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-WBA55CG/Applications/BLE/BLE_HeartRate/Core/Inc/app_common.h
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_HeartRate/Core/Inc/app_conf.h
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_HeartRate/Core/Inc/app_entry.h
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_HeartRate/Core/Inc/utilities_conf.h
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_HeartRate/Core/Inc/main.h
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_HeartRate/System/Modules/Flash/rf_timing_synchro.c
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_HeartRate/System/Modules/Flash/rf_timing_synchro.h
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_HeartRate/System/Modules/Flash/flash_driver.c
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_HeartRate/System/Modules/Flash/flash_driver.h
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_HeartRate/System/Modules/Flash/flash_manager.c
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_HeartRate/System/Modules/Flash/flash_manager.h
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_HeartRate/System/Modules/RTDebug/debug_signals.h
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_HeartRate/System/Modules/RTDebug/RTDebug.c
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_HeartRate/System/Modules/RTDebug/RTDebug.h
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_HeartRate/System/Modules/RTDebug/local_debug_tables.h
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_HeartRate/System/Modules/scm.c
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_HeartRate/System/Modules/scm.h
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_HeartRate/System/Modules/stm_list.c
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_HeartRate/System/Modules/stm_list.h
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_HeartRate/System/Modules/utilities_common.h
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_HeartRate/System/Interfaces/hw.h
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_HeartRate/System/Interfaces/hw_aes.c
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_HeartRate/System/Interfaces/hw_if.h
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_HeartRate/System/Interfaces/hw_pka.c
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_HeartRate/System/Interfaces/pka_p256.c
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_HeartRate/System/Config/Log/log_module.c
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_HeartRate/System/Config/Log/log_module.h
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_HeartRate/System/Config/Debug_GPIO/app_debug.h
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_HeartRate/System/Config/Debug_GPIO/debug_config.h
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_HeartRate/STM32_WPAN/Target/power_table.c
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_HeartRate/STM32_WPAN/Target/bpka.c
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_HeartRate/STM32_WPAN/Target/bpka.h
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_HeartRate/STM32_WPAN/Target/linklayer_plat.c
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_HeartRate/STM32_WPAN/Target/ll_sys_if.c
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_TransparentMode/Core/Inc/app_common.h
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_TransparentMode/Core/Inc/app_conf.h
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_TransparentMode/Core/Inc/app_entry.h
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_TransparentMode/Core/Inc/utilities_conf.h
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_TransparentMode/Core/Inc/main.h
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_TransparentMode/System/Modules/Flash/rf_timing_synchro.c
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_TransparentMode/System/Modules/Flash/rf_timing_synchro.h
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_TransparentMode/System/Modules/Flash/flash_driver.c
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_TransparentMode/System/Modules/Flash/flash_driver.h
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_TransparentMode/System/Modules/Flash/flash_manager.c
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_TransparentMode/System/Modules/Flash/flash_manager.h
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_TransparentMode/System/Modules/RTDebug/debug_signals.h
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_TransparentMode/System/Modules/RTDebug/RTDebug.c
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_TransparentMode/System/Modules/RTDebug/RTDebug.h
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_TransparentMode/System/Modules/RTDebug/local_debug_tables.h
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_TransparentMode/System/Modules/scm.c
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_TransparentMode/System/Modules/scm.h
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_TransparentMode/System/Modules/stm_list.c
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_TransparentMode/System/Modules/stm_list.h
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_TransparentMode/System/Modules/utilities_common.h
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_TransparentMode/System/Interfaces/hw.h
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_TransparentMode/System/Interfaces/hw_aes.c
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_TransparentMode/System/Interfaces/hw_if.h
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_TransparentMode/System/Interfaces/hw_pka.c
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_TransparentMode/System/Interfaces/pka_p256.c
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_TransparentMode/System/Config/Log/log_module.c
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_TransparentMode/System/Config/Log/log_module.h
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_TransparentMode/System/Config/Debug_GPIO/app_debug.h
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_TransparentMode/System/Config/Debug_GPIO/debug_config.h
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_TransparentMode/STM32_WPAN/Target/power_table.c
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_TransparentMode/STM32_WPAN/Target/bpka.c
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_TransparentMode/STM32_WPAN/Target/bpka.h
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_TransparentMode/STM32_WPAN/Target/linklayer_plat.c
Projects/NUCLEO-WBA55CG/Applications/BLE/BLE_TransparentMode/STM32_WPAN/Target/ll_sys_if.c
Utilities/trace/adv_trace/stm32_adv_trace.h
Utilities/misc/stm32_mem.h
Utilities/tim_serv/stm32_timer.h
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading