Skip to content

Commit

Permalink
lib/stm32: update stm32wba to cube version V1.4.1
Browse files Browse the repository at this point in the history
Update Cube version for STM32WBAxx series
on https://github.com/STMicroelectronics
from version v1.3.1
to version v1.4.1

Signed-off-by: Alessandro Manganaro <[email protected]>
  • Loading branch information
asm5878 authored and erwango committed Oct 25, 2024
1 parent 54ea0ee commit 62c87be
Show file tree
Hide file tree
Showing 39 changed files with 526 additions and 196 deletions.
4 changes: 2 additions & 2 deletions lib/stm32wba/hci/README
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Origin:
https://github.com/STMicroelectronics/STM32CubeWBA

Status:
version v1.3.1
version v1.4.1

Purpose:
This library is used on STM32WBA series to port BLE controller library in
Expand Down Expand Up @@ -87,7 +87,7 @@ URL:
https://github.com/STMicroelectronics/STM32CubeWBA

Commit:
8d1d0ffef7a3a25d8ee8f589a614bc5da65c9300
3820501e7e128592290861c9cc0f7189246bf00d

Maintained-by:
External
Expand Down
64 changes: 36 additions & 28 deletions lib/stm32wba/hci/app_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
/* Includes ------------------------------------------------------------------*/
#include "hw_if.h"
#include "utilities_conf.h"
#include "blestack.h"
/* #include "log_module.h" */

/* USER CODE BEGIN Includes */

Expand All @@ -51,7 +49,7 @@
/**
* Define BD_ADDR type: define proper address. Can only be GAP_PUBLIC_ADDR (0x00) or GAP_STATIC_RANDOM_ADDR (0x01)
*/
#define CFG_BD_ADDRESS_TYPE (GAP_PUBLIC_ADDR)
#define CFG_BD_ADDRESS_DEVICE (GAP_PUBLIC_ADDR)

/**
* Define privacy: PRIVACY_DISABLED or PRIVACY_ENABLED
Expand All @@ -64,7 +62,7 @@
* 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_BLE_ADDRESS_TYPE (GAP_PUBLIC_ADDR)
#define CFG_BD_ADDRESS_TYPE (GAP_PUBLIC_ADDR)

#define ADV_INTERVAL_MIN (0x0080)
#define ADV_INTERVAL_MAX (0x00A0)
Expand All @@ -76,31 +74,31 @@
/**
* 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 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 CFG_IO_CAPABILITY (IO_CAP_DISPLAY_YES_NO)

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

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

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

/**
* Identity root key used to derive IRK and DHK(Legacy)
Expand Down Expand Up @@ -233,6 +231,9 @@
#define CFG_LPM_LEVEL (2)
#define CFG_LPM_STDBY_SUPPORTED (1)

/* Defines time to wake up from standby before radio event to meet timings */
#define CFG_LPM_STDBY_WAKEUP_TIME (1500)

/* USER CODE BEGIN Low_Power 0 */

/* USER CODE END Low_Power 0 */
Expand All @@ -245,6 +246,8 @@ typedef enum
{
CFG_LPM_APP,
CFG_LPM_LOG,
CFG_LPM_LL_DEEPSLEEP,
CFG_LPM_LL_HW_RCO_CLBR,
/* USER CODE BEGIN CFG_LPM_Id_t */

/* USER CODE END CFG_LPM_Id_t */
Expand Down Expand Up @@ -287,6 +290,9 @@ typedef enum
#define CFG_LOG_INSERT_TIME_STAMP_INSIDE_THE_TRACE (0U)
#define CFG_LOG_INSERT_EOL_INSIDE_THE_TRACE (0U)

#define CFG_LOG_TRACE_FIFO_SIZE (4096U)
#define CFG_LOG_TRACE_BUF_SIZE (256U)

/* macro ensuring retrocompatibility with old applications */
#define APP_DBG LOG_INFO_APP
#define APP_DBG_MSG LOG_INFO_APP
Expand Down Expand Up @@ -314,14 +320,14 @@ typedef enum
*/
typedef enum
{
CFG_TASK_HW_RNG, /* Task linked to chip internal peripheral. */
CFG_TASK_LINK_LAYER, /* Tasks linked to Communications Layers. */
CFG_TASK_HW_RNG,
CFG_TASK_LINK_LAYER,
CFG_TASK_HCI_ASYNCH_EVT_ID,
CFG_TASK_LINK_LAYER_TEMP_MEAS,
CFG_TASK_TEMP_MEAS,
CFG_TASK_BLE_HOST,
CFG_TASK_AMM,
CFG_TASK_BPKA,
CFG_TASK_AMM_BCKGND,
CFG_TASK_FLASH_MANAGER_BCKGND,
CFG_TASK_FLASH_MANAGER,
CFG_TASK_BLE_TIMER_BCKGND,
/* USER CODE BEGIN CFG_Task_Id_t */
TASK_BUTTON_1,
Expand Down Expand Up @@ -351,6 +357,9 @@ typedef enum
CFG_SEQ_PRIO_NBR /* Shall be LAST in the list */
} CFG_SEQ_Prio_Id_t;

/* 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
*/
Expand All @@ -362,16 +371,6 @@ typedef enum
/* USER CODE END CFG_IdleEvt_Id_t */
} CFG_IdleEvt_Id_t;

