Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit cf77ef0

Browse files
authoredApr 5, 2023
Merge pull request #55 from fpistm/CubeWB_v1.16.0
chore: update to STM32Cube_FW v1.16.0
2 parents df96671 + a9bef0c commit cf77ef0

File tree

15 files changed

+1089
-51
lines changed

15 files changed

+1089
-51
lines changed
 

‎src/utility/HCISharedMemTransport.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,8 @@ int HCISharedMemTransportClass::stm32wb_start_ble(void)
658658
CFG_BLE_MAX_ADV_DATA_LEN,
659659
CFG_BLE_TX_PATH_COMPENS,
660660
CFG_BLE_RX_PATH_COMPENS,
661-
CFG_BLE_CORE_VERSION
661+
CFG_BLE_CORE_VERSION,
662+
CFG_BLE_OPTIONS_EXT
662663
};
663664
/**
664665
* Starts the BLE Stack on CPU2

‎src/utility/STM32Cube_FW/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
## Source
33

4-
[STMicroelectronics/STM32CubeWB Release vv1.15.0](https://github.com/STMicroelectronics/STM32CubeWB/releases/tag/vv1.15.0)
5-
- Application: [BLE_TransparentMode](https://github.com/STMicroelectronics/STM32CubeWB/tree/vv1.15.0/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode)
4+
[STMicroelectronics/STM32CubeWB Release vvv1.16.0](https://github.com/STMicroelectronics/STM32CubeWB/releases/tag/vvv1.16.0)
5+
- Application: [BLE_TransparentMode](https://github.com/STMicroelectronics/STM32CubeWB/tree/vvv1.16.0/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode)
66

‎src/utility/STM32Cube_FW/app_conf_default.h

Lines changed: 437 additions & 10 deletions
Large diffs are not rendered by default.

‎src/utility/STM32Cube_FW/ble_bufsize.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*****************************************************************************
66
* @attention
77
*
8-
* Copyright (c) 2018-2022 STMicroelectronics.
8+
* Copyright (c) 2018-2023 STMicroelectronics.
99
* All rights reserved.
1010
*
1111
* This software is licensed under terms that can be found in the LICENSE file
@@ -86,11 +86,11 @@
8686
* BLE_FIXED_BUFFER_SIZE_BYTES:
8787
* A part of the RAM, is dynamically allocated by initializing all the pointers
8888
* defined in a global context variable "mem_alloc_ctx_p".
89-
* This initialization is made in the Dynamic_allocator functions, which
89+
* This initialization is made in the Dynamic_allocator functions, which
9090
* assign a portion of RAM given by the external application to the above
9191
* mentioned "global pointers".
9292
*
93-
* The size of this Dynamic RAM is made of 2 main components:
93+
* The size of this Dynamic RAM is made of 2 main components:
9494
* - a part that is parameters-dependent (num of links, GATT buffers, ...),
9595
* and which value is made explicit by the following macro;
9696
* - a part, that may be considered "fixed", i.e. independent from the above
@@ -120,11 +120,11 @@
120120
#elif (LL_ONLY != 0)
121121
#define BLE_PER_LINK_SIZE_BYTES 244 /* LL only Full */
122122
#elif (SLAVE_ONLY != 0)
123-
#define BLE_PER_LINK_SIZE_BYTES 336 /* Peripheral only */
123+
#define BLE_PER_LINK_SIZE_BYTES 344 /* Peripheral only */
124124
#elif (BASIC_FEATURES != 0)
125-
#define BLE_PER_LINK_SIZE_BYTES 412 /* Basic Features */
125+
#define BLE_PER_LINK_SIZE_BYTES 420 /* Basic Features */
126126
#else
127-
#define BLE_PER_LINK_SIZE_BYTES 424 /* Full stack */
127+
#define BLE_PER_LINK_SIZE_BYTES 432 /* Full stack */
128128
#endif
129129

130130
/*

‎src/utility/STM32Cube_FW/hw.h

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ extern "C" {
4141
******************************************************************************/
4242
void HW_IPCC_Enable( void );
4343
void HW_IPCC_Init( void );
44+
#define HW_IPCC_Rx_Handler IPCC_C1_RX_IRQHandler
45+
#define HW_IPCC_Tx_Handler IPCC_C1_TX_IRQHandler
4446

4547
void HW_IPCC_BLE_Init( void );
4648
void HW_IPCC_BLE_SendCmd( void );
@@ -83,10 +85,27 @@ extern "C" {
8385
void HW_IPCC_BLE_LLD_ReceiveRsp( void );
8486
void HW_IPCC_BLE_LLD_SendRspAck( void );
8587

86-
88+
8789
void HW_IPCC_TRACES_Init( void );
8890
void HW_IPCC_TRACES_EvtNot( void );
8991

92+
void HW_IPCC_MAC_802_15_4_Init( void );
93+
void HW_IPCC_MAC_802_15_4_SendCmd( void );
94+
void HW_IPCC_MAC_802_15_4_SendAck( void );
95+
void HW_IPCC_MAC_802_15_4_CmdEvtNot( void );
96+
void HW_IPCC_MAC_802_15_4_EvtNot( void );
97+
98+
void HW_IPCC_ZIGBEE_Init( void );
99+
100+
void HW_IPCC_ZIGBEE_SendM4RequestToM0(void); /* M4 Request to M0 */
101+
void HW_IPCC_ZIGBEE_RecvAppliAckFromM0(void); /* Request ACK from M0 */
102+
103+
void HW_IPCC_ZIGBEE_RecvM0NotifyToM4(void); /* M0 Notify to M4 */
104+
void HW_IPCC_ZIGBEE_SendM4AckToM0Notify(void); /* Notify ACK from M4 */
105+
void HW_IPCC_ZIGBEE_RecvM0RequestToM4(void); /* M0 Request to M4 */
106+
void HW_IPCC_ZIGBEE_SendM4AckToM0Request(void); /* Request ACK from M4 */
107+
108+
90109
#ifdef __cplusplus
91110
}
92111
#endif

