From 7ce1cd28402140744fbf1c351534de8bcea3e0da Mon Sep 17 00:00:00 2001 From: Nidhal BEN OTHMEN Date: Wed, 4 Dec 2024 09:41:37 +0100 Subject: [PATCH] lib: stm32wba: Align code with BLE_TransparentMode from STM32CubeWBA Align code with BLE_TransparentMode application from STM32CubeWBA instead of BLE_HeartRate application. Signed-off-by: Nidhal BEN OTHMEN --- .../BLE_TransparentMode/Core/Inc/app_conf.h | 94 +++---------------- .../BLE_TransparentMode/Core/Inc/app_entry.h | 6 +- lib/stm32wba/README | 68 +++++++------- 3 files changed, 49 insertions(+), 119 deletions(-) diff --git a/lib/stm32wba/BLE_TransparentMode/Core/Inc/app_conf.h b/lib/stm32wba/BLE_TransparentMode/Core/Inc/app_conf.h index d19be4663..93c4a54e5 100644 --- a/lib/stm32wba/BLE_TransparentMode/Core/Inc/app_conf.h +++ b/lib/stm32wba/BLE_TransparentMode/Core/Inc/app_conf.h @@ -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) */ @@ -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 */ @@ -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 */ @@ -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, @@ -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; @@ -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] @@ -419,7 +347,7 @@ typedef enum * - 2 : Debugger available in low power mode. * ******************************************************************************/ -#define CFG_DEBUGGER_LEVEL (0) +#define CFG_DEBUGGER_LEVEL (2) /****************************************************************************** * RealTime GPIO debug module configuration @@ -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 @@ -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) /** diff --git a/lib/stm32wba/BLE_TransparentMode/Core/Inc/app_entry.h b/lib/stm32wba/BLE_TransparentMode/Core/Inc/app_entry.h index bd1a7754e..91bc9c6c3 100644 --- a/lib/stm32wba/BLE_TransparentMode/Core/Inc/app_entry.h +++ b/lib/stm32wba/BLE_TransparentMode/Core/Inc/app_entry.h @@ -42,7 +42,6 @@ extern "C" { /* Exported constants --------------------------------------------------------*/ #define WPAN_SUCCESS 0u -/* USER CODE BEGIN EC */ /****************************************************************************** * Information Table * @@ -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 --------------------------------------------------------*/ diff --git a/lib/stm32wba/README b/lib/stm32wba/README index 38836f979..aeb66b11b 100644 --- a/lib/stm32wba/README +++ b/lib/stm32wba/README @@ -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