/* Sequencer priorities by default */
#define CFG_TASK_PRIO_HW_RNG CFG_SEQ_PRIO_0
#define CFG_TASK_PRIO_LINK_LAYER CFG_SEQ_PRIO_0
/* USER CODE BEGIN TASK_Priority_Define */

/* USER CODE END TASK_Priority_Define */

/* Used by Sequencer */
#define UTIL_SEQ_CONF_PRIO_NBR CFG_SEQ_PRIO_NBR

/**
* These are the lists of events id registered to the sequencer
* Each event id shall be in the range [0:31]
Expand All @@ -385,6 +384,9 @@ typedef enum
} CFG_Event_Id_t;

/**< Events defines */
/* USER CODE BEGIN EVENT_ID_Define */

/* USER CODE END EVENT_ID_Define */

/******************************************************************************
* NVM configuration
Expand Down Expand Up @@ -464,6 +466,12 @@ typedef enum
*/
#define CFG_RF_TX_POWER_TABLE_ID (1)

/* Custom LSE sleep clock accuracy to use if both conditions are met:
* - LSE is selected as Link Layer sleep clock source
* - the LSE used is different from the default one.
*/
#define CFG_RADIO_LSE_SLEEP_TIMER_CUSTOM_SCA_RANGE (0)

/* USER CODE BEGIN Radio_Configuration */

/* USER CODE END Radio_Configuration */
Expand Down
17 changes: 16 additions & 1 deletion lib/stm32wba/hci/app_entry.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,22 @@ extern "C" {
#define WPAN_SUCCESS 0u

/* USER CODE BEGIN EC */

/******************************************************************************
* 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_BUILD (0)
#define CFG_FW_BRANCH (0)
#define CFG_FW_SUBVERSION (1)
#define CFG_FW_MINOR_VERSION (4)
#define CFG_FW_MAJOR_VERSION (1)
/* USER CODE END EC */

/* Exported variables --------------------------------------------------------*/
Expand Down
16 changes: 16 additions & 0 deletions lib/stm32wba/hci/auto/ble_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -2497,6 +2497,22 @@ typedef __PACKED_STRUCT
uint8_t Status;
} aci_hal_continuous_tx_start_rp0;

typedef __PACKED_STRUCT
{
uint8_t Mode;
uint8_t Key[16];
uint8_t IV[8];
uint16_t In_Data_Length;
uint8_t In_Data[BLE_CMD_MAX_PARAM_LEN - 27];
} aci_hal_ead_encrypt_decrypt_cp0;

typedef __PACKED_STRUCT
{
uint8_t Status;
uint16_t Out_Data_Length;
uint8_t Out_Data[(BLE_EVT_MAX_PARAM_LEN - 3) - 3];
} aci_hal_ead_encrypt_decrypt_rp0;