‎src/utility/STM32Cube_FW/hw_ipcc.c

Lines changed: 212 additions & 2 deletions
Large diffs are not rendered by default.

‎src/utility/STM32Cube_FW/mbox_def.h

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,12 @@ extern "C" {
106106
uint8_t *m0cmd_buffer;
107107
} MB_BleLldTable_t;
108108

109+
typedef struct
110+
{
111+
uint8_t *notifM0toM4_buffer;
112+
uint8_t *appliCmdM4toM0_buffer;
113+
uint8_t *requestM0toM4_buffer;
114+
} MB_ZigbeeTable_t;
109115
/**
110116
* msg
111117
* [0:7] = cmd/evt
@@ -133,6 +139,13 @@ extern "C" {
133139
uint8_t *traces_queue;
134140
} MB_TracesTable_t;
135141

142+
typedef struct
143+
{
144+
uint8_t *p_cmdrsp_buffer;
145+
uint8_t *p_notack_buffer;
146+
uint8_t *evt_queue;
147+
} MB_Mac_802_15_4_t;
148+
136149
typedef struct
137150
{
138151
MB_DeviceInfoTable_t *p_device_info_table;
@@ -141,6 +154,8 @@ extern "C" {
141154
MB_SysTable_t *p_sys_table;
142155
MB_MemManagerTable_t *p_mem_manager_table;
143156
MB_TracesTable_t *p_traces_table;
157+
MB_Mac_802_15_4_t *p_mac_802_15_4_table;
158+
MB_ZigbeeTable_t *p_zigbee_table;
144159
MB_LldTestsTable_t *p_lld_tests_table;
145160
MB_BleLldTable_t *p_ble_lld_table;
146161
} MB_RefTable_t;
@@ -184,6 +199,15 @@ typedef struct
184199
* | |
185200
* |<---HW_IPCC_SYSTEM_EVENT_CHANNEL-----------------|
186201
* | |
202+
* | (ZIGBEE) |
203+
* |----HW_IPCC_ZIGBEE_CMD_APPLI_CHANNEL------------>|
204+
* | |
205+
* |----HW_IPCC_ZIGBEE_CMD_CLI_CHANNEL-------------->|
206+
* | |
207+
* |<---HW_IPCC_ZIGBEE_APPLI_NOTIF_ACK_CHANNEL-------|
208+
* | |
209+
* |<---HW_IPCC_ZIGBEE_CLI_NOTIF_ACK_CHANNEL---------|
210+
* | |
187211
* | (THREAD) |
188212
* |----HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL----------->|
189213
* | |
@@ -207,6 +231,11 @@ typedef struct
207231
* | |
208232
* |<---HW_IPCC_BLE_LLD_M0_CMD_CHANNEL---------------|
209233
* | |
234+
* | (MAC) |
235+
* |----HW_IPCC_MAC_802_15_4_CMD_RSP_CHANNEL-------->|
236+
* | |
237+
* |<---HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL|
238+
* | |
210239
* | (BUFFER) |
211240
* |----HW_IPCC_MM_RELEASE_BUFFER_CHANNE------------>|
212241
* | |
@@ -224,6 +253,8 @@ typedef struct
224253
#define HW_IPCC_BLE_CMD_CHANNEL LL_IPCC_CHANNEL_1
225254
#define HW_IPCC_SYSTEM_CMD_RSP_CHANNEL LL_IPCC_CHANNEL_2
226255
#define HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL LL_IPCC_CHANNEL_3
256+
#define HW_IPCC_ZIGBEE_CMD_APPLI_CHANNEL LL_IPCC_CHANNEL_3
257+
#define HW_IPCC_MAC_802_15_4_CMD_RSP_CHANNEL LL_IPCC_CHANNEL_3
227258
#define HW_IPCC_MM_RELEASE_BUFFER_CHANNEL LL_IPCC_CHANNEL_4
228259
#define HW_IPCC_THREAD_CLI_CMD_CHANNEL LL_IPCC_CHANNEL_5
229260
#define HW_IPCC_LLDTESTS_CLI_CMD_CHANNEL LL_IPCC_CHANNEL_5
@@ -235,12 +266,15 @@ typedef struct
235266
#define HW_IPCC_BLE_EVENT_CHANNEL LL_IPCC_CHANNEL_1
236267
#define HW_IPCC_SYSTEM_EVENT_CHANNEL LL_IPCC_CHANNEL_2
237268
#define HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL LL_IPCC_CHANNEL_3
269+
#define HW_IPCC_ZIGBEE_APPLI_NOTIF_ACK_CHANNEL LL_IPCC_CHANNEL_3
270+
#define HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL LL_IPCC_CHANNEL_3
238271
#define HW_IPCC_LLDTESTS_M0_CMD_CHANNEL LL_IPCC_CHANNEL_3
239272
#define HW_IPCC_BLE_LLD_M0_CMD_CHANNEL LL_IPCC_CHANNEL_3
240273
#define HW_IPCC_TRACES_CHANNEL LL_IPCC_CHANNEL_4
241274
#define HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL LL_IPCC_CHANNEL_5
242275
#define HW_IPCC_LLDTESTS_CLI_RSP_CHANNEL LL_IPCC_CHANNEL_5
243276
#define HW_IPCC_BLE_LLD_CLI_RSP_CHANNEL LL_IPCC_CHANNEL_5
244277
#define HW_IPCC_BLE_LLD_RSP_CHANNEL LL_IPCC_CHANNEL_5
278+
#define HW_IPCC_ZIGBEE_M0_REQUEST_CHANNEL LL_IPCC_CHANNEL_5
245279
#endif /*__MBOX_H */
246280

