From a93bdadef5ed1408a7cdfb7f65eea19568dc0b09 Mon Sep 17 00:00:00 2001 From: Frederic Pillon Date: Thu, 13 Jul 2023 16:49:37 +0200 Subject: [PATCH 01/10] chore(editorconfig): do not apply change to patch files Signed-off-by: Frederic Pillon --- .editorconfig | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.editorconfig b/.editorconfig index c7bf2228..47433680 100644 --- a/.editorconfig +++ b/.editorconfig @@ -5,6 +5,12 @@ indent_style = space indent_size = 2 trim_trailing_whitespace = true +[*.patch] +insert_final_newline = unset +indent_style = unset +indent_size = unset +trim_trailing_whitespace = unset + [*.md] trim_trailing_whitespace = false From 98e8e3f1441509437c7b72cd4f887af09b93967f Mon Sep 17 00:00:00 2001 From: Frederic Pillon Date: Thu, 13 Jul 2023 18:28:25 +0200 Subject: [PATCH 02/10] fix: regenerate STM32Cube_FW patches Prepare update to version 1.17.0 Signed-off-by: Frederic Pillon --- ...001-chore-adapt-STM32Cube_FW-sources.patch | 78 ++--- ...imeout-when-waiting-for-the-cmd_resp.patch | 11 +- ...ort-for-customize-app_conf_default.h.patch | 6 +- ...004-fix-warning-outside-array-bounds.patch | 304 ------------------ 4 files changed, 35 insertions(+), 364 deletions(-) delete mode 100644 extras/STM32Cube_FW/0004-fix-warning-outside-array-bounds.patch diff --git a/extras/STM32Cube_FW/0001-chore-adapt-STM32Cube_FW-sources.patch b/extras/STM32Cube_FW/0001-chore-adapt-STM32Cube_FW-sources.patch index 246a1257..ce3c8818 100644 --- a/extras/STM32Cube_FW/0001-chore-adapt-STM32Cube_FW-sources.patch +++ b/extras/STM32Cube_FW/0001-chore-adapt-STM32Cube_FW-sources.patch @@ -1,25 +1,22 @@ -From ef2495f6fa746df9f86f0db39fa00244d22feb3b Mon Sep 17 00:00:00 2001 +From fd17a2302d60208768610cb4723eb403c52ff2b1 Mon Sep 17 00:00:00 2001 From: Frederic Pillon -Date: Wed, 5 Apr 2023 10:18:52 +0200 -Subject: [PATCH 1/4] chore: adapt STM32Cube_FW sources - -Compare to previous patch, do the minimum changes required -to ease further update. +Date: Thu, 13 Jul 2023 17:08:05 +0200 +Subject: [PATCH 1/3] chore: adapt STM32Cube_FW sources Signed-off-by: Frederic Pillon --- - src/utility/STM32Cube_FW/app_conf_default.h | 47 +++++++++++++++------ - src/utility/STM32Cube_FW/ble_bufsize.h | 11 ++++- - src/utility/STM32Cube_FW/hw.h | 15 +++++-- - src/utility/STM32Cube_FW/hw_ipcc.c | 4 +- + src/utility/STM32Cube_FW/app_conf_default.h | 46 ++++++++++++++++----- + src/utility/STM32Cube_FW/ble_bufsize.h | 7 ++++ + src/utility/STM32Cube_FW/hw.h | 13 +++++- + src/utility/STM32Cube_FW/hw_ipcc.c | 5 ++- src/utility/STM32Cube_FW/shci.c | 3 +- src/utility/STM32Cube_FW/shci_tl.c | 18 +++++++- - src/utility/STM32Cube_FW/stm_list.c | 7 ++- - src/utility/STM32Cube_FW/tl_mbox.c | 8 +++- - 8 files changed, 90 insertions(+), 23 deletions(-) + src/utility/STM32Cube_FW/stm_list.c | 7 +++- + src/utility/STM32Cube_FW/tl_mbox.c | 7 +++- + 8 files changed, 86 insertions(+), 20 deletions(-) diff --git a/src/utility/STM32Cube_FW/app_conf_default.h b/src/utility/STM32Cube_FW/app_conf_default.h -index 51bd33a..e89df14 100644 +index 51bd33a..1c6dd91 100644 --- a/src/utility/STM32Cube_FW/app_conf_default.h +++ b/src/utility/STM32Cube_FW/app_conf_default.h @@ -1,9 +1,9 @@ @@ -121,19 +118,18 @@ index 51bd33a..e89df14 100644 /****************************************************************************** * Transport Layer ******************************************************************************/ -@@ -657,5 +680,5 @@ typedef enum - #define CFG_OTP_BASE_ADDRESS OTP_AREA_BASE +@@ -658,4 +681,5 @@ typedef enum #define CFG_OTP_END_ADRESS OTP_AREA_END_ADDR -- + -#endif /*APP_CONF_H */ +#endif +#endif /*APP_CONF_DEFAULT_H */ diff --git a/src/utility/STM32Cube_FW/ble_bufsize.h b/src/utility/STM32Cube_FW/ble_bufsize.h -index 7b7c170..53cf59a 100644 +index b9935c0..d4d2890 100644 --- a/src/utility/STM32Cube_FW/ble_bufsize.h +++ b/src/utility/STM32Cube_FW/ble_bufsize.h -@@ -75,15 +75,22 @@ +@@ -75,6 +75,13 @@ ((pw) + MAX(BLE_MEM_BLOCK_X_MTU(mtu, n_link), \ BLE_MBLOCKS_SECURE_CONNECTIONS)) @@ -147,19 +143,8 @@ index 7b7c170..53cf59a 100644 /* * BLE_FIXED_BUFFER_SIZE_BYTES: * A part of the RAM, is dynamically allocated by initializing all the pointers - * defined in a global context variable "mem_alloc_ctx_p". -- * This initialization is made in the Dynamic_allocator functions, which -+ * This initialization is made in the Dynamic_allocator functions, which - * assign a portion of RAM given by the external application to the above - * mentioned "global pointers". - * -- * The size of this Dynamic RAM is made of 2 main components: -+ * The size of this Dynamic RAM is made of 2 main components: - * - a part that is parameters-dependent (num of links, GATT buffers, ...), - * and which value is made explicit by the following macro; - * - a part, that may be considered "fixed", i.e. independent from the above diff --git a/src/utility/STM32Cube_FW/hw.h b/src/utility/STM32Cube_FW/hw.h -index 503fa2c..1472a5e 100644 +index 651e1f1..1472a5e 100644 --- a/src/utility/STM32Cube_FW/hw.h +++ b/src/utility/STM32Cube_FW/hw.h @@ -26,14 +26,23 @@ extern "C" { @@ -188,23 +173,15 @@ index 503fa2c..1472a5e 100644 void HW_IPCC_BLE_Init( void ); void HW_IPCC_BLE_SendCmd( void ); -@@ -76,7 +85,7 @@ extern "C" { - void HW_IPCC_BLE_LLD_ReceiveRsp( void ); - void HW_IPCC_BLE_LLD_SendRspAck( void ); - -- -+ - void HW_IPCC_TRACES_Init( void ); - void HW_IPCC_TRACES_EvtNot( void ); - diff --git a/src/utility/STM32Cube_FW/hw_ipcc.c b/src/utility/STM32Cube_FW/hw_ipcc.c -index fd620b8..3461cbe 100644 +index fd620b8..c730482 100644 --- a/src/utility/STM32Cube_FW/hw_ipcc.c +++ b/src/utility/STM32Cube_FW/hw_ipcc.c -@@ -18,8 +18,9 @@ +@@ -17,9 +17,9 @@ + ****************************************************************************** */ /* USER CODE END Header */ - +- +#if defined(STM32WBxx) /* Includes ------------------------------------------------------------------*/ -#include "app_common.h" @@ -212,13 +189,13 @@ index fd620b8..3461cbe 100644 #include "mbox_def.h" /* Global variables ---------------------------------------------------------*/ -@@ -667,3 +668,4 @@ static void HW_IPCC_TRACES_EvtHandler( void ) +@@ -667,3 +667,4 @@ static void HW_IPCC_TRACES_EvtHandler( void ) } __weak void HW_IPCC_TRACES_EvtNot( void ){}; +#endif /* STM32WBxx */ diff --git a/src/utility/STM32Cube_FW/shci.c b/src/utility/STM32Cube_FW/shci.c -index 301db76..cb7d7bd 100644 +index eaa35d7..4525656 100644 --- a/src/utility/STM32Cube_FW/shci.c +++ b/src/utility/STM32Cube_FW/shci.c @@ -16,7 +16,7 @@ @@ -236,7 +213,7 @@ index 301db76..cb7d7bd 100644 } +#endif /* STM32WBxx */ diff --git a/src/utility/STM32Cube_FW/shci_tl.c b/src/utility/STM32Cube_FW/shci_tl.c -index 2b387b1..a336aa6 100644 +index 0f60430..e343809 100644 --- a/src/utility/STM32Cube_FW/shci_tl.c +++ b/src/utility/STM32Cube_FW/shci_tl.c @@ -16,12 +16,13 @@ @@ -275,7 +252,7 @@ index 2b387b1..a336aa6 100644 /* Private functions ---------------------------------------------------------*/ static void TlInit( TL_CmdPacket_t * p_cmdbuffer ) { -@@ -251,3 +266,4 @@ __WEAK void shci_cmd_resp_release(uint32_t flag) +@@ -250,3 +265,4 @@ __WEAK void shci_cmd_resp_release(uint32_t flag) return; } @@ -306,7 +283,7 @@ index 4c92864..4e8c364 100644 } +#endif /* STM32WBxx */ diff --git a/src/utility/STM32Cube_FW/tl_mbox.c b/src/utility/STM32Cube_FW/tl_mbox.c -index 27a998a..ff219b9 100644 +index 27a998a..1139316 100644 --- a/src/utility/STM32Cube_FW/tl_mbox.c +++ b/src/utility/STM32Cube_FW/tl_mbox.c @@ -16,6 +16,7 @@ @@ -329,11 +306,10 @@ index 27a998a..ff219b9 100644 /**< tables */ PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static tListNode FreeBufQueue; PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static tListNode TracesEvtQueue; -@@ -97,8 +99,11 @@ void TL_Init( void ) +@@ -97,8 +99,10 @@ void TL_Init( void ) TL_RefTable.p_sys_table = &TL_SysTable; TL_RefTable.p_mem_manager_table = &TL_MemManagerTable; TL_RefTable.p_traces_table = &TL_TracesTable; -+ +#if 0 TL_RefTable.p_mac_802_15_4_table = &TL_Mac_802_15_4_Table; TL_RefTable.p_zigbee_table = &TL_Zigbee_Table; @@ -341,7 +317,7 @@ index 27a998a..ff219b9 100644 HW_IPCC_Init(); return; -@@ -846,3 +851,4 @@ static void OutputDbgTrace(TL_MB_PacketType_t packet_type, uint8_t* buffer) +@@ -846,3 +850,4 @@ static void OutputDbgTrace(TL_MB_PacketType_t packet_type, uint8_t* buffer) return; } diff --git a/extras/STM32Cube_FW/0002-fix-include-a-timeout-when-waiting-for-the-cmd_resp.patch b/extras/STM32Cube_FW/0002-fix-include-a-timeout-when-waiting-for-the-cmd_resp.patch index feeef35a..4afa2128 100644 --- a/extras/STM32Cube_FW/0002-fix-include-a-timeout-when-waiting-for-the-cmd_resp.patch +++ b/extras/STM32Cube_FW/0002-fix-include-a-timeout-when-waiting-for-the-cmd_resp.patch @@ -1,7 +1,7 @@ -From 12683bb7a3f0b0ad1e10400cba0e3694f9b9ee95 Mon Sep 17 00:00:00 2001 +From 598c654f18fc9389be8326610a51052943151f04 Mon Sep 17 00:00:00 2001 From: Frederic Pillon -Date: Mon, 12 Dec 2022 17:17:48 +0100 -Subject: [PATCH 2/4] fix: include a timeout when waiting for the cmd_resp +Date: Thu, 13 Jul 2023 17:16:40 +0200 +Subject: [PATCH 2/3] fix: include a timeout when waiting for the cmd_resp Signed-off-by: Frederic Pillon --- @@ -9,7 +9,7 @@ Signed-off-by: Frederic Pillon 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/utility/STM32Cube_FW/shci_tl.c b/src/utility/STM32Cube_FW/shci_tl.c -index a336aa6..d1d35f5 100644 +index e343809..6038025 100644 --- a/src/utility/STM32Cube_FW/shci_tl.c +++ b/src/utility/STM32Cube_FW/shci_tl.c @@ -23,6 +23,7 @@ @@ -20,13 +20,12 @@ index a336aa6..d1d35f5 100644 /* Private typedef -----------------------------------------------------------*/ typedef enum -@@ -250,11 +251,12 @@ static void TlUserEvtReceived(TL_EvtPacket_t *shcievt) +@@ -250,10 +251,11 @@ static void TlUserEvtReceived(TL_EvtPacket_t *shcievt) /* Weak implementation ----------------------------------------------------------------*/ __WEAK void shci_cmd_resp_wait(uint32_t timeout) { - (void)timeout; - - CmdRspStatusFlag = SHCI_TL_CMD_RESP_WAIT; - while(CmdRspStatusFlag != SHCI_TL_CMD_RESP_RELEASE); - + for (unsigned long start = millis(); (millis() - start) < timeout;) { diff --git a/extras/STM32Cube_FW/0003-chore-add-support-for-customize-app_conf_default.h.patch b/extras/STM32Cube_FW/0003-chore-add-support-for-customize-app_conf_default.h.patch index e2da2673..32e10c12 100644 --- a/extras/STM32Cube_FW/0003-chore-add-support-for-customize-app_conf_default.h.patch +++ b/extras/STM32Cube_FW/0003-chore-add-support-for-customize-app_conf_default.h.patch @@ -1,7 +1,7 @@ -From 8575588fedd55cf7238a1a810708100e700e57c0 Mon Sep 17 00:00:00 2001 +From 663ed22fd680de1f32c542df0799c403665ecb2e Mon Sep 17 00:00:00 2001 From: Frederic Pillon Date: Mon, 12 Dec 2022 17:29:27 +0100 -Subject: [PATCH 3/4] chore: add support for customize app_conf_default.h +Subject: [PATCH 3/3] chore: add support for customize app_conf_default.h Signed-off-by: Frederic Pillon --- @@ -9,7 +9,7 @@ Signed-off-by: Frederic Pillon 1 file changed, 68 insertions(+), 18 deletions(-) diff --git a/src/utility/STM32Cube_FW/app_conf_default.h b/src/utility/STM32Cube_FW/app_conf_default.h -index e89df14..1f17900 100644 +index 1c6dd91..d39492e 100644 --- a/src/utility/STM32Cube_FW/app_conf_default.h +++ b/src/utility/STM32Cube_FW/app_conf_default.h @@ -48,7 +48,9 @@ diff --git a/extras/STM32Cube_FW/0004-fix-warning-outside-array-bounds.patch b/extras/STM32Cube_FW/0004-fix-warning-outside-array-bounds.patch deleted file mode 100644 index ae4aed42..00000000 --- a/extras/STM32Cube_FW/0004-fix-warning-outside-array-bounds.patch +++ /dev/null @@ -1,304 +0,0 @@ -From 64caac5c39a47cac4ab840ba975bca065aa40efa Mon Sep 17 00:00:00 2001 -From: Frederic Pillon -Date: Wed, 8 Feb 2023 16:50:46 +0100 -Subject: [PATCH 4/4] fix: warning outside array bounds - -array subscript 'TL_CcEvt_t[0]' is partly outside array bounds - -Signed-off-by: Frederic Pillon ---- - src/utility/STM32Cube_FW/shci.c | 60 ++++++++++++++++----------------- - src/utility/STM32Cube_FW/tl.h | 3 ++ - 2 files changed, 33 insertions(+), 30 deletions(-) - -diff --git a/src/utility/STM32Cube_FW/shci.c b/src/utility/STM32Cube_FW/shci.c -index cb7d7bd..6348145 100644 ---- a/src/utility/STM32Cube_FW/shci.c -+++ b/src/utility/STM32Cube_FW/shci.c -@@ -42,7 +42,7 @@ uint8_t SHCI_C2_FUS_GetState( SHCI_FUS_GetState_ErrorCode_t *p_error_code ) - /** - * A command status event + payload has the same size than the expected command complete - */ -- uint8_t local_buffer[TL_BLEEVT_CS_BUFFER_SIZE + 1]; -+ uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE]; - TL_EvtPacket_t * p_rsp; - - p_rsp = (TL_EvtPacket_t *)local_buffer; -@@ -66,7 +66,7 @@ SHCI_CmdStatus_t SHCI_C2_FUS_FwUpgrade( uint32_t fw_src_add, uint32_t fw_dest_a - * TL_BLEEVT_CS_BUFFER_SIZE is 15 bytes so it is large enough to hold the 8 bytes of command parameters - * Buffer is large enough to hold command complete without payload - */ -- uint8_t local_buffer[TL_BLEEVT_CS_BUFFER_SIZE]; -+ uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE]; - TL_EvtPacket_t * p_rsp; - uint32_t *p_cmd; - uint8_t cmd_length; -@@ -101,7 +101,7 @@ SHCI_CmdStatus_t SHCI_C2_FUS_FwDelete( void ) - /** - * Buffer is large enough to hold command complete without payload - */ -- uint8_t local_buffer[TL_BLEEVT_CS_BUFFER_SIZE]; -+ uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE]; - TL_EvtPacket_t * p_rsp; - - p_rsp = (TL_EvtPacket_t *)local_buffer; -@@ -119,7 +119,7 @@ SHCI_CmdStatus_t SHCI_C2_FUS_UpdateAuthKey( SHCI_C2_FUS_UpdateAuthKey_Cmd_Param_ - /** - * Buffer is large enough to hold command complete without payload - */ -- uint8_t local_buffer[TL_BLEEVT_CS_BUFFER_SIZE]; -+ uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE]; - TL_EvtPacket_t * p_rsp; - - p_rsp = (TL_EvtPacket_t *)local_buffer; -@@ -137,7 +137,7 @@ SHCI_CmdStatus_t SHCI_C2_FUS_LockAuthKey( void ) - /** - * Buffer is large enough to hold command complete without payload - */ -- uint8_t local_buffer[TL_BLEEVT_CS_BUFFER_SIZE]; -+ uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE]; - TL_EvtPacket_t * p_rsp; - - p_rsp = (TL_EvtPacket_t *)local_buffer; -@@ -155,7 +155,7 @@ SHCI_CmdStatus_t SHCI_C2_FUS_StoreUsrKey( SHCI_C2_FUS_StoreUsrKey_Cmd_Param_t *p - /** - * Buffer is large enough to hold command complete without payload - */ -- uint8_t local_buffer[TL_BLEEVT_CS_BUFFER_SIZE + 1]; -+ uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE]; - TL_EvtPacket_t * p_rsp; - uint8_t local_payload_len; - -@@ -189,7 +189,7 @@ SHCI_CmdStatus_t SHCI_C2_FUS_LoadUsrKey( uint8_t key_index ) - /** - * Buffer is large enough to hold command complete without payload - */ -- uint8_t local_buffer[TL_BLEEVT_CS_BUFFER_SIZE]; -+ uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE]; - TL_EvtPacket_t * p_rsp; - - p_rsp = (TL_EvtPacket_t *)local_buffer; -@@ -209,7 +209,7 @@ SHCI_CmdStatus_t SHCI_C2_FUS_StartWs( void ) - /** - * Buffer is large enough to hold command complete without payload - */ -- uint8_t local_buffer[TL_BLEEVT_CS_BUFFER_SIZE]; -+ uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE]; - TL_EvtPacket_t * p_rsp; - - p_rsp = (TL_EvtPacket_t *)local_buffer; -@@ -227,7 +227,7 @@ SHCI_CmdStatus_t SHCI_C2_FUS_LockUsrKey( uint8_t key_index ) - /** - * Buffer is large enough to hold command complete without payload - */ -- uint8_t local_buffer[TL_BLEEVT_CS_BUFFER_SIZE]; -+ uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE]; - TL_EvtPacket_t * p_rsp; - - p_rsp = (TL_EvtPacket_t *)local_buffer; -@@ -247,7 +247,7 @@ 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]; -+ uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE]; - TL_EvtPacket_t * p_rsp; - - p_rsp = (TL_EvtPacket_t *)local_buffer; -@@ -267,7 +267,7 @@ 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]; -+ uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE]; - TL_EvtPacket_t * p_rsp; - - p_rsp = (TL_EvtPacket_t *)local_buffer; -@@ -285,7 +285,7 @@ SHCI_CmdStatus_t SHCI_C2_BLE_Init( SHCI_C2_Ble_Init_Cmd_Packet_t *pCmdPacket ) - /** - * Buffer is large enough to hold command complete without payload - */ -- uint8_t local_buffer[TL_BLEEVT_CS_BUFFER_SIZE]; -+ uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE]; - TL_EvtPacket_t * p_rsp; - - p_rsp = (TL_EvtPacket_t *)local_buffer; -@@ -303,7 +303,7 @@ SHCI_CmdStatus_t SHCI_C2_THREAD_Init( void ) - /** - * Buffer is large enough to hold command complete without payload - */ -- uint8_t local_buffer[TL_BLEEVT_CS_BUFFER_SIZE]; -+ uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE]; - TL_EvtPacket_t * p_rsp; - - p_rsp = (TL_EvtPacket_t *)local_buffer; -@@ -321,7 +321,7 @@ SHCI_CmdStatus_t SHCI_C2_LLDTESTS_Init( uint8_t param_size, uint8_t * p_param ) - /** - * Buffer is large enough to hold command complete without payload - */ -- uint8_t local_buffer[TL_BLEEVT_CS_BUFFER_SIZE]; -+ uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE]; - TL_EvtPacket_t * p_rsp; - - p_rsp = (TL_EvtPacket_t *)local_buffer; -@@ -339,7 +339,7 @@ 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 - */ -- uint8_t local_buffer[TL_BLEEVT_CS_BUFFER_SIZE]; -+ uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE]; - TL_EvtPacket_t * p_rsp; - - p_rsp = (TL_EvtPacket_t *)local_buffer; -@@ -357,7 +357,7 @@ SHCI_CmdStatus_t SHCI_C2_ZIGBEE_Init( void ) - /** - * Buffer is large enough to hold command complete without payload - */ -- uint8_t local_buffer[TL_BLEEVT_CS_BUFFER_SIZE]; -+ uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE]; - TL_EvtPacket_t * p_rsp; - - p_rsp = (TL_EvtPacket_t *)local_buffer; -@@ -375,7 +375,7 @@ SHCI_CmdStatus_t SHCI_C2_DEBUG_Init( SHCI_C2_DEBUG_Init_Cmd_Packet_t *pCmdPacket - /** - * Buffer is large enough to hold command complete without payload - */ -- uint8_t local_buffer[TL_BLEEVT_CS_BUFFER_SIZE]; -+ uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE]; - TL_EvtPacket_t * p_rsp; - - p_rsp = (TL_EvtPacket_t *)local_buffer; -@@ -393,7 +393,7 @@ SHCI_CmdStatus_t SHCI_C2_FLASH_EraseActivity( SHCI_EraseActivity_t erase_activit - /** - * Buffer is large enough to hold command complete without payload - */ -- uint8_t local_buffer[TL_BLEEVT_CS_BUFFER_SIZE]; -+ uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE]; - TL_EvtPacket_t * p_rsp; - - p_rsp = (TL_EvtPacket_t *)local_buffer; -@@ -413,7 +413,7 @@ SHCI_CmdStatus_t SHCI_C2_CONCURRENT_SetMode( SHCI_C2_CONCURRENT_Mode_Param_t Mod - /** - * Buffer is large enough to hold command complete without payload - */ -- uint8_t local_buffer[TL_BLEEVT_CS_BUFFER_SIZE]; -+ uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE]; - TL_EvtPacket_t * p_rsp; - - p_rsp = (TL_EvtPacket_t *)local_buffer; -@@ -433,7 +433,7 @@ SHCI_CmdStatus_t SHCI_C2_CONCURRENT_GetNextBleEvtTime( SHCI_C2_CONCURRENT_GetNex - /** - * Buffer is large enough to hold command complete without payload - */ -- uint8_t local_buffer[TL_BLEEVT_CS_BUFFER_SIZE+4]; -+ uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE]; - TL_EvtPacket_t * p_rsp; - - p_rsp = (TL_EvtPacket_t *)local_buffer; -@@ -453,7 +453,7 @@ 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]; -+ uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE]; - TL_EvtPacket_t * p_rsp; - - p_rsp = (TL_EvtPacket_t *)local_buffer; -@@ -471,7 +471,7 @@ SHCI_CmdStatus_t SHCI_C2_FLASH_StoreData( SHCI_C2_FLASH_Ip_t Ip ) - /** - * Buffer is large enough to hold command complete without payload - */ -- uint8_t local_buffer[TL_BLEEVT_CS_BUFFER_SIZE]; -+ uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE]; - TL_EvtPacket_t * p_rsp; - - p_rsp = (TL_EvtPacket_t *)local_buffer; -@@ -491,7 +491,7 @@ SHCI_CmdStatus_t SHCI_C2_FLASH_EraseData( SHCI_C2_FLASH_Ip_t Ip ) - /** - * Buffer is large enough to hold command complete without payload - */ -- uint8_t local_buffer[TL_BLEEVT_CS_BUFFER_SIZE]; -+ uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE]; - TL_EvtPacket_t * p_rsp; - - p_rsp = (TL_EvtPacket_t *)local_buffer; -@@ -511,7 +511,7 @@ SHCI_CmdStatus_t SHCI_C2_RADIO_AllowLowPower( SHCI_C2_FLASH_Ip_t Ip,uint8_t Fla - /** - * Buffer is large enough to hold command complete without payload - */ -- uint8_t local_buffer[TL_BLEEVT_CS_BUFFER_SIZE]; -+ uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE]; - TL_EvtPacket_t * p_rsp; - - p_rsp = (TL_EvtPacket_t *)local_buffer; -@@ -532,7 +532,7 @@ SHCI_CmdStatus_t SHCI_C2_MAC_802_15_4_Init( void ) - /** - * Buffer is large enough to hold command complete without payload - */ -- uint8_t local_buffer[TL_BLEEVT_CS_BUFFER_SIZE]; -+ uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE]; - TL_EvtPacket_t * p_rsp; - - p_rsp = (TL_EvtPacket_t *)local_buffer; -@@ -550,7 +550,7 @@ SHCI_CmdStatus_t SHCI_C2_Reinit( void ) - /** - * Buffer is large enough to hold command complete without payload - */ -- uint8_t local_buffer[TL_BLEEVT_CS_BUFFER_SIZE]; -+ uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE]; - TL_EvtPacket_t * p_rsp; - - p_rsp = (TL_EvtPacket_t *)local_buffer; -@@ -569,7 +569,7 @@ SHCI_CmdStatus_t SHCI_C2_ExtpaConfig(uint32_t gpio_port, uint16_t gpio_pin_numbe - * TL_BLEEVT_CS_BUFFER_SIZE is 15 bytes so it is large enough to hold the 8 bytes of command parameters - * Buffer is large enough to hold command complete without payload - */ -- uint8_t local_buffer[TL_BLEEVT_CS_BUFFER_SIZE]; -+ uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE]; - TL_EvtPacket_t * p_rsp; - - p_rsp = (TL_EvtPacket_t *)local_buffer; -@@ -593,7 +593,7 @@ SHCI_CmdStatus_t SHCI_C2_SetFlashActivityControl(SHCI_C2_SET_FLASH_ACTIVITY_CONT - * TL_BLEEVT_CS_BUFFER_SIZE is 15 bytes so it is large enough to hold the 1 byte of command parameter - * Buffer is large enough to hold command complete without payload - */ -- uint8_t local_buffer[TL_BLEEVT_CS_BUFFER_SIZE]; -+ uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE]; - TL_EvtPacket_t * p_rsp; - - p_rsp = (TL_EvtPacket_t *)local_buffer; -@@ -613,7 +613,7 @@ SHCI_CmdStatus_t SHCI_C2_Config(SHCI_C2_CONFIG_Cmd_Param_t *pCmdPacket) - /** - * Buffer is large enough to hold command complete without payload - */ -- uint8_t local_buffer[TL_BLEEVT_CS_BUFFER_SIZE]; -+ uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE]; - TL_EvtPacket_t * p_rsp; - - p_rsp = (TL_EvtPacket_t *)local_buffer; -@@ -631,7 +631,7 @@ 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]; -+ uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE]; - TL_EvtPacket_t * p_rsp; - - p_rsp = (TL_EvtPacket_t *)local_buffer; -diff --git a/src/utility/STM32Cube_FW/tl.h b/src/utility/STM32Cube_FW/tl.h -index 6bfa265..63126b3 100644 ---- a/src/utility/STM32Cube_FW/tl.h -+++ b/src/utility/STM32Cube_FW/tl.h -@@ -61,6 +61,9 @@ extern "C" { - #define TL_BLEEVT_CS_PACKET_SIZE (TL_EVT_HDR_SIZE + sizeof(TL_CsEvt_t)) - #define TL_BLEEVT_CS_BUFFER_SIZE (sizeof(TL_PacketHeader_t) + TL_BLEEVT_CS_PACKET_SIZE) - -+#define TL_BLEEVT_CC_PACKET_SIZE (TL_EVT_HDR_SIZE + sizeof(TL_CcEvt_t)) -+#define TL_BLEEVT_CC_BUFFER_SIZE (sizeof(TL_PacketHeader_t) + TL_BLEEVT_CC_PACKET_SIZE) -+ - /* Exported types ------------------------------------------------------------*/ - /**< Packet header */ - typedef PACKED_STRUCT --- -2.38.0.windows.1 - From eab189123182abdf7dc1f628da54c6952e789f54 Mon Sep 17 00:00:00 2001 From: Frederic Pillon Date: Mon, 17 Jul 2023 11:30:41 +0200 Subject: [PATCH 03/10] fix(doc): wrong version Signed-off-by: Frederic Pillon --- src/utility/STM32Cube_FW/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utility/STM32Cube_FW/README.md b/src/utility/STM32Cube_FW/README.md index 780e2706..e6f6e0ae 100644 --- a/src/utility/STM32Cube_FW/README.md +++ b/src/utility/STM32Cube_FW/README.md @@ -1,6 +1,6 @@ ## Source -[STMicroelectronics/STM32CubeWB Release vvv1.16.0](https://github.com/STMicroelectronics/STM32CubeWB/releases/tag/vvv1.16.0) -- Application: [BLE_TransparentMode](https://github.com/STMicroelectronics/STM32CubeWB/tree/vvv1.16.0/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode) +[STMicroelectronics/STM32CubeWB Release v1.16.0](https://github.com/STMicroelectronics/STM32CubeWB/releases/tag/v1.16.0) +- Application: [BLE_TransparentMode](https://github.com/STMicroelectronics/STM32CubeWB/tree/v1.16.0/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode) From 61b8a3b295f6a01b3efefe937683a89cf0559da4 Mon Sep 17 00:00:00 2001 From: Frederic Pillon Date: Mon, 17 Jul 2023 11:34:26 +0200 Subject: [PATCH 04/10] chore: update STM32Cube_FW from Cube version v1.17.0 Signed-off-by: Frederic Pillon --- src/utility/STM32Cube_FW/README.md | 4 +- src/utility/STM32Cube_FW/app_conf_default.h | 129 +++++--------------- src/utility/STM32Cube_FW/ble_bufsize.h | 13 +- src/utility/STM32Cube_FW/hw.h | 13 +- src/utility/STM32Cube_FW/hw_ipcc.c | 4 +- src/utility/STM32Cube_FW/shci.c | 21 ++-- src/utility/STM32Cube_FW/shci.h | 11 +- src/utility/STM32Cube_FW/shci_tl.c | 31 +---- src/utility/STM32Cube_FW/stm_list.c | 7 +- src/utility/STM32Cube_FW/tl.h | 10 +- src/utility/STM32Cube_FW/tl_mbox.c | 8 +- 11 files changed, 64 insertions(+), 187 deletions(-) diff --git a/src/utility/STM32Cube_FW/README.md b/src/utility/STM32Cube_FW/README.md index e6f6e0ae..0d39a3ef 100644 --- a/src/utility/STM32Cube_FW/README.md +++ b/src/utility/STM32Cube_FW/README.md @@ -1,6 +1,6 @@ ## Source -[STMicroelectronics/STM32CubeWB Release v1.16.0](https://github.com/STMicroelectronics/STM32CubeWB/releases/tag/v1.16.0) -- Application: [BLE_TransparentMode](https://github.com/STMicroelectronics/STM32CubeWB/tree/v1.16.0/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode) +[STMicroelectronics/STM32CubeWB Release v1.17.0](https://github.com/STMicroelectronics/STM32CubeWB/releases/tag/v1.17.0) +- Application: [BLE_TransparentMode](https://github.com/STMicroelectronics/STM32CubeWB/tree/v1.17.0/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode) diff --git a/src/utility/STM32Cube_FW/app_conf_default.h b/src/utility/STM32Cube_FW/app_conf_default.h index 1f17900d..51bd33af 100644 --- a/src/utility/STM32Cube_FW/app_conf_default.h +++ b/src/utility/STM32Cube_FW/app_conf_default.h @@ -1,9 +1,9 @@ /* USER CODE BEGIN Header */ /** ****************************************************************************** - * @file app_conf_default.h + * @file app_conf.h * @author MCD Application Team - * @brief Default application configuration file for STM32WPAN Middleware. + * @brief Application configuration file for STM32WPAN Middleware. ****************************************************************************** * @attention * @@ -19,40 +19,18 @@ /* USER CODE END Header */ /* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef APP_CONF_DEFAULT_H -#define APP_CONF_DEFAULT_H -#if 0 +#ifndef APP_CONF_H +#define APP_CONF_H + #include "hw.h" #include "hw_conf.h" #include "hw_if.h" #include "ble_bufsize.h" -#endif + /****************************************************************************** * Application Config ******************************************************************************/ -/**< generic parameters ******************************************************/ -/* HCI related defines */ - -#define ACI_HAL_SET_TX_POWER_LEVEL 0xFC0F -#define ACI_WRITE_CONFIG_DATA_OPCODE 0xFC0C -#define ACI_READ_CONFIG_DATA_OPCODE 0xFC0D -#define MAX_HCI_ACL_PACKET_SIZE (sizeof(TL_PacketHeader_t) + 5 + 251) -#define HCI_RESET 0x0C03 - -#ifndef BLE_SHARED_MEM_BYTE_ORDER - #define BLE_SHARED_MEM_BYTE_ORDER MSBFIRST -#endif -#define BLE_MODULE_SHARED_MEM_BUFFER_SIZE 128 - -/** - * Define Tx Power - */ -#ifndef CFG_TX_POWER - #define CFG_TX_POWER (0x18) /* -0.15dBm */ -#endif - -#if 0 /** * Define Secure Connections Support */ @@ -126,7 +104,7 @@ #define CFG_FW_SUBVERSION (1) #define CFG_FW_BRANCH (0) #define CFG_FW_BUILD (0) -#endif + /****************************************************************************** * BLE Stack ******************************************************************************/ @@ -134,25 +112,13 @@ * Maximum number of simultaneous connections that the device will support. * Valid values are from 1 to 8 */ -#ifndef CFG_BLE_NUM_LINK -#ifdef STM32WB15xx - #define CFG_BLE_NUM_LINK 3 -#else - #define CFG_BLE_NUM_LINK 8 -#endif -#endif +#define CFG_BLE_NUM_LINK 8 /** * Maximum number of Services that can be stored in the GATT database. * Note that the GAP and GATT services are automatically added so this parameter should be 2 plus the number of user services */ -#ifndef CFG_BLE_NUM_GATT_SERVICES -#ifdef STM32WB15xx - #define CFG_BLE_NUM_GATT_SERVICES 4 -#else - #define CFG_BLE_NUM_GATT_SERVICES 8 -#endif -#endif +#define CFG_BLE_NUM_GATT_SERVICES 8 /** * Maximum number of Attributes @@ -161,21 +127,13 @@ * Note that certain characteristics and relative descriptors are added automatically during device initialization * so this parameters should be 9 plus the number of user Attributes */ -#ifndef CFG_BLE_NUM_GATT_ATTRIBUTES -#ifdef STM32WB15xx - #define CFG_BLE_NUM_GATT_ATTRIBUTES 30 -#else - #define CFG_BLE_NUM_GATT_ATTRIBUTES 68 -#endif -#endif +#define CFG_BLE_NUM_GATT_ATTRIBUTES 68 /** * Maximum supported ATT_MTU size * This parameter is ignored by the CPU2 when CFG_BLE_OPTIONS has SHCI_C2_BLE_INIT_OPTIONS_LL_ONLY flag set */ -#ifndef CFG_BLE_MAX_ATT_MTU - #define CFG_BLE_MAX_ATT_MTU (156) -#endif +#define CFG_BLE_MAX_ATT_MTU (156) /** * Size of the storage area for Attribute values @@ -188,43 +146,29 @@ * The total amount of memory needed is the sum of the above quantities for each attribute. * This parameter is ignored by the CPU2 when CFG_BLE_OPTIONS has SHCI_C2_BLE_INIT_OPTIONS_LL_ONLY flag set */ -#ifndef CFG_BLE_ATT_VALUE_ARRAY_SIZE -#ifdef STM32WB15xx - #define CFG_BLE_ATT_VALUE_ARRAY_SIZE (1290) -#else - #define CFG_BLE_ATT_VALUE_ARRAY_SIZE (1344) -#endif -#endif +#define CFG_BLE_ATT_VALUE_ARRAY_SIZE (1344) /** * Prepare Write List size in terms of number of packet * This parameter is ignored by the CPU2 when CFG_BLE_OPTIONS has SHCI_C2_BLE_INIT_OPTIONS_LL_ONLY flag set */ -// #define CFG_BLE_PREPARE_WRITE_LIST_SIZE BLE_PREP_WRITE_X_ATT(CFG_BLE_MAX_ATT_MTU) -#ifndef CFG_BLE_PREPARE_WRITE_LIST_SIZE - #define CFG_BLE_PREPARE_WRITE_LIST_SIZE (0x3A) -#endif +#define CFG_BLE_PREPARE_WRITE_LIST_SIZE BLE_PREP_WRITE_X_ATT(CFG_BLE_MAX_ATT_MTU) /** * Number of allocated memory blocks * This parameter is overwritten by the CPU2 with an hardcoded optimal value when the parameter CFG_BLE_OPTIONS has SHCI_C2_BLE_INIT_OPTIONS_LL_ONLY flag set */ -//#define CFG_BLE_MBLOCK_COUNT (BLE_MBLOCKS_CALC(CFG_BLE_PREPARE_WRITE_LIST_SIZE, CFG_BLE_MAX_ATT_MTU, CFG_BLE_NUM_LINK)) -#define CFG_BLE_MBLOCK_COUNT (0x79) +#define CFG_BLE_MBLOCK_COUNT (BLE_MBLOCKS_CALC(CFG_BLE_PREPARE_WRITE_LIST_SIZE, CFG_BLE_MAX_ATT_MTU, CFG_BLE_NUM_LINK)) /** * Enable or disable the Extended Packet length feature. Valid values are 0 or 1. */ -#ifndef CFG_BLE_DATA_LENGTH_EXTENSION - #define CFG_BLE_DATA_LENGTH_EXTENSION 1 -#endif +#define CFG_BLE_DATA_LENGTH_EXTENSION 1 /** * Sleep clock accuracy in Slave mode (ppm value) */ -#ifndef CFG_BLE_SLAVE_SCA - #define CFG_BLE_SLAVE_SCA 500 -#endif +#define CFG_BLE_SLAVE_SCA 500 /** * Sleep clock accuracy in Master mode @@ -237,9 +181,7 @@ * 6 : 21 ppm to 30 ppm * 7 : 0 ppm to 20 ppm */ -#ifndef CFG_BLE_MASTER_SCA - #define CFG_BLE_MASTER_SCA 0 -#endif +#define CFG_BLE_MASTER_SCA 0 /** * LsSource @@ -248,27 +190,21 @@ * - bit 1: 1: STM32WB5M Module device 0: Other devices as STM32WBxx SOC, STM32WB1M module * - bit 2: 1: HSE/1024 Clock config 0: LSE Clock config */ -#ifndef CFG_BLE_LS_SOURCE - #if defined(STM32WB5Mxx) - #define CFG_BLE_LS_SOURCE (SHCI_C2_BLE_INIT_CFG_BLE_LS_NOCALIB | SHCI_C2_BLE_INIT_CFG_BLE_LS_MOD5MM_DEV | SHCI_C2_BLE_INIT_CFG_BLE_LS_CLK_LSE) - #else - #define CFG_BLE_LS_SOURCE (SHCI_C2_BLE_INIT_CFG_BLE_LS_NOCALIB | SHCI_C2_BLE_INIT_CFG_BLE_LS_OTHER_DEV | SHCI_C2_BLE_INIT_CFG_BLE_LS_CLK_LSE) - #endif +#if defined(STM32WB5Mxx) + #define CFG_BLE_LS_SOURCE (SHCI_C2_BLE_INIT_CFG_BLE_LS_NOCALIB | SHCI_C2_BLE_INIT_CFG_BLE_LS_MOD5MM_DEV | SHCI_C2_BLE_INIT_CFG_BLE_LS_CLK_LSE) +#else + #define CFG_BLE_LS_SOURCE (SHCI_C2_BLE_INIT_CFG_BLE_LS_NOCALIB | SHCI_C2_BLE_INIT_CFG_BLE_LS_OTHER_DEV | SHCI_C2_BLE_INIT_CFG_BLE_LS_CLK_LSE) #endif /** * Start up time of the high speed (16 or 32 MHz) crystal oscillator in units of 625/256 us (~2.44 us) */ -#ifndef CFG_BLE_HSE_STARTUP_TIME - #define CFG_BLE_HSE_STARTUP_TIME 0x148 -#endif +#define CFG_BLE_HSE_STARTUP_TIME 0x148 /** * Maximum duration of the connection event when the device is in Slave mode in units of 625/256 us (~2.44 us) */ -#ifndef CFG_BLE_MAX_CONN_EVENT_LENGTH - #define CFG_BLE_MAX_CONN_EVENT_LENGTH (0xFFFFFFFF) -#endif +#define CFG_BLE_MAX_CONN_EVENT_LENGTH (0xFFFFFFFF) /** * Viterbi Mode @@ -314,7 +250,7 @@ * 0: LE Power Class 2-3 * other bits: complete with Options_extension flag */ -#define CFG_BLE_OPTIONS (SHCI_C2_BLE_INIT_OPTIONS_LL_ONLY) +#define CFG_BLE_OPTIONS (SHCI_C2_BLE_INIT_OPTIONS_LL_HOST | SHCI_C2_BLE_INIT_OPTIONS_WITH_SVC_CHANGE_DESC | SHCI_C2_BLE_INIT_OPTIONS_DEVICE_NAME_RW | SHCI_C2_BLE_INIT_OPTIONS_EXT_ADV | SHCI_C2_BLE_INIT_OPTIONS_CS_ALGO2 | SHCI_C2_BLE_INIT_OPTIONS_FULL_GATTDB_NVM | SHCI_C2_BLE_INIT_OPTIONS_GATT_CACHING_NOTUSED | SHCI_C2_BLE_INIT_OPTIONS_POWER_CLASS_2_3) /** * BLE stack Options_extension flags to be configured with: @@ -356,11 +292,7 @@ * This parameter is considered by the CPU2 when CFG_BLE_OPTIONS has SHCI_C2_BLE_INIT_OPTIONS_EXT_ADV flag set */ -#if defined(STM32WB15xx) - #define CFG_BLE_MAX_ADV_SET_NBR (3) -#else - #define CFG_BLE_MAX_ADV_SET_NBR (8) -#endif +#define CFG_BLE_MAX_ADV_SET_NBR (8) /* Maximum advertising data length (in bytes) * Range: 31 .. 1650 with limitation: @@ -369,11 +301,7 @@ * This parameter is considered by the CPU2 when CFG_BLE_OPTIONS has SHCI_C2_BLE_INIT_OPTIONS_EXT_ADV flag set */ -#if defined(STM32WB15xx) - #define CFG_BLE_MAX_ADV_DATA_LEN (414) -#else - #define CFG_BLE_MAX_ADV_DATA_LEN (207) -#endif +#define CFG_BLE_MAX_ADV_DATA_LEN (207) /* RF TX Path Compensation Value (16-bit signed integer). Units: 0.1 dB. * Range: -1280 .. 1280 @@ -395,7 +323,6 @@ #define CFG_BLE_CORE_VERSION (SHCI_C2_BLE_INIT_BLE_CORE_5_3) -#if 0 /****************************************************************************** * Transport Layer ******************************************************************************/ @@ -730,5 +657,5 @@ typedef enum #define CFG_OTP_BASE_ADDRESS OTP_AREA_BASE #define CFG_OTP_END_ADRESS OTP_AREA_END_ADDR -#endif -#endif /*APP_CONF_DEFAULT_H */ + +#endif /*APP_CONF_H */ diff --git a/src/utility/STM32Cube_FW/ble_bufsize.h b/src/utility/STM32Cube_FW/ble_bufsize.h index 53cf59a8..b9935c0b 100644 --- a/src/utility/STM32Cube_FW/ble_bufsize.h +++ b/src/utility/STM32Cube_FW/ble_bufsize.h @@ -75,13 +75,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 dynamically allocated by initializing all the pointers @@ -103,11 +96,11 @@ #elif (LL_ONLY != 0) #define BLE_FIXED_BUFFER_SIZE_BYTES 6036 /* LL only Full */ #elif (SLAVE_ONLY != 0) -#define BLE_FIXED_BUFFER_SIZE_BYTES 6292 /* Peripheral only */ +#define BLE_FIXED_BUFFER_SIZE_BYTES 6300 /* Peripheral only */ #elif (BASIC_FEATURES != 0) -#define BLE_FIXED_BUFFER_SIZE_BYTES 6624 /* Basic Features */ +#define BLE_FIXED_BUFFER_SIZE_BYTES 6632 /* Basic Features */ #else -#define BLE_FIXED_BUFFER_SIZE_BYTES 7144 /* Full stack */ +#define BLE_FIXED_BUFFER_SIZE_BYTES 7152 /* Full stack */ #endif /* diff --git a/src/utility/STM32Cube_FW/hw.h b/src/utility/STM32Cube_FW/hw.h index 1472a5e8..651e1f17 100644 --- a/src/utility/STM32Cube_FW/hw.h +++ b/src/utility/STM32Cube_FW/hw.h @@ -26,23 +26,14 @@ extern "C" { #endif /* Includes ------------------------------------------------------------------*/ -#include "stm32_def.h" -#include "stm32wbxx_ll_bus.h" -#include "stm32wbxx_ll_exti.h" -#include "stm32wbxx_ll_system.h" -#include "stm32wbxx_ll_rcc.h" -#include "stm32wbxx_ll_ipcc.h" -#include "stm32wbxx_ll_cortex.h" -#include "stm32wbxx_ll_utils.h" -#include "stm32wbxx_ll_pwr.h" /****************************************************************************** * HW IPCC ******************************************************************************/ void HW_IPCC_Enable( void ); void HW_IPCC_Init( void ); -#define HW_IPCC_Rx_Handler IPCC_C1_RX_IRQHandler -#define HW_IPCC_Tx_Handler IPCC_C1_TX_IRQHandler + void HW_IPCC_Rx_Handler( void ); + void HW_IPCC_Tx_Handler( void ); void HW_IPCC_BLE_Init( void ); void HW_IPCC_BLE_SendCmd( void ); diff --git a/src/utility/STM32Cube_FW/hw_ipcc.c b/src/utility/STM32Cube_FW/hw_ipcc.c index 3461cbed..fd620b85 100644 --- a/src/utility/STM32Cube_FW/hw_ipcc.c +++ b/src/utility/STM32Cube_FW/hw_ipcc.c @@ -18,9 +18,8 @@ */ /* USER CODE END Header */ -#if defined(STM32WBxx) /* Includes ------------------------------------------------------------------*/ -#include "hw.h" +#include "app_common.h" #include "mbox_def.h" /* Global variables ---------------------------------------------------------*/ @@ -668,4 +667,3 @@ static void HW_IPCC_TRACES_EvtHandler( void ) } __weak void HW_IPCC_TRACES_EvtNot( void ){}; -#endif /* STM32WBxx */ diff --git a/src/utility/STM32Cube_FW/shci.c b/src/utility/STM32Cube_FW/shci.c index 6348145f..eaa35d7c 100644 --- a/src/utility/STM32Cube_FW/shci.c +++ b/src/utility/STM32Cube_FW/shci.c @@ -16,7 +16,7 @@ ****************************************************************************** */ -#if defined(STM32WBxx) + /* Includes ------------------------------------------------------------------*/ #include "stm32_wpan_common.h" @@ -40,9 +40,9 @@ uint8_t SHCI_C2_FUS_GetState( SHCI_FUS_GetState_ErrorCode_t *p_error_code ) { /** - * A command status event + payload has the same size than the expected command complete + * Buffer is large enough to hold command complete with payload */ - uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE]; + uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE + 1]; TL_EvtPacket_t * p_rsp; p_rsp = (TL_EvtPacket_t *)local_buffer; @@ -63,7 +63,7 @@ uint8_t SHCI_C2_FUS_GetState( SHCI_FUS_GetState_ErrorCode_t *p_error_code ) SHCI_CmdStatus_t SHCI_C2_FUS_FwUpgrade( uint32_t fw_src_add, uint32_t fw_dest_add ) { /** - * TL_BLEEVT_CS_BUFFER_SIZE is 15 bytes so it is large enough to hold the 8 bytes of command parameters + * TL_BLEEVT_CC_BUFFER_SIZE is 16 bytes so it is large enough to hold the 8 bytes of command parameters * Buffer is large enough to hold command complete without payload */ uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE]; @@ -153,9 +153,9 @@ SHCI_CmdStatus_t SHCI_C2_FUS_LockAuthKey( void ) SHCI_CmdStatus_t SHCI_C2_FUS_StoreUsrKey( SHCI_C2_FUS_StoreUsrKey_Cmd_Param_t *pParam, uint8_t *p_key_index ) { /** - * Buffer is large enough to hold command complete without payload + * Buffer is large enough to hold command complete with payload */ - uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE]; + uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE + 1]; TL_EvtPacket_t * p_rsp; uint8_t local_payload_len; @@ -431,9 +431,9 @@ SHCI_CmdStatus_t SHCI_C2_CONCURRENT_SetMode( SHCI_C2_CONCURRENT_Mode_Param_t Mod SHCI_CmdStatus_t SHCI_C2_CONCURRENT_GetNextBleEvtTime( SHCI_C2_CONCURRENT_GetNextBleEvtTime_Param_t *pParam ) { /** - * Buffer is large enough to hold command complete without payload + * Buffer is large enough to hold command complete with payload */ - uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE]; + uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE+4]; TL_EvtPacket_t * p_rsp; p_rsp = (TL_EvtPacket_t *)local_buffer; @@ -566,7 +566,7 @@ SHCI_CmdStatus_t SHCI_C2_Reinit( void ) SHCI_CmdStatus_t SHCI_C2_ExtpaConfig(uint32_t gpio_port, uint16_t gpio_pin_number, uint8_t gpio_polarity, uint8_t gpio_status) { /** - * TL_BLEEVT_CS_BUFFER_SIZE is 15 bytes so it is large enough to hold the 8 bytes of command parameters + * TL_BLEEVT_CC_BUFFER_SIZE is 16 bytes so it is large enough to hold the 8 bytes of command parameters * Buffer is large enough to hold command complete without payload */ uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE]; @@ -590,7 +590,7 @@ SHCI_CmdStatus_t SHCI_C2_ExtpaConfig(uint32_t gpio_port, uint16_t gpio_pin_numbe SHCI_CmdStatus_t SHCI_C2_SetFlashActivityControl(SHCI_C2_SET_FLASH_ACTIVITY_CONTROL_Source_t Source) { /** - * TL_BLEEVT_CS_BUFFER_SIZE is 15 bytes so it is large enough to hold the 1 byte of command parameter + * TL_BLEEVT_CC_BUFFER_SIZE is 16 bytes so it is large enough to hold the 1 byte of command parameter * Buffer is large enough to hold command complete without payload */ uint8_t local_buffer[TL_BLEEVT_CC_BUFFER_SIZE]; @@ -739,4 +739,3 @@ SHCI_CmdStatus_t SHCI_GetWirelessFwInfo( WirelessFwInfo_t* pWirelessInfo ) return (SHCI_Success); } -#endif /* STM32WBxx */ diff --git a/src/utility/STM32Cube_FW/shci.h b/src/utility/STM32Cube_FW/shci.h index d2aa0a58..750fa972 100644 --- a/src/utility/STM32Cube_FW/shci.h +++ b/src/utility/STM32Cube_FW/shci.h @@ -535,7 +535,7 @@ extern "C" { * - bit 4: 1: CS Algo #2 supported 0: CS Algo #2 not supported * - bit 5: 1: Reduced GATT database in NVM 0: Full GATT database in NVM * - bit 6: 1: GATT caching is used 0: GATT caching is not used - * - bit 7: 1: LE Power Class 1 0: LE Power Classe 2-3 + * - bit 7: 1: LE Power Class 1 0: LE Power Class 2-3 * - other bits: complete with Options_extension flag */ uint8_t Options; @@ -668,6 +668,7 @@ extern "C" { */ #define SHCI_C2_BLE_INIT_BLE_CORE_5_2 11 #define SHCI_C2_BLE_INIT_BLE_CORE_5_3 12 +#define SHCI_C2_BLE_INIT_BLE_CORE_5_4 13 /** * LsSource information @@ -904,7 +905,7 @@ extern "C" { #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 + * At startup, the information relative to the wireless binary are stored in RAM through a structure defined by * 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: * @@ -1150,7 +1151,7 @@ typedef struct { * @brief Starts the LLD tests CLI * * @param param_size : Nb of bytes - * @param p_param : pointeur with data to give from M4 to M0 + * @param p_param : pointer with data to give from M4 to M0 * @retval Status */ SHCI_CmdStatus_t SHCI_C2_LLDTESTS_Init( uint8_t param_size, uint8_t * p_param ); @@ -1160,7 +1161,7 @@ typedef struct { * @brief Starts the LLD tests BLE * * @param param_size : Nb of bytes - * @param p_param : pointeur with data to give from M4 to M0 + * @param p_param : pointer with data to give from M4 to M0 * @retval Status */ SHCI_CmdStatus_t SHCI_C2_BLE_LLD_Init( uint8_t param_size, uint8_t * p_param ); @@ -1260,7 +1261,7 @@ typedef struct { /** * SHCI_GetWirelessFwInfo - * @brief This function read back the informations relative to the wireless binary loaded. + * @brief This function read back the information relative to the wireless binary loaded. * Refer yourself to MB_WirelessFwInfoTable_t structure to get the significance * of the different parameters returned. * @param pWirelessInfo : Pointer to WirelessFwInfo_t. diff --git a/src/utility/STM32Cube_FW/shci_tl.c b/src/utility/STM32Cube_FW/shci_tl.c index d1d35f5b..0f604300 100644 --- a/src/utility/STM32Cube_FW/shci_tl.c +++ b/src/utility/STM32Cube_FW/shci_tl.c @@ -16,14 +16,12 @@ ****************************************************************************** */ -#if defined(STM32WBxx) + /* Includes ------------------------------------------------------------------*/ #include "stm32_wpan_common.h" #include "stm_list.h" #include "shci_tl.h" -#include "stm32_def.h" -#include "wiring_time.h" /* Private typedef -----------------------------------------------------------*/ typedef enum @@ -154,7 +152,7 @@ void shci_send( uint16_t cmd_code, uint8_t len_cmd_payload, uint8_t * p_cmd_payl pCmdBuffer->cmdserial.cmd.plen = len_cmd_payload; memcpy(pCmdBuffer->cmdserial.cmd.payload, p_cmd_payload, len_cmd_payload ); - + CmdRspStatusFlag = SHCI_TL_CMD_RESP_WAIT; shciContext.io.Send(0,0); shci_cmd_resp_wait(SHCI_TL_DEFAULT_TIMEOUT); @@ -170,20 +168,6 @@ void shci_send( uint16_t cmd_code, uint8_t len_cmd_payload, uint8_t * p_cmd_payl return; } -void shci_notify_asynch_evt(void *pdata) -{ - UNUSED(pdata); - /* Need to parse data in future version */ - shci_user_evt_proc(); -} - -void shci_register_io_bus(tSHciIO *fops) -{ - /* Register IO bus services */ - fops->Init = TL_SYS_Init; - fops->Send = TL_SYS_SendCmd; -} - /* Private functions ---------------------------------------------------------*/ static void TlInit( TL_CmdPacket_t * p_cmdbuffer ) { @@ -251,12 +235,10 @@ static void TlUserEvtReceived(TL_EvtPacket_t *shcievt) /* Weak implementation ----------------------------------------------------------------*/ __WEAK void shci_cmd_resp_wait(uint32_t timeout) { - CmdRspStatusFlag = SHCI_TL_CMD_RESP_WAIT; - for (unsigned long start = millis(); (millis() - start) < timeout;) { - if (CmdRspStatusFlag == SHCI_TL_CMD_RESP_RELEASE) { - break; - } - } + (void)timeout; + + while(CmdRspStatusFlag != SHCI_TL_CMD_RESP_RELEASE); + return; } @@ -268,4 +250,3 @@ __WEAK void shci_cmd_resp_release(uint32_t flag) return; } -#endif /* STM32WBxx */ diff --git a/src/utility/STM32Cube_FW/stm_list.c b/src/utility/STM32Cube_FW/stm_list.c index 4e8c3643..4c928647 100644 --- a/src/utility/STM32Cube_FW/stm_list.c +++ b/src/utility/STM32Cube_FW/stm_list.c @@ -16,13 +16,11 @@ ****************************************************************************** */ -#if defined(STM32WBxx) + /****************************************************************************** * Include Files ******************************************************************************/ -#include "stdint.h" -#include "cmsis_gcc.h" -#include "stm32_wpan_common.h" +#include "utilities_common.h" #include "stm_list.h" @@ -206,4 +204,3 @@ void LST_get_prev_node (tListNode * ref_node, tListNode ** node) __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/ } -#endif /* STM32WBxx */ diff --git a/src/utility/STM32Cube_FW/tl.h b/src/utility/STM32Cube_FW/tl.h index 63126b3d..8e8c6cbc 100644 --- a/src/utility/STM32Cube_FW/tl.h +++ b/src/utility/STM32Cube_FW/tl.h @@ -58,12 +58,8 @@ extern "C" { #define TL_BLEEVT_CS_OPCODE (0x0F) #define TL_BLEEVT_VS_OPCODE (0xFF) -#define TL_BLEEVT_CS_PACKET_SIZE (TL_EVT_HDR_SIZE + sizeof(TL_CsEvt_t)) -#define TL_BLEEVT_CS_BUFFER_SIZE (sizeof(TL_PacketHeader_t) + TL_BLEEVT_CS_PACKET_SIZE) - #define TL_BLEEVT_CC_PACKET_SIZE (TL_EVT_HDR_SIZE + sizeof(TL_CcEvt_t)) #define TL_BLEEVT_CC_BUFFER_SIZE (sizeof(TL_PacketHeader_t) + TL_BLEEVT_CC_PACKET_SIZE) - /* Exported types ------------------------------------------------------------*/ /**< Packet header */ typedef PACKED_STRUCT @@ -93,7 +89,7 @@ typedef PACKED_STRUCT { uint8_t numcmd; uint16_t cmdcode; - uint8_t payload[255]; + uint8_t payload[2]; } TL_CcEvt_t; /** @@ -102,7 +98,7 @@ typedef PACKED_STRUCT typedef PACKED_STRUCT { uint16_t subevtcode; - uint8_t payload[255]; + uint8_t payload[2]; } TL_AsynchEvt_t; /** @@ -112,7 +108,7 @@ typedef PACKED_STRUCT { uint8_t evtcode; uint8_t plen; - uint8_t payload[255]; + uint8_t payload[2]; } TL_Evt_t; typedef PACKED_STRUCT diff --git a/src/utility/STM32Cube_FW/tl_mbox.c b/src/utility/STM32Cube_FW/tl_mbox.c index ff219b97..27a998a3 100644 --- a/src/utility/STM32Cube_FW/tl_mbox.c +++ b/src/utility/STM32Cube_FW/tl_mbox.c @@ -16,7 +16,6 @@ ****************************************************************************** */ -#if defined(STM32WBxx) /* Includes ------------------------------------------------------------------*/ #include "stm32_wpan_common.h" #include "hw.h" @@ -52,10 +51,9 @@ 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; -#if 0 PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_Mac_802_15_4_t TL_Mac_802_15_4_Table; PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_ZigbeeTable_t TL_Zigbee_Table; -#endif + /**< tables */ PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static tListNode FreeBufQueue; PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static tListNode TracesEvtQueue; @@ -99,11 +97,8 @@ void TL_Init( void ) TL_RefTable.p_sys_table = &TL_SysTable; TL_RefTable.p_mem_manager_table = &TL_MemManagerTable; TL_RefTable.p_traces_table = &TL_TracesTable; - -#if 0 TL_RefTable.p_mac_802_15_4_table = &TL_Mac_802_15_4_Table; TL_RefTable.p_zigbee_table = &TL_Zigbee_Table; -#endif HW_IPCC_Init(); return; @@ -851,4 +846,3 @@ static void OutputDbgTrace(TL_MB_PacketType_t packet_type, uint8_t* buffer) return; } -#endif /* STM32WBxx */ From 542e007fa5a1b53664d2efb5f01d67767123a357 Mon Sep 17 00:00:00 2001 From: Frederic Pillon Date: Thu, 13 Jul 2023 17:08:05 +0200 Subject: [PATCH 05/10] chore: adapt STM32Cube_FW sources Signed-off-by: Frederic Pillon --- src/utility/STM32Cube_FW/app_conf_default.h | 46 ++++++++++++++++----- src/utility/STM32Cube_FW/ble_bufsize.h | 7 ++++ src/utility/STM32Cube_FW/hw.h | 13 +++++- src/utility/STM32Cube_FW/hw_ipcc.c | 5 ++- src/utility/STM32Cube_FW/shci.c | 3 +- src/utility/STM32Cube_FW/shci_tl.c | 18 +++++++- src/utility/STM32Cube_FW/stm_list.c | 7 +++- src/utility/STM32Cube_FW/tl_mbox.c | 7 +++- 8 files changed, 86 insertions(+), 20 deletions(-) diff --git a/src/utility/STM32Cube_FW/app_conf_default.h b/src/utility/STM32Cube_FW/app_conf_default.h index 51bd33af..1c6dd917 100644 --- a/src/utility/STM32Cube_FW/app_conf_default.h +++ b/src/utility/STM32Cube_FW/app_conf_default.h @@ -1,9 +1,9 @@ /* USER CODE BEGIN Header */ /** ****************************************************************************** - * @file app_conf.h + * @file app_conf_default.h * @author MCD Application Team - * @brief Application configuration file for STM32WPAN Middleware. + * @brief Default application configuration file for STM32WPAN Middleware. ****************************************************************************** * @attention * @@ -19,18 +19,38 @@ /* USER CODE END Header */ /* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef APP_CONF_H -#define APP_CONF_H - +#ifndef APP_CONF_DEFAULT_H +#define APP_CONF_DEFAULT_H +#if 0 #include "hw.h" #include "hw_conf.h" #include "hw_if.h" #include "ble_bufsize.h" - +#endif /****************************************************************************** * Application Config ******************************************************************************/ +/**< generic parameters ******************************************************/ +/* HCI related defines */ + +#define ACI_HAL_SET_TX_POWER_LEVEL 0xFC0F +#define ACI_WRITE_CONFIG_DATA_OPCODE 0xFC0C +#define ACI_READ_CONFIG_DATA_OPCODE 0xFC0D +#define MAX_HCI_ACL_PACKET_SIZE (sizeof(TL_PacketHeader_t) + 5 + 251) +#define HCI_RESET 0x0C03 + +#ifndef BLE_SHARED_MEM_BYTE_ORDER + #define BLE_SHARED_MEM_BYTE_ORDER MSBFIRST +#endif +#define BLE_MODULE_SHARED_MEM_BUFFER_SIZE 128 + +/** + * Define Tx Power + */ +#define CFG_TX_POWER (0x18) /* -0.15dBm */ + +#if 0 /** * Define Secure Connections Support */ @@ -104,7 +124,7 @@ #define CFG_FW_SUBVERSION (1) #define CFG_FW_BRANCH (0) #define CFG_FW_BUILD (0) - +#endif /****************************************************************************** * BLE Stack ******************************************************************************/ @@ -152,13 +172,15 @@ * Prepare Write List size in terms of number of packet * This parameter is ignored by the CPU2 when CFG_BLE_OPTIONS has SHCI_C2_BLE_INIT_OPTIONS_LL_ONLY flag set */ -#define CFG_BLE_PREPARE_WRITE_LIST_SIZE BLE_PREP_WRITE_X_ATT(CFG_BLE_MAX_ATT_MTU) +// #define CFG_BLE_PREPARE_WRITE_LIST_SIZE BLE_PREP_WRITE_X_ATT(CFG_BLE_MAX_ATT_MTU) +#define CFG_BLE_PREPARE_WRITE_LIST_SIZE (0x3A) /** * Number of allocated memory blocks * This parameter is overwritten by the CPU2 with an hardcoded optimal value when the parameter CFG_BLE_OPTIONS has SHCI_C2_BLE_INIT_OPTIONS_LL_ONLY flag set */ -#define CFG_BLE_MBLOCK_COUNT (BLE_MBLOCKS_CALC(CFG_BLE_PREPARE_WRITE_LIST_SIZE, CFG_BLE_MAX_ATT_MTU, CFG_BLE_NUM_LINK)) +//#define CFG_BLE_MBLOCK_COUNT (BLE_MBLOCKS_CALC(CFG_BLE_PREPARE_WRITE_LIST_SIZE, CFG_BLE_MAX_ATT_MTU, CFG_BLE_NUM_LINK)) +#define CFG_BLE_MBLOCK_COUNT (0x79) /** * Enable or disable the Extended Packet length feature. Valid values are 0 or 1. @@ -250,7 +272,7 @@ * 0: LE Power Class 2-3 * other bits: complete with Options_extension flag */ -#define CFG_BLE_OPTIONS (SHCI_C2_BLE_INIT_OPTIONS_LL_HOST | SHCI_C2_BLE_INIT_OPTIONS_WITH_SVC_CHANGE_DESC | SHCI_C2_BLE_INIT_OPTIONS_DEVICE_NAME_RW | SHCI_C2_BLE_INIT_OPTIONS_EXT_ADV | SHCI_C2_BLE_INIT_OPTIONS_CS_ALGO2 | SHCI_C2_BLE_INIT_OPTIONS_FULL_GATTDB_NVM | SHCI_C2_BLE_INIT_OPTIONS_GATT_CACHING_NOTUSED | SHCI_C2_BLE_INIT_OPTIONS_POWER_CLASS_2_3) +#define CFG_BLE_OPTIONS (SHCI_C2_BLE_INIT_OPTIONS_LL_ONLY) /** * BLE stack Options_extension flags to be configured with: @@ -323,6 +345,7 @@ #define CFG_BLE_CORE_VERSION (SHCI_C2_BLE_INIT_BLE_CORE_5_3) +#if 0 /****************************************************************************** * Transport Layer ******************************************************************************/ @@ -658,4 +681,5 @@ typedef enum #define CFG_OTP_END_ADRESS OTP_AREA_END_ADDR -#endif /*APP_CONF_H */ +#endif +#endif /*APP_CONF_DEFAULT_H */ diff --git a/src/utility/STM32Cube_FW/ble_bufsize.h b/src/utility/STM32Cube_FW/ble_bufsize.h index b9935c0b..d4d28907 100644 --- a/src/utility/STM32Cube_FW/ble_bufsize.h +++ b/src/utility/STM32Cube_FW/ble_bufsize.h @@ -75,6 +75,13 @@ ((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 dynamically allocated by initializing all the pointers diff --git a/src/utility/STM32Cube_FW/hw.h b/src/utility/STM32Cube_FW/hw.h index 651e1f17..1472a5e8 100644 --- a/src/utility/STM32Cube_FW/hw.h +++ b/src/utility/STM32Cube_FW/hw.h @@ -26,14 +26,23 @@ extern "C" { #endif /* Includes ------------------------------------------------------------------*/ +#include "stm32_def.h" +#include "stm32wbxx_ll_bus.h" +#include "stm32wbxx_ll_exti.h" +#include "stm32wbxx_ll_system.h" +#include "stm32wbxx_ll_rcc.h" +#include "stm32wbxx_ll_ipcc.h" +#include "stm32wbxx_ll_cortex.h" +#include "stm32wbxx_ll_utils.h" +#include "stm32wbxx_ll_pwr.h" /****************************************************************************** * HW IPCC ******************************************************************************/ void HW_IPCC_Enable( void ); void HW_IPCC_Init( void ); - void HW_IPCC_Rx_Handler( void ); - void HW_IPCC_Tx_Handler( void ); +#define HW_IPCC_Rx_Handler IPCC_C1_RX_IRQHandler +#define HW_IPCC_Tx_Handler IPCC_C1_TX_IRQHandler void HW_IPCC_BLE_Init( void ); void HW_IPCC_BLE_SendCmd( void ); diff --git a/src/utility/STM32Cube_FW/hw_ipcc.c b/src/utility/STM32Cube_FW/hw_ipcc.c index fd620b85..c7304823 100644 --- a/src/utility/STM32Cube_FW/hw_ipcc.c +++ b/src/utility/STM32Cube_FW/hw_ipcc.c @@ -17,9 +17,9 @@ ****************************************************************************** */ /* USER CODE END Header */ - +#if defined(STM32WBxx) /* Includes ------------------------------------------------------------------*/ -#include "app_common.h" +#include "hw.h" #include "mbox_def.h" /* Global variables ---------------------------------------------------------*/ @@ -667,3 +667,4 @@ static void HW_IPCC_TRACES_EvtHandler( void ) } __weak void HW_IPCC_TRACES_EvtNot( void ){}; +#endif /* STM32WBxx */ diff --git a/src/utility/STM32Cube_FW/shci.c b/src/utility/STM32Cube_FW/shci.c index eaa35d7c..4525656e 100644 --- a/src/utility/STM32Cube_FW/shci.c +++ b/src/utility/STM32Cube_FW/shci.c @@ -16,7 +16,7 @@ ****************************************************************************** */ - +#if defined(STM32WBxx) /* Includes ------------------------------------------------------------------*/ #include "stm32_wpan_common.h" @@ -739,3 +739,4 @@ SHCI_CmdStatus_t SHCI_GetWirelessFwInfo( WirelessFwInfo_t* pWirelessInfo ) return (SHCI_Success); } +#endif /* STM32WBxx */ diff --git a/src/utility/STM32Cube_FW/shci_tl.c b/src/utility/STM32Cube_FW/shci_tl.c index 0f604300..e3438094 100644 --- a/src/utility/STM32Cube_FW/shci_tl.c +++ b/src/utility/STM32Cube_FW/shci_tl.c @@ -16,12 +16,13 @@ ****************************************************************************** */ - +#if defined(STM32WBxx) /* Includes ------------------------------------------------------------------*/ #include "stm32_wpan_common.h" #include "stm_list.h" #include "shci_tl.h" +#include "stm32_def.h" /* Private typedef -----------------------------------------------------------*/ typedef enum @@ -168,6 +169,20 @@ void shci_send( uint16_t cmd_code, uint8_t len_cmd_payload, uint8_t * p_cmd_payl return; } +void shci_notify_asynch_evt(void *pdata) +{ + UNUSED(pdata); + /* Need to parse data in future version */ + shci_user_evt_proc(); +} + +void shci_register_io_bus(tSHciIO *fops) +{ + /* Register IO bus services */ + fops->Init = TL_SYS_Init; + fops->Send = TL_SYS_SendCmd; +} + /* Private functions ---------------------------------------------------------*/ static void TlInit( TL_CmdPacket_t * p_cmdbuffer ) { @@ -250,3 +265,4 @@ __WEAK void shci_cmd_resp_release(uint32_t flag) return; } +#endif /* STM32WBxx */ diff --git a/src/utility/STM32Cube_FW/stm_list.c b/src/utility/STM32Cube_FW/stm_list.c index 4c928647..4e8c3643 100644 --- a/src/utility/STM32Cube_FW/stm_list.c +++ b/src/utility/STM32Cube_FW/stm_list.c @@ -16,11 +16,13 @@ ****************************************************************************** */ - +#if defined(STM32WBxx) /****************************************************************************** * Include Files ******************************************************************************/ -#include "utilities_common.h" +#include "stdint.h" +#include "cmsis_gcc.h" +#include "stm32_wpan_common.h" #include "stm_list.h" @@ -204,3 +206,4 @@ void LST_get_prev_node (tListNode * ref_node, tListNode ** node) __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/ } +#endif /* STM32WBxx */ diff --git a/src/utility/STM32Cube_FW/tl_mbox.c b/src/utility/STM32Cube_FW/tl_mbox.c index 27a998a3..11393162 100644 --- a/src/utility/STM32Cube_FW/tl_mbox.c +++ b/src/utility/STM32Cube_FW/tl_mbox.c @@ -16,6 +16,7 @@ ****************************************************************************** */ +#if defined(STM32WBxx) /* Includes ------------------------------------------------------------------*/ #include "stm32_wpan_common.h" #include "hw.h" @@ -51,9 +52,10 @@ 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; +#if 0 PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_Mac_802_15_4_t TL_Mac_802_15_4_Table; PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_ZigbeeTable_t TL_Zigbee_Table; - +#endif /**< tables */ PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static tListNode FreeBufQueue; PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static tListNode TracesEvtQueue; @@ -97,8 +99,10 @@ void TL_Init( void ) TL_RefTable.p_sys_table = &TL_SysTable; TL_RefTable.p_mem_manager_table = &TL_MemManagerTable; TL_RefTable.p_traces_table = &TL_TracesTable; +#if 0 TL_RefTable.p_mac_802_15_4_table = &TL_Mac_802_15_4_Table; TL_RefTable.p_zigbee_table = &TL_Zigbee_Table; +#endif HW_IPCC_Init(); return; @@ -846,3 +850,4 @@ static void OutputDbgTrace(TL_MB_PacketType_t packet_type, uint8_t* buffer) return; } +#endif /* STM32WBxx */ From 5d07a0e5c0463965f8cf8dde6076b5cf2c779e90 Mon Sep 17 00:00:00 2001 From: Frederic Pillon Date: Thu, 13 Jul 2023 17:16:40 +0200 Subject: [PATCH 06/10] fix: include a timeout when waiting for the cmd_resp Signed-off-by: Frederic Pillon --- src/utility/STM32Cube_FW/shci_tl.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/utility/STM32Cube_FW/shci_tl.c b/src/utility/STM32Cube_FW/shci_tl.c index e3438094..60380251 100644 --- a/src/utility/STM32Cube_FW/shci_tl.c +++ b/src/utility/STM32Cube_FW/shci_tl.c @@ -23,6 +23,7 @@ #include "stm_list.h" #include "shci_tl.h" #include "stm32_def.h" +#include "wiring_time.h" /* Private typedef -----------------------------------------------------------*/ typedef enum @@ -250,10 +251,11 @@ static void TlUserEvtReceived(TL_EvtPacket_t *shcievt) /* Weak implementation ----------------------------------------------------------------*/ __WEAK void shci_cmd_resp_wait(uint32_t timeout) { - (void)timeout; - - while(CmdRspStatusFlag != SHCI_TL_CMD_RESP_RELEASE); - + for (unsigned long start = millis(); (millis() - start) < timeout;) { + if (CmdRspStatusFlag == SHCI_TL_CMD_RESP_RELEASE) { + break; + } + } return; } From 370e1082edae9b69d50f824db85b5cbe3b786e79 Mon Sep 17 00:00:00 2001 From: Frederic Pillon Date: Mon, 12 Dec 2022 17:29:27 +0100 Subject: [PATCH 07/10] chore: add support for customize app_conf_default.h Signed-off-by: Frederic Pillon --- src/utility/STM32Cube_FW/app_conf_default.h | 86 ++++++++++++++++----- 1 file changed, 68 insertions(+), 18 deletions(-) diff --git a/src/utility/STM32Cube_FW/app_conf_default.h b/src/utility/STM32Cube_FW/app_conf_default.h index 1c6dd917..d39492ea 100644 --- a/src/utility/STM32Cube_FW/app_conf_default.h +++ b/src/utility/STM32Cube_FW/app_conf_default.h @@ -48,7 +48,9 @@ /** * Define Tx Power */ -#define CFG_TX_POWER (0x18) /* -0.15dBm */ +#ifndef CFG_TX_POWER + #define CFG_TX_POWER (0x18) /* -0.15dBm */ +#endif #if 0 /** @@ -132,13 +134,25 @@ * Maximum number of simultaneous connections that the device will support. * Valid values are from 1 to 8 */ -#define CFG_BLE_NUM_LINK 8 +#ifndef CFG_BLE_NUM_LINK +#ifdef STM32WB15xx + #define CFG_BLE_NUM_LINK 3 +#else + #define CFG_BLE_NUM_LINK 8 +#endif +#endif /** * Maximum number of Services that can be stored in the GATT database. * Note that the GAP and GATT services are automatically added so this parameter should be 2 plus the number of user services */ -#define CFG_BLE_NUM_GATT_SERVICES 8 +#ifndef CFG_BLE_NUM_GATT_SERVICES +#ifdef STM32WB15xx + #define CFG_BLE_NUM_GATT_SERVICES 4 +#else + #define CFG_BLE_NUM_GATT_SERVICES 8 +#endif +#endif /** * Maximum number of Attributes @@ -147,13 +161,21 @@ * Note that certain characteristics and relative descriptors are added automatically during device initialization * so this parameters should be 9 plus the number of user Attributes */ -#define CFG_BLE_NUM_GATT_ATTRIBUTES 68 +#ifndef CFG_BLE_NUM_GATT_ATTRIBUTES +#ifdef STM32WB15xx + #define CFG_BLE_NUM_GATT_ATTRIBUTES 30 +#else + #define CFG_BLE_NUM_GATT_ATTRIBUTES 68 +#endif +#endif /** * Maximum supported ATT_MTU size * This parameter is ignored by the CPU2 when CFG_BLE_OPTIONS has SHCI_C2_BLE_INIT_OPTIONS_LL_ONLY flag set */ -#define CFG_BLE_MAX_ATT_MTU (156) +#ifndef CFG_BLE_MAX_ATT_MTU + #define CFG_BLE_MAX_ATT_MTU (156) +#endif /** * Size of the storage area for Attribute values @@ -166,14 +188,22 @@ * The total amount of memory needed is the sum of the above quantities for each attribute. * This parameter is ignored by the CPU2 when CFG_BLE_OPTIONS has SHCI_C2_BLE_INIT_OPTIONS_LL_ONLY flag set */ -#define CFG_BLE_ATT_VALUE_ARRAY_SIZE (1344) +#ifndef CFG_BLE_ATT_VALUE_ARRAY_SIZE +#ifdef STM32WB15xx + #define CFG_BLE_ATT_VALUE_ARRAY_SIZE (1290) +#else + #define CFG_BLE_ATT_VALUE_ARRAY_SIZE (1344) +#endif +#endif /** * Prepare Write List size in terms of number of packet * This parameter is ignored by the CPU2 when CFG_BLE_OPTIONS has SHCI_C2_BLE_INIT_OPTIONS_LL_ONLY flag set */ // #define CFG_BLE_PREPARE_WRITE_LIST_SIZE BLE_PREP_WRITE_X_ATT(CFG_BLE_MAX_ATT_MTU) -#define CFG_BLE_PREPARE_WRITE_LIST_SIZE (0x3A) +#ifndef CFG_BLE_PREPARE_WRITE_LIST_SIZE + #define CFG_BLE_PREPARE_WRITE_LIST_SIZE (0x3A) +#endif /** * Number of allocated memory blocks @@ -185,12 +215,16 @@ /** * Enable or disable the Extended Packet length feature. Valid values are 0 or 1. */ -#define CFG_BLE_DATA_LENGTH_EXTENSION 1 +#ifndef CFG_BLE_DATA_LENGTH_EXTENSION + #define CFG_BLE_DATA_LENGTH_EXTENSION 1 +#endif /** * Sleep clock accuracy in Slave mode (ppm value) */ -#define CFG_BLE_SLAVE_SCA 500 +#ifndef CFG_BLE_SLAVE_SCA + #define CFG_BLE_SLAVE_SCA 500 +#endif /** * Sleep clock accuracy in Master mode @@ -203,7 +237,9 @@ * 6 : 21 ppm to 30 ppm * 7 : 0 ppm to 20 ppm */ -#define CFG_BLE_MASTER_SCA 0 +#ifndef CFG_BLE_MASTER_SCA + #define CFG_BLE_MASTER_SCA 0 +#endif /** * LsSource @@ -212,21 +248,27 @@ * - bit 1: 1: STM32WB5M Module device 0: Other devices as STM32WBxx SOC, STM32WB1M module * - bit 2: 1: HSE/1024 Clock config 0: LSE Clock config */ -#if defined(STM32WB5Mxx) - #define CFG_BLE_LS_SOURCE (SHCI_C2_BLE_INIT_CFG_BLE_LS_NOCALIB | SHCI_C2_BLE_INIT_CFG_BLE_LS_MOD5MM_DEV | SHCI_C2_BLE_INIT_CFG_BLE_LS_CLK_LSE) -#else - #define CFG_BLE_LS_SOURCE (SHCI_C2_BLE_INIT_CFG_BLE_LS_NOCALIB | SHCI_C2_BLE_INIT_CFG_BLE_LS_OTHER_DEV | SHCI_C2_BLE_INIT_CFG_BLE_LS_CLK_LSE) +#ifndef CFG_BLE_LS_SOURCE + #if defined(STM32WB5Mxx) + #define CFG_BLE_LS_SOURCE (SHCI_C2_BLE_INIT_CFG_BLE_LS_NOCALIB | SHCI_C2_BLE_INIT_CFG_BLE_LS_MOD5MM_DEV | SHCI_C2_BLE_INIT_CFG_BLE_LS_CLK_LSE) + #else + #define CFG_BLE_LS_SOURCE (SHCI_C2_BLE_INIT_CFG_BLE_LS_NOCALIB | SHCI_C2_BLE_INIT_CFG_BLE_LS_OTHER_DEV | SHCI_C2_BLE_INIT_CFG_BLE_LS_CLK_LSE) + #endif #endif /** * Start up time of the high speed (16 or 32 MHz) crystal oscillator in units of 625/256 us (~2.44 us) */ -#define CFG_BLE_HSE_STARTUP_TIME 0x148 +#ifndef CFG_BLE_HSE_STARTUP_TIME + #define CFG_BLE_HSE_STARTUP_TIME 0x148 +#endif /** * Maximum duration of the connection event when the device is in Slave mode in units of 625/256 us (~2.44 us) */ -#define CFG_BLE_MAX_CONN_EVENT_LENGTH (0xFFFFFFFF) +#ifndef CFG_BLE_MAX_CONN_EVENT_LENGTH + #define CFG_BLE_MAX_CONN_EVENT_LENGTH (0xFFFFFFFF) +#endif /** * Viterbi Mode @@ -314,7 +356,11 @@ * This parameter is considered by the CPU2 when CFG_BLE_OPTIONS has SHCI_C2_BLE_INIT_OPTIONS_EXT_ADV flag set */ -#define CFG_BLE_MAX_ADV_SET_NBR (8) +#if defined(STM32WB15xx) + #define CFG_BLE_MAX_ADV_SET_NBR (3) +#else + #define CFG_BLE_MAX_ADV_SET_NBR (8) +#endif /* Maximum advertising data length (in bytes) * Range: 31 .. 1650 with limitation: @@ -323,7 +369,11 @@ * This parameter is considered by the CPU2 when CFG_BLE_OPTIONS has SHCI_C2_BLE_INIT_OPTIONS_EXT_ADV flag set */ -#define CFG_BLE_MAX_ADV_DATA_LEN (207) +#if defined(STM32WB15xx) + #define CFG_BLE_MAX_ADV_DATA_LEN (414) +#else + #define CFG_BLE_MAX_ADV_DATA_LEN (207) +#endif /* RF TX Path Compensation Value (16-bit signed integer). Units: 0.1 dB. * Range: -1280 .. 1280 From 819cebd2bed57448f925d34d50d8df51cbe58c04 Mon Sep 17 00:00:00 2001 From: Frederic Pillon Date: Mon, 24 Jul 2023 10:55:20 +0200 Subject: [PATCH 08/10] fix: TL_Evt_t payload size for reset Within last CubeWB update TL_Evt_t payload size was reduced. This produce a warning -Warray-bounds due to the reset management which require 4 bytes. Signed-off-by: Frederic Pillon --- src/utility/STM32Cube_FW/tl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utility/STM32Cube_FW/tl.h b/src/utility/STM32Cube_FW/tl.h index 8e8c6cbc..74520878 100644 --- a/src/utility/STM32Cube_FW/tl.h +++ b/src/utility/STM32Cube_FW/tl.h @@ -108,7 +108,7 @@ typedef PACKED_STRUCT { uint8_t evtcode; uint8_t plen; - uint8_t payload[2]; + uint8_t payload[4]; } TL_Evt_t; typedef PACKED_STRUCT From 2a070faebcae906ff48c7329b0c2de2b2d64744d Mon Sep 17 00:00:00 2001 From: Frederic Pillon Date: Mon, 24 Jul 2023 11:19:27 +0200 Subject: [PATCH 09/10] fix: regenerate STM32Cube_FW patches Signed-off-by: Frederic Pillon --- ...001-chore-adapt-STM32Cube_FW-sources.patch | 4 +-- ...imeout-when-waiting-for-the-cmd_resp.patch | 4 +-- ...ort-for-customize-app_conf_default.h.patch | 4 +-- ...-fix-TL_Evt_t-payload-size-for-reset.patch | 30 +++++++++++++++++++ 4 files changed, 36 insertions(+), 6 deletions(-) create mode 100644 extras/STM32Cube_FW/0004-fix-TL_Evt_t-payload-size-for-reset.patch diff --git a/extras/STM32Cube_FW/0001-chore-adapt-STM32Cube_FW-sources.patch b/extras/STM32Cube_FW/0001-chore-adapt-STM32Cube_FW-sources.patch index ce3c8818..48a28137 100644 --- a/extras/STM32Cube_FW/0001-chore-adapt-STM32Cube_FW-sources.patch +++ b/extras/STM32Cube_FW/0001-chore-adapt-STM32Cube_FW-sources.patch @@ -1,7 +1,7 @@ -From fd17a2302d60208768610cb4723eb403c52ff2b1 Mon Sep 17 00:00:00 2001 +From 542e007fa5a1b53664d2efb5f01d67767123a357 Mon Sep 17 00:00:00 2001 From: Frederic Pillon Date: Thu, 13 Jul 2023 17:08:05 +0200 -Subject: [PATCH 1/3] chore: adapt STM32Cube_FW sources +Subject: [PATCH 1/4] chore: adapt STM32Cube_FW sources Signed-off-by: Frederic Pillon --- diff --git a/extras/STM32Cube_FW/0002-fix-include-a-timeout-when-waiting-for-the-cmd_resp.patch b/extras/STM32Cube_FW/0002-fix-include-a-timeout-when-waiting-for-the-cmd_resp.patch index 4afa2128..07ce6e6e 100644 --- a/extras/STM32Cube_FW/0002-fix-include-a-timeout-when-waiting-for-the-cmd_resp.patch +++ b/extras/STM32Cube_FW/0002-fix-include-a-timeout-when-waiting-for-the-cmd_resp.patch @@ -1,7 +1,7 @@ -From 598c654f18fc9389be8326610a51052943151f04 Mon Sep 17 00:00:00 2001 +From 5d07a0e5c0463965f8cf8dde6076b5cf2c779e90 Mon Sep 17 00:00:00 2001 From: Frederic Pillon Date: Thu, 13 Jul 2023 17:16:40 +0200 -Subject: [PATCH 2/3] fix: include a timeout when waiting for the cmd_resp +Subject: [PATCH 2/4] fix: include a timeout when waiting for the cmd_resp Signed-off-by: Frederic Pillon --- diff --git a/extras/STM32Cube_FW/0003-chore-add-support-for-customize-app_conf_default.h.patch b/extras/STM32Cube_FW/0003-chore-add-support-for-customize-app_conf_default.h.patch index 32e10c12..e23d54c8 100644 --- a/extras/STM32Cube_FW/0003-chore-add-support-for-customize-app_conf_default.h.patch +++ b/extras/STM32Cube_FW/0003-chore-add-support-for-customize-app_conf_default.h.patch @@ -1,7 +1,7 @@ -From 663ed22fd680de1f32c542df0799c403665ecb2e Mon Sep 17 00:00:00 2001 +From 370e1082edae9b69d50f824db85b5cbe3b786e79 Mon Sep 17 00:00:00 2001 From: Frederic Pillon Date: Mon, 12 Dec 2022 17:29:27 +0100 -Subject: [PATCH 3/3] chore: add support for customize app_conf_default.h +Subject: [PATCH 3/4] chore: add support for customize app_conf_default.h Signed-off-by: Frederic Pillon --- diff --git a/extras/STM32Cube_FW/0004-fix-TL_Evt_t-payload-size-for-reset.patch b/extras/STM32Cube_FW/0004-fix-TL_Evt_t-payload-size-for-reset.patch new file mode 100644 index 00000000..c239749f --- /dev/null +++ b/extras/STM32Cube_FW/0004-fix-TL_Evt_t-payload-size-for-reset.patch @@ -0,0 +1,30 @@ +From b294edcaee311c15dfb307ea1298ae88b16a92bf Mon Sep 17 00:00:00 2001 +From: Frederic Pillon +Date: Mon, 24 Jul 2023 10:55:20 +0200 +Subject: [PATCH 4/4] fix: TL_Evt_t payload size for reset + +Within STM32CubeWB v1.17.0 update TL_Evt_t payload size was reduced. +This produce a warning -Warray-bounds due to the reset management +which require 4 bytes. + +Signed-off-by: Frederic Pillon +--- + src/utility/STM32Cube_FW/tl.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/utility/STM32Cube_FW/tl.h b/src/utility/STM32Cube_FW/tl.h +index 8e8c6cb..7452087 100644 +--- a/src/utility/STM32Cube_FW/tl.h ++++ b/src/utility/STM32Cube_FW/tl.h +@@ -108,7 +108,7 @@ typedef PACKED_STRUCT + { + uint8_t evtcode; + uint8_t plen; +- uint8_t payload[2]; ++ uint8_t payload[4]; + } TL_Evt_t; + + typedef PACKED_STRUCT +-- +2.38.0.windows.1 + From 347ff927abfbe29e336087ce184c5858b0364bc6 Mon Sep 17 00:00:00 2001 From: Frederic Pillon Date: Tue, 9 Jan 2024 15:20:47 +0100 Subject: [PATCH 10/10] chore: bump library version to 1.2.6 Signed-off-by: Frederic Pillon --- library.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library.properties b/library.properties index 35083868..da5c1c4c 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=STM32duinoBLE -version=1.2.5 +version=1.2.6 author=Arduino, SRA maintainer=stm32duino sentence=Fork of ArduinoBLE library to add the support of STM32WB, SPBTLE-RF, SPBTLE-1S, BLUENRG-M2SP and BLUENRG-M0 BLE modules. pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy