Skip to content

Commit 1bd138b

Browse files
authored
Merge pull request #13304 from jeromecoutant/PR_WB_CUBE17
STM32WB update drivers version to CUBE V1.7.0
2 parents 0e2d3df + 03296f0 commit 1bd138b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+44034
-1620
lines changed

features/FEATURE_BLE/targets/TARGET_STM/TARGET_STM32WB/HCIDriver.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ static bool get_bd_address(uint8_t *bd_addr);
8686
static bool sysevt_wait(void);
8787
static bool sysevt_check(void);
8888

89+
extern int BLE_inited;
8990

9091
namespace ble {
9192
namespace vendor {
@@ -675,6 +676,9 @@ class TransportDriver : public cordio::CordioHCITransportDriver {
675676
* Starts the BLE Stack on CPU2
676677
*/
677678
SHCI_C2_BLE_Init(&ble_init_cmd_packet);
679+
680+
/* Used in flash_api.c */
681+
BLE_inited = 1;
678682
}
679683

680684
TL_CmdPacket_t *bleCmdBuf;

features/FEATURE_BLE/targets/TARGET_STM/TARGET_STM32WB/STM32Cube_FW/mbox_def.h

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,17 @@ extern "C" {
100100
uint8_t *m0cmd_buffer;
101101
} MB_LldTestsTable_t;
102102

103+
typedef struct
104+
{
105+
uint8_t *cmdrsp_buffer;
106+
uint8_t *m0cmd_buffer;
107+
} MB_LldBleTable_t;
108+
103109
typedef struct
104110
{
105111
uint8_t *notifM0toM4_buffer;
106112
uint8_t *appliCmdM4toM0_buffer;
107-
uint8_t *loggingM0toM4_buffer;
113+
uint8_t *requestM0toM4_buffer;
108114
} MB_ZigbeeTable_t;
109115
/**
110116
* msg
@@ -151,6 +157,7 @@ extern "C" {
151157
MB_Mac_802_15_4_t *p_mac_802_15_4_table;
152158
MB_ZigbeeTable_t *p_zigbee_table;
153159
MB_LldTestsTable_t *p_lld_tests_table;
160+
MB_LldBleTable_t *p_lld_ble_table;
154161
} MB_RefTable_t;
155162

156163
#ifdef __cplusplus
@@ -194,6 +201,13 @@ extern "C" {
194201
* | |
195202
* |<---HW_IPCC_BLE_EVENT_CHANNEL--------------------|
196203
* | |
204+
* | (LLD BLE) |
205+
* |----HW_IPCC_LLD_BLE_CMD_CHANNEL----------------->|
206+
* | |
207+
* |<---HW_IPCC_LLD_BLE_RSP_CHANNEL------------------|
208+
* | |
209+
* |<---HW_IPCC_LLD_BLE_M0_CMD_CHANNEL---------------|
210+
* | |
197211
* | (MAC) |
198212
* |----HW_IPCC_MAC_802_15_4_CMD_RSP_CHANNEL-------->|
199213
* | |
@@ -221,6 +235,8 @@ extern "C" {
221235
#define HW_IPCC_MM_RELEASE_BUFFER_CHANNEL LL_IPCC_CHANNEL_4
222236
#define HW_IPCC_THREAD_CLI_CMD_CHANNEL LL_IPCC_CHANNEL_5
223237
#define HW_IPCC_LLDTESTS_CLI_CMD_CHANNEL LL_IPCC_CHANNEL_5
238+
#define HW_IPCC_LLD_BLE_CLI_CMD_CHANNEL LL_IPCC_CHANNEL_5
239+
#define HW_IPCC_LLD_BLE_CMD_CHANNEL LL_IPCC_CHANNEL_5
224240
#define HW_IPCC_HCI_ACL_DATA_CHANNEL LL_IPCC_CHANNEL_6
225241

226242
/** CPU2 */
@@ -230,10 +246,13 @@ extern "C" {
230246
#define HW_IPCC_ZIGBEE_APPLI_NOTIF_ACK_CHANNEL LL_IPCC_CHANNEL_3
231247
#define HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL LL_IPCC_CHANNEL_3
232248
#define HW_IPCC_LLDTESTS_M0_CMD_CHANNEL LL_IPCC_CHANNEL_3
249+
#define HW_IPCC_LLD_BLE_M0_CMD_CHANNEL LL_IPCC_CHANNEL_3
233250
#define HW_IPCC_TRACES_CHANNEL LL_IPCC_CHANNEL_4
234251
#define HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL LL_IPCC_CHANNEL_5
235252
#define HW_IPCC_LLDTESTS_CLI_RSP_CHANNEL LL_IPCC_CHANNEL_5
236-
#define HW_IPCC_ZIGBEE_APPLI_LOGGING_CHANNEL LL_IPCC_CHANNEL_5
253+
#define HW_IPCC_LLD_BLE_CLI_RSP_CHANNEL LL_IPCC_CHANNEL_5
254+
#define HW_IPCC_LLD_BLE_RSP_CHANNEL LL_IPCC_CHANNEL_5
255+
#define HW_IPCC_ZIGBEE_M0_REQUEST_CHANNEL LL_IPCC_CHANNEL_5
237256
#endif /*__MBOX_H */
238257

239258
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

features/FEATURE_BLE/targets/TARGET_STM/TARGET_STM32WB/STM32Cube_FW/shci.c

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,24 @@ SHCI_CmdStatus_t SHCI_C2_LLDTESTS_Init( uint8_t param_size, uint8_t * p_param )
298298
return (SHCI_CmdStatus_t)(((TL_CcEvt_t*)(p_rsp->evtserial.evt.payload))->payload[0]);
299299
}
300300

301+
SHCI_CmdStatus_t SHCI_C2_LLD_BLE_Init( uint8_t param_size, uint8_t * p_param )
302+
{
303+
/**
304+
* Buffer is large enough to hold command complete without payload
305+
*/
306+
uint8_t local_buffer[TL_BLEEVT_CS_BUFFER_SIZE];
307+
TL_EvtPacket_t * p_rsp;
308+
309+
p_rsp = (TL_EvtPacket_t *)local_buffer;
310+
311+
shci_send( SHCI_OPCODE_C2_LLD_TESTS_INIT,
312+
param_size,
313+
p_param,
314+
p_rsp );
315+
316+
return (SHCI_CmdStatus_t)(((TL_CcEvt_t*)(p_rsp->evtserial.evt.payload))->payload[0]);
317+
}
318+
301319
SHCI_CmdStatus_t SHCI_C2_ZIGBEE_Init( void )
302320
{
303321
/**
@@ -315,6 +333,7 @@ SHCI_CmdStatus_t SHCI_C2_ZIGBEE_Init( void )
315333

316334
return (SHCI_CmdStatus_t)(((TL_CcEvt_t*)(p_rsp->evtserial.evt.payload))->payload[0]);
317335
}
336+
318337
SHCI_CmdStatus_t SHCI_C2_DEBUG_Init( SHCI_C2_DEBUG_Init_Cmd_Packet_t *pCmdPacket )
319338
{
320339
/**
@@ -494,6 +513,27 @@ SHCI_CmdStatus_t SHCI_C2_ExtpaConfig(uint32_t gpio_port, uint16_t gpio_pin_numbe
494513
return (SHCI_CmdStatus_t)(((TL_CcEvt_t*)(p_rsp->evtserial.evt.payload))->payload[0]);
495514
}
496515

516+
SHCI_CmdStatus_t SHCI_C2_SetFlashActivityControl(SHCI_C2_SET_FLASH_ACTIVITY_CONTROL_Source_t Source)
517+
{
518+
/**
519+
* TL_BLEEVT_CS_BUFFER_SIZE is 15 bytes so it is large enough to hold the 1 byte of command parameter
520+
* Buffer is large enough to hold command complete without payload
521+
*/
522+
uint8_t local_buffer[TL_BLEEVT_CS_BUFFER_SIZE];
523+
TL_EvtPacket_t * p_rsp;
524+
525+
p_rsp = (TL_EvtPacket_t *)local_buffer;
526+
527+
local_buffer[0] = (uint8_t)Source;
528+
529+
shci_send( SHCI_OPCODE_C2_SET_FLASH_ACTIVITY_CONTROL,
530+
1,
531+
local_buffer,
532+
p_rsp );
533+
534+
return (SHCI_CmdStatus_t)(((TL_CcEvt_t*)(p_rsp->evtserial.evt.payload))->payload[0]);
535+
}
536+
497537
/**
498538
* Local System COMMAND
499539
* These commands are NOT sent to the CPU2

features/FEATURE_BLE/targets/TARGET_STM/TARGET_STM32WB/STM32Cube_FW/shci.h

Lines changed: 59 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,9 @@ extern "C" {
137137
SHCI_OCF_C2_REINIT,
138138
SHCI_OCF_C2_ZIGBEE_INIT,
139139
SHCI_OCF_C2_LLD_TESTS_INIT,
140-
SHCI_OCF_C2_EXTPA_CONFIG
140+
SHCI_OCF_C2_EXTPA_CONFIG,
141+
SHCI_OCF_C2_SET_FLASH_ACTIVITY_CONTROL,
142+
SHCI_OCF_C2_LLD_BLE_INIT
141143
} SHCI_OCF_t;
142144

143145
#define SHCI_OPCODE_C2_FUS_GET_STATE (( SHCI_OGF << 10) + SHCI_OCF_C2_FUS_GET_STATE)
@@ -296,6 +298,20 @@ extern "C" {
296298

297299
#define SHCI_OPCODE_C2_DEBUG_INIT (( SHCI_OGF << 10) + SHCI_OCF_C2_DEBUG_INIT)
298300
/** Command parameters */
301+
typedef PACKED_STRUCT
302+
{
303+
uint8_t thread_config;
304+
uint8_t ble_config;
305+
uint8_t mac_802_15_4_config;
306+
uint8_t zigbee_config;
307+
} SHCI_C2_DEBUG_TracesConfig_t;
308+
309+
typedef PACKED_STRUCT
310+
{
311+
uint8_t ble_dtb_cfg;
312+
uint8_t reserved[3];
313+
} SHCI_C2_DEBUG_GeneralConfig_t;
314+
299315
typedef PACKED_STRUCT{
300316
uint8_t *pGpioConfig;
301317
uint8_t *pTracesConfig;
@@ -352,6 +368,8 @@ extern "C" {
352368

353369
#define SHCI_OPCODE_C2_LLD_TESTS_INIT (( SHCI_OGF << 10) + SHCI_OCF_C2_LLD_TESTS_INIT)
354370

371+
#define SHCI_OPCODE_C2_LLD_BLE_INIT (( SHCI_OGF << 10) + SHCI_OCF_C2_LLD_BLE_INIT)
372+
355373
#define SHCI_OPCODE_C2_EXTPA_CONFIG (( SHCI_OGF << 10) + SHCI_OCF_C2_EXTPA_CONFIG)
356374
/** Command parameters */
357375
enum
@@ -375,6 +393,16 @@ extern "C" {
375393

376394
/** No response parameters*/
377395

396+
#define SHCI_OPCODE_C2_SET_FLASH_ACTIVITY_CONTROL (( SHCI_OGF << 10) + SHCI_OCF_C2_SET_FLASH_ACTIVITY_CONTROL)
397+
/** Command parameters */
398+
typedef enum
399+
{
400+
FLASH_ACTIVITY_CONTROL_PES,
401+
FLASH_ACTIVITY_CONTROL_SEM7,
402+
}SHCI_C2_SET_FLASH_ACTIVITY_CONTROL_Source_t;
403+
404+
/** No response parameters*/
405+
378406
/* Exported type --------------------------------------------------------*/
379407

380408
typedef MB_WirelessFwInfoTable_t SHCI_WirelessFwInfoTable_t;
@@ -427,16 +455,21 @@ typedef MB_WirelessFwInfoTable_t SHCI_WirelessFwInfoTable_t;
427455
#define INFO_STACK_TYPE_MASK 0x000000ff
428456
#define INFO_STACK_TYPE_NONE 0
429457

430-
#define INFO_STACK_TYPE_BLE_STANDARD 0x1
431-
#define INFO_STACK_TYPE_BLE_HCI 0x2
458+
#define INFO_STACK_TYPE_BLE_STANDARD 0x01
459+
#define INFO_STACK_TYPE_BLE_HCI 0x02
460+
#define INFO_STACK_TYPE_BLE_LIGHT 0x03
432461
#define INFO_STACK_TYPE_THREAD_FTD 0x10
433462
#define INFO_STACK_TYPE_THREAD_MTD 0x11
434-
#define INFO_STACK_TYPE_ZIGBEE 0x30
463+
#define INFO_STACK_TYPE_ZIGBEE_FFD 0x30
464+
#define INFO_STACK_TYPE_ZIGBEE_RFD 0x31
435465
#define INFO_STACK_TYPE_MAC 0x40
436466
#define INFO_STACK_TYPE_BLE_THREAD_FTD_STATIC 0x50
437467
#define INFO_STACK_TYPE_802154_LLD_TESTS 0x60
438468
#define INFO_STACK_TYPE_802154_PHY_VALID 0x61
439469
#define INFO_STACK_TYPE_BLE_PHY_VALID 0x62
470+
#define INFO_STACK_TYPE_BLE_LLD_TESTS 0x63
471+
#define INFO_STACK_TYPE_BLE_RLV 0x64
472+
#define INFO_STACK_TYPE_802154_RLV 0x65
440473
#define INFO_STACK_TYPE_BLE_ZIGBEE_FFD_STATIC 0x70
441474

442475
typedef struct {
@@ -587,6 +620,16 @@ typedef struct {
587620
*/
588621
SHCI_CmdStatus_t SHCI_C2_LLDTESTS_Init( uint8_t param_size, uint8_t * p_param );
589622

623+
/**
624+
* SHCI_C2_LLD_BLE_Init
625+
* @brief Starts the LLD tests CLI
626+
*
627+
* @param param_size : Nb of bytes
628+
* @param p_param : pointeur with data to give from M4 to M0
629+
* @retval Status
630+
*/
631+
SHCI_CmdStatus_t SHCI_C2_LLD_BLE_Init( uint8_t param_size, uint8_t * p_param );
632+
590633
/**
591634
* SHCI_C2_ZIGBEE_Init
592635
* @brief Starts the Zigbee Stack
@@ -706,6 +749,18 @@ typedef struct {
706749
*/
707750
SHCI_CmdStatus_t SHCI_C2_ExtpaConfig(uint32_t gpio_port, uint16_t gpio_pin_number, uint8_t gpio_polarity, uint8_t gpio_status);
708751

752+
/**
753+
* SHCI_C2_SetFlashActivityControl
754+
* @brief Set the mechanism to be used on CPU2 to prevent the CPU1 to either write or erase in flash
755+
*
756+
* @param Source: It can be one of the following list
757+
* - FLASH_ACTIVITY_CONTROL_PES : The CPU2 set the PES bit to prevent the CPU1 to either read or write in flash
758+
* - FLASH_ACTIVITY_CONTROL_SEM7 : The CPU2 gets the semaphore 7 to prevent the CPU1 to either read or write in flash.
759+
* This requires the CPU1 to first get semaphore 7 before erasing or writing the flash.
760+
*
761+
* @retval Status
762+
*/
763+
SHCI_CmdStatus_t SHCI_C2_SetFlashActivityControl(SHCI_C2_SET_FLASH_ACTIVITY_CONTROL_Source_t Source);
709764

710765
#ifdef __cplusplus
711766
}

0 commit comments

Comments
 (0)