mirror of https://github.com/ARMmbed/mbed-os.git
STM32WB : BLE update from STM32Cube_FW_WB_V1.11.1
parent
c9af87dc63
commit
f904d10bd6
|
@ -1,6 +1,6 @@
|
|||
/*****************************************************************************
|
||||
* @file ble_bufsize.h
|
||||
* @author MCD Application Team
|
||||
* @author MCD
|
||||
* @brief Definition of BLE stack buffers size
|
||||
*****************************************************************************
|
||||
* @attention
|
||||
|
@ -25,11 +25,6 @@
|
|||
*/
|
||||
#define BLE_DEFAULT_ATT_MTU 23
|
||||
|
||||
/*
|
||||
* BLE_DEFAULT_MAX_ATT_MTU: maximum supported ATT MTU size.
|
||||
*/
|
||||
#define BLE_DEFAULT_MAX_ATT_MTU 158
|
||||
|
||||
/*
|
||||
* BLE_DEFAULT_MAX_ATT_SIZE: maximum attribute size.
|
||||
*/
|
||||
|
@ -81,13 +76,6 @@
|
|||
((pw) + MAX(BLE_MEM_BLOCK_X_MTU(mtu, n_link), \
|
||||
BLE_MBLOCKS_SECURE_CONNECTIONS))
|
||||
|
||||
/*
|
||||
* BLE_DEFAULT_MBLOCKS_COUNT: default memory blocks count
|
||||
*/
|
||||
#define BLE_DEFAULT_MBLOCKS_COUNT(n_link) \
|
||||
BLE_MBLOCKS_CALC(BLE_DEFAULT_PREP_WRITE_LIST_SIZE, \
|
||||
BLE_DEFAULT_MAX_ATT_MTU, n_link)
|
||||
|
||||
/*
|
||||
* BLE_FIXED_BUFFER_SIZE_BYTES:
|
||||
* A part of the RAM, is dinamically allocated by initilizing all the pointers
|
||||
|
@ -102,23 +90,31 @@
|
|||
* - a part, that may be considered "fixed", i.e. independent from the above
|
||||
* mentioned parameters.
|
||||
*/
|
||||
#if (SLAVE_ONLY == 0) && (LL_ONLY == 0)
|
||||
#define BLE_FIXED_BUFFER_SIZE_BYTES 6960 /* Full stack */
|
||||
#elif SLAVE_ONLY == 0
|
||||
#define BLE_FIXED_BUFFER_SIZE_BYTES 6256 /* LL only */
|
||||
#if (BEACON_ONLY != 0)
|
||||
#define BLE_FIXED_BUFFER_SIZE_BYTES 6212 /* Beacon only */
|
||||
#elif (LL_ONLY != 0)
|
||||
#define BLE_FIXED_BUFFER_SIZE_BYTES 6272 /* LL only */
|
||||
#elif (SLAVE_ONLY != 0)
|
||||
#define BLE_FIXED_BUFFER_SIZE_BYTES 6712 /* Peripheral only */
|
||||
#elif (BASIC_FEATURES != 0)
|
||||
#define BLE_FIXED_BUFFER_SIZE_BYTES 6972 /* Basic Features */
|
||||
#else
|
||||
#define BLE_FIXED_BUFFER_SIZE_BYTES 6696 /* Slave only */
|
||||
#define BLE_FIXED_BUFFER_SIZE_BYTES 7240 /* Full stack */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* BLE_PER_LINK_SIZE_BYTES: additional memory size used per link
|
||||
*/
|
||||
#if (SLAVE_ONLY == 0) && (LL_ONLY == 0)
|
||||
#define BLE_PER_LINK_SIZE_BYTES 380 /* Full stack */
|
||||
#elif SLAVE_ONLY == 0
|
||||
#if (BEACON_ONLY != 0)
|
||||
#define BLE_PER_LINK_SIZE_BYTES 148 /* Beacon only */
|
||||
#elif (LL_ONLY != 0)
|
||||
#define BLE_PER_LINK_SIZE_BYTES 196 /* LL only */
|
||||
#elif (SLAVE_ONLY != 0)
|
||||
#define BLE_PER_LINK_SIZE_BYTES 332 /* Peripheral only */
|
||||
#elif (BASIC_FEATURES != 0)
|
||||
#define BLE_PER_LINK_SIZE_BYTES 332 /* Basic Features */
|
||||
#else
|
||||
#define BLE_PER_LINK_SIZE_BYTES 332 /* Slave only */
|
||||
#define BLE_PER_LINK_SIZE_BYTES 384 /* Full stack */
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
@ -126,7 +122,7 @@
|
|||
* needed for the storage of data structures (except GATT database elements)
|
||||
* whose size depends on the number of supported connections.
|
||||
*
|
||||
* @param num_links: Maximum number of simultaneous connections that the device
|
||||
* @param n_link: Maximum number of simultaneous connections that the device
|
||||
* will support. Valid values are from 1 to 8.
|
||||
*
|
||||
* @param mblocks_count: Number of memory blocks allocated for packets.
|
||||
|
@ -158,4 +154,4 @@
|
|||
(40 * (num_gatt_attributes)) + (48 * (num_gatt_services)))
|
||||
|
||||
|
||||
#endif /* ! BLE_BUFSIZE_H__ */
|
||||
#endif /* BLE_BUFSIZE_H__ */
|
||||
|
|
|
@ -104,7 +104,7 @@ extern "C" {
|
|||
{
|
||||
uint8_t *cmdrsp_buffer;
|
||||
uint8_t *m0cmd_buffer;
|
||||
} MB_LldBleTable_t;
|
||||
} MB_BleLldTable_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
@ -157,9 +157,32 @@ extern "C" {
|
|||
MB_Mac_802_15_4_t *p_mac_802_15_4_table;
|
||||
MB_ZigbeeTable_t *p_zigbee_table;
|
||||
MB_LldTestsTable_t *p_lld_tests_table;
|
||||
MB_LldBleTable_t *p_lld_ble_table;
|
||||
MB_BleLldTable_t *p_ble_lld_table;
|
||||
} MB_RefTable_t;
|
||||
|
||||
/**
|
||||
* This table shall be used only in the case the CPU2 runs the FUS.
|
||||
* It is used by the command SHCI_GetWirelessFwInfo()
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint32_t DeviceInfoTableState;
|
||||
uint8_t Reserved1;
|
||||
uint8_t LastFusActiveState;
|
||||
uint8_t LastWirelessStackState;
|
||||
uint8_t CurrentWirelessStackType;
|
||||
uint32_t SafeBootVersion;
|
||||
uint32_t FusVersion;
|
||||
uint32_t FusMemorySize;
|
||||
uint32_t WirelessStackVersion;
|
||||
uint32_t WirelessStackMemorySize;
|
||||
uint32_t WirelessFirmwareBleInfo;
|
||||
uint32_t WirelessFirmwareThreadInfo;
|
||||
uint32_t Reserved2;
|
||||
uint64_t UID64;
|
||||
uint16_t DeviceId;
|
||||
} MB_FUS_DeviceInfoTable_t ;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -201,12 +224,12 @@ extern "C" {
|
|||
* | |
|
||||
* |<---HW_IPCC_BLE_EVENT_CHANNEL--------------------|
|
||||
* | |
|
||||
* | (LLD BLE) |
|
||||
* |----HW_IPCC_LLD_BLE_CMD_CHANNEL----------------->|
|
||||
* | (BLE LLD) |
|
||||
* |----HW_IPCC_BLE_LLD_CMD_CHANNEL----------------->|
|
||||
* | |
|
||||
* |<---HW_IPCC_LLD_BLE_RSP_CHANNEL------------------|
|
||||
* |<---HW_IPCC_BLE_LLD_RSP_CHANNEL------------------|
|
||||
* | |
|
||||
* |<---HW_IPCC_LLD_BLE_M0_CMD_CHANNEL---------------|
|
||||
* |<---HW_IPCC_BLE_LLD_M0_CMD_CHANNEL---------------|
|
||||
* | |
|
||||
* | (MAC) |
|
||||
* |----HW_IPCC_MAC_802_15_4_CMD_RSP_CHANNEL-------->|
|
||||
|
@ -235,8 +258,8 @@ extern "C" {
|
|||
#define HW_IPCC_MM_RELEASE_BUFFER_CHANNEL LL_IPCC_CHANNEL_4
|
||||
#define HW_IPCC_THREAD_CLI_CMD_CHANNEL LL_IPCC_CHANNEL_5
|
||||
#define HW_IPCC_LLDTESTS_CLI_CMD_CHANNEL LL_IPCC_CHANNEL_5
|
||||
#define HW_IPCC_LLD_BLE_CLI_CMD_CHANNEL LL_IPCC_CHANNEL_5
|
||||
#define HW_IPCC_LLD_BLE_CMD_CHANNEL LL_IPCC_CHANNEL_5
|
||||
#define HW_IPCC_BLE_LLD_CLI_CMD_CHANNEL LL_IPCC_CHANNEL_5
|
||||
#define HW_IPCC_BLE_LLD_CMD_CHANNEL LL_IPCC_CHANNEL_5
|
||||
#define HW_IPCC_HCI_ACL_DATA_CHANNEL LL_IPCC_CHANNEL_6
|
||||
|
||||
/** CPU2 */
|
||||
|
@ -246,12 +269,12 @@ extern "C" {
|
|||
#define HW_IPCC_ZIGBEE_APPLI_NOTIF_ACK_CHANNEL LL_IPCC_CHANNEL_3
|
||||
#define HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL LL_IPCC_CHANNEL_3
|
||||
#define HW_IPCC_LLDTESTS_M0_CMD_CHANNEL LL_IPCC_CHANNEL_3
|
||||
#define HW_IPCC_LLD_BLE_M0_CMD_CHANNEL LL_IPCC_CHANNEL_3
|
||||
#define HW_IPCC_BLE_LLD_M0_CMD_CHANNEL LL_IPCC_CHANNEL_3
|
||||
#define HW_IPCC_TRACES_CHANNEL LL_IPCC_CHANNEL_4
|
||||
#define HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL LL_IPCC_CHANNEL_5
|
||||
#define HW_IPCC_LLDTESTS_CLI_RSP_CHANNEL LL_IPCC_CHANNEL_5
|
||||
#define HW_IPCC_LLD_BLE_CLI_RSP_CHANNEL LL_IPCC_CHANNEL_5
|
||||
#define HW_IPCC_LLD_BLE_RSP_CHANNEL LL_IPCC_CHANNEL_5
|
||||
#define HW_IPCC_BLE_LLD_CLI_RSP_CHANNEL LL_IPCC_CHANNEL_5
|
||||
#define HW_IPCC_BLE_LLD_RSP_CHANNEL LL_IPCC_CHANNEL_5
|
||||
#define HW_IPCC_ZIGBEE_M0_REQUEST_CHANNEL LL_IPCC_CHANNEL_5
|
||||
#endif /*__MBOX_H */
|
||||
|
||||
|
|
|
@ -223,7 +223,6 @@ SHCI_CmdStatus_t SHCI_C2_FUS_StartWs( void )
|
|||
return (SHCI_CmdStatus_t)(((TL_CcEvt_t*)(p_rsp->evtserial.evt.payload))->payload[0]);
|
||||
}
|
||||
|
||||
|
||||
SHCI_CmdStatus_t SHCI_C2_FUS_LockUsrKey( uint8_t key_index )
|
||||
{
|
||||
/**
|
||||
|
@ -244,6 +243,44 @@ SHCI_CmdStatus_t SHCI_C2_FUS_LockUsrKey( uint8_t key_index )
|
|||
return (SHCI_CmdStatus_t)(((TL_CcEvt_t*)(p_rsp->evtserial.evt.payload))->payload[0]);
|
||||
}
|
||||
|
||||
SHCI_CmdStatus_t SHCI_C2_FUS_UnloadUsrKey( uint8_t key_index )
|
||||
{
|
||||
/**
|
||||
* Buffer is large enough to hold command complete without payload
|
||||
*/
|
||||
uint8_t local_buffer[TL_BLEEVT_CS_BUFFER_SIZE];
|
||||
TL_EvtPacket_t * p_rsp;
|
||||
|
||||
p_rsp = (TL_EvtPacket_t *)local_buffer;
|
||||
|
||||
local_buffer[0] = key_index;
|
||||
|
||||
shci_send( SHCI_OPCODE_C2_FUS_UNLOAD_USR_KEY,
|
||||
1,
|
||||
local_buffer,
|
||||
p_rsp );
|
||||
|
||||
return (SHCI_CmdStatus_t)(((TL_CcEvt_t*)(p_rsp->evtserial.evt.payload))->payload[0]);
|
||||
}
|
||||
|
||||
SHCI_CmdStatus_t SHCI_C2_FUS_ActivateAntiRollback( void )
|
||||
{
|
||||
/**
|
||||
* Buffer is large enough to hold command complete without payload
|
||||
*/
|
||||
uint8_t local_buffer[TL_BLEEVT_CS_BUFFER_SIZE];
|
||||
TL_EvtPacket_t * p_rsp;
|
||||
|
||||
p_rsp = (TL_EvtPacket_t *)local_buffer;
|
||||
|
||||
shci_send( SHCI_OPCODE_C2_FUS_ACTIVATE_ANTIROLLBACK,
|
||||
0,
|
||||
0,
|
||||
p_rsp );
|
||||
|
||||
return (SHCI_CmdStatus_t)(((TL_CcEvt_t*)(p_rsp->evtserial.evt.payload))->payload[0]);
|
||||
}
|
||||
|
||||
SHCI_CmdStatus_t SHCI_C2_BLE_Init( SHCI_C2_Ble_Init_Cmd_Packet_t *pCmdPacket )
|
||||
{
|
||||
/**
|
||||
|
@ -298,7 +335,7 @@ SHCI_CmdStatus_t SHCI_C2_LLDTESTS_Init( uint8_t param_size, uint8_t * p_param )
|
|||
return (SHCI_CmdStatus_t)(((TL_CcEvt_t*)(p_rsp->evtserial.evt.payload))->payload[0]);
|
||||
}
|
||||
|
||||
SHCI_CmdStatus_t SHCI_C2_LLD_BLE_Init( uint8_t param_size, uint8_t * p_param )
|
||||
SHCI_CmdStatus_t SHCI_C2_BLE_LLD_Init( uint8_t param_size, uint8_t * p_param )
|
||||
{
|
||||
/**
|
||||
* Buffer is large enough to hold command complete without payload
|
||||
|
@ -308,7 +345,7 @@ SHCI_CmdStatus_t SHCI_C2_LLD_BLE_Init( uint8_t param_size, uint8_t * p_param )
|
|||
|
||||
p_rsp = (TL_EvtPacket_t *)local_buffer;
|
||||
|
||||
shci_send( SHCI_OPCODE_C2_LLD_BLE_INIT,
|
||||
shci_send( SHCI_OPCODE_C2_BLE_LLD_INIT,
|
||||
param_size,
|
||||
p_param,
|
||||
p_rsp );
|
||||
|
@ -392,6 +429,44 @@ SHCI_CmdStatus_t SHCI_C2_CONCURRENT_SetMode( SHCI_C2_CONCURRENT_Mode_Param_t Mod
|
|||
return (SHCI_CmdStatus_t)(((TL_CcEvt_t*)(p_rsp->evtserial.evt.payload))->payload[0]);
|
||||
}
|
||||
|
||||
SHCI_CmdStatus_t SHCI_C2_CONCURRENT_GetNextBleEvtTime( SHCI_C2_CONCURRENT_GetNextBleEvtTime_Param_t *pParam )
|
||||
{
|
||||
/**
|
||||
* Buffer is large enough to hold command complete without payload
|
||||
*/
|
||||
uint8_t local_buffer[TL_BLEEVT_CS_BUFFER_SIZE+4];
|
||||
TL_EvtPacket_t * p_rsp;
|
||||
|
||||
p_rsp = (TL_EvtPacket_t *)local_buffer;
|
||||
|
||||
shci_send( SHCI_OPCODE_C2_CONCURRENT_GET_NEXT_BLE_EVT_TIME,
|
||||
0,
|
||||
0,
|
||||
p_rsp );
|
||||
|
||||
memcpy((void*)&(pParam->relative_time), (void*)&((TL_CcEvt_t*)(p_rsp->evtserial.evt.payload))->payload[1], sizeof(pParam->relative_time));
|
||||
|
||||
return (SHCI_CmdStatus_t)(((TL_CcEvt_t*)(p_rsp->evtserial.evt.payload))->payload[0]);
|
||||
}
|
||||
|
||||
SHCI_CmdStatus_t SHCI_C2_CONCURRENT_EnableNext_802154_EvtNotification( void )
|
||||
{
|
||||
/**
|
||||
* Buffer is large enough to hold command complete without payload
|
||||
*/
|
||||
uint8_t local_buffer[TL_BLEEVT_CS_BUFFER_SIZE];
|
||||
TL_EvtPacket_t * p_rsp;
|
||||
|
||||
p_rsp = (TL_EvtPacket_t *)local_buffer;
|
||||
|
||||
shci_send( SHCI_OPCODE_C2_CONCURRENT_ENABLE_NEXT_802154_EVT_NOTIFICATION,
|
||||
0,
|
||||
0,
|
||||
p_rsp );
|
||||
|
||||
return (SHCI_CmdStatus_t)(((TL_CcEvt_t*)(p_rsp->evtserial.evt.payload))->payload[0]);
|
||||
}
|
||||
|
||||
SHCI_CmdStatus_t SHCI_C2_FLASH_StoreData( SHCI_C2_FLASH_Ip_t Ip )
|
||||
{
|
||||
/**
|
||||
|
@ -552,6 +627,23 @@ SHCI_CmdStatus_t SHCI_C2_Config(SHCI_C2_CONFIG_Cmd_Param_t *pCmdPacket)
|
|||
return (SHCI_CmdStatus_t)(((TL_CcEvt_t*)(p_rsp->evtserial.evt.payload))->payload[0]);
|
||||
}
|
||||
|
||||
SHCI_CmdStatus_t SHCI_C2_802_15_4_DeInit( void )
|
||||
{
|
||||
/**
|
||||
* Buffer is large enough to hold command complete without payload
|
||||
*/
|
||||
uint8_t local_buffer[TL_BLEEVT_CS_BUFFER_SIZE];
|
||||
TL_EvtPacket_t * p_rsp;
|
||||
|
||||
p_rsp = (TL_EvtPacket_t *)local_buffer;
|
||||
|
||||
shci_send( SHCI_OPCODE_C2_802_15_4_DEINIT,
|
||||
0,
|
||||
0,
|
||||
p_rsp );
|
||||
|
||||
return (SHCI_CmdStatus_t)(((TL_CcEvt_t*)(p_rsp->evtserial.evt.payload))->payload[0]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Local System COMMAND
|
||||
|
@ -562,46 +654,89 @@ SHCI_CmdStatus_t SHCI_GetWirelessFwInfo( WirelessFwInfo_t* pWirelessInfo )
|
|||
{
|
||||
uint32_t ipccdba = 0;
|
||||
MB_RefTable_t * p_RefTable = NULL;
|
||||
uint32_t version = 0;
|
||||
uint32_t memorySize = 0;
|
||||
uint32_t infoStack = 0;
|
||||
uint32_t wireless_firmware_version = 0;
|
||||
uint32_t wireless_firmware_memorySize = 0;
|
||||
uint32_t wireless_firmware_infoStack = 0;
|
||||
MB_FUS_DeviceInfoTable_t * p_fus_device_info_table = NULL;
|
||||
uint32_t fus_version = 0;
|
||||
uint32_t fus_memorySize = 0;
|
||||
|
||||
ipccdba = READ_BIT( FLASH->IPCCBR, FLASH_IPCCBR_IPCCDBA );
|
||||
p_RefTable = (MB_RefTable_t*)((ipccdba<<2) + SRAM2A_BASE);
|
||||
|
||||
/**
|
||||
* The Device Info Table mapping depends on which firmware is running on CPU2.
|
||||
* If the FUS is running on CPU2, FUS_DEVICE_INFO_TABLE_VALIDITY_KEYWORD shall be written in the table.
|
||||
* Otherwise, it means the Wireless Firmware is running on the CPU2
|
||||
*/
|
||||
p_fus_device_info_table = (MB_FUS_DeviceInfoTable_t*)(*(uint32_t*)((ipccdba<<2) + SRAM2A_BASE));
|
||||
|
||||
if(p_fus_device_info_table->DeviceInfoTableState == FUS_DEVICE_INFO_TABLE_VALIDITY_KEYWORD)
|
||||
{
|
||||
/* The FUS is running on CPU2 */
|
||||
/**
|
||||
* Retrieve the WirelessFwInfoTable
|
||||
* This table is stored in RAM at startup during the TL (transport layer) initialization
|
||||
*/
|
||||
wireless_firmware_version = p_fus_device_info_table->WirelessStackVersion;
|
||||
wireless_firmware_memorySize = p_fus_device_info_table->WirelessStackMemorySize;
|
||||
wireless_firmware_infoStack = p_fus_device_info_table->WirelessFirmwareBleInfo;
|
||||
|
||||
/**
|
||||
* Retrieve the FusInfoTable
|
||||
* This table is stored in RAM at startup during the TL (transport layer) initialization
|
||||
*/
|
||||
fus_version = p_fus_device_info_table->FusVersion;
|
||||
fus_memorySize = p_fus_device_info_table->FusMemorySize;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* The Wireless Firmware is running on CPU2 */
|
||||
p_RefTable = (MB_RefTable_t*)((ipccdba<<2) + SRAM2A_BASE);
|
||||
|
||||
/**
|
||||
* Retrieve the WirelessFwInfoTable
|
||||
* This table is stored in RAM at startup during the TL (transport layer) initialization
|
||||
*/
|
||||
wireless_firmware_version = p_RefTable->p_device_info_table->WirelessFwInfoTable.Version;
|
||||
wireless_firmware_memorySize = p_RefTable->p_device_info_table->WirelessFwInfoTable.MemorySize;
|
||||
wireless_firmware_infoStack = p_RefTable->p_device_info_table->WirelessFwInfoTable.InfoStack;
|
||||
|
||||
/**
|
||||
* Retrieve the FusInfoTable
|
||||
* This table is stored in RAM at startup during the TL (transport layer) initialization
|
||||
*/
|
||||
fus_version = p_RefTable->p_device_info_table->FusInfoTable.Version;
|
||||
fus_memorySize = p_RefTable->p_device_info_table->FusInfoTable.MemorySize;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the WirelessFwInfoTable
|
||||
* This table is stored in RAM at startup during the TL (transport layer) initialization
|
||||
*/
|
||||
version = p_RefTable->p_device_info_table->WirelessFwInfoTable.Version;
|
||||
pWirelessInfo->VersionMajor = ((version & INFO_VERSION_MAJOR_MASK) >> INFO_VERSION_MAJOR_OFFSET);
|
||||
pWirelessInfo->VersionMinor = ((version & INFO_VERSION_MINOR_MASK) >> INFO_VERSION_MINOR_OFFSET);
|
||||
pWirelessInfo->VersionSub = ((version & INFO_VERSION_SUB_MASK) >> INFO_VERSION_SUB_OFFSET);
|
||||
pWirelessInfo->VersionBranch = ((version & INFO_VERSION_BRANCH_MASK) >> INFO_VERSION_BRANCH_OFFSET);
|
||||
pWirelessInfo->VersionReleaseType = ((version & INFO_VERSION_TYPE_MASK) >> INFO_VERSION_TYPE_OFFSET);
|
||||
pWirelessInfo->VersionMajor = ((wireless_firmware_version & INFO_VERSION_MAJOR_MASK) >> INFO_VERSION_MAJOR_OFFSET);
|
||||
pWirelessInfo->VersionMinor = ((wireless_firmware_version & INFO_VERSION_MINOR_MASK) >> INFO_VERSION_MINOR_OFFSET);
|
||||
pWirelessInfo->VersionSub = ((wireless_firmware_version & INFO_VERSION_SUB_MASK) >> INFO_VERSION_SUB_OFFSET);
|
||||
pWirelessInfo->VersionBranch = ((wireless_firmware_version & INFO_VERSION_BRANCH_MASK) >> INFO_VERSION_BRANCH_OFFSET);
|
||||
pWirelessInfo->VersionReleaseType = ((wireless_firmware_version & INFO_VERSION_TYPE_MASK) >> INFO_VERSION_TYPE_OFFSET);
|
||||
|
||||
memorySize = p_RefTable->p_device_info_table->WirelessFwInfoTable.MemorySize;
|
||||
pWirelessInfo->MemorySizeSram2B = ((memorySize & INFO_SIZE_SRAM2B_MASK) >> INFO_SIZE_SRAM2B_OFFSET);
|
||||
pWirelessInfo->MemorySizeSram2A = ((memorySize & INFO_SIZE_SRAM2A_MASK) >> INFO_SIZE_SRAM2A_OFFSET);
|
||||
pWirelessInfo->MemorySizeSram1 = ((memorySize & INFO_SIZE_SRAM1_MASK) >> INFO_SIZE_SRAM1_OFFSET);
|
||||
pWirelessInfo->MemorySizeFlash = ((memorySize & INFO_SIZE_FLASH_MASK) >> INFO_SIZE_FLASH_OFFSET);
|
||||
pWirelessInfo->MemorySizeSram2B = ((wireless_firmware_memorySize & INFO_SIZE_SRAM2B_MASK) >> INFO_SIZE_SRAM2B_OFFSET);
|
||||
pWirelessInfo->MemorySizeSram2A = ((wireless_firmware_memorySize & INFO_SIZE_SRAM2A_MASK) >> INFO_SIZE_SRAM2A_OFFSET);
|
||||
pWirelessInfo->MemorySizeSram1 = ((wireless_firmware_memorySize & INFO_SIZE_SRAM1_MASK) >> INFO_SIZE_SRAM1_OFFSET);
|
||||
pWirelessInfo->MemorySizeFlash = ((wireless_firmware_memorySize & INFO_SIZE_FLASH_MASK) >> INFO_SIZE_FLASH_OFFSET);
|
||||
|
||||
infoStack = p_RefTable->p_device_info_table->WirelessFwInfoTable.InfoStack;
|
||||
pWirelessInfo->StackType = ((infoStack & INFO_STACK_TYPE_MASK) >> INFO_STACK_TYPE_OFFSET);
|
||||
pWirelessInfo->StackType = ((wireless_firmware_infoStack & INFO_STACK_TYPE_MASK) >> INFO_STACK_TYPE_OFFSET);
|
||||
|
||||
/**
|
||||
* Retrieve the FusInfoTable
|
||||
* This table is stored in RAM at startup during the TL (transport layer) initialization
|
||||
*/
|
||||
version = p_RefTable->p_device_info_table->FusInfoTable.Version;
|
||||
pWirelessInfo->FusVersionMajor = ((version & INFO_VERSION_MAJOR_MASK) >> INFO_VERSION_MAJOR_OFFSET);
|
||||
pWirelessInfo->FusVersionMinor = ((version & INFO_VERSION_MINOR_MASK) >> INFO_VERSION_MINOR_OFFSET);
|
||||
pWirelessInfo->FusVersionSub = ((version & INFO_VERSION_SUB_MASK) >> INFO_VERSION_SUB_OFFSET);
|
||||
pWirelessInfo->FusVersionMajor = ((fus_version & INFO_VERSION_MAJOR_MASK) >> INFO_VERSION_MAJOR_OFFSET);
|
||||
pWirelessInfo->FusVersionMinor = ((fus_version & INFO_VERSION_MINOR_MASK) >> INFO_VERSION_MINOR_OFFSET);
|
||||
pWirelessInfo->FusVersionSub = ((fus_version & INFO_VERSION_SUB_MASK) >> INFO_VERSION_SUB_OFFSET);
|
||||
|
||||
memorySize = p_RefTable->p_device_info_table->FusInfoTable.MemorySize;
|
||||
pWirelessInfo->FusMemorySizeSram2B = ((memorySize & INFO_SIZE_SRAM2B_MASK) >> INFO_SIZE_SRAM2B_OFFSET);
|
||||
pWirelessInfo->FusMemorySizeSram2A = ((memorySize & INFO_SIZE_SRAM2A_MASK) >> INFO_SIZE_SRAM2A_OFFSET);
|
||||
pWirelessInfo->FusMemorySizeFlash = ((memorySize & INFO_SIZE_FLASH_MASK) >> INFO_SIZE_FLASH_OFFSET);
|
||||
pWirelessInfo->FusMemorySizeSram2B = ((fus_memorySize & INFO_SIZE_SRAM2B_MASK) >> INFO_SIZE_SRAM2B_OFFSET);
|
||||
pWirelessInfo->FusMemorySizeSram2A = ((fus_memorySize & INFO_SIZE_SRAM2A_MASK) >> INFO_SIZE_SRAM2A_OFFSET);
|
||||
pWirelessInfo->FusMemorySizeFlash = ((fus_memorySize & INFO_SIZE_FLASH_MASK) >> INFO_SIZE_FLASH_OFFSET);
|
||||
|
||||
return (SHCI_Success);
|
||||
}
|
||||
|
|
|
@ -35,22 +35,22 @@ extern "C" {
|
|||
typedef enum
|
||||
{
|
||||
WIRELESS_FW_RUNNING = 0x00,
|
||||
RSS_FW_RUNNING = 0x01,
|
||||
FUS_FW_RUNNING = 0x01,
|
||||
} SHCI_SysEvt_Ready_Rsp_t;
|
||||
|
||||
/* ERROR CODES
|
||||
*
|
||||
* These error codes are detected on M0 side and are send back to the M4 via a system
|
||||
* notification message. It is up to the application running on M4 to manage these errors
|
||||
* These error codes are detected on CPU2 side and are send back to the CPU1 via a system
|
||||
* notification message. It is up to the application running on CPU1 to manage these errors
|
||||
*
|
||||
* These errors can be generated by all layers (low level driver, stack, framework infrastructure, etc..)
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
ERR_BLE_INIT = 0,
|
||||
ERR_THREAD_LLD_FATAL_ERROR = 125, /* The LLD driver used on 802_15_4 detected a fatal error */
|
||||
ERR_THREAD_UNKNOWN_CMD = 126, /* The command send by the M4 to control the Thread stack is unknown */
|
||||
ERR_ZIGBEE_UNKNOWN_CMD = 200, /* The command send by the M4 to control the Zigbee stack is unknown */
|
||||
ERR_BLE_INIT = 0, /* This event is currently not reported by the CPU2 */
|
||||
ERR_THREAD_LLD_FATAL_ERROR = 125, /* The LLD driver used on 802_15_4 detected a fatal error */
|
||||
ERR_THREAD_UNKNOWN_CMD = 126, /* The command send by the CPU1 to control the Thread stack is unknown */
|
||||
ERR_ZIGBEE_UNKNOWN_CMD = 200, /* The command send by the CPU1 to control the Zigbee stack is unknown */
|
||||
} SCHI_SystemErrCode_t;
|
||||
|
||||
#define SHCI_EVTCODE ( 0xFF )
|
||||
|
@ -64,11 +64,12 @@ extern "C" {
|
|||
SHCI_SUB_EVT_CODE_READY = SHCI_SUB_EVT_CODE_BASE,
|
||||
SHCI_SUB_EVT_ERROR_NOTIF,
|
||||
SHCI_SUB_EVT_BLE_NVM_RAM_UPDATE,
|
||||
SHCI_SUB_EVT_OT_NVM_RAM_UPDATE,
|
||||
SHCI_SUB_EVT_THREAD_NVM_RAM_UPDATE,
|
||||
SHCI_SUB_EVT_NVM_START_WRITE,
|
||||
SHCI_SUB_EVT_NVM_END_WRITE,
|
||||
SHCI_SUB_EVT_NVM_START_ERASE,
|
||||
SHCI_SUB_EVT_NVM_END_ERASE,
|
||||
SHCI_SUB_EVT_CODE_CONCURRENT_802154_EVT,
|
||||
} SHCI_SUB_EVT_CODE_t;
|
||||
|
||||
/**
|
||||
|
@ -101,7 +102,7 @@ extern "C" {
|
|||
} SHCI_C2_BleNvmRamUpdate_Evt_t;
|
||||
|
||||
/**
|
||||
* SHCI_SUB_EVT_OT_NVM_RAM_UPDATE
|
||||
* SHCI_SUB_EVT_THREAD_NVM_RAM_UPDATE
|
||||
* This notifies the CPU1 which part of the OT NVM RAM has been updated so that only the modified
|
||||
* section could be written in Flash/NVM
|
||||
* StartAddress : Start address of the section that has been modified
|
||||
|
@ -110,7 +111,7 @@ extern "C" {
|
|||
typedef PACKED_STRUCT{
|
||||
uint32_t StartAddress;
|
||||
uint32_t Size;
|
||||
} SHCI_C2_OtNvmRamUpdate_Evt_t;
|
||||
} SHCI_C2_ThreadNvmRamUpdate_Evt_t;
|
||||
|
||||
/**
|
||||
* SHCI_SUB_EVT_NVM_START_WRITE
|
||||
|
@ -151,6 +152,11 @@ extern "C" {
|
|||
/* SYSTEM COMMAND */
|
||||
typedef PACKED_STRUCT
|
||||
{
|
||||
/**
|
||||
* MetaData holds :
|
||||
* 2*32bits for chaining list
|
||||
* 1*32bits with BLE header (type + Opcode + Length)
|
||||
*/
|
||||
uint32_t MetaData[3];
|
||||
} SHCI_Header_t;
|
||||
|
||||
|
@ -160,6 +166,7 @@ extern "C" {
|
|||
SHCI_UNKNOWN_CMD = 0x01,
|
||||
SHCI_ERR_UNSUPPORTED_FEATURE = 0x11,
|
||||
SHCI_ERR_INVALID_HCI_CMD_PARAMS = 0x12,
|
||||
SHCI_ERR_INVALID_PARAMS = 0x42,
|
||||
SHCI_FUS_CMD_NOT_SUPPORTED = 0xFF,
|
||||
} SHCI_CmdStatus_t;
|
||||
|
||||
|
@ -192,8 +199,8 @@ extern "C" {
|
|||
SHCI_OCF_C2_FUS_RESERVED2,
|
||||
SHCI_OCF_C2_FUS_RESERVED3,
|
||||
SHCI_OCF_C2_FUS_LOCK_USR_KEY,
|
||||
SHCI_OCF_C2_FUS_RESERVED5,
|
||||
SHCI_OCF_C2_FUS_RESERVED6,
|
||||
SHCI_OCF_C2_FUS_UNLOAD_USR_KEY,
|
||||
SHCI_OCF_C2_FUS_ACTIVATE_ANTIROLLBACK,
|
||||
SHCI_OCF_C2_FUS_RESERVED7,
|
||||
SHCI_OCF_C2_FUS_RESERVED8,
|
||||
SHCI_OCF_C2_FUS_RESERVED9,
|
||||
|
@ -214,23 +221,47 @@ extern "C" {
|
|||
SHCI_OCF_C2_LLD_TESTS_INIT,
|
||||
SHCI_OCF_C2_EXTPA_CONFIG,
|
||||
SHCI_OCF_C2_SET_FLASH_ACTIVITY_CONTROL,
|
||||
SHCI_OCF_C2_LLD_BLE_INIT,
|
||||
SHCI_OCF_C2_CONFIG,
|
||||
SHCI_OCF_C2_BLE_LLD_INIT,
|
||||
SHCI_OCF_C2_CONFIG,
|
||||
SHCI_OCF_C2_CONCURRENT_GET_NEXT_BLE_EVT_TIME,
|
||||
SHCI_OCF_C2_CONCURRENT_ENABLE_NEXT_802154_EVT_NOTIFICATION,
|
||||
SHCI_OCF_C2_802_15_4_DEINIT,
|
||||
} SHCI_OCF_t;
|
||||
|
||||
#define SHCI_OPCODE_C2_FUS_GET_STATE (( SHCI_OGF << 10) + SHCI_OCF_C2_FUS_GET_STATE)
|
||||
/** No command parameters */
|
||||
/** Response parameters*/
|
||||
/** It responds a 1 byte value holding FUS State error code when the FUS State value is 0xFF (FUS_STATE_VALUE_ERROR) */
|
||||
typedef enum
|
||||
{
|
||||
FUS_STATE_NO_ERROR = 0x00,
|
||||
FUS_STATE_IMG_NOT_FOUND = 0x01,
|
||||
FUS_STATE_IMG_CORRUPT = 0x02,
|
||||
FUS_STATE_IMG_NOT_AUTHENTIC = 0x03,
|
||||
FUS_STATE_IMG_NOT_ENOUGH_SPACE = 0x04,
|
||||
FUS_STATE_ERR_UNKNOWN = 0xFF,
|
||||
FUS_STATE_ERROR_NO_ERROR = 0x00,
|
||||
FUS_STATE_ERROR_IMG_NOT_FOUND = 0x01,
|
||||
FUS_STATE_ERROR_IMG_CORRUPT = 0x02,
|
||||
FUS_STATE_ERROR_IMG_NOT_AUTHENTIC = 0x03,
|
||||
FUS_STATE_ERROR_IMG_NOT_ENOUGH_SPACE = 0x04,
|
||||
FUS_STATE_ERROR_IMAGE_USRABORT = 0x05,
|
||||
FUS_STATE_ERROR_IMAGE_ERSERROR = 0x06,
|
||||
FUS_STATE_ERROR_IMAGE_WRTERROR = 0x07,
|
||||
FUS_STATE_ERROR_AUTH_TAG_ST_NOTFOUND = 0x08,
|
||||
FUS_STATE_ERROR_AUTH_TAG_CUST_NOTFOUND = 0x09,
|
||||
FUS_STATE_ERROR_AUTH_KEY_LOCKED = 0x0A,
|
||||
FUS_STATE_ERROR_FW_ROLLBACK_ERROR = 0x11,
|
||||
FUS_STATE_ERROR_STATE_NOT_RUNNING = 0xFE,
|
||||
FUS_STATE_ERROR_ERR_UNKNOWN = 0xFF,
|
||||
} SHCI_FUS_GetState_ErrorCode_t;
|
||||
|
||||
enum
|
||||
{
|
||||
FUS_STATE_VALUE_IDLE = 0x00,
|
||||
FUS_STATE_VALUE_FW_UPGRD_ONGOING = 0x10,
|
||||
FUS_STATE_VALUE_FW_UPGRD_ONGOING_END = 0x1F, /* All values between 0x10 and 0x1F has the same meaning */
|
||||
FUS_STATE_VALUE_FUS_UPGRD_ONGOING = 0x20,
|
||||
FUS_STATE_VALUE_FUS_UPGRD_ONGOING_END = 0x2F, /* All values between 0x20 and 0x2F has the same meaning */
|
||||
FUS_STATE_VALUE_SERVICE_ONGOING = 0x30,
|
||||
FUS_STATE_VALUE_SERVICE_ONGOING_END = 0x3F, /* All values between 0x30 and 0x3F has the same meaning */
|
||||
FUS_STATE_VALUE_ERROR = 0xFF,
|
||||
};
|
||||
|
||||
#define SHCI_OPCODE_C2_FUS_RESERVED1 (( SHCI_OGF << 10) + SHCI_OCF_C2_FUS_RESERVED1)
|
||||
/** No command parameters */
|
||||
/** No response parameters*/
|
||||
|
@ -306,11 +337,11 @@ extern "C" {
|
|||
|
||||
/** No response parameters*/
|
||||
|
||||
#define SHCI_OPCODE_C2_FUS_RESERVED5 (( SHCI_OGF << 10) + SHCI_OCF_C2_FUS_RESERVED5)
|
||||
#define SHCI_OPCODE_C2_FUS_UNLOAD_USR_KEY (( SHCI_OGF << 10) + SHCI_OCF_C2_FUS_UNLOAD_USR_KEY)
|
||||
/** No command parameters */
|
||||
/** No response parameters*/
|
||||
/** 1 byte holding the key index value */
|
||||
|
||||
#define SHCI_OPCODE_C2_FUS_RESERVED6 (( SHCI_OGF << 10) + SHCI_OCF_C2_FUS_RESERVED6)
|
||||
#define SHCI_OPCODE_C2_FUS_ACTIVATE_ANTIROLLBACK (( SHCI_OGF << 10) + SHCI_OCF_C2_FUS_ACTIVATE_ANTIROLLBACK)
|
||||
/** No command parameters */
|
||||
/** No response parameters*/
|
||||
|
||||
|
@ -341,24 +372,192 @@ extern "C" {
|
|||
#define SHCI_OPCODE_C2_BLE_INIT (( SHCI_OGF << 10) + SHCI_OCF_C2_BLE_INIT)
|
||||
/** THE ORDER SHALL NOT BE CHANGED */
|
||||
typedef PACKED_STRUCT{
|
||||
uint8_t* pBleBufferAddress; /**< NOT USED CURRENTLY */
|
||||
uint32_t BleBufferSize; /**< Size of the Buffer allocated in pBleBufferAddress */
|
||||
uint8_t* pBleBufferAddress; /**< NOT USED - shall be set to 0 */
|
||||
uint32_t BleBufferSize; /**< NOT USED - shall be set to 0 */
|
||||
|
||||
/**
|
||||
* NumAttrRecord
|
||||
* Maximum number of attribute records related to all the required characteristics (excluding the services)
|
||||
* that can be stored in the GATT database, for the specific BLE user application.
|
||||
* For each characteristic, the number of attribute records goes from two to five depending on the characteristic properties:
|
||||
* - minimum of two (one for declaration and one for the value)
|
||||
* - add one more record for each additional property: notify or indicate, broadcast, extended property.
|
||||
* The total calculated value must be increased by 9, due to the records related to the standard attribute profile and
|
||||
* GAP service characteristics, and automatically added when initializing GATT and GAP layers
|
||||
* - Min value: <number of user attributes> + 9
|
||||
* - Max value: depending on the GATT database defined by user application
|
||||
*/
|
||||
uint16_t NumAttrRecord;
|
||||
|
||||
/**
|
||||
* NumAttrServ
|
||||
* Defines the maximum number of services that can be stored in the GATT database. Note that the GAP and GATT services
|
||||
* are automatically added at initialization so this parameter must be the number of user services increased by two.
|
||||
* - Min value: <number of user service> + 2
|
||||
* - Max value: depending GATT database defined by user application
|
||||
*/
|
||||
uint16_t NumAttrServ;
|
||||
|
||||
/**
|
||||
* AttrValueArrSize
|
||||
* NOTE: This parameter is ignored by the CPU2 when the parameter "Options" is set to "LL_only" ( see Options description in that structure )
|
||||
*
|
||||
* Size of the storage area for the attribute values.
|
||||
* Each characteristic contributes to the attrValueArrSize value as follows:
|
||||
* - Characteristic value length plus:
|
||||
* + 5 bytes if characteristic UUID is 16 bits
|
||||
* + 19 bytes if characteristic UUID is 128 bits
|
||||
* + 2 bytes if characteristic has a server configuration descriptor
|
||||
* + 2 bytes * NumOfLinks if the characteristic has a client configuration descriptor
|
||||
* + 2 bytes if the characteristic has extended properties
|
||||
* Each descriptor contributes to the attrValueArrSize value as follows:
|
||||
* - Descriptor length
|
||||
*/
|
||||
uint16_t AttrValueArrSize;
|
||||
|
||||
/**
|
||||
* NumOfLinks
|
||||
* Maximum number of BLE links supported
|
||||
* - Min value: 1
|
||||
* - Max value: 8
|
||||
*/
|
||||
uint8_t NumOfLinks;
|
||||
|
||||
/**
|
||||
* ExtendedPacketLengthEnable
|
||||
* Disable/enable the extended packet length BLE 5.0 feature
|
||||
* - Disable: 0
|
||||
* - Enable: 1
|
||||
*/
|
||||
uint8_t ExtendedPacketLengthEnable;
|
||||
|
||||
/**
|
||||
* PrWriteListSize
|
||||
* NOTE: This parameter is ignored by the CPU2 when the parameter "Options" is set to "LL_only" ( see Options description in that structure )
|
||||
*
|
||||
* Maximum number of supported “prepare write request”
|
||||
* - Min value: given by the macro DEFAULT_PREP_WRITE_LIST_SIZE
|
||||
* - Max value: a value higher than the minimum required can be specified, but it is not recommended
|
||||
*/
|
||||
uint8_t PrWriteListSize;
|
||||
|
||||
/**
|
||||
* MblockCount
|
||||
* NOTE: This parameter is overwritten by the CPU2 with an hardcoded optimal value when the parameter "Options" is set to "LL_only"
|
||||
* ( see Options description in that structure )
|
||||
*
|
||||
* Number of allocated memory blocks for the BLE stack
|
||||
* - Min value: given by the macro MBLOCKS_CALC
|
||||
* - Max value: a higher value can improve data throughput performance, but uses more memory
|
||||
*/
|
||||
uint8_t MblockCount;
|
||||
|
||||
/**
|
||||
* AttMtu
|
||||
* NOTE: This parameter is ignored by the CPU2 when the parameter "Options" is set to "LL_only" ( see Options description in that structure )
|
||||
*
|
||||
* Maximum ATT MTU size supported
|
||||
* - Min value: 23
|
||||
* - Max value: 512
|
||||
*/
|
||||
uint16_t AttMtu;
|
||||
|
||||
/**
|
||||
* SlaveSca
|
||||
* The sleep clock accuracy (ppm value) that used in BLE connected slave mode to calculate the window widening
|
||||
* (in combination with the sleep clock accuracy sent by master in CONNECT_REQ PDU),
|
||||
* refer to BLE 5.0 specifications - Vol 6 - Part B - chap 4.5.7 and 4.2.2
|
||||
* - Min value: 0
|
||||
* - Max value: 500 (worst possible admitted by specification)
|
||||
*/
|
||||
uint16_t SlaveSca;
|
||||
|
||||
/**
|
||||
* MasterSca
|
||||
* The sleep clock accuracy handled in master mode. It is used to determine the connection and advertising events timing.
|
||||
* It is transmitted to the slave in CONNEC_REQ PDU used by the slave to calculate the window widening,
|
||||
* see SlaveSca and Bluetooth Core Specification v5.0 Vol 6 - Part B - chap 4.5.7 and 4.2.2
|
||||
* Possible values:
|
||||
* - 251 ppm to 500 ppm: 0
|
||||
* - 151 ppm to 250 ppm: 1
|
||||
* - 101 ppm to 150 ppm: 2
|
||||
* - 76 ppm to 100 ppm: 3
|
||||
* - 51 ppm to 75 ppm: 4
|
||||
* - 31 ppm to 50 ppm: 5
|
||||
* - 21 ppm to 30 ppm: 6
|
||||
* - 0 ppm to 20 ppm: 7
|
||||
*/
|
||||
uint8_t MasterSca;
|
||||
|
||||
/**
|
||||
* LsSource
|
||||
* Source for the 32 kHz slow speed clock.
|
||||
* - External crystal LSE: 0 - No calibration
|
||||
* - Others:1 - As the accuracy of this oscillator can vary depending upon external conditions (temperature),
|
||||
* it is calibrated every second to ensure correct behavior of timing sensitive BLE operations
|
||||
*/
|
||||
uint8_t LsSource;
|
||||
|
||||
/**
|
||||
* MaxConnEventLength
|
||||
* This parameter determines the maximum duration of a slave connection event. When this duration is reached the slave closes
|
||||
* the current connections event (whatever is the CE_length parameter specified by the master in HCI_CREATE_CONNECTION HCI command),
|
||||
* expressed in units of 625/256 µs (~2.44 µs)
|
||||
* - Min value: 0 (if 0 is specified, the master and slave perform only a single TX-RX exchange per connection event)
|
||||
* - Max value: 1638400 (4000 ms). A higher value can be specified (max 0xFFFFFFFF) but results in a maximum connection time
|
||||
* of 4000 ms as specified. In this case the parameter is not applied, and the predicted CE length calculated on slave is not shortened
|
||||
*/
|
||||
uint32_t MaxConnEventLength;
|
||||
|
||||
/**
|
||||
* HsStartupTime
|
||||
* Startup time of the high speed (16 or 32 MHz) crystal oscillator in units of 625/256 µs (~2.44 µs).
|
||||
* - Min value: 0
|
||||
* - Max value: 820 (~2 ms). A higher value can be specified, but the value that implemented in stack is forced to ~2 ms
|
||||
*/
|
||||
uint16_t HsStartupTime;
|
||||
|
||||
/**
|
||||
* ViterbiEnable
|
||||
* Viterbi implementation in BLE LL reception.
|
||||
* - 0: Enable
|
||||
* - 1: Disable
|
||||
*/
|
||||
uint8_t ViterbiEnable;
|
||||
uint8_t LlOnly;
|
||||
|
||||
/**
|
||||
* Options flags
|
||||
* - bit 0: 1: LL only 0: LL + host
|
||||
* - bit 1: 1: no service change desc. 0: with service change desc.
|
||||
* - bit 2: 1: device name Read-Only 0: device name R/W
|
||||
* - bit 7: 1: LE Power Class 1 0: LE Power Classe 2-3
|
||||
* - other bits: reserved ( shall be set to 0)
|
||||
*/
|
||||
uint8_t Options;
|
||||
|
||||
/**
|
||||
* HwVersion
|
||||
* Reserved for future use - shall be set to 0
|
||||
*/
|
||||
uint8_t HwVersion;
|
||||
|
||||
/**
|
||||
* Maximum number of connection-oriented channels in initiator mode.
|
||||
* Range: 0 .. 64
|
||||
*/
|
||||
uint8_t max_coc_initiator_nbr;
|
||||
|
||||
/**
|
||||
* Minimum transmit power in dBm supported by the Controller.
|
||||
* Range: -127 .. 20
|
||||
*/
|
||||
int8_t min_tx_power;
|
||||
|
||||
/**
|
||||
* Maximum transmit power in dBm supported by the Controller.
|
||||
* Range: -127 .. 20
|
||||
*/
|
||||
int8_t max_tx_power;
|
||||
} SHCI_C2_Ble_Init_Cmd_Param_t;
|
||||
|
||||
typedef PACKED_STRUCT{
|
||||
|
@ -366,7 +565,23 @@ extern "C" {
|
|||
SHCI_C2_Ble_Init_Cmd_Param_t Param;
|
||||
} SHCI_C2_Ble_Init_Cmd_Packet_t;
|
||||
|
||||
/** No response parameters*/
|
||||
/**
|
||||
* Options
|
||||
* Each definition below may be added together to build the Options value
|
||||
* WARNING : Only one definition per bit shall be added to build the Options value
|
||||
*/
|
||||
#define SHCI_C2_BLE_INIT_OPTIONS_LL_ONLY (1<<0)
|
||||
#define SHCI_C2_BLE_INIT_OPTIONS_LL_HOST (0<<0)
|
||||
|
||||
#define SHCI_C2_BLE_INIT_OPTIONS_NO_SVC_CHANGE_DESC (1<<1)
|
||||
#define SHCI_C2_BLE_INIT_OPTIONS_WITH_SVC_CHANGE_DESC (0<<1)
|
||||
|
||||
#define SHCI_C2_BLE_INIT_OPTIONS_DEVICE_NAME_RO (1<<2)
|
||||
#define SHCI_C2_BLE_INIT_OPTIONS_DEVICE_NAME_RW (0<<2)
|
||||
|
||||
#define SHCI_C2_BLE_INIT_OPTIONS_POWER_CLASS_1 (1<<7)
|
||||
#define SHCI_C2_BLE_INIT_OPTIONS_POWER_CLASS_2_3 (0<<7)
|
||||
|
||||
|
||||
#define SHCI_OPCODE_C2_THREAD_INIT (( SHCI_OGF << 10) + SHCI_OCF_C2_THREAD_INIT)
|
||||
/** No command parameters */
|
||||
|
@ -420,9 +635,22 @@ extern "C" {
|
|||
BLE_ENABLE,
|
||||
THREAD_ENABLE,
|
||||
ZIGBEE_ENABLE,
|
||||
MAC_ENABLE,
|
||||
} SHCI_C2_CONCURRENT_Mode_Param_t;
|
||||
/** No response parameters*/
|
||||
|
||||
|
||||
#define SHCI_OPCODE_C2_CONCURRENT_GET_NEXT_BLE_EVT_TIME (( SHCI_OGF << 10) + SHCI_OCF_C2_CONCURRENT_GET_NEXT_BLE_EVT_TIME)
|
||||
/** command parameters */
|
||||
typedef PACKED_STRUCT
|
||||
{
|
||||
uint32_t relative_time;
|
||||
} SHCI_C2_CONCURRENT_GetNextBleEvtTime_Param_t;
|
||||
/** No response parameters*/
|
||||
|
||||
#define SHCI_OPCODE_C2_CONCURRENT_ENABLE_NEXT_802154_EVT_NOTIFICATION (( SHCI_OGF << 10) + SHCI_OCF_C2_CONCURRENT_ENABLE_NEXT_802154_EVT_NOTIFICATION)
|
||||
/** No command parameters */
|
||||
/** No response parameters*/
|
||||
|
||||
#define SHCI_OPCODE_C2_FLASH_STORE_DATA (( SHCI_OGF << 10) + SHCI_OCF_C2_FLASH_STORE_DATA)
|
||||
#define SHCI_OPCODE_C2_FLASH_ERASE_DATA (( SHCI_OGF << 10) + SHCI_OCF_C2_FLASH_ERASE_DATA)
|
||||
/** command parameters */
|
||||
|
@ -444,7 +672,7 @@ extern "C" {
|
|||
|
||||
#define SHCI_OPCODE_C2_LLD_TESTS_INIT (( SHCI_OGF << 10) + SHCI_OCF_C2_LLD_TESTS_INIT)
|
||||
|
||||
#define SHCI_OPCODE_C2_LLD_BLE_INIT (( SHCI_OGF << 10) + SHCI_OCF_C2_LLD_BLE_INIT)
|
||||
#define SHCI_OPCODE_C2_BLE_LLD_INIT (( SHCI_OGF << 10) + SHCI_OCF_C2_BLE_LLD_INIT)
|
||||
|
||||
#define SHCI_OPCODE_C2_EXTPA_CONFIG (( SHCI_OGF << 10) + SHCI_OCF_C2_EXTPA_CONFIG)
|
||||
/** Command parameters */
|
||||
|
@ -490,6 +718,8 @@ extern "C" {
|
|||
uint32_t ThreadNvmRamAddress;
|
||||
} SHCI_C2_CONFIG_Cmd_Param_t;
|
||||
|
||||
#define SHCI_OPCODE_C2_802_15_4_DEINIT (( SHCI_OGF << 10) + SHCI_OCF_C2_802_15_4_DEINIT)
|
||||
|
||||
/**
|
||||
* PayloadCmdSize
|
||||
* Value that shall be used
|
||||
|
@ -512,7 +742,7 @@ extern "C" {
|
|||
*/
|
||||
#define SHCI_C2_CONFIG_EVTMASK1_BIT0_ERROR_NOTIF_ENABLE (1<<0)
|
||||
#define SHCI_C2_CONFIG_EVTMASK1_BIT1_BLE_NVM_RAM_UPDATE_ENABLE (1<<1)
|
||||
#define SHCI_C2_CONFIG_EVTMASK1_BIT2_OT_NVM_RAM_UPDATE_ENABLE (1<<2)
|
||||
#define SHCI_C2_CONFIG_EVTMASK1_BIT2_THREAD_NVM_RAM_UPDATE_ENABLE (1<<2)
|
||||
#define SHCI_C2_CONFIG_EVTMASK1_BIT3_NVM_START_WRITE_ENABLE (1<<3)
|
||||
#define SHCI_C2_CONFIG_EVTMASK1_BIT4_NVM_END_WRITE_ENABLE (1<<4)
|
||||
#define SHCI_C2_CONFIG_EVTMASK1_BIT5_NVM_START_ERASE_ENABLE (1<<5)
|
||||
|
@ -536,18 +766,17 @@ extern "C" {
|
|||
/** No response parameters*/
|
||||
|
||||
/* Exported type --------------------------------------------------------*/
|
||||
|
||||
typedef MB_WirelessFwInfoTable_t SHCI_WirelessFwInfoTable_t;
|
||||
#define FUS_DEVICE_INFO_TABLE_VALIDITY_KEYWORD (0xA94656B9)
|
||||
|
||||
/*
|
||||
* At startup, the informations relative to the wireless binary are stored in RAM trough a structure defined by
|
||||
* SHCI_WirelessFwInfoTable_t.This structure contains 4 fields (Version,MemorySize, Stack_info and a reserved part)
|
||||
* MB_WirelessFwInfoTable_t.This structure contains 4 fields (Version,MemorySize, Stack_info and a reserved part)
|
||||
* each of those coded on 32 bits as shown on the table below:
|
||||
*
|
||||
*
|
||||
* |7 |6 |5 |4 |3 |2 |1 |0 |7 |6 |5 |4 |3 |2 |1 |0 |7 |6 |5 |4 |3 |2 |1 |0 |7 |6 |5 |4 |3 |2 |1 |0 |
|
||||
* -------------------------------------------------------------------------------------------------
|
||||
* Version | Major version | Minor version | Sub version | Branch |Releas Type|
|
||||
* Version | Major version | Minor version | Sub version | Branch |ReleaseType|
|
||||
* -------------------------------------------------------------------------------------------------
|
||||
* MemorySize | SRAM2B (kB) | SRAM2A (kB) | SRAM1 (kB) | FLASH (4kb) |
|
||||
* -------------------------------------------------------------------------------------------------
|
||||
|
@ -587,16 +816,17 @@ typedef MB_WirelessFwInfoTable_t SHCI_WirelessFwInfoTable_t;
|
|||
#define INFO_STACK_TYPE_MASK 0x000000ff
|
||||
#define INFO_STACK_TYPE_NONE 0
|
||||
|
||||
#define INFO_STACK_TYPE_BLE_STANDARD 0x01
|
||||
#define INFO_STACK_TYPE_BLE_FULL 0x01
|
||||
#define INFO_STACK_TYPE_BLE_HCI 0x02
|
||||
#define INFO_STACK_TYPE_BLE_LIGHT 0x03
|
||||
#define INFO_STACK_TYPE_BLE_BEACON 0x04
|
||||
#define INFO_STACK_TYPE_THREAD_FTD 0x10
|
||||
#define INFO_STACK_TYPE_THREAD_MTD 0x11
|
||||
#define INFO_STACK_TYPE_ZIGBEE_FFD 0x30
|
||||
#define INFO_STACK_TYPE_ZIGBEE_RFD 0x31
|
||||
#define INFO_STACK_TYPE_MAC 0x40
|
||||
#define INFO_STACK_TYPE_BLE_THREAD_FTD_STATIC 0x50
|
||||
#define INFO_STACK_TYPE_BLE_THREAD_FTD_DYAMIC 0x51
|
||||
#define INFO_STACK_TYPE_BLE_THREAD_FTD_DYAMIC 0x51
|
||||
#define INFO_STACK_TYPE_802154_LLD_TESTS 0x60
|
||||
#define INFO_STACK_TYPE_802154_PHY_VALID 0x61
|
||||
#define INFO_STACK_TYPE_BLE_PHY_VALID 0x62
|
||||
|
@ -604,8 +834,11 @@ typedef MB_WirelessFwInfoTable_t SHCI_WirelessFwInfoTable_t;
|
|||
#define INFO_STACK_TYPE_BLE_RLV 0x64
|
||||
#define INFO_STACK_TYPE_802154_RLV 0x65
|
||||
#define INFO_STACK_TYPE_BLE_ZIGBEE_FFD_STATIC 0x70
|
||||
#define INFO_STACK_TYPE_BLE_ZIGBEE_RFD_STATIC 0x71
|
||||
#define INFO_STACK_TYPE_BLE_ZIGBEE_FFD_DYNAMIC 0x78
|
||||
#define INFO_STACK_TYPE_BLE_ZIGBEE_RFD_DYNAMIC 0x79
|
||||
#define INFO_STACK_TYPE_RLV 0x80
|
||||
#define INFO_STACK_TYPE_BLE_MAC_STATIC 0x90
|
||||
|
||||
typedef struct {
|
||||
/**
|
||||
|
@ -635,18 +868,16 @@ typedef struct {
|
|||
|
||||
/* Exported functions ------------------------------------------------------- */
|
||||
|
||||
/**
|
||||
* For all SHCI_C2_FUS_xxx() command:
|
||||
* When the wireless FW is running on the CPU2, the command returns SHCI_FUS_CMD_NOT_SUPPORTED
|
||||
* When any FUS command is sent after the SHCI_FUS_CMD_NOT_SUPPORTED has been received,
|
||||
* the CPU2 switches on the RSS ( This reboots automatically the device )
|
||||
*/
|
||||
/**
|
||||
* SHCI_C2_FUS_GetState
|
||||
* @brief Read the FUS State
|
||||
* If the user is not interested by the Error code response, a null value may
|
||||
* be passed as parameter
|
||||
*
|
||||
* Note: This command is fully supported only by the FUS.
|
||||
* When the wireless firmware receives that command, it responds SHCI_FUS_CMD_NOT_SUPPORTED the first time.
|
||||
* When the wireless firmware receives that command a second time, it reboots the full device with the FUS running on CPU2
|
||||
*
|
||||
* @param p_rsp : return the error code when the FUS State Value = 0xFF
|
||||
* @retval FUS State Values
|
||||
*/
|
||||
|
@ -655,6 +886,7 @@ typedef struct {
|
|||
/**
|
||||
* SHCI_C2_FUS_FwUpgrade
|
||||
* @brief Request the FUS to install the CPU2 firmware update
|
||||
* Note: This command is only supported by the FUS.
|
||||
*
|
||||
* @param fw_src_add: Address of the firmware image location
|
||||
* @param fw_dest_add: Address of the firmware destination
|
||||
|
@ -665,6 +897,7 @@ typedef struct {
|
|||
/**
|
||||
* SHCI_C2_FUS_FwDelete
|
||||
* @brief Delete the wireless stack on CPU2
|
||||
* Note: This command is only supported by the FUS.
|
||||
*
|
||||
* @param None
|
||||
* @retval Status
|
||||
|
@ -674,6 +907,7 @@ typedef struct {
|
|||
/**
|
||||
* SHCI_C2_FUS_UpdateAuthKey
|
||||
* @brief Request the FUS to update the authentication key
|
||||
* Note: This command is only supported by the FUS.
|
||||
*
|
||||
* @param pCmdPacket
|
||||
* @retval Status
|
||||
|
@ -683,6 +917,7 @@ typedef struct {
|
|||
/**
|
||||
* SHCI_C2_FUS_LockAuthKey
|
||||
* @brief Request the FUS to prevent any future update of the authentication key
|
||||
* Note: This command is only supported by the FUS.
|
||||
*
|
||||
* @param None
|
||||
* @retval Status
|
||||
|
@ -692,6 +927,7 @@ typedef struct {
|
|||
/**
|
||||
* SHCI_C2_FUS_StoreUsrKey
|
||||
* @brief Request the FUS to store the user key
|
||||
* Note: This command is supported by both the FUS and the wireless stack.
|
||||
*
|
||||
* @param pParam : command parameter
|
||||
* @param p_key_index : Index allocated by the FUS to the stored key
|
||||
|
@ -703,6 +939,7 @@ typedef struct {
|
|||
/**
|
||||
* SHCI_C2_FUS_LoadUsrKey
|
||||
* @brief Request the FUS to load the user key into the AES
|
||||
* Note: This command is supported by both the FUS and the wireless stack.
|
||||
*
|
||||
* @param key_index : index of the user key to load in AES1
|
||||
* @retval Status
|
||||
|
@ -712,6 +949,7 @@ typedef struct {
|
|||
/**
|
||||
* SHCI_C2_FUS_StartWs
|
||||
* @brief Request the FUS to reboot on the wireless stack
|
||||
* Note: This command is only supported by the FUS.
|
||||
*
|
||||
* @param None
|
||||
* @retval Status
|
||||
|
@ -721,17 +959,41 @@ typedef struct {
|
|||
/**
|
||||
* SHCI_C2_FUS_LockUsrKey
|
||||
* @brief Request the FUS to lock the user key so that it cannot be updated later on
|
||||
* Note: This command is supported by both the FUS and the wireless stack.
|
||||
*
|
||||
* @param key_index : index of the user key to lock
|
||||
* @retval Status
|
||||
*/
|
||||
SHCI_CmdStatus_t SHCI_C2_FUS_LockUsrKey( uint8_t key_index );
|
||||
|
||||
/**
|
||||
* SHCI_C2_FUS_UnloadUsrKey
|
||||
* @brief Request the FUS to Unload the user key so that the CPU1 may use the AES with another Key
|
||||
* Note: This command is supported by both the FUS and the wireless stack.
|
||||
*
|
||||
* @param key_index : index of the user key to unload
|
||||
* @retval Status
|
||||
*/
|
||||
SHCI_CmdStatus_t SHCI_C2_FUS_UnloadUsrKey( uint8_t key_index );
|
||||
|
||||
/**
|
||||
* SHCI_C2_FUS_ActivateAntiRollback
|
||||
* @brief Request the FUS to enable the AntiRollback feature so that it is not possible to update the wireless firmware
|
||||
* with an older version than the current one.
|
||||
* Note:
|
||||
* - This command is only supported by the FUS.
|
||||
* - Once this feature is enabled, it is not possible anymore to disable it.
|
||||
*
|
||||
* @param None
|
||||
* @retval Status
|
||||
*/
|
||||
SHCI_CmdStatus_t SHCI_C2_FUS_ActivateAntiRollback( void );
|
||||
|
||||
/**
|
||||
* SHCI_C2_BLE_Init
|
||||
* @brief Provides parameters and starts the BLE Stack
|
||||
*
|
||||
* @param pCmdPacket : Parameters to be provided to the BLE Stack
|
||||
* @param pCmdPacket : Parameters are described SHCI_C2_Ble_Init_Cmd_Packet_t declaration
|
||||
* @retval Status
|
||||
*/
|
||||
SHCI_CmdStatus_t SHCI_C2_BLE_Init( SHCI_C2_Ble_Init_Cmd_Packet_t *pCmdPacket );
|
||||
|
@ -756,14 +1018,14 @@ typedef struct {
|
|||
SHCI_CmdStatus_t SHCI_C2_LLDTESTS_Init( uint8_t param_size, uint8_t * p_param );
|
||||
|
||||
/**
|
||||
* SHCI_C2_LLD_BLE_Init
|
||||
* @brief Starts the LLD tests CLI
|
||||
* SHCI_C2_BLE_LLD_Init
|
||||
* @brief Starts the LLD tests BLE
|
||||
*
|
||||
* @param param_size : Nb of bytes
|
||||
* @param p_param : pointeur with data to give from M4 to M0
|
||||
* @retval Status
|
||||
*/
|
||||
SHCI_CmdStatus_t SHCI_C2_LLD_BLE_Init( uint8_t param_size, uint8_t * p_param );
|
||||
SHCI_CmdStatus_t SHCI_C2_BLE_LLD_Init( uint8_t param_size, uint8_t * p_param );
|
||||
|
||||
/**
|
||||
* SHCI_C2_ZIGBEE_Init
|
||||
|
@ -800,6 +1062,24 @@ typedef struct {
|
|||
* @retval Status
|
||||
*/
|
||||
SHCI_CmdStatus_t SHCI_C2_CONCURRENT_SetMode( SHCI_C2_CONCURRENT_Mode_Param_t Mode );
|
||||
|
||||
/**
|
||||
* SHCI_C2_CONCURRENT_GetNextBleEvtTime
|
||||
* @brief Get the next BLE event date (relative time)
|
||||
*
|
||||
* @param Command Packet
|
||||
* @retval None
|
||||
*/
|
||||
SHCI_CmdStatus_t SHCI_C2_CONCURRENT_GetNextBleEvtTime( SHCI_C2_CONCURRENT_GetNextBleEvtTime_Param_t *pParam );
|
||||
|
||||
/**
|
||||
* SHCI_C2_CONCURRENT_EnableNext_802154_EvtNotification
|
||||
* @brief Activate the next 802.15.4 event notification (one shot)
|
||||
*
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
SHCI_CmdStatus_t SHCI_C2_CONCURRENT_EnableNext_802154_EvtNotification( void );
|
||||
|
||||
/**
|
||||
* SHCI_C2_FLASH_StoreData
|
||||
|
@ -842,7 +1122,7 @@ typedef struct {
|
|||
/**
|
||||
* SHCI_GetWirelessFwInfo
|
||||
* @brief This function read back the informations relative to the wireless binary loaded.
|
||||
* Refer yourself to SHCI_WirelessFwInfoTable_t structure to get the significance
|
||||
* Refer yourself to MB_WirelessFwInfoTable_t structure to get the significance
|
||||
* of the different parameters returned.
|
||||
* @param pWirelessInfo : Pointer to WirelessFwInfo_t.
|
||||
*
|
||||
|
@ -935,6 +1215,15 @@ typedef struct {
|
|||
*/
|
||||
SHCI_CmdStatus_t SHCI_C2_Config(SHCI_C2_CONFIG_Cmd_Param_t *pCmdPacket);
|
||||
|
||||
/**
|
||||
* SHCI_C2_802_15_4_DeInit
|
||||
* @brief Deinit 802.15.4 layer (to be used before entering StandBy mode)
|
||||
*
|
||||
* @param None
|
||||
* @retval Status
|
||||
*/
|
||||
SHCI_CmdStatus_t SHCI_C2_802_15_4_DeInit( void );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -24,33 +24,6 @@
|
|||
#include "stm_list.h"
|
||||
#include "shci_tl.h"
|
||||
|
||||
#include "mbed_toolchain.h"
|
||||
|
||||
/**
|
||||
* These traces are not yet supported in an usual way in the delivery package
|
||||
* They can enabled by adding the definition of TL_SHCI_CMD_DBG_EN and/or TL_SHCI_EVT_DBG_EN in the preprocessor option in the IDE
|
||||
*/
|
||||
#if ( (TL_SHCI_CMD_DBG_EN != 0) || (TL_SHCI_EVT_DBG_EN != 0) )
|
||||
#include "app_conf.h"
|
||||
#include "dbg_trace.h"
|
||||
#endif
|
||||
|
||||
#if (TL_SHCI_CMD_DBG_EN != 0)
|
||||
#define TL_SHCI_CMD_DBG_MSG PRINT_MESG_DBG
|
||||
#define TL_SHCI_CMD_DBG_BUF PRINT_LOG_BUFF_DBG
|
||||
#else
|
||||
#define TL_SHCI_CMD_DBG_MSG(...)
|
||||
#define TL_SHCI_CMD_DBG_BUF(...)
|
||||
#endif
|
||||
|
||||
#if (TL_SHCI_EVT_DBG_EN != 0)
|
||||
#define TL_SHCI_EVT_DBG_MSG PRINT_MESG_DBG
|
||||
#define TL_SHCI_EVT_DBG_BUF PRINT_LOG_BUFF_DBG
|
||||
#else
|
||||
#define TL_SHCI_EVT_DBG_MSG(...)
|
||||
#define TL_SHCI_EVT_DBG_BUF(...)
|
||||
#endif
|
||||
|
||||
/* Private typedef -----------------------------------------------------------*/
|
||||
typedef enum
|
||||
{
|
||||
|
@ -88,9 +61,6 @@ static void Cmd_SetStatus(SHCI_TL_CmdStatus_t shcicmdstatus);
|
|||
static void TlCmdEvtReceived(TL_EvtPacket_t *shcievt);
|
||||
static void TlUserEvtReceived(TL_EvtPacket_t *shcievt);
|
||||
static void TlInit( TL_CmdPacket_t * p_cmdbuffer );
|
||||
static void OutputCmdTrace(TL_CmdPacket_t *pCmdBuffer);
|
||||
static void OutputRspTrace(TL_EvtPacket_t *p_rsp);
|
||||
static void OutputEvtTrace(TL_EvtPacket_t *phcievtbuffer);
|
||||
|
||||
/* Interface ------- ---------------------------------------------------------*/
|
||||
void shci_init(void(* UserEvtRx)(void* pData), void* pConf)
|
||||
|
@ -128,8 +98,6 @@ void shci_user_evt_proc(void)
|
|||
{
|
||||
LST_remove_head ( &SHciAsynchEventQueue, (tListNode **)&phcievtbuffer );
|
||||
|
||||
OutputEvtTrace(phcievtbuffer);
|
||||
|
||||
if (shciContext.UserEvtRx != NULL)
|
||||
{
|
||||
UserEvtRxParam.pckt = phcievtbuffer;
|
||||
|
@ -186,8 +154,6 @@ void shci_send( uint16_t cmd_code, uint8_t len_cmd_payload, uint8_t * p_cmd_payl
|
|||
|
||||
memcpy(pCmdBuffer->cmdserial.cmd.payload, p_cmd_payload, len_cmd_payload );
|
||||
|
||||
OutputCmdTrace(pCmdBuffer);
|
||||
|
||||
shciContext.io.Send(0,0);
|
||||
|
||||
shci_cmd_resp_wait(SHCI_TL_DEFAULT_TIMEOUT);
|
||||
|
@ -198,8 +164,6 @@ void shci_send( uint16_t cmd_code, uint8_t len_cmd_payload, uint8_t * p_cmd_payl
|
|||
*/
|
||||
memcpy( &(p_rsp->evtserial), pCmdBuffer, ((TL_EvtSerial_t*)pCmdBuffer)->evt.plen + TL_EVT_HDR_SIZE );
|
||||
|
||||
OutputRspTrace(p_rsp);
|
||||
|
||||
Cmd_SetStatus(SHCI_TL_CmdAvailable);
|
||||
|
||||
return;
|
||||
|
@ -269,69 +233,8 @@ static void TlUserEvtReceived(TL_EvtPacket_t *shcievt)
|
|||
return;
|
||||
}
|
||||
|
||||
static void OutputCmdTrace(TL_CmdPacket_t *pCmdBuffer)
|
||||
{
|
||||
TL_SHCI_CMD_DBG_MSG("sys cmd: 0x%04X", pCmdBuffer->cmdserial.cmd.cmdcode);
|
||||
|
||||
if(pCmdBuffer->cmdserial.cmd.plen != 0)
|
||||
{
|
||||
TL_SHCI_CMD_DBG_MSG(" payload:");
|
||||
TL_SHCI_CMD_DBG_BUF(pCmdBuffer->cmdserial.cmd.payload, pCmdBuffer->cmdserial.cmd.plen, "");
|
||||
}
|
||||
TL_SHCI_CMD_DBG_MSG("\r\n");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static void OutputRspTrace(TL_EvtPacket_t *p_rsp)
|
||||
{
|
||||
switch(p_rsp->evtserial.evt.evtcode)
|
||||
{
|
||||
case TL_BLEEVT_CC_OPCODE:
|
||||
TL_SHCI_CMD_DBG_MSG("sys rsp: 0x%02X", p_rsp->evtserial.evt.evtcode);
|
||||
TL_SHCI_CMD_DBG_MSG(" cmd opcode: 0x%02X", ((TL_CcEvt_t*)(p_rsp->evtserial.evt.payload))->cmdcode);
|
||||
TL_SHCI_CMD_DBG_MSG(" status: 0x%02X", ((TL_CcEvt_t*)(p_rsp->evtserial.evt.payload))->payload[0]);
|
||||
if((p_rsp->evtserial.evt.plen-4) != 0)
|
||||
{
|
||||
TL_SHCI_CMD_DBG_MSG(" payload:");
|
||||
TL_SHCI_CMD_DBG_BUF(&((TL_CcEvt_t*)(p_rsp->evtserial.evt.payload))->payload[1], p_rsp->evtserial.evt.plen-4, "");
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
TL_SHCI_CMD_DBG_MSG("unknown sys rsp received: %02X", p_rsp->evtserial.evt.evtcode);
|
||||
break;
|
||||
}
|
||||
|
||||
TL_SHCI_CMD_DBG_MSG("\r\n");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static void OutputEvtTrace(TL_EvtPacket_t *phcievtbuffer)
|
||||
{
|
||||
if(phcievtbuffer->evtserial.evt.evtcode != TL_BLEEVT_VS_OPCODE)
|
||||
{
|
||||
TL_SHCI_EVT_DBG_MSG("unknown sys evt received: %02X", phcievtbuffer->evtserial.evt.evtcode);
|
||||
}
|
||||
else
|
||||
{
|
||||
TL_SHCI_EVT_DBG_MSG("sys evt: 0x%02X", phcievtbuffer->evtserial.evt.evtcode);
|
||||
TL_SHCI_EVT_DBG_MSG(" subevtcode: 0x%04X", ((TL_AsynchEvt_t*)(phcievtbuffer->evtserial.evt.payload))->subevtcode);
|
||||
if((phcievtbuffer->evtserial.evt.plen-2) != 0)
|
||||
{
|
||||
TL_SHCI_EVT_DBG_MSG(" payload:");
|
||||
TL_SHCI_EVT_DBG_BUF(((TL_AsynchEvt_t*)(phcievtbuffer->evtserial.evt.payload))->payload, phcievtbuffer->evtserial.evt.plen-2, "");
|
||||
}
|
||||
}
|
||||
|
||||
TL_SHCI_EVT_DBG_MSG("\r\n");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/* Weak implementation ----------------------------------------------------------------*/
|
||||
MBED_WEAK void shci_cmd_resp_wait(uint32_t timeout)
|
||||
__WEAK void shci_cmd_resp_wait(uint32_t timeout)
|
||||
{
|
||||
(void)timeout;
|
||||
|
||||
|
@ -341,7 +244,7 @@ MBED_WEAK void shci_cmd_resp_wait(uint32_t timeout)
|
|||
return;
|
||||
}
|
||||
|
||||
MBED_WEAK void shci_cmd_resp_release(uint32_t flag)
|
||||
__WEAK void shci_cmd_resp_release(uint32_t flag)
|
||||
{
|
||||
(void)flag;
|
||||
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
/**
|
||||
******************************************************************************
|
||||
* @file stm32_wpan_common.h
|
||||
* @author MCD Application Team
|
||||
* @brief Common file to utilities
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2019 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
******************************************************************************
|
||||
* @file stm32_wpan_common.h
|
||||
* @author MCD Application Team
|
||||
* @brief Common file to utilities
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2018 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
|
@ -31,6 +31,7 @@ extern "C" {
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include "cmsis_compiler.h"
|
||||
|
||||
/* -------------------------------- *
|
||||
* Basic definitions *
|
||||
|
@ -142,7 +143,7 @@ extern "C" {
|
|||
#define PACKED_STRUCT struct PACKED__
|
||||
#elif defined (__ICCARM__)
|
||||
#define PACKED_STRUCT __packed struct
|
||||
#elif
|
||||
#else
|
||||
#define PACKED_STRUCT __packed struct
|
||||
#endif
|
||||
|
||||
|
|
|
@ -22,8 +22,9 @@
|
|||
#define _STM_LIST_H_
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "stm32_wpan_common.h"
|
||||
|
||||
typedef struct _tListNode {
|
||||
typedef PACKED_STRUCT _tListNode {
|
||||
struct _tListNode * next;
|
||||
struct _tListNode * prev;
|
||||
} tListNode;
|
||||
|
|
|
@ -195,9 +195,9 @@ typedef struct
|
|||
|
||||
typedef struct
|
||||
{
|
||||
uint8_t *p_LldBleCmdRspBuffer;
|
||||
uint8_t *p_LldBleM0CmdBuffer;
|
||||
} TL_LLD_BLE_Config_t;
|
||||
uint8_t *p_BleLldCmdRspBuffer;
|
||||
uint8_t *p_BleLldM0CmdBuffer;
|
||||
} TL_BLE_LLD_Config_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
@ -282,17 +282,17 @@ void TL_LLDTESTS_ReceiveM0Cmd( TL_CmdPacket_t * Notbuffer );
|
|||
void TL_LLDTESTS_SendM0CmdAck( void );
|
||||
|
||||
/******************************************************************************
|
||||
* LLD BLE
|
||||
* BLE LLD
|
||||
******************************************************************************/
|
||||
void TL_LLD_BLE_Init( TL_LLD_BLE_Config_t *p_Config );
|
||||
void TL_LLD_BLE_SendCliCmd( void );
|
||||
void TL_LLD_BLE_ReceiveCliRsp( TL_CmdPacket_t * Notbuffer );
|
||||
void TL_LLD_BLE_SendCliRspAck( void );
|
||||
void TL_LLD_BLE_ReceiveM0Cmd( TL_CmdPacket_t * Notbuffer );
|
||||
void TL_LLD_BLE_SendM0CmdAck( void );
|
||||
void TL_LLD_BLE_SendCmd( void );
|
||||
void TL_LLD_BLE_ReceiveRsp( TL_CmdPacket_t * Notbuffer );
|
||||
void TL_LLD_BLE_SendRspAck( void );
|
||||
void TL_BLE_LLD_Init( TL_BLE_LLD_Config_t *p_Config );
|
||||
void TL_BLE_LLD_SendCliCmd( void );
|
||||
void TL_BLE_LLD_ReceiveCliRsp( TL_CmdPacket_t * Notbuffer );
|
||||
void TL_BLE_LLD_SendCliRspAck( void );
|
||||
void TL_BLE_LLD_ReceiveM0Cmd( TL_CmdPacket_t * Notbuffer );
|
||||
void TL_BLE_LLD_SendM0CmdAck( void );
|
||||
void TL_BLE_LLD_SendCmd( void );
|
||||
void TL_BLE_LLD_ReceiveRsp( TL_CmdPacket_t * Notbuffer );
|
||||
void TL_BLE_LLD_SendRspAck( void );
|
||||
/******************************************************************************
|
||||
* MEMORY MANAGER
|
||||
******************************************************************************/
|
||||
|
|
|
@ -22,28 +22,23 @@
|
|||
#include "stm32_wpan_common.h"
|
||||
#include "hw.h"
|
||||
|
||||
#include "mbed_toolchain.h"
|
||||
|
||||
#include "stm_list.h"
|
||||
#include "tl.h"
|
||||
#include "mbox_def.h"
|
||||
|
||||
/**
|
||||
* These traces are not yet supported in an usual way in the delivery package
|
||||
* They can enabled by adding the definition of TL_MM_DBG_EN in the preprocessor option in the IDE
|
||||
*/
|
||||
#if(TL_MM_DBG_EN != 0)
|
||||
#include "app_conf.h"
|
||||
#include "dbg_trace.h"
|
||||
#endif
|
||||
|
||||
#if (TL_MM_DBG_EN != 0)
|
||||
#define TL_MM_DBG__MSG PRINT_MESG_DBG
|
||||
#else
|
||||
#define TL_MM_DBG__MSG(...)
|
||||
#endif
|
||||
#include "tl_dbg_conf.h"
|
||||
|
||||
/* Private typedef -----------------------------------------------------------*/
|
||||
typedef enum
|
||||
{
|
||||
TL_MB_MM_RELEASE_BUFFER,
|
||||
TL_MB_BLE_CMD,
|
||||
TL_MB_BLE_CMD_RSP,
|
||||
TL_MB_BLE_ASYNCH_EVT,
|
||||
TL_MB_SYS_CMD,
|
||||
TL_MB_SYS_CMD_RSP,
|
||||
TL_MB_SYS_ASYNCH_EVT,
|
||||
} TL_MB_PacketType_t;
|
||||
|
||||
/* Private defines -----------------------------------------------------------*/
|
||||
/* Private macros ------------------------------------------------------------*/
|
||||
/* Private variables ---------------------------------------------------------*/
|
||||
|
@ -54,7 +49,7 @@ PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_DeviceInfoTable_t TL_DeviceInfoTa
|
|||
PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_BleTable_t TL_BleTable;
|
||||
PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_ThreadTable_t TL_ThreadTable;
|
||||
PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_LldTestsTable_t TL_LldTestsTable;
|
||||
PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_LldBleTable_t TL_LldBleTable;
|
||||
PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_BleLldTable_t TL_BleLldTable;
|
||||
PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_SysTable_t TL_SysTable;
|
||||
PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_MemManagerTable_t TL_MemManagerTable;
|
||||
PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_TracesTable_t TL_TracesTable;
|
||||
|
@ -79,7 +74,7 @@ static void (* SYS_EVT_IoBusCallBackFunction) (TL_EvtPacket_t *phcievt);
|
|||
/* Global variables ----------------------------------------------------------*/
|
||||
/* Private function prototypes -----------------------------------------------*/
|
||||
static void SendFreeBuf( void );
|
||||
static void OutputMemReleaseTrace(TL_EvtPacket_t * phcievt);
|
||||
static void OutputDbgTrace(TL_MB_PacketType_t packet_type, uint8_t* buffer);
|
||||
|
||||
/* Public Functions Definition ------------------------------------------------------*/
|
||||
|
||||
|
@ -100,7 +95,7 @@ void TL_Init( void )
|
|||
TL_RefTable.p_ble_table = &TL_BleTable;
|
||||
TL_RefTable.p_thread_table = &TL_ThreadTable;
|
||||
TL_RefTable.p_lld_tests_table = &TL_LldTestsTable;
|
||||
TL_RefTable.p_lld_ble_table = &TL_LldBleTable;
|
||||
TL_RefTable.p_ble_lld_table = &TL_BleLldTable;
|
||||
TL_RefTable.p_sys_table = &TL_SysTable;
|
||||
TL_RefTable.p_mem_manager_table = &TL_MemManagerTable;
|
||||
TL_RefTable.p_traces_table = &TL_TracesTable;
|
||||
|
@ -144,6 +139,8 @@ int32_t TL_BLE_SendCmd( uint8_t* buffer, uint16_t size )
|
|||
|
||||
((TL_CmdPacket_t*)(TL_RefTable.p_ble_table->pcmd_buffer))->cmdserial.type = TL_BLECMD_PKT_TYPE;
|
||||
|
||||
OutputDbgTrace(TL_MB_BLE_CMD, TL_RefTable.p_ble_table->pcmd_buffer);
|
||||
|
||||
HW_IPCC_BLE_SendCmd();
|
||||
|
||||
return 0;
|
||||
|
@ -157,6 +154,15 @@ void HW_IPCC_BLE_RxEvtNot(void)
|
|||
{
|
||||
LST_remove_head (&EvtQueue, (tListNode **)&phcievt);
|
||||
|
||||
if ( ((phcievt->evtserial.evt.evtcode) == TL_BLEEVT_CS_OPCODE) || ((phcievt->evtserial.evt.evtcode) == TL_BLEEVT_CC_OPCODE ) )
|
||||
{
|
||||
OutputDbgTrace(TL_MB_BLE_CMD_RSP, (uint8_t*)phcievt);
|
||||
}
|
||||
else
|
||||
{
|
||||
OutputDbgTrace(TL_MB_BLE_ASYNCH_EVT, (uint8_t*)phcievt);
|
||||
}
|
||||
|
||||
BLE_IoBusEvtCallBackFunction(phcievt);
|
||||
}
|
||||
|
||||
|
@ -211,6 +217,8 @@ int32_t TL_SYS_SendCmd( uint8_t* buffer, uint16_t size )
|
|||
|
||||
((TL_CmdPacket_t *)(TL_RefTable.p_sys_table->pcmd_buffer))->cmdserial.type = TL_SYSCMD_PKT_TYPE;
|
||||
|
||||
OutputDbgTrace(TL_MB_SYS_CMD, TL_RefTable.p_sys_table->pcmd_buffer);
|
||||
|
||||
HW_IPCC_SYS_SendCmd();
|
||||
|
||||
return 0;
|
||||
|
@ -218,6 +226,8 @@ int32_t TL_SYS_SendCmd( uint8_t* buffer, uint16_t size )
|
|||
|
||||
void HW_IPCC_SYS_CmdEvtNot(void)
|
||||
{
|
||||
OutputDbgTrace(TL_MB_SYS_CMD_RSP, (uint8_t*)(TL_RefTable.p_sys_table->pcmd_buffer) );
|
||||
|
||||
SYS_CMD_IoBusCallBackFunction( (TL_EvtPacket_t*)(TL_RefTable.p_sys_table->pcmd_buffer) );
|
||||
|
||||
return;
|
||||
|
@ -230,6 +240,9 @@ void HW_IPCC_SYS_EvtNot( void )
|
|||
while(LST_is_empty(&SystemEvtQueue) == FALSE)
|
||||
{
|
||||
LST_remove_head (&SystemEvtQueue, (tListNode **)&p_evt);
|
||||
|
||||
OutputDbgTrace(TL_MB_SYS_ASYNCH_EVT, (uint8_t*)p_evt );
|
||||
|
||||
SYS_EVT_IoBusCallBackFunction( p_evt );
|
||||
}
|
||||
|
||||
|
@ -312,9 +325,9 @@ void HW_IPCC_THREAD_CliEvtNot( void )
|
|||
return;
|
||||
}
|
||||
|
||||
MBED_WEAK void TL_OT_CmdEvtReceived( TL_EvtPacket_t * Otbuffer ){};
|
||||
MBED_WEAK void TL_THREAD_NotReceived( TL_EvtPacket_t * Notbuffer ){};
|
||||
MBED_WEAK void TL_THREAD_CliNotReceived( TL_EvtPacket_t * Notbuffer ){};
|
||||
__WEAK void TL_OT_CmdEvtReceived( TL_EvtPacket_t * Otbuffer ){};
|
||||
__WEAK void TL_THREAD_NotReceived( TL_EvtPacket_t * Notbuffer ){};
|
||||
__WEAK void TL_THREAD_CliNotReceived( TL_EvtPacket_t * Notbuffer ){};
|
||||
|
||||
#endif /* THREAD_WB */
|
||||
|
||||
|
@ -365,80 +378,80 @@ void TL_LLDTESTS_SendM0CmdAck( void )
|
|||
return;
|
||||
}
|
||||
|
||||
MBED_WEAK void TL_LLDTESTS_ReceiveCliRsp( TL_CmdPacket_t * Notbuffer ){};
|
||||
MBED_WEAK void TL_LLDTESTS_ReceiveM0Cmd( TL_CmdPacket_t * Notbuffer ){};
|
||||
__WEAK void TL_LLDTESTS_ReceiveCliRsp( TL_CmdPacket_t * Notbuffer ){};
|
||||
__WEAK void TL_LLDTESTS_ReceiveM0Cmd( TL_CmdPacket_t * Notbuffer ){};
|
||||
#endif /* LLD_TESTS_WB */
|
||||
|
||||
/******************************************************************************
|
||||
* LLD BLE
|
||||
* BLE LLD
|
||||
******************************************************************************/
|
||||
#ifdef LLD_BLE_WB
|
||||
void TL_LLD_BLE_Init( TL_LLD_BLE_Config_t *p_Config )
|
||||
#ifdef BLE_LLD_WB
|
||||
void TL_BLE_LLD_Init( TL_BLE_LLD_Config_t *p_Config )
|
||||
{
|
||||
MB_LldBleTable_t * p_lld_ble_table;
|
||||
MB_BleLldTable_t * p_ble_lld_table;
|
||||
|
||||
p_lld_ble_table = TL_RefTable.p_lld_ble_table;
|
||||
p_lld_ble_table->cmdrsp_buffer = p_Config->p_LldBleCmdRspBuffer;
|
||||
p_lld_ble_table->m0cmd_buffer = p_Config->p_LldBleM0CmdBuffer;
|
||||
HW_IPCC_LLD_BLE_Init();
|
||||
p_ble_lld_table = TL_RefTable.p_ble_lld_table;
|
||||
p_ble_lld_table->cmdrsp_buffer = p_Config->p_BleLldCmdRspBuffer;
|
||||
p_ble_lld_table->m0cmd_buffer = p_Config->p_BleLldM0CmdBuffer;
|
||||
HW_IPCC_BLE_LLD_Init();
|
||||
return;
|
||||
}
|
||||
|
||||
void TL_LLD_BLE_SendCliCmd( void )
|
||||
void TL_BLE_LLD_SendCliCmd( void )
|
||||
{
|
||||
((TL_CmdPacket_t *)(TL_RefTable.p_lld_ble_table->cmdrsp_buffer))->cmdserial.type = TL_CLICMD_PKT_TYPE;
|
||||
HW_IPCC_LLD_BLE_SendCliCmd();
|
||||
((TL_CmdPacket_t *)(TL_RefTable.p_ble_lld_table->cmdrsp_buffer))->cmdserial.type = TL_CLICMD_PKT_TYPE;
|
||||
HW_IPCC_BLE_LLD_SendCliCmd();
|
||||
return;
|
||||
}
|
||||
|
||||
void HW_IPCC_LLD_BLE_ReceiveCliRsp( void )
|
||||
void HW_IPCC_BLE_LLD_ReceiveCliRsp( void )
|
||||
{
|
||||
TL_LLD_BLE_ReceiveCliRsp( (TL_CmdPacket_t*)(TL_RefTable.p_lld_ble_table->cmdrsp_buffer) );
|
||||
TL_BLE_LLD_ReceiveCliRsp( (TL_CmdPacket_t*)(TL_RefTable.p_ble_lld_table->cmdrsp_buffer) );
|
||||
return;
|
||||
}
|
||||
|
||||
void TL_LLD_BLE_SendCliRspAck( void )
|
||||
void TL_BLE_LLD_SendCliRspAck( void )
|
||||
{
|
||||
HW_IPCC_LLD_BLE_SendCliRspAck();
|
||||
HW_IPCC_BLE_LLD_SendCliRspAck();
|
||||
return;
|
||||
}
|
||||
|
||||
void HW_IPCC_LLD_BLE_ReceiveM0Cmd( void )
|
||||
void HW_IPCC_BLE_LLD_ReceiveM0Cmd( void )
|
||||
{
|
||||
TL_LLD_BLE_ReceiveM0Cmd( (TL_CmdPacket_t*)(TL_RefTable.p_lld_ble_table->m0cmd_buffer) );
|
||||
TL_BLE_LLD_ReceiveM0Cmd( (TL_CmdPacket_t*)(TL_RefTable.p_ble_lld_table->m0cmd_buffer) );
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
void TL_LLD_BLE_SendM0CmdAck( void )
|
||||
void TL_BLE_LLD_SendM0CmdAck( void )
|
||||
{
|
||||
HW_IPCC_LLD_BLE_SendM0CmdAck();
|
||||
HW_IPCC_BLE_LLD_SendM0CmdAck();
|
||||
return;
|
||||
}
|
||||
|
||||
MBED_WEAK void TL_LLD_BLE_ReceiveCliRsp( TL_CmdPacket_t * Notbuffer ){};
|
||||
MBED_WEAK void TL_LLD_BLE_ReceiveM0Cmd( TL_CmdPacket_t * Notbuffer ){};
|
||||
__WEAK void TL_BLE_LLD_ReceiveCliRsp( TL_CmdPacket_t * Notbuffer ){};
|
||||
__WEAK void TL_BLE_LLD_ReceiveM0Cmd( TL_CmdPacket_t * Notbuffer ){};
|
||||
|
||||
/* Transparent Mode */
|
||||
void TL_LLD_BLE_SendCmd( void )
|
||||
void TL_BLE_LLD_SendCmd( void )
|
||||
{
|
||||
((TL_CmdPacket_t *)(TL_RefTable.p_lld_ble_table->cmdrsp_buffer))->cmdserial.type = TL_CLICMD_PKT_TYPE;
|
||||
HW_IPCC_LLD_BLE_SendCmd();
|
||||
((TL_CmdPacket_t *)(TL_RefTable.p_ble_lld_table->cmdrsp_buffer))->cmdserial.type = TL_CLICMD_PKT_TYPE;
|
||||
HW_IPCC_BLE_LLD_SendCmd();
|
||||
return;
|
||||
}
|
||||
|
||||
void HW_IPCC_LLD_BLE_ReceiveRsp( void )
|
||||
void HW_IPCC_BLE_LLD_ReceiveRsp( void )
|
||||
{
|
||||
TL_LLD_BLE_ReceiveRsp( (TL_CmdPacket_t*)(TL_RefTable.p_lld_ble_table->cmdrsp_buffer) );
|
||||
TL_BLE_LLD_ReceiveRsp( (TL_CmdPacket_t*)(TL_RefTable.p_ble_lld_table->cmdrsp_buffer) );
|
||||
return;
|
||||
}
|
||||
|
||||
void TL_LLD_BLE_SendRspAck( void )
|
||||
void TL_BLE_LLD_SendRspAck( void )
|
||||
{
|
||||
HW_IPCC_LLD_BLE_SendRspAck();
|
||||
HW_IPCC_BLE_LLD_SendRspAck();
|
||||
return;
|
||||
}
|
||||
#endif /* LLD_BLE_WB */
|
||||
#endif /* BLE_LLD_WB */
|
||||
|
||||
#ifdef MAC_802_15_4_WB
|
||||
/******************************************************************************
|
||||
|
@ -490,8 +503,8 @@ void HW_IPCC_MAC_802_15_4_EvtNot( void )
|
|||
return;
|
||||
}
|
||||
|
||||
MBED_WEAK void TL_MAC_802_15_4_CmdEvtReceived( TL_EvtPacket_t * Otbuffer ){};
|
||||
MBED_WEAK void TL_MAC_802_15_4_NotReceived( TL_EvtPacket_t * Notbuffer ){};
|
||||
__WEAK void TL_MAC_802_15_4_CmdEvtReceived( TL_EvtPacket_t * Otbuffer ){};
|
||||
__WEAK void TL_MAC_802_15_4_NotReceived( TL_EvtPacket_t * Notbuffer ){};
|
||||
#endif
|
||||
|
||||
#ifdef ZIGBEE_WB
|
||||
|
@ -567,8 +580,8 @@ void TL_ZIGBEE_SendM4AckToM0Request(void)
|
|||
}
|
||||
|
||||
|
||||
MBED_WEAK void TL_ZIGBEE_CmdEvtReceived( TL_EvtPacket_t * Otbuffer ){};
|
||||
MBED_WEAK void TL_ZIGBEE_NotReceived( TL_EvtPacket_t * Notbuffer ){};
|
||||
__WEAK void TL_ZIGBEE_CmdEvtReceived( TL_EvtPacket_t * Otbuffer ){};
|
||||
__WEAK void TL_ZIGBEE_NotReceived( TL_EvtPacket_t * Notbuffer ){};
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -600,7 +613,7 @@ void TL_MM_EvtDone(TL_EvtPacket_t * phcievt)
|
|||
{
|
||||
LST_insert_tail(&LocalFreeBufQueue, (tListNode *)phcievt);
|
||||
|
||||
OutputMemReleaseTrace(phcievt);
|
||||
OutputDbgTrace(TL_MB_MM_RELEASE_BUFFER, (uint8_t*)phcievt);
|
||||
|
||||
HW_IPCC_MM_SendFreeBuf( SendFreeBuf );
|
||||
|
||||
|
@ -620,39 +633,6 @@ static void SendFreeBuf( void )
|
|||
return;
|
||||
}
|
||||
|
||||
static void OutputMemReleaseTrace(TL_EvtPacket_t * phcievt)
|
||||
{
|
||||
switch(phcievt->evtserial.evt.evtcode)
|
||||
{
|
||||
case TL_BLEEVT_CS_OPCODE:
|
||||
TL_MM_DBG__MSG("mm evt released: 0x%02X", phcievt->evtserial.evt.evtcode);
|
||||
TL_MM_DBG__MSG(" cmd opcode: 0x%04X", ((TL_CsEvt_t*)(phcievt->evtserial.evt.payload))->cmdcode);
|
||||
TL_MM_DBG__MSG(" buffer addr: 0x%08X", phcievt);
|
||||
break;
|
||||
|
||||
case TL_BLEEVT_CC_OPCODE:
|
||||
TL_MM_DBG__MSG("mm evt released: 0x%02X", phcievt->evtserial.evt.evtcode);
|
||||
TL_MM_DBG__MSG(" cmd opcode: 0x%04X", ((TL_CcEvt_t*)(phcievt->evtserial.evt.payload))->cmdcode);
|
||||
TL_MM_DBG__MSG(" buffer addr: 0x%08X", phcievt);
|
||||
break;
|
||||
|
||||
case TL_BLEEVT_VS_OPCODE:
|
||||
TL_MM_DBG__MSG("mm evt released: 0x%02X", phcievt->evtserial.evt.evtcode);
|
||||
TL_MM_DBG__MSG(" subevtcode: 0x%04X", ((TL_AsynchEvt_t*)(phcievt->evtserial.evt.payload))->subevtcode);
|
||||
TL_MM_DBG__MSG(" buffer addr: 0x%08X", phcievt);
|
||||
break;
|
||||
|
||||
default:
|
||||
TL_MM_DBG__MSG("mm evt released: 0x%02X", phcievt->evtserial.evt.evtcode);
|
||||
TL_MM_DBG__MSG(" buffer addr: 0x%08X", phcievt);
|
||||
break;
|
||||
}
|
||||
|
||||
TL_MM_DBG__MSG("\r\n");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* TRACES
|
||||
******************************************************************************/
|
||||
|
@ -680,9 +660,192 @@ void HW_IPCC_TRACES_EvtNot(void)
|
|||
return;
|
||||
}
|
||||
|
||||
MBED_WEAK void TL_TRACES_EvtReceived( TL_EvtPacket_t * hcievt )
|
||||
__WEAK void TL_TRACES_EvtReceived( TL_EvtPacket_t * hcievt )
|
||||
{
|
||||
(void)(hcievt);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* DEBUG INFORMATION
|
||||
******************************************************************************/
|
||||
static void OutputDbgTrace(TL_MB_PacketType_t packet_type, uint8_t* buffer)
|
||||
{
|
||||
TL_EvtPacket_t *p_evt_packet;
|
||||
TL_CmdPacket_t *p_cmd_packet;
|
||||
|
||||
switch(packet_type)
|
||||
{
|
||||
case TL_MB_MM_RELEASE_BUFFER:
|
||||
p_evt_packet = (TL_EvtPacket_t*)buffer;
|
||||
switch(p_evt_packet->evtserial.evt.evtcode)
|
||||
{
|
||||
case TL_BLEEVT_CS_OPCODE:
|
||||
TL_MM_DBG_MSG("mm evt released: 0x%02X", p_evt_packet->evtserial.evt.evtcode);
|
||||
TL_MM_DBG_MSG(" cmd opcode: 0x%04X", ((TL_CsEvt_t*)(p_evt_packet->evtserial.evt.payload))->cmdcode);
|
||||
TL_MM_DBG_MSG(" buffer addr: 0x%08X", p_evt_packet);
|
||||
break;
|
||||
|
||||
case TL_BLEEVT_CC_OPCODE:
|
||||
TL_MM_DBG_MSG("mm evt released: 0x%02X", p_evt_packet->evtserial.evt.evtcode);
|
||||
TL_MM_DBG_MSG(" cmd opcode: 0x%04X", ((TL_CcEvt_t*)(p_evt_packet->evtserial.evt.payload))->cmdcode);
|
||||
TL_MM_DBG_MSG(" buffer addr: 0x%08X", p_evt_packet);
|
||||
break;
|
||||
|
||||
case TL_BLEEVT_VS_OPCODE:
|
||||
TL_MM_DBG_MSG("mm evt released: 0x%02X", p_evt_packet->evtserial.evt.evtcode);
|
||||
TL_MM_DBG_MSG(" subevtcode: 0x%04X", ((TL_AsynchEvt_t*)(p_evt_packet->evtserial.evt.payload))->subevtcode);
|
||||
TL_MM_DBG_MSG(" buffer addr: 0x%08X", p_evt_packet);
|
||||
break;
|
||||
|
||||
default:
|
||||
TL_MM_DBG_MSG("mm evt released: 0x%02X", p_evt_packet->evtserial.evt.evtcode);
|
||||
TL_MM_DBG_MSG(" buffer addr: 0x%08X", p_evt_packet);
|
||||
break;
|
||||
}
|
||||
|
||||
TL_MM_DBG_MSG("\r\n");
|
||||
break;
|
||||
|
||||
case TL_MB_BLE_CMD:
|
||||
p_cmd_packet = (TL_CmdPacket_t*)buffer;
|
||||
TL_HCI_CMD_DBG_MSG("ble cmd: 0x%04X", p_cmd_packet->cmdserial.cmd.cmdcode);
|
||||
if(p_cmd_packet->cmdserial.cmd.plen != 0)
|
||||
{
|
||||
TL_HCI_CMD_DBG_MSG(" payload:");
|
||||
TL_HCI_CMD_DBG_BUF(p_cmd_packet->cmdserial.cmd.payload, p_cmd_packet->cmdserial.cmd.plen, "");
|
||||
}
|
||||
TL_HCI_CMD_DBG_MSG("\r\n");
|
||||
|
||||
TL_HCI_CMD_DBG_RAW(&p_cmd_packet->cmdserial, p_cmd_packet->cmdserial.cmd.plen+TL_CMD_HDR_SIZE);
|
||||
break;
|
||||
|
||||
case TL_MB_BLE_CMD_RSP:
|
||||
p_evt_packet = (TL_EvtPacket_t*)buffer;
|
||||
switch(p_evt_packet->evtserial.evt.evtcode)
|
||||
{
|
||||
case TL_BLEEVT_CS_OPCODE:
|
||||
TL_HCI_CMD_DBG_MSG("ble rsp: 0x%02X", p_evt_packet->evtserial.evt.evtcode);
|
||||
TL_HCI_CMD_DBG_MSG(" cmd opcode: 0x%04X", ((TL_CsEvt_t*)(p_evt_packet->evtserial.evt.payload))->cmdcode);
|
||||
TL_HCI_CMD_DBG_MSG(" numhci: 0x%02X", ((TL_CsEvt_t*)(p_evt_packet->evtserial.evt.payload))->numcmd);
|
||||
TL_HCI_CMD_DBG_MSG(" status: 0x%02X", ((TL_CsEvt_t*)(p_evt_packet->evtserial.evt.payload))->status);
|
||||
break;
|
||||
|
||||
case TL_BLEEVT_CC_OPCODE:
|
||||
TL_HCI_CMD_DBG_MSG("ble rsp: 0x%02X", p_evt_packet->evtserial.evt.evtcode);
|
||||
TL_HCI_CMD_DBG_MSG(" cmd opcode: 0x%04X", ((TL_CcEvt_t*)(p_evt_packet->evtserial.evt.payload))->cmdcode);
|
||||
TL_HCI_CMD_DBG_MSG(" numhci: 0x%02X", ((TL_CcEvt_t*)(p_evt_packet->evtserial.evt.payload))->numcmd);
|
||||
TL_HCI_CMD_DBG_MSG(" status: 0x%02X", ((TL_CcEvt_t*)(p_evt_packet->evtserial.evt.payload))->payload[0]);
|
||||
if((p_evt_packet->evtserial.evt.plen-4) != 0)
|
||||
{
|
||||
TL_HCI_CMD_DBG_MSG(" payload:");
|
||||
TL_HCI_CMD_DBG_BUF(&((TL_CcEvt_t*)(p_evt_packet->evtserial.evt.payload))->payload[1], p_evt_packet->evtserial.evt.plen-4, "");
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
TL_HCI_CMD_DBG_MSG("unknown ble rsp received: %02X", p_evt_packet->evtserial.evt.evtcode);
|
||||
break;
|
||||
}
|
||||
|
||||
TL_HCI_CMD_DBG_MSG("\r\n");
|
||||
|
||||
TL_HCI_CMD_DBG_RAW(&p_evt_packet->evtserial, p_evt_packet->evtserial.evt.plen+TL_EVT_HDR_SIZE);
|
||||
break;
|
||||
|
||||
case TL_MB_BLE_ASYNCH_EVT:
|
||||
p_evt_packet = (TL_EvtPacket_t*)buffer;
|
||||
if(p_evt_packet->evtserial.evt.evtcode != TL_BLEEVT_VS_OPCODE)
|
||||
{
|
||||
TL_HCI_EVT_DBG_MSG("ble evt: 0x%02X", p_evt_packet->evtserial.evt.evtcode);
|
||||
if((p_evt_packet->evtserial.evt.plen) != 0)
|
||||
{
|
||||
TL_HCI_EVT_DBG_MSG(" payload:");
|
||||
TL_HCI_EVT_DBG_BUF(p_evt_packet->evtserial.evt.payload, p_evt_packet->evtserial.evt.plen, "");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
TL_HCI_EVT_DBG_MSG("ble evt: 0x%02X", p_evt_packet->evtserial.evt.evtcode);
|
||||
TL_HCI_EVT_DBG_MSG(" subevtcode: 0x%04X", ((TL_AsynchEvt_t*)(p_evt_packet->evtserial.evt.payload))->subevtcode);
|
||||
if((p_evt_packet->evtserial.evt.plen-2) != 0)
|
||||
{
|
||||
TL_HCI_EVT_DBG_MSG(" payload:");
|
||||
TL_HCI_EVT_DBG_BUF(((TL_AsynchEvt_t*)(p_evt_packet->evtserial.evt.payload))->payload, p_evt_packet->evtserial.evt.plen-2, "");
|
||||
}
|
||||
}
|
||||
|
||||
TL_HCI_EVT_DBG_MSG("\r\n");
|
||||
|
||||
TL_HCI_EVT_DBG_RAW(&p_evt_packet->evtserial, p_evt_packet->evtserial.evt.plen+TL_EVT_HDR_SIZE);
|
||||
break;
|
||||
|
||||
case TL_MB_SYS_CMD:
|
||||
p_cmd_packet = (TL_CmdPacket_t*)buffer;
|
||||
|
||||
TL_SHCI_CMD_DBG_MSG("sys cmd: 0x%04X", p_cmd_packet->cmdserial.cmd.cmdcode);
|
||||
|
||||
if(p_cmd_packet->cmdserial.cmd.plen != 0)
|
||||
{
|
||||
TL_SHCI_CMD_DBG_MSG(" payload:");
|
||||
TL_SHCI_CMD_DBG_BUF(p_cmd_packet->cmdserial.cmd.payload, p_cmd_packet->cmdserial.cmd.plen, "");
|
||||
}
|
||||
TL_SHCI_CMD_DBG_MSG("\r\n");
|
||||
|
||||
TL_SHCI_CMD_DBG_RAW(&p_cmd_packet->cmdserial, p_cmd_packet->cmdserial.cmd.plen+TL_CMD_HDR_SIZE);
|
||||
break;
|
||||
|
||||
case TL_MB_SYS_CMD_RSP:
|
||||
p_evt_packet = (TL_EvtPacket_t*)buffer;
|
||||
switch(p_evt_packet->evtserial.evt.evtcode)
|
||||
{
|
||||
case TL_BLEEVT_CC_OPCODE:
|
||||
TL_SHCI_CMD_DBG_MSG("sys rsp: 0x%02X", p_evt_packet->evtserial.evt.evtcode);
|
||||
TL_SHCI_CMD_DBG_MSG(" cmd opcode: 0x%02X", ((TL_CcEvt_t*)(p_evt_packet->evtserial.evt.payload))->cmdcode);
|
||||
TL_SHCI_CMD_DBG_MSG(" status: 0x%02X", ((TL_CcEvt_t*)(p_evt_packet->evtserial.evt.payload))->payload[0]);
|
||||
if((p_evt_packet->evtserial.evt.plen-4) != 0)
|
||||
{
|
||||
TL_SHCI_CMD_DBG_MSG(" payload:");
|
||||
TL_SHCI_CMD_DBG_BUF(&((TL_CcEvt_t*)(p_evt_packet->evtserial.evt.payload))->payload[1], p_evt_packet->evtserial.evt.plen-4, "");
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
TL_SHCI_CMD_DBG_MSG("unknown sys rsp received: %02X", p_evt_packet->evtserial.evt.evtcode);
|
||||
break;
|
||||
}
|
||||
|
||||
TL_SHCI_CMD_DBG_MSG("\r\n");
|
||||
|
||||
TL_SHCI_CMD_DBG_RAW(&p_evt_packet->evtserial, p_evt_packet->evtserial.evt.plen+TL_EVT_HDR_SIZE);
|
||||
break;
|
||||
|
||||
case TL_MB_SYS_ASYNCH_EVT:
|
||||
p_evt_packet = (TL_EvtPacket_t*)buffer;
|
||||
if(p_evt_packet->evtserial.evt.evtcode != TL_BLEEVT_VS_OPCODE)
|
||||
{
|
||||
TL_SHCI_EVT_DBG_MSG("unknown sys evt received: %02X", p_evt_packet->evtserial.evt.evtcode);
|
||||
}
|
||||
else
|
||||
{
|
||||
TL_SHCI_EVT_DBG_MSG("sys evt: 0x%02X", p_evt_packet->evtserial.evt.evtcode);
|
||||
TL_SHCI_EVT_DBG_MSG(" subevtcode: 0x%04X", ((TL_AsynchEvt_t*)(p_evt_packet->evtserial.evt.payload))->subevtcode);
|
||||
if((p_evt_packet->evtserial.evt.plen-2) != 0)
|
||||
{
|
||||
TL_SHCI_EVT_DBG_MSG(" payload:");
|
||||
TL_SHCI_EVT_DBG_BUF(((TL_AsynchEvt_t*)(p_evt_packet->evtserial.evt.payload))->payload, p_evt_packet->evtserial.evt.plen-2, "");
|
||||
}
|
||||
}
|
||||
|
||||
TL_SHCI_EVT_DBG_MSG("\r\n");
|
||||
|
||||
TL_SHCI_EVT_DBG_RAW(&p_evt_packet->evtserial, p_evt_packet->evtserial.evt.plen+TL_EVT_HDR_SIZE);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
|
|
Loading…
Reference in New Issue