‎src/utility/STM32Cube_FW/shci.c

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,24 @@ SHCI_CmdStatus_t SHCI_C2_BLE_LLD_Init( uint8_t param_size, uint8_t * p_param )
352352
return (SHCI_CmdStatus_t)(((TL_CcEvt_t*)(p_rsp->evtserial.evt.payload))->payload[0]);
353353
}
354354

355+
SHCI_CmdStatus_t SHCI_C2_ZIGBEE_Init( void )
356+
{
357+
/**
358+
* Buffer is large enough to hold command complete without payload
359+
*/
360+
uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE];
361+
TL_EvtPacket_t * p_rsp;
362+
363+
p_rsp = (TL_EvtPacket_t *)local_buffer;
364+
365+
shci_send( SHCI_OPCODE_C2_ZIGBEE_INIT,
366+
0,
367+
0,
368+
p_rsp );
369+
370+
return (SHCI_CmdStatus_t)(((TL_CcEvt_t*)(p_rsp->evtserial.evt.payload))->payload[0]);
371+
}
372+
355373
SHCI_CmdStatus_t SHCI_C2_DEBUG_Init( SHCI_C2_DEBUG_Init_Cmd_Packet_t *pCmdPacket )
356374
{
357375
/**
@@ -509,6 +527,24 @@ SHCI_CmdStatus_t SHCI_C2_RADIO_AllowLowPower( SHCI_C2_FLASH_Ip_t Ip,uint8_t Fla
509527
return (SHCI_CmdStatus_t)(((TL_CcEvt_t*)(p_rsp->evtserial.evt.payload))->payload[0]);
510528
}
511529

530+
SHCI_CmdStatus_t SHCI_C2_MAC_802_15_4_Init( void )
531+
{
532+
/**
533+
* Buffer is large enough to hold command complete without payload
534+
*/
535+
uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE];
536+
TL_EvtPacket_t * p_rsp;
537+
538+
p_rsp = (TL_EvtPacket_t *)local_buffer;
539+
540+
shci_send( SHCI_OPCODE_C2_MAC_802_15_4_INIT,
541+
0,
542+
0,
543+
p_rsp );
544+
545+
return (SHCI_CmdStatus_t)(((TL_CcEvt_t*)(p_rsp->evtserial.evt.payload))->payload[0]);
546+
}
547+
512548
SHCI_CmdStatus_t SHCI_C2_Reinit( void )
513549
{
514550
/**

‎src/utility/STM32Cube_FW/shci.h

Lines changed: 63 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ extern "C" {
4949
ERR_BLE_INIT = 0, /* This event is currently not reported by the CPU2 */
5050
ERR_THREAD_LLD_FATAL_ERROR = 125, /* The LLD driver used on 802_15_4 detected a fatal error */
5151
ERR_THREAD_UNKNOWN_CMD = 126, /* The command send by the CPU1 to control the Thread stack is unknown */
52+
ERR_ZIGBEE_UNKNOWN_CMD = 200, /* The command send by the CPU1 to control the Zigbee stack is unknown */
5253
} SCHI_SystemErrCode_t;
5354

