Skip to content

Commit cc4342a

Browse files
committed
lib/stm32: update stm32wba to cube version V1.4.1
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]>
1 parent 437e29f commit cc4342a

39 files changed

+526
-196
lines changed

lib/stm32wba/hci/README

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Origin:
66
https://github.com/STMicroelectronics/STM32CubeWBA
77

88
Status:
9-
version v1.3.1
9+
version v1.4.1
1010

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

8989
Commit:
90-
8d1d0ffef7a3a25d8ee8f589a614bc5da65c9300
90+
3820501e7e128592290861c9cc0f7189246bf00d
9191

9292
Maintained-by:
9393
External

lib/stm32wba/hci/app_conf.h

Lines changed: 36 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525
/* Includes ------------------------------------------------------------------*/
2626
#include "hw_if.h"
2727
#include "utilities_conf.h"
28-
#include "blestack.h"
29-
/* #include "log_module.h" */
3028

3129
/* USER CODE BEGIN Includes */
3230

@@ -51,7 +49,7 @@
5149
/**
5250
* Define BD_ADDR type: define proper address. Can only be GAP_PUBLIC_ADDR (0x00) or GAP_STATIC_RANDOM_ADDR (0x01)
5351
*/
54-
#define CFG_BD_ADDRESS_TYPE (GAP_PUBLIC_ADDR)
52+
#define CFG_BD_ADDRESS_DEVICE (GAP_PUBLIC_ADDR)
5553

5654
/**
5755
* Define privacy: PRIVACY_DISABLED or PRIVACY_ENABLED
@@ -64,7 +62,7 @@
6462
* if CFG_PRIVACY equals PRIVACY_DISABLED, CFG_BLE_ADDRESS_TYPE has 2 allowed values: GAP_PUBLIC_ADDR or GAP_STATIC_RANDOM_ADDR
6563
* if CFG_PRIVACY equals PRIVACY_ENABLED, CFG_BLE_ADDRESS_TYPE has 2 allowed values: GAP_RESOLVABLE_PRIVATE_ADDR or GAP_NON_RESOLVABLE_PRIVATE_ADDR
6664
*/
67-
#define CFG_BLE_ADDRESS_TYPE (GAP_PUBLIC_ADDR)
65+
#define CFG_BD_ADDRESS_TYPE (GAP_PUBLIC_ADDR)
6866

6967
#define ADV_INTERVAL_MIN (0x0080)
7068
#define ADV_INTERVAL_MAX (0x00A0)
@@ -76,31 +74,31 @@
7674
/**
7775
* Define IO Authentication
7876
*/
79-
#define CFG_BONDING_MODE (1)
80-
#define CFG_USED_FIXED_PIN (0) /* 0->fixed pin is used ; 1->No fixed pin used*/
81-
#define CFG_FIXED_PIN (111111)
82-
#define CFG_ENCRYPTION_KEY_SIZE_MAX (16)
83-
#define CFG_ENCRYPTION_KEY_SIZE_MIN (8)
77+
#define CFG_BONDING_MODE (1)
78+
#define CFG_USED_FIXED_PIN (0) /* 0->fixed pin is used ; 1->No fixed pin used*/
79+
#define CFG_FIXED_PIN (111111)
80+
#define CFG_ENCRYPTION_KEY_SIZE_MAX (16)
81+
#define CFG_ENCRYPTION_KEY_SIZE_MIN (8)
8482

8583
/**
8684
* Define Input Output capabilities
8785
*/
88-
#define CFG_IO_CAPABILITY (IO_CAP_DISPLAY_YES_NO)
86+
#define CFG_IO_CAPABILITY (IO_CAP_DISPLAY_YES_NO)
8987

9088
/**
9189
* Define Man In The Middle modes
9290
*/
93-
#define CFG_MITM_PROTECTION (MITM_PROTECTION_REQUIRED)
91+
#define CFG_MITM_PROTECTION (MITM_PROTECTION_REQUIRED)
9492

9593
/**
9694
* Define Secure Connections Support
9795
*/
98-
#define CFG_SC_SUPPORT (SC_PAIRING_OPTIONAL)
96+
#define CFG_SC_SUPPORT (SC_PAIRING_OPTIONAL)
9997