typedef __PACKED_STRUCT
{
uint8_t Status;
Expand Down
18 changes: 11 additions & 7 deletions lib/stm32wba/hci/ble_bufsize.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/*****************************************************************************
* @file ble_bufsize.h
* @author MDG
* @brief Definition of BLE stack buffers size
*****************************************************************************
* @attention
Expand Down Expand Up @@ -49,7 +48,7 @@
*/
#define BLE_MEM_BLOCK_SIZE 32

#if (BASIC_FEATURES != 0)
#if ((BASIC_FEATURES != 0)||(PERIPHERAL_ONLY != 0))
#define BLE_MEM_BLOCK_X_PTX(n_link) 0
#else
#define BLE_MEM_BLOCK_X_PTX(n_link) (n_link)
Expand Down Expand Up @@ -96,19 +95,24 @@
* - a part, that may be considered "fixed", i.e. independent from the above
* mentioned parameters.
*/
#if (BASIC_FEATURES != 0)
#define BLE_FIXED_BUFFER_SIZE_BYTES 244 /* Basic Features */
#if (PERIPHERAL_ONLY != 0)
#define BLE_FIXED_BUFFER_SIZE_BYTES 4 /* Peripheral Only */
#elif (BASIC_FEATURES != 0)
#define BLE_FIXED_BUFFER_SIZE_BYTES 260 /* Basic Features */
#else
#define BLE_FIXED_BUFFER_SIZE_BYTES 660 /* Full stack */
#define BLE_FIXED_BUFFER_SIZE_BYTES 676 /* Full stack / Basic Plus */
#endif

/*
* BLE_PER_LINK_SIZE_BYTES: additional memory size used per link
*/
#if (BASIC_FEATURES != 0)

#if (PERIPHERAL_ONLY != 0)
#define BLE_PER_LINK_SIZE_BYTES 148 /* Peripheral Only */
#elif (BASIC_FEATURES != 0)
#define BLE_PER_LINK_SIZE_BYTES 176 /* Basic Features */
#else
#define BLE_PER_LINK_SIZE_BYTES 188 /* Full stack */
#define BLE_PER_LINK_SIZE_BYTES 188 /* Full stack / Basic Plus */
#endif

/*
Expand Down
5 changes: 4 additions & 1 deletion lib/stm32wba/hci/ble_const.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*****************************************************************************
* @file ble_const.h
* @author MDG
*
* @brief This file contains the definitions which are compiler dependent.
*****************************************************************************
* @attention
Expand Down Expand Up @@ -32,6 +32,9 @@
#ifndef BASIC_PLUS
#define BASIC_PLUS 0
#endif
#ifndef PERIPHERAL_ONLY
#define PERIPHERAL_ONLY 0
#endif
#ifndef LL_ONLY
#define LL_ONLY 0
#endif
Expand Down
2 changes: 1 addition & 1 deletion lib/stm32wba/hci/ble_defs.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*****************************************************************************
* @file ble_defs.h
* @author MDG
*
* @brief This file contains definitions used for BLE Stack interface.
*****************************************************************************
* @attention
Expand Down
2 changes: 1 addition & 1 deletion lib/stm32wba/hci/ble_std.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/******************************************************************************
* @file ble_std.h
* @author MDG
*
* @brief BLE standard definitions
******************************************************************************
* @attention
Expand Down
30 changes: 29 additions & 1 deletion lib/stm32wba/hci/bleplat.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*****************************************************************************
* @file bleplat.h
* @author MDG
*
* @brief This file contains the interface of the BLE platform layer
* (lower interface of the BLE stack library).
* It is included by the STM32WBX BLE stack library.
Expand Down Expand Up @@ -222,6 +222,34 @@ extern void BLEPLAT_AesCmacCompute( const uint8_t* input,
uint32_t input_length,
uint8_t* output_tag );

/**
* @brief CCM computation
*
* @param mode: CCM mode (0=encryption, 1=decryption)
* @param key: AES encryption key (16 bytes)
* @param iv_length: IV length (in bytes)
* @param iv: IV data
* @param add_length: add length (in bytes)
* @param add: add data
* @param input_length: input data length (in bytes)
* @param inputL: original data (to be encrypted or decrypted)
* @param tag_length: CCM tag length (in bytes)
* @param tag: CCM tag
* @param output: result data (encrypted or decrypted)
* @retval status (BLEPLAT_XX)
*/
extern int BLEPLAT_AesCcmCrypt( uint8_t mode,
const uint8_t* key,
uint8_t iv_length,
const uint8_t* iv,
uint16_t add_length,
const uint8_t* add,
uint32_t input_length,
const uint8_t* input,
uint8_t tag_length,
uint8_t* tag,
uint8_t* output );

/* Random Number Generation (RNG) interface:
*/

Expand Down
2 changes: 1 addition & 1 deletion lib/stm32wba/hci/blestack.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*****************************************************************************
* @file blestack.h
* @author MDG
*
* @brief Header file for BLE stack
*****************************************************************************
* @attention
Expand Down
Loading

0 comments on commit 62c87be

Please sign in to comment.