5455
#define SHCI_EVTCODE ( 0xFF )
@@ -215,7 +216,9 @@ extern "C" {
215216
SHCI_OCF_C2_FLASH_STORE_DATA,
216217
SHCI_OCF_C2_FLASH_ERASE_DATA,
217218
SHCI_OCF_C2_RADIO_ALLOW_LOW_POWER,
219+
SHCI_OCF_C2_MAC_802_15_4_INIT,
218220
SHCI_OCF_C2_REINIT,
221+
SHCI_OCF_C2_ZIGBEE_INIT,
219222
SHCI_OCF_C2_LLD_TESTS_INIT,
220223
SHCI_OCF_C2_EXTPA_CONFIG,
221224
SHCI_OCF_C2_SET_FLASH_ACTIVITY_CONTROL,
@@ -433,7 +436,7 @@ extern "C" {
433436
* PrWriteListSize
434437
* NOTE: This parameter is ignored by the CPU2 when the parameter "Options" is set to "LL_only" ( see Options description in that structure )
435438
*
436-
* Maximum number of supported "prepare write request"
439+
* Maximum number of supported “prepare write request”
437440
* - Min value: given by the macro DEFAULT_PREP_WRITE_LIST_SIZE
438441
* - Max value: a value higher than the minimum required can be specified, but it is not recommended
439442
*/
@@ -500,7 +503,7 @@ extern "C" {
500503
* MaxConnEventLength
501504
* This parameter determines the maximum duration of a slave connection event. When this duration is reached the slave closes
502505
* the current connections event (whatever is the CE_length parameter specified by the master in HCI_CREATE_CONNECTION HCI command),
503-
* expressed in units of 625/256 µs (~2.44 µs)
506+
* expressed in units of 625/256 µs (~2.44 µs)
504507
* - Min value: 0 (if 0 is specified, the master and slave perform only a single TX-RX exchange per connection event)
505508
* - Max value: 1638400 (4000 ms). A higher value can be specified (max 0xFFFFFFFF) but results in a maximum connection time
506509
* of 4000 ms as specified. In this case the parameter is not applied, and the predicted CE length calculated on slave is not shortened
@@ -509,7 +512,7 @@ extern "C" {
509512

510513
/**
511514
* HsStartupTime
512-
* Startup time of the high speed (16 or 32 MHz) crystal oscillator in units of 625/256 µs (~2.44 µs).
515+
* Startup time of the high speed (16 or 32 MHz) crystal oscillator in units of 625/256 µs (~2.44 µs).
513516
* - Min value: 0
514517
* - Max value: 820 (~2 ms). A higher value can be specified, but the value that implemented in stack is forced to ~2 ms
515518
*/
@@ -533,9 +536,7 @@ extern "C" {
533536
* - bit 5: 1: Reduced GATT database in NVM 0: Full GATT database in NVM
534537
* - bit 6: 1: GATT caching is used 0: GATT caching is not used
535538
* - bit 7: 1: LE Power Class 1 0: LE Power Classe 2-3
536-
* - bit 8: 1: appearance Writable 0: appearance Read-Only
537-
* - bit 9: 1: Enhanced ATT supported 0: Enhanced ATT not supported
538-
* - other bits: reserved ( shall be set to 0)
539+
* - other bits: complete with Options_extension flag
539540
*/
540541
uint8_t Options;
541542

@@ -601,6 +602,14 @@ extern "C" {
601602
*/
602603
uint8_t ble_core_version;
603604

605+
/**
606+
* Options flags extension
607+
* - bit 0: 1: appearance Writable 0: appearance Read-Only
608+
* - bit 1: 1: Enhanced ATT supported 0: Enhanced ATT not supported
609+
* - other bits: reserved ( shall be set to 0)
610+
*/
611+
uint8_t Options_extension;
612+
604613
} SHCI_C2_Ble_Init_Cmd_Param_t;
605614

606615
typedef PACKED_STRUCT{
@@ -637,11 +646,16 @@ extern "C" {
637646
#define SHCI_C2_BLE_INIT_OPTIONS_POWER_CLASS_1 (1<<7)
638647
#define SHCI_C2_BLE_INIT_OPTIONS_POWER_CLASS_2_3 (0<<7)
639648

640-
#define SHCI_C2_BLE_INIT_OPTIONS_APPEARANCE_WRITABLE (1<<8)
641-
#define SHCI_C2_BLE_INIT_OPTIONS_APPEARANCE_READONLY (0<<8)
649+
/**
650+
* Options extension
651+
* Each definition below may be added together to build the Options value
652+
* WARNING : Only one definition per bit shall be added to build the Options value
653+
*/
654+
#define SHCI_C2_BLE_INIT_OPTIONS_APPEARANCE_WRITABLE (1<<0)
655+
#define SHCI_C2_BLE_INIT_OPTIONS_APPEARANCE_READONLY (0<<0)
642656

643-
#define SHCI_C2_BLE_INIT_OPTIONS_ENHANCED_ATT_SUPPORTED (1<<9)
644-
#define SHCI_C2_BLE_INIT_OPTIONS_ENHANCED_ATT_NOTSUPPORTED (0<<9)
657+
#define SHCI_C2_BLE_INIT_OPTIONS_ENHANCED_ATT_SUPPORTED (1<<1)
658+
#define SHCI_C2_BLE_INIT_OPTIONS_ENHANCED_ATT_NOTSUPPORTED (0<<1)
645659

646660
/**
647661
* RX models configuration
@@ -675,6 +689,8 @@ extern "C" {
675689
{
676690
uint8_t thread_config;
677691
uint8_t ble_config;
692+
uint8_t mac_802_15_4_config;
693+
uint8_t zigbee_config;
678694
} SHCI_C2_DEBUG_TracesConfig_t;
679695

680696
typedef PACKED_STRUCT
@@ -738,6 +754,8 @@ extern "C" {
738754
{
739755
BLE_ENABLE,
740756
THREAD_ENABLE,
757+
ZIGBEE_ENABLE,
758+
MAC_ENABLE,
741759
} SHCI_C2_CONCURRENT_Mode_Param_t;
742760
/** No response parameters*/
743761

@@ -760,13 +778,18 @@ extern "C" {
760778
{
761779
BLE_IP,
762780
THREAD_IP,
781+
ZIGBEE_IP,
763782
} SHCI_C2_FLASH_Ip_t;
764783
/** No response parameters*/
765784

766785
#define SHCI_OPCODE_C2_RADIO_ALLOW_LOW_POWER (( SHCI_OGF << 10) + SHCI_OCF_C2_RADIO_ALLOW_LOW_POWER)
767786

787+
#define SHCI_OPCODE_C2_MAC_802_15_4_INIT (( SHCI_OGF << 10) + SHCI_OCF_C2_MAC_802_15_4_INIT)
788+
768789
#define SHCI_OPCODE_C2_REINIT (( SHCI_OGF << 10) + SHCI_OCF_C2_REINIT)
769790

791+
#define SHCI_OPCODE_C2_ZIGBEE_INIT (( SHCI_OGF << 10) + SHCI_OCF_C2_ZIGBEE_INIT)
792+
770793
#define SHCI_OPCODE_C2_LLD_TESTS_INIT (( SHCI_OGF << 10) + SHCI_OCF_C2_LLD_TESTS_INIT)
771794

772795
#define SHCI_OPCODE_C2_BLE_LLD_INIT (( SHCI_OGF << 10) + SHCI_OCF_C2_BLE_LLD_INIT)
@@ -881,7 +904,7 @@ extern "C" {
881904
#define FUS_DEVICE_INFO_TABLE_VALIDITY_KEYWORD (0xA94656B9)
882905

883906
/*
884-
* At startup, the information relative to the wireless binary are stored in RAM through a structure defined by
907+
* At startup, the informations relative to the wireless binary are stored in RAM trough a structure defined by
885908
* MB_WirelessFwInfoTable_t.This structure contains 4 fields (Version,MemorySize, Stack_info and a reserved part)
886909
* each of those coded on 32 bits as shown on the table below:
887910
*
@@ -937,6 +960,9 @@ extern "C" {
937960
#define INFO_STACK_TYPE_BLE_HCI_EXT_ADV 0x07
938961
#define INFO_STACK_TYPE_THREAD_FTD 0x10
939962
#define INFO_STACK_TYPE_THREAD_MTD 0x11
963+
#define INFO_STACK_TYPE_ZIGBEE_FFD 0x30
964+
#define INFO_STACK_TYPE_ZIGBEE_RFD 0x31
965+
#define INFO_STACK_TYPE_MAC 0x40
940966
#define INFO_STACK_TYPE_BLE_THREAD_FTD_STATIC 0x50
941967
#define INFO_STACK_TYPE_BLE_THREAD_FTD_DYAMIC 0x51
942968
#define INFO_STACK_TYPE_802154_LLD_TESTS 0x60
@@ -945,7 +971,12 @@ extern "C" {
945971
#define INFO_STACK_TYPE_BLE_LLD_TESTS 0x63
946972
#define INFO_STACK_TYPE_BLE_RLV 0x64
947973
#define INFO_STACK_TYPE_802154_RLV 0x65
974+
#define INFO_STACK_TYPE_BLE_ZIGBEE_FFD_STATIC 0x70
975+
#define INFO_STACK_TYPE_BLE_ZIGBEE_RFD_STATIC 0x71
976+
#define INFO_STACK_TYPE_BLE_ZIGBEE_FFD_DYNAMIC 0x78
977+
#define INFO_STACK_TYPE_BLE_ZIGBEE_RFD_DYNAMIC 0x79
948978
#define INFO_STACK_TYPE_RLV 0x80
979+
#define INFO_STACK_TYPE_BLE_MAC_STATIC 0x90
949980

950981
typedef struct {
951982
/**
@@ -1119,7 +1150,7 @@ typedef struct {
11191150
* @brief Starts the LLD tests CLI
11201151
*
11211152
* @param param_size : Nb of bytes
1122-
* @param p_param : pointer with data to give from M4 to M0
1153+
* @param p_param : pointeur with data to give from M4 to M0
11231154
* @retval Status
11241155
*/
11251156
SHCI_CmdStatus_t SHCI_C2_LLDTESTS_Init( uint8_t param_size, uint8_t * p_param );
@@ -1129,11 +1160,20 @@ typedef struct {
11291160
* @brief Starts the LLD tests BLE
11301161
*
11311162
* @param param_size : Nb of bytes
1132-
* @param p_param : pointer with data to give from M4 to M0
1163+
* @param p_param : pointeur with data to give from M4 to M0
11331164
* @retval Status
11341165
*/
11351166
SHCI_CmdStatus_t SHCI_C2_BLE_LLD_Init( uint8_t param_size, uint8_t * p_param );
11361167

1168+
/**
1169+
* SHCI_C2_ZIGBEE_Init
1170+
* @brief Starts the Zigbee Stack
1171+
*
1172+
* @param None
1173+
* @retval Status
1174+
*/
1175+
SHCI_CmdStatus_t SHCI_C2_ZIGBEE_Init( void );
1176+
11371177
/**
11381178
* SHCI_C2_DEBUG_Init
11391179
* @brief Starts the Traces
@@ -1208,6 +1248,16 @@ typedef struct {
12081248
*/
12091249
SHCI_CmdStatus_t SHCI_C2_RADIO_AllowLowPower( SHCI_C2_FLASH_Ip_t Ip,uint8_t FlagRadioLowPowerOn);
12101250

1251+
1252+
/**
1253+
* SHCI_C2_MAC_802_15_4_Init
1254+
* @brief Starts the MAC 802.15.4 on M0
1255+
*
1256+
* @param None
1257+
* @retval Status
1258+
*/
1259+
SHCI_CmdStatus_t SHCI_C2_MAC_802_15_4_Init( void );
1260+
12111261
/**
12121262
* SHCI_GetWirelessFwInfo
12131263
* @brief This function read back the informations relative to the wireless binary loaded.

‎src/utility/STM32Cube_FW/shci_tl.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ void shci_init(void(* UserEvtRx)(void* pData), void* pConf)
7272
shci_register_io_bus (&shciContext.io);
7373

7474
TlInit((TL_CmdPacket_t *)(((SHCI_TL_HciInitConf_t *)pConf)->p_cmdbuffer));
75+
76+
return;
7577
}
7678

7779
void shci_user_evt_proc(void)
@@ -127,6 +129,8 @@ void shci_user_evt_proc(void)
127129
shci_notify_asynch_evt((void*) &SHciAsynchEventQueue);
128130
}
129131

132+
133+
return;
130134
}
131135

132136
void shci_resume_flow( void )
@@ -138,6 +142,8 @@ void shci_resume_flow( void )
138142
* be called
139143
*/
140144
shci_notify_asynch_evt((void*) &SHciAsynchEventQueue);
145+
146+
return;
141147
}
142148

143149
void shci_send( uint16_t cmd_code, uint8_t len_cmd_payload, uint8_t * p_cmd_payload, TL_EvtPacket_t * p_rsp )
@@ -160,6 +166,8 @@ void shci_send( uint16_t cmd_code, uint8_t len_cmd_payload, uint8_t * p_cmd_payl
160166
memcpy( &(p_rsp->evtserial), pCmdBuffer, ((TL_EvtSerial_t*)pCmdBuffer)->evt.plen + TL_EVT_HDR_SIZE );
161167

162168
Cmd_SetStatus(SHCI_TL_CmdAvailable);
169+
170+
return;
163171
}
164172

165173
void shci_notify_asynch_evt(void *pdata)
@@ -198,6 +206,8 @@ static void TlInit( TL_CmdPacket_t * p_cmdbuffer )
198206
Conf.IoBusCallBackUserEvt = TlUserEvtReceived;
199207
shciContext.io.Init(&Conf);
200208
}
209+
210+
return;
201211
}
202212

203213
static void Cmd_SetStatus(SHCI_TL_CmdStatus_t shcicmdstatus)
@@ -218,18 +228,24 @@ static void Cmd_SetStatus(SHCI_TL_CmdStatus_t shcicmdstatus)
218228
StatusNotCallBackFunction( SHCI_TL_CmdAvailable );
219229
}
220230
}
231+
232+
return;
221233
}
222234

223235
static void TlCmdEvtReceived(TL_EvtPacket_t *shcievt)
224236
{
225237
(void)(shcievt);
226238
shci_cmd_resp_release(0); /**< Notify the application the Cmd response has been received */
239+
240+
return;
227241
}
228242

229243
static void TlUserEvtReceived(TL_EvtPacket_t *shcievt)
230244
{
231245
LST_insert_tail(&SHciAsynchEventQueue, (tListNode *)shcievt);
232246
shci_notify_asynch_evt((void*) &SHciAsynchEventQueue); /**< Notify the application a full HCI event has been received */
247+
248+
return;
233249
}
234250

235251
/* Weak implementation ----------------------------------------------------------------*/
@@ -241,12 +257,15 @@ __WEAK void shci_cmd_resp_wait(uint32_t timeout)
241257
break;
242258
}
243259
}
260+
return;
244261
}
245262

246263
__WEAK void shci_cmd_resp_release(uint32_t flag)
247264
{
248265
(void)flag;
249266

250267
CmdRspStatusFlag = SHCI_TL_CMD_RESP_RELEASE;
268+
269+
return;
251270
}
252271
#endif /* STM32WBxx */

‎src/utility/STM32Cube_FW/stm32_wpan_common.h

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,19 @@
2525
extern "C" {
2626
#endif
2727

28-
#define __ASM __asm /*!< asm keyword for GNU Compiler */
29-
#define __INLINE inline /*!< inline keyword for GNU Compiler */
30-
#define __STATIC_INLINE static inline
28+
#if defined ( __CC_ARM )||defined (__ARMCC_VERSION)
29+
#define __ASM __asm /*!< asm keyword for ARM Compiler */
30+
#define __INLINE __inline /*!< inline keyword for ARM Compiler */
31+
#define __STATIC_INLINE static __inline
32+
#elif defined ( __ICCARM__ )
33+
#define __ASM __asm /*!< asm keyword for IAR Compiler */
34+
#define __INLINE inline /*!< inline keyword for IAR Compiler. Only available in High optimization mode! */
35+
#define __STATIC_INLINE static inline
36+
#elif defined ( __GNUC__ )
37+
#define __ASM __asm /*!< asm keyword for GNU Compiler */
38+
#define __INLINE inline /*!< inline keyword for GNU Compiler */
39+
#define __STATIC_INLINE static inline
40+
#endif
3141

3242
#include <stdint.h>
3343
#include <string.h>
@@ -130,8 +140,29 @@ extern "C" {
130140
/* ----------------------------------- *
131141
* Packed usage (compiler dependent) *
132142
* ----------------------------------- */
143+
#undef PACKED__
133144
#undef PACKED_STRUCT
134-
#define PACKED_STRUCT struct __packed
145+
146+
#if defined ( __CC_ARM )
147+
#if defined ( __GNUC__ )
148+
/* GNU extension */
149+
#define PACKED__ __attribute__((packed))
150+
#define PACKED_STRUCT struct PACKED__
151+
#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050U)
152+
#define PACKED__ __attribute__((packed))
153+
#define PACKED_STRUCT struct PACKED__
154+
#else
155+
#define PACKED__(TYPE) __packed TYPE
156+
#define PACKED_STRUCT PACKED__(struct)
157+
#endif
158+
#elif defined ( __GNUC__ )
159+
#define PACKED__ __attribute__((packed))
160+
#define PACKED_STRUCT struct PACKED__
161+
#elif defined (__ICCARM__)
162+
#define PACKED_STRUCT __packed struct
163+
#else
164+
#define PACKED_STRUCT __packed struct
165+
#endif
135166

136167
#ifdef __cplusplus
137168
}

‎src/utility/STM32Cube_FW/stm_list.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@
2020
/******************************************************************************
2121
* Include Files
2222
******************************************************************************/
23-
#include "stm_list.h"
23+
#include "stdint.h"
2424
#include "cmsis_gcc.h"
2525
#include "stm32_wpan_common.h"
2626

27+
#include "stm_list.h"
28+
2729
/******************************************************************************
2830
* Function Definitions
2931
******************************************************************************/
@@ -33,20 +35,20 @@ void LST_init_head (tListNode * listHead)
3335
listHead->prev = listHead;
3436
}
3537

36-
bool LST_is_empty (tListNode * listHead)
38+
uint8_t LST_is_empty (tListNode * listHead)
3739
{
3840
uint32_t primask_bit;
39-
bool return_value;
41+
uint8_t return_value;
4042

4143
primask_bit = __get_PRIMASK(); /**< backup PRIMASK bit */
4244
__disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
4345
if(listHead->next == listHead)
4446
{
45-
return_value = true;
47+
return_value = TRUE;
4648
}
4749
else
4850
{
49-
return_value = false;
51+
return_value = FALSE;
5052
}
5153
__set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
5254

‎src/utility/STM32Cube_FW/stm_list.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
#define _STM_LIST_H_
2222

2323
/* Includes ------------------------------------------------------------------*/
24-
#include "stdint.h"
25-
#include "stdbool.h"
2624
#include "stm32_wpan_common.h"
2725

2826
typedef PACKED_STRUCT _tListNode {
@@ -32,7 +30,7 @@ typedef PACKED_STRUCT _tListNode {
3230

3331
void LST_init_head (tListNode * listHead);
3432

35-
bool LST_is_empty (tListNode * listHead);
33+
uint8_t LST_is_empty (tListNode * listHead);
3634

3735
void LST_insert_head (tListNode * listHead, tListNode * node);
3836

‎src/utility/STM32Cube_FW/tl.h

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,19 @@ typedef struct
205205
uint8_t *p_BleLldM0CmdBuffer;
206206
} TL_BLE_LLD_Config_t;
207207

208+
typedef struct
209+
{
210+
uint8_t *p_Mac_802_15_4_CmdRspBuffer;
211+
uint8_t *p_Mac_802_15_4_NotAckBuffer;
212+
} TL_MAC_802_15_4_Config_t;
213+
214+
typedef struct
215+
{
216+
uint8_t *p_ZigbeeOtCmdRspBuffer;
217+
uint8_t *p_ZigbeeNotAckBuffer;
218+
uint8_t *p_ZigbeeNotifRequestBuffer;
219+
} TL_ZIGBEE_Config_t;
220+
208221
/**
209222
* @brief Contain the BLE HCI Init Configuration
210223
* @{
@@ -228,6 +241,43 @@ typedef struct
228241
uint8_t *p_cmdbuffer;
229242
} TL_SYS_InitConf_t;
230243

244+
/*****************************************************************************************
245+
* Event type copied from ble_legacy.h
246+
*/
247+
248+
typedef PACKED_STRUCT
249+
{
250+
uint8_t type;
251+
uint8_t data[1];
252+
} hci_uart_pckt;
253+
254+
typedef PACKED_STRUCT
255+
{
256+
uint8_t evt;
257+
uint8_t plen;
258+
uint8_t data[1];
259+
} hci_event_pckt;
260+
261+
typedef PACKED_STRUCT
262+
{
263+
uint8_t subevent;
264+
uint8_t data[1];
265+
} evt_le_meta_event;
266+
267+
/**
268+
* Vendor specific event for BLE core.
269+
*/
270+
typedef PACKED_STRUCT
271+
{
272+
uint16_t ecode; /**< One of the BLE core event codes. */
273+
uint8_t data[1];
274+
} evt_blecore_aci;
275+
276+
/* Bluetooth 48 bit address (in little-endian order).
277+
*/
278+
typedef uint8_t tBDAddr[6];
279+
280+
231281
/* Exported constants --------------------------------------------------------*/
232282
/* External variables --------------------------------------------------------*/
233283
/* Exported macros -----------------------------------------------------------*/
@@ -298,6 +348,26 @@ void TL_MM_EvtDone( TL_EvtPacket_t * hcievt );
298348
void TL_TRACES_Init( void );
299349
void TL_TRACES_EvtReceived( TL_EvtPacket_t * hcievt );
300350

351+
/******************************************************************************
352+
* MAC 802.15.4
353+
******************************************************************************/
354+
void TL_MAC_802_15_4_Init( TL_MAC_802_15_4_Config_t *p_Config );
355+
void TL_MAC_802_15_4_SendCmd( void );
356+
void TL_MAC_802_15_4_CmdEvtReceived( TL_EvtPacket_t * Otbuffer );
357+
void TL_MAC_802_15_4_NotReceived( TL_EvtPacket_t * Notbuffer );
358+
void TL_MAC_802_15_4_SendAck ( void );
359+
360+
/******************************************************************************
361+
* ZIGBEE
362+
******************************************************************************/
363+
void TL_ZIGBEE_Init( TL_ZIGBEE_Config_t *p_Config );
364+
void TL_ZIGBEE_SendM4RequestToM0( void );
365+
void TL_ZIGBEE_SendM4AckToM0Notify ( void );
366+
void TL_ZIGBEE_NotReceived( TL_EvtPacket_t * Notbuffer );
367+
void TL_ZIGBEE_CmdEvtReceived( TL_EvtPacket_t * Otbuffer );
368+
void TL_ZIGBEE_M0RequestReceived(TL_EvtPacket_t * Otbuffer );
369+
void TL_ZIGBEE_SendM4AckToM0Request(void);
370+
301371
#ifdef __cplusplus
302372
} /* extern "C" */
303373
#endif

‎src/utility/STM32Cube_FW/tl_mbox.c

Lines changed: 145 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,16 @@ PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_BleLldTable_t TL_BleLldTable;
5252
PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_SysTable_t TL_SysTable;
5353
PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_MemManagerTable_t TL_MemManagerTable;
5454
PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_TracesTable_t TL_TracesTable;
55-
55+
#if 0
56+
PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_Mac_802_15_4_t TL_Mac_802_15_4_Table;
57+
PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_ZigbeeTable_t TL_Zigbee_Table;
58+
#endif
5659
/**< tables */
5760
PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static tListNode FreeBufQueue;
5861
PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static tListNode TracesEvtQueue;
5962
PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static uint8_t CsBuffer[sizeof(TL_PacketHeader_t) + TL_EVT_HDR_SIZE + sizeof(TL_CsEvt_t)];
60-
PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static tListNode EvtQueue;
61-
PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static tListNode SystemEvtQueue;
63+
PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static tListNode EvtQueue;
64+
PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static tListNode SystemEvtQueue;
6265

6366

6467
static tListNode LocalFreeBufQueue;
@@ -76,7 +79,7 @@ static void OutputDbgTrace(TL_MB_PacketType_t packet_type, uint8_t* buffer);
7679
/* Public Functions Definition ------------------------------------------------------*/
7780

7881
/******************************************************************************
79-
* GENERAL
82+
* GENERAL - refer to AN5289 for functions description.
8083
******************************************************************************/
8184
void TL_Enable( void )
8285
{
@@ -96,6 +99,11 @@ void TL_Init( void )
9699
TL_RefTable.p_sys_table = &TL_SysTable;
97100
TL_RefTable.p_mem_manager_table = &TL_MemManagerTable;
98101
TL_RefTable.p_traces_table = &TL_TracesTable;
102+
103+
#if 0
104+
TL_RefTable.p_mac_802_15_4_table = &TL_Mac_802_15_4_Table;
105+
TL_RefTable.p_zigbee_table = &TL_Zigbee_Table;
106+
#endif
99107
HW_IPCC_Init();
100108

101109
return;
@@ -449,6 +457,139 @@ void TL_BLE_LLD_SendRspAck( void )
449457
}
450458
#endif /* BLE_LLD_WB */
451459

460+
#ifdef MAC_802_15_4_WB
461+
/******************************************************************************
462+
* MAC 802.15.4
463+
******************************************************************************/
464+
void TL_MAC_802_15_4_Init( TL_MAC_802_15_4_Config_t *p_Config )
465+
{
466+
MB_Mac_802_15_4_t * p_mac_802_15_4_table;
467+
468+
p_mac_802_15_4_table = TL_RefTable.p_mac_802_15_4_table;
469+
470+
p_mac_802_15_4_table->p_cmdrsp_buffer = p_Config->p_Mac_802_15_4_CmdRspBuffer;
471+
p_mac_802_15_4_table->p_notack_buffer = p_Config->p_Mac_802_15_4_NotAckBuffer;
472+
473+
HW_IPCC_MAC_802_15_4_Init();
474+
475+
return;
476+
}
477+
478+
void TL_MAC_802_15_4_SendCmd( void )
479+
{
480+
((TL_CmdPacket_t *)(TL_RefTable.p_mac_802_15_4_table->p_cmdrsp_buffer))->cmdserial.type = TL_OTCMD_PKT_TYPE;
481+
482+
HW_IPCC_MAC_802_15_4_SendCmd();
483+
484+
return;
485+
}
486+
487+
void TL_MAC_802_15_4_SendAck ( void )
488+
{
489+
((TL_CmdPacket_t *)(TL_RefTable.p_mac_802_15_4_table->p_notack_buffer))->cmdserial.type = TL_OTACK_PKT_TYPE;
490+
491+
HW_IPCC_MAC_802_15_4_SendAck();
492+
493+
return;
494+
}
495+
496+
void HW_IPCC_MAC_802_15_4_CmdEvtNot(void)
497+
{
498+
TL_MAC_802_15_4_CmdEvtReceived( (TL_EvtPacket_t*)(TL_RefTable.p_mac_802_15_4_table->p_cmdrsp_buffer) );
499+
500+
return;
501+
}
502+
503+
void HW_IPCC_MAC_802_15_4_EvtNot( void )
504+
{
505+
TL_MAC_802_15_4_NotReceived( (TL_EvtPacket_t*)(TL_RefTable.p_mac_802_15_4_table->p_notack_buffer) );
506+
507+
return;
508+
}
509+
510+
__WEAK void TL_MAC_802_15_4_CmdEvtReceived( TL_EvtPacket_t * Otbuffer ){};
511+
__WEAK void TL_MAC_802_15_4_NotReceived( TL_EvtPacket_t * Notbuffer ){};
512+
#endif
513+
514+
#ifdef ZIGBEE_WB
515+
/******************************************************************************
516+
* ZIGBEE
517+
******************************************************************************/
518+
void TL_ZIGBEE_Init( TL_ZIGBEE_Config_t *p_Config )
519+
{
520+
MB_ZigbeeTable_t * p_zigbee_table;
521+
522+
p_zigbee_table = TL_RefTable.p_zigbee_table;
523+
p_zigbee_table->appliCmdM4toM0_buffer = p_Config->p_ZigbeeOtCmdRspBuffer;
524+
p_zigbee_table->notifM0toM4_buffer = p_Config->p_ZigbeeNotAckBuffer;
525+
p_zigbee_table->requestM0toM4_buffer = p_Config->p_ZigbeeNotifRequestBuffer;
526+
527+
HW_IPCC_ZIGBEE_Init();
528+
529+
return;
530+
}
531+
532+
/* Zigbee M4 to M0 Request */
533+
void TL_ZIGBEE_SendM4RequestToM0( void )
534+
{
535+
((TL_CmdPacket_t *)(TL_RefTable.p_zigbee_table->appliCmdM4toM0_buffer))->cmdserial.type = TL_OTCMD_PKT_TYPE;
536+
537+
HW_IPCC_ZIGBEE_SendM4RequestToM0();
538+
539+
return;
540+
}
541+
542+
/* Used to receive an ACK from the M0 */
543+
void HW_IPCC_ZIGBEE_RecvAppliAckFromM0(void)
544+
{
545+
TL_ZIGBEE_CmdEvtReceived( (TL_EvtPacket_t*)(TL_RefTable.p_zigbee_table->appliCmdM4toM0_buffer) );
546+
547+
return;
548+
}
549+
550+
/* Zigbee notification from M0 to M4 */
551+
void HW_IPCC_ZIGBEE_RecvM0NotifyToM4( void )
552+
{
553+
TL_ZIGBEE_NotReceived( (TL_EvtPacket_t*)(TL_RefTable.p_zigbee_table->notifM0toM4_buffer) );
554+
555+
return;
556+
}
557+
558+
/* Send an ACK to the M0 for a Notification */
559+
void TL_ZIGBEE_SendM4AckToM0Notify ( void )
560+
{
561+
((TL_CmdPacket_t *)(TL_RefTable.p_zigbee_table->notifM0toM4_buffer))->cmdserial.type = TL_OTACK_PKT_TYPE;
562+
563+
HW_IPCC_ZIGBEE_SendM4AckToM0Notify();
564+
565+
return;
566+
}
567+
568+
/* Zigbee M0 to M4 Request */
569+
void HW_IPCC_ZIGBEE_RecvM0RequestToM4( void )
570+
{
571+
TL_ZIGBEE_M0RequestReceived( (TL_EvtPacket_t*)(TL_RefTable.p_zigbee_table->requestM0toM4_buffer) );
572+
573+
return;
574+
}
575+
576+
/* Send an ACK to the M0 for a Request */
577+
void TL_ZIGBEE_SendM4AckToM0Request(void)
578+
{
579+
((TL_CmdPacket_t *)(TL_RefTable.p_zigbee_table->requestM0toM4_buffer))->cmdserial.type = TL_OTACK_PKT_TYPE;
580+
581+
HW_IPCC_ZIGBEE_SendM4AckToM0Request();
582+
583+
return;
584+
}
585+
586+
587+
__WEAK void TL_ZIGBEE_CmdEvtReceived( TL_EvtPacket_t * Otbuffer ){};
588+
__WEAK void TL_ZIGBEE_NotReceived( TL_EvtPacket_t * Notbuffer ){};
589+
#endif
590+
591+
592+
452593
/******************************************************************************
453594
* MEMORY MANAGER
454595
******************************************************************************/

0 commit comments

Comments
 (0)
Please sign in to comment.