10098
/**
10199
* Define Keypress Notification Support
102100
*/
103-
#define CFG_KEYPRESS_NOTIFICATION_SUPPORT (KEYPRESS_NOT_SUPPORTED)
101+
#define CFG_KEYPRESS_NOTIFICATION_SUPPORT (KEYPRESS_NOT_SUPPORTED)
104102

105103
/**
106104
* Identity root key used to derive IRK and DHK(Legacy)
@@ -233,6 +231,9 @@
233231
#define CFG_LPM_LEVEL (2)
234232
#define CFG_LPM_STDBY_SUPPORTED (1)
235233

234+
/* Defines time to wake up from standby before radio event to meet timings */
235+
#define CFG_LPM_STDBY_WAKEUP_TIME (1500)
236+
236237
/* USER CODE BEGIN Low_Power 0 */
237238

238239
/* USER CODE END Low_Power 0 */
@@ -245,6 +246,8 @@ typedef enum
245246
{
246247
CFG_LPM_APP,
247248
CFG_LPM_LOG,
249+
CFG_LPM_LL_DEEPSLEEP,
250+
CFG_LPM_LL_HW_RCO_CLBR,
248251
/* USER CODE BEGIN CFG_LPM_Id_t */
249252

250253
/* USER CODE END CFG_LPM_Id_t */
@@ -287,6 +290,9 @@ typedef enum
287290
#define CFG_LOG_INSERT_TIME_STAMP_INSIDE_THE_TRACE (0U)
288291
#define CFG_LOG_INSERT_EOL_INSIDE_THE_TRACE (0U)
289292

293+
#define CFG_LOG_TRACE_FIFO_SIZE (4096U)
294+
#define CFG_LOG_TRACE_BUF_SIZE (256U)
295+
290296
/* macro ensuring retrocompatibility with old applications */
291297
#define APP_DBG LOG_INFO_APP
292298
#define APP_DBG_MSG LOG_INFO_APP
@@ -314,14 +320,14 @@ typedef enum
314320
*/
315321
typedef enum
316322
{
317-
CFG_TASK_HW_RNG, /* Task linked to chip internal peripheral. */
318-
CFG_TASK_LINK_LAYER, /* Tasks linked to Communications Layers. */
323+
CFG_TASK_HW_RNG,
324+
CFG_TASK_LINK_LAYER,
319325
CFG_TASK_HCI_ASYNCH_EVT_ID,
320-
CFG_TASK_LINK_LAYER_TEMP_MEAS,
326+
CFG_TASK_TEMP_MEAS,
321327
CFG_TASK_BLE_HOST,
328+
CFG_TASK_AMM,
322329
CFG_TASK_BPKA,
323-
CFG_TASK_AMM_BCKGND,
324-
CFG_TASK_FLASH_MANAGER_BCKGND,
330+
CFG_TASK_FLASH_MANAGER,
325331
CFG_TASK_BLE_TIMER_BCKGND,
326332
/* USER CODE BEGIN CFG_Task_Id_t */
327333
TASK_BUTTON_1,
@@ -351,6 +357,9 @@ typedef enum
351357
CFG_SEQ_PRIO_NBR /* Shall be LAST in the list */
352358
} CFG_SEQ_Prio_Id_t;
353359

360+
/* Sequencer configuration */
361+
#define UTIL_SEQ_CONF_PRIO_NBR CFG_SEQ_PRIO_NBR
362+
354363
/**
355364
* This is a bit mapping over 32bits listing all events id supported in the application
356365
*/
@@ -362,16 +371,6 @@ typedef enum
362371
/* USER CODE END CFG_IdleEvt_Id_t */
363372
} CFG_IdleEvt_Id_t;
364373

365-
/* Sequencer priorities by default */
366-
#define CFG_TASK_PRIO_HW_RNG CFG_SEQ_PRIO_0
367-
#define CFG_TASK_PRIO_LINK_LAYER CFG_SEQ_PRIO_0
368-
/* USER CODE BEGIN TASK_Priority_Define */
369-
370-
/* USER CODE END TASK_Priority_Define */
371-
372-
/* Used by Sequencer */
373-
#define UTIL_SEQ_CONF_PRIO_NBR CFG_SEQ_PRIO_NBR
374-
375374
/**
376375
* These are the lists of events id registered to the sequencer
377376
* Each event id shall be in the range [0:31]
@@ -385,6 +384,9 @@ typedef enum
385384
} CFG_Event_Id_t;
386385

387386
/**< Events defines */
387+
/* USER CODE BEGIN EVENT_ID_Define */
388+
389+
/* USER CODE END EVENT_ID_Define */
388390

389391
/******************************************************************************
390392
* NVM configuration
@@ -464,6 +466,12 @@ typedef enum
464466
*/
465467
#define CFG_RF_TX_POWER_TABLE_ID (1)
466468

469+
/* Custom LSE sleep clock accuracy to use if both conditions are met:
470+
* - LSE is selected as Link Layer sleep clock source
471+
* - the LSE used is different from the default one.
472+
*/
473+
#define CFG_RADIO_LSE_SLEEP_TIMER_CUSTOM_SCA_RANGE (0)
474+
467475
/* USER CODE BEGIN Radio_Configuration */
468476

469477
/* USER CODE END Radio_Configuration */

lib/stm32wba/hci/app_entry.h

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,22 @@ extern "C" {
4343
#define WPAN_SUCCESS 0u
4444

4545
/* USER CODE BEGIN EC */
46-
46+
/******************************************************************************
47+
* Information Table
48+
*
49+
* Version
50+
* [0:3] = Build - 0: Untracked - 15:Released - x: Tracked version
51+
* [4:7] = branch - 0: Mass Market - x: ...
52+
* [8:15] = Subversion
53+
* [16:23] = Version minor
54+
* [24:31] = Version major
55+
*
56+
******************************************************************************/
57+
#define CFG_FW_BUILD (0)
58+
#define CFG_FW_BRANCH (0)
59+
#define CFG_FW_SUBVERSION (1)
60+
#define CFG_FW_MINOR_VERSION (4)
61+
#define CFG_FW_MAJOR_VERSION (1)
4762
/* USER CODE END EC */
4863

4964
/* Exported variables --------------------------------------------------------*/

lib/stm32wba/hci/auto/ble_types.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2497,6 +2497,22 @@ typedef __PACKED_STRUCT
24972497
uint8_t Status;
24982498
} aci_hal_continuous_tx_start_rp0;
24992499

2500+
typedef __PACKED_STRUCT
2501+
{
2502+
uint8_t Mode;
2503+
uint8_t Key[16];
2504+
uint8_t IV[8];
2505+
uint16_t In_Data_Length;
2506+
uint8_t In_Data[BLE_CMD_MAX_PARAM_LEN - 27];
2507+
} aci_hal_ead_encrypt_decrypt_cp0;
2508+
2509+
typedef __PACKED_STRUCT
2510+
{
2511+
uint8_t Status;
2512+
uint16_t Out_Data_Length;
2513+
uint8_t Out_Data[(BLE_EVT_MAX_PARAM_LEN - 3) - 3];
2514+
} aci_hal_ead_encrypt_decrypt_rp0;
2515+
25002516
typedef __PACKED_STRUCT
25012517
{
25022518
uint8_t Status;

lib/stm32wba/hci/ble_bufsize.h

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/*****************************************************************************
22
* @file ble_bufsize.h
3-
* @author MDG
43
* @brief Definition of BLE stack buffers size
54
*****************************************************************************
65
* @attention
@@ -49,7 +48,7 @@
4948
*/
5049
#define BLE_MEM_BLOCK_SIZE 32
5150

52-
#if (BASIC_FEATURES != 0)
51+
#if ((BASIC_FEATURES != 0)||(PERIPHERAL_ONLY != 0))
5352
#define BLE_MEM_BLOCK_X_PTX(n_link) 0
5453
#else
5554
#define BLE_MEM_BLOCK_X_PTX(n_link) (n_link)
@@ -96,19 +95,24 @@
9695
* - a part, that may be considered "fixed", i.e. independent from the above
9796
* mentioned parameters.
9897
*/
99-
#if (BASIC_FEATURES != 0)
100-
#define BLE_FIXED_BUFFER_SIZE_BYTES 244 /* Basic Features */
98+
#if (PERIPHERAL_ONLY != 0)
99+
#define BLE_FIXED_BUFFER_SIZE_BYTES 4 /* Peripheral Only */
100+
#elif (BASIC_FEATURES != 0)
101+
#define BLE_FIXED_BUFFER_SIZE_BYTES 260 /* Basic Features */
101102
#else
102-
#define BLE_FIXED_BUFFER_SIZE_BYTES 660 /* Full stack */
103+
#define BLE_FIXED_BUFFER_SIZE_BYTES 676 /* Full stack / Basic Plus */
103104
#endif
104105

105106
/*
106107
* BLE_PER_LINK_SIZE_BYTES: additional memory size used per link
107108
*/
108-
#if (BASIC_FEATURES != 0)
109+
110+
#if (PERIPHERAL_ONLY != 0)
111+
#define BLE_PER_LINK_SIZE_BYTES 148 /* Peripheral Only */
112+
#elif (BASIC_FEATURES != 0)
109113
#define BLE_PER_LINK_SIZE_BYTES 176 /* Basic Features */
110114
#else
111-
#define BLE_PER_LINK_SIZE_BYTES 188 /* Full stack */
115+
#define BLE_PER_LINK_SIZE_BYTES 188 /* Full stack / Basic Plus */
112116
#endif
113117

114118
/*

lib/stm32wba/hci/ble_const.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*****************************************************************************
22
* @file ble_const.h
3-
* @author MDG
3+
*
44
* @brief This file contains the definitions which are compiler dependent.
55
*****************************************************************************
66
* @attention
@@ -32,6 +32,9 @@
3232
#ifndef BASIC_PLUS
3333
#define BASIC_PLUS 0
3434
#endif
35+
#ifndef PERIPHERAL_ONLY
36+
#define PERIPHERAL_ONLY 0
37+
#endif
3538
#ifndef LL_ONLY
3639
#define LL_ONLY 0
3740
#endif

lib/stm32wba/hci/ble_defs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*****************************************************************************
22
* @file ble_defs.h
3-
* @author MDG
3+
*
44
* @brief This file contains definitions used for BLE Stack interface.
55
*****************************************************************************
66
* @attention

lib/stm32wba/hci/ble_std.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/******************************************************************************
22
* @file ble_std.h
3-
* @author MDG
3+
*
44
* @brief BLE standard definitions
55
******************************************************************************
66
* @attention

lib/stm32wba/hci/bleplat.h

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*****************************************************************************
22
* @file bleplat.h
3-
* @author MDG
3+
*
44
* @brief This file contains the interface of the BLE platform layer
55
* (lower interface of the BLE stack library).
66
* It is included by the STM32WBX BLE stack library.
@@ -222,6 +222,34 @@ extern void BLEPLAT_AesCmacCompute( const uint8_t* input,
222222
uint32_t input_length,
223223
uint8_t* output_tag );
224224

225+
/**
226+
* @brief CCM computation
227+
*
228+
* @param mode: CCM mode (0=encryption, 1=decryption)
229+
* @param key: AES encryption key (16 bytes)
230+
* @param iv_length: IV length (in bytes)
231+
* @param iv: IV data
232+
* @param add_length: add length (in bytes)
233+
* @param add: add data
234+
* @param input_length: input data length (in bytes)
235+
* @param inputL: original data (to be encrypted or decrypted)
236+
* @param tag_length: CCM tag length (in bytes)
237+
* @param tag: CCM tag
238+
* @param output: result data (encrypted or decrypted)
239+
* @retval status (BLEPLAT_XX)
240+
*/
241+
extern int BLEPLAT_AesCcmCrypt( uint8_t mode,
242+
const uint8_t* key,
243+
uint8_t iv_length,
244+
const uint8_t* iv,
245+
uint16_t add_length,
246+
const uint8_t* add,
247+
uint32_t input_length,
248+
const uint8_t* input,
249+
uint8_t tag_length,
250+
uint8_t* tag,
251+
uint8_t* output );
252+
225253
/* Random Number Generation (RNG) interface:
226254
*/
227255

lib/stm32wba/hci/blestack.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*****************************************************************************
22
* @file blestack.h
3-
* @author MDG
3+
*
44
* @brief Header file for BLE stack
55
*****************************************************************************
66
* @attention

0 commit comments

Comments
 (0)