Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion lib/stm32wba/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ if(CONFIG_IEEE802154_STM32WBA)
zephyr_sources(Common/WPAN/Modules/BasicAES/baes_ccm.c)
zephyr_sources(Common/WPAN/Modules/BasicAES/baes_cmac.c)
zephyr_sources(Common/WPAN/Modules/BasicAES/baes_ecb.c)
zephyr_sources(Common/WPAN/Interfaces/hw_aes.c)
endif()

set(STM32WBA_LIB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../zephyr/blobs/stm32wba/lib)
Expand Down Expand Up @@ -86,7 +87,12 @@ endif()

# Selecting the proper version of link layer lib
if(CONFIG_BT_STM32WBA)
# Checking all the soc variants and not simply relying on board name
if(BLE_LIB_TYPE STREQUAL "BLE_LIB_BASIC")
zephyr_include_directories(STM32_WPAN/link_layer/ll_cmd_lib/config/ble_basic)
elseif(BLE_LIB_TYPE STREQUAL "BLE_LIB_FULL")
zephyr_include_directories(STM32_WPAN/link_layer/ll_cmd_lib/config/ble_full)
endif()
# Checking all the soc variants and not simply relying on board name
if(CONFIG_SOC_STM32WBA65XX)
message(STATUS "STM32WBA6 link layer lib selected")
if (BLE_LIB_TYPE STREQUAL "BLE_LIB_BASIC")
Expand Down
22 changes: 21 additions & 1 deletion lib/stm32wba/Common/WPAN/Interfaces/hw.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#define HW_H__

#include "stm32wbaxx.h"
#include "app_conf.h"

/* ---------------------------------------------------------------------------
* General
Expand Down Expand Up @@ -360,7 +361,7 @@ extern void HW_PKA_P256_ReadEccScalarMul( uint32_t* p_x,
* Thus, the function HW_RNG_Process() must be called regularly in background
* loop to generate a pool of random numbers. The function HW_RNG_Get() reads
* the random numbers from the pool.
* The size of the pool must be configured with CFG_HW_RNG_POOL_SIZE.
* The size of the pool must be configured with HW_RNG_POOL_SIZE.
*/

/* Error codes definition for HW_RNG return values */
Expand All @@ -371,6 +372,11 @@ enum
HW_RNG_UFLOW_ERROR = CFG_HW_ERROR_OFFSET + 0x103,
};

/* RNG pool size */
#define HW_RNG_POOL_SIZE (CFG_HW_RNG_POOL_SIZE)
/* Default threshold to refill RNG pool */
#define HW_RNG_POOL_DEFAULT_THRESHOLD (12)

/* RNG_KERNEL_CLK_ON
*
* Enable RNG kernel clock.
Expand Down Expand Up @@ -441,6 +447,20 @@ extern void HW_RNG_DisableClock( uint8_t user_mask );

extern void HWCB_RNG_Process( void );

/*
* HW_RNG_Init
*
* This function initializes RNG (clock, configuration ...)
*/
extern void HW_RNG_Init(void);

/*
* HW_RNG_Init
*
* Sets RNG pool threshold (for refill)
*/
extern void HW_RNG_SetPoolThreshold(uint8_t threshold);

/* ---------------------------------------------------------------------------
* GPIO
* ---------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion lib/stm32wba/Common/WPAN/Modules/BasicAES/baes.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
******************************************************************************
* @file baes.h
* @file baes.h
* @author MCD Application Team
* @brief This file contains the interface of the basic AES software module.
******************************************************************************
Expand Down
74 changes: 36 additions & 38 deletions lib/stm32wba/Common/WPAN/Modules/RTDebug/RTDebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,48 +28,46 @@
/** and global signal table GPIO manipulation **/
/**************************************************************/

#define GENERIC_DEBUG_GPIO_SET(signal, table) do { \
uint32_t debug_table_idx = 0; \
if(signal >= sizeof(table)) \
{ \
return; \
} \
debug_table_idx = table[signal]; \
if(debug_table_idx != RT_DEBUG_SIGNAL_UNUSED) \
{ \
HAL_GPIO_WritePin(general_debug_table[debug_table_idx].GPIO_port, \
general_debug_table[debug_table_idx].GPIO_pin, \
GPIO_PIN_SET); \
} \
#define GENERIC_DEBUG_GPIO_SET(signal, table) do { \
uint32_t debug_table_idx = 0; \
if(signal >= sizeof(table)) \
{ \
return; \
} \
debug_table_idx = table[signal]; \
if(debug_table_idx != RT_DEBUG_SIGNAL_UNUSED) \
{ \
LL_GPIO_SetOutputPin(general_debug_table[debug_table_idx].GPIO_port, \
general_debug_table[debug_table_idx].GPIO_pin); \
} \
} while(0)

#define GENERIC_DEBUG_GPIO_RESET(signal, table) do { \
uint32_t debug_table_idx = 0; \
if(signal >= sizeof(table)) \
{ \
return; \
} \
debug_table_idx = table[signal]; \
if(debug_table_idx != RT_DEBUG_SIGNAL_UNUSED) \
{ \
HAL_GPIO_WritePin(general_debug_table[debug_table_idx].GPIO_port, \
general_debug_table[debug_table_idx].GPIO_pin, \
GPIO_PIN_RESET); \
} \
#define GENERIC_DEBUG_GPIO_RESET(signal, table) do { \
uint32_t debug_table_idx = 0; \
if(signal >= sizeof(table)) \
{ \
return; \
} \
debug_table_idx = table[signal]; \
if(debug_table_idx != RT_DEBUG_SIGNAL_UNUSED) \
{ \
LL_GPIO_ResetOutputPin(general_debug_table[debug_table_idx].GPIO_port, \
general_debug_table[debug_table_idx].GPIO_pin); \
} \
} while(0)

#define GENERIC_DEBUG_GPIO_TOGGLE(signal, table) do { \
uint32_t debug_table_idx = 0; \
if(signal >= sizeof(table)) \
{ \
return; \
} \
debug_table_idx = table[signal]; \
if(debug_table_idx != RT_DEBUG_SIGNAL_UNUSED) \
{ \
HAL_GPIO_TogglePin(general_debug_table[debug_table_idx].GPIO_port, \
general_debug_table[debug_table_idx].GPIO_pin); \
} \
#define GENERIC_DEBUG_GPIO_TOGGLE(signal, table) do { \
uint32_t debug_table_idx = 0; \
if(signal >= sizeof(table)) \
{ \
return; \
} \
debug_table_idx = table[signal]; \
if(debug_table_idx != RT_DEBUG_SIGNAL_UNUSED) \
{ \
LL_GPIO_TogglePin(general_debug_table[debug_table_idx].GPIO_port, \
general_debug_table[debug_table_idx].GPIO_pin); \
} \
} while(0)

#endif /* CFG_RT_DEBUG_GPIO_MODULE */
Expand Down
4 changes: 4 additions & 0 deletions lib/stm32wba/Common/WPAN/Modules/RTDebug/debug_signals.h
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,10 @@ typedef enum {
RT_DEBUG_LLHWC_GET_CH_IDX_ALGO_2,
#endif /* USE_RT_DEBUG_LLHWC_GET_CH_IDX_ALGO_2 */

#if (USE_RT_DEBUG_BACK_FROM_DEEP_SLEEP == 1)
RT_DEBUG_BACK_FROM_DEEP_SLEEP,
#endif /* USE_RT_DEBUG_BACK_FROM_DEEP_SLEEP */

#include "app_debug_signal_def.h"

RT_DEBUG_SIGNALS_TOTAL_NUM
Expand Down
6 changes: 6 additions & 0 deletions lib/stm32wba/Common/WPAN/Modules/RTDebug/local_debug_tables.h
Original file line number Diff line number Diff line change
Expand Up @@ -1149,6 +1149,12 @@ static const rt_debug_signal_t linklayer_debug_table[] = {
#else
[DBG_IO_LLHWC_GET_CH_IDX_ALGO_2] = RT_DEBUG_SIGNAL_UNUSED,
#endif /* USE_RT_DEBUG_LLHWC_GET_CH_IDX_ALGO_2 */

#if (USE_RT_DEBUG_BACK_FROM_DEEP_SLEEP == 1)
[DBG_IO_BACK_FROM_DEEP_SLEEP] = RT_DEBUG_BACK_FROM_DEEP_SLEEP,
#else
[DBG_IO_BACK_FROM_DEEP_SLEEP] = RT_DEBUG_SIGNAL_UNUSED,
#endif /* USE_RT_DEBUG_BACK_FROM_DEEP_SLEEP */
};

#endif /* CFG_RT_DEBUG_GPIO_MODULE */
Expand Down
29 changes: 16 additions & 13 deletions lib/stm32wba/IEEE802154/STM32_WPAN/Target/linklayer_plat.c
Original file line number Diff line number Diff line change
Expand Up @@ -498,37 +498,40 @@ void LINKLAYER_PLAT_RequestTemperature(void)
{

}
#ifndef __ZEPHYR__

/**
* @brief Enable RTOS context switch.
* @brief PHY Start calibration.
* @param None
* @retval None
*/
void LINKLAYER_PLAT_EnableOSContextSwitch(void)
void LINKLAYER_PLAT_PhyStartClbr(void)
{
/* USER CODE BEGIN LINKLAYER_PLAT_EnableOSContextSwitch_0 */
/* USER CODE BEGIN LINKLAYER_PLAT_PhyStartClbr_0 */

/* USER CODE END LINKLAYER_PLAT_PhyStartClbr_0 */

/* USER CODE END LINKLAYER_PLAT_EnableOSContextSwitch_0 */
/* USER CODE BEGIN LINKLAYER_PLAT_EnableOSContextSwitch_1 */
/* USER CODE BEGIN LINKLAYER_PLAT_PhyStartClbr_1 */

/* USER CODE END LINKLAYER_PLAT_EnableOSContextSwitch_1 */
/* USER CODE END LINKLAYER_PLAT_PhyStartClbr_1 */
}

/**
* @brief Disable RTOS context switch.
* @brief PHY Stop calibration.
* @param None
* @retval None
*/
void LINKLAYER_PLAT_DisableOSContextSwitch(void)
void LINKLAYER_PLAT_PhyStopClbr(void)
{
/* USER CODE BEGIN LINKLAYER_PLAT_DisableOSContextSwitch_0 */
/* USER CODE BEGIN LINKLAYER_PLAT_PhyStopClbr_0 */

/* USER CODE END LINKLAYER_PLAT_DisableOSContextSwitch_0 */
/* USER CODE BEGIN LINKLAYER_PLAT_DisableOSContextSwitch_1 */
/* USER CODE END LINKLAYER_PLAT_PhyStopClbr_0 */

/* USER CODE END LINKLAYER_PLAT_DisableOSContextSwitch_1 */
/* USER CODE BEGIN LINKLAYER_PLAT_PhyStopClbr_1 */

/* USER CODE END LINKLAYER_PLAT_PhyStopClbr_1 */
}

#ifndef __ZEPHYR__
/**
* @brief Notify the upper layer that new Link Layer timings have been applied.
* @param evnt_timing[in]: Evnt_timing_t pointer to structure contains drift time , execution time and scheduling time
Expand Down
23 changes: 13 additions & 10 deletions lib/stm32wba/IEEE802154/STM32_WPAN/Target/ll_sys_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
******************************************************************************
* @attention
*
* Copyright (c) 2022 STMicroelectronics.
* Copyright (c) 2025 STMicroelectronics.
* All rights reserved.
*
* This software is licensed under terms that can be found in the LICENSE file
Expand All @@ -17,17 +17,17 @@
******************************************************************************
*/
/* USER CODE END Header */
#include <zephyr/logging/log.h>
#include "ll_intf.h"

#include "main.h"
#include "app_common.h"
#include "app_conf.h"
#include "log_module.h"
#include "ll_intf_cmn.h"
#include "ll_sys.h"
#include "ll_sys_if.h"
#include "platform.h"
#include "utilities_common.h"
#ifndef __ZEPHYR__
#if (USE_TEMPERATURE_BASED_RADIO_CALIBRATION == 1)
#include "temp_measurement.h"
#endif /* (USE_TEMPERATURE_BASED_RADIO_CALIBRATION == 1) */
#endif /*__ZEPHYR__*/

/* Private defines -----------------------------------------------------------*/
/* Radio event scheduling method - must be set at 1 */
#define USE_RADIO_LOW_ISR (1)
Expand All @@ -53,7 +53,6 @@
/* USER CODE END PV */

/* Global variables ----------------------------------------------------------*/

/* USER CODE BEGIN GV */

/* USER CODE END GV */
Expand Down Expand Up @@ -211,4 +210,8 @@ void ll_sys_sleep_clock_source_selection(void)
ll_intf_cmn_le_select_slp_clk_src((uint8_t)linklayer_slp_clk_src, &freq_value);
}


void ll_sys_set_rtl_polling_time(uint8_t rtl_polling_time)
{
/* first parameter otInstance *aInstance is unused */
radio_set_rtl_polling_time(NULL, rtl_polling_time);
}
7 changes: 2 additions & 5 deletions lib/stm32wba/IEEE802154/STM32_WPAN/Target/ll_sys_if.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
******************************************************************************
* @attention
*
* Copyright (c) 2022 STMicroelectronics.
* Copyright (c) 2025 STMicroelectronics.
* All rights reserved.
*
* This software is licensed under terms that can be found in the LICENSE file
Expand Down Expand Up @@ -39,7 +39,6 @@ extern "C" {
/* USER CODE END ET */

/* Exported constants --------------------------------------------------------*/

/* USER CODE BEGIN EC */

/* USER CODE END EC */
Expand All @@ -55,9 +54,7 @@ extern "C" {
/* USER CODE END EM */

/* Exported functions prototypes ---------------------------------------------*/
#if (USE_TEMPERATURE_BASED_RADIO_CALIBRATION == 1)
void ll_sys_bg_temperature_measurement(void);
#endif /* USE_TEMPERATURE_BASED_RADIO_CALIBRATION */
void ll_sys_set_rtl_polling_time(uint8_t rtl_polling_time);
/* USER CODE BEGIN EFP */

/* USER CODE END EFP */
Expand Down
28 changes: 14 additions & 14 deletions lib/stm32wba/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Origin:
https://github.com/STMicroelectronics/STM32CubeWBA

Status:
version v1.6.0
version v1.7.0

Purpose:
This library is used on STM32WBA series to port BLE and IEEE802154 controller libraries in
Expand Down Expand Up @@ -48,6 +48,7 @@ Description:
Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/inc/ot_inc/toolchain.h
Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/inc/ot_inc/types.h
Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/config/ble_full/ll_fw_config.h
Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/config/ble_basic/ll_fw_config.h
Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/config/ieee_15_4_basic/ll_fw_config.h
Middlewares/ST/STM32_WPAN/link_layer/ll_cmd_lib/config/thread/ll_fw_config.h
Middlewares/ST/STM32_WPAN/link_layer/ll_sys/inc/linklayer_plat.h
Expand Down Expand Up @@ -103,12 +104,12 @@ Description:
Projects/NUCLEO-WBA65RI/Applications/BLE/BLE_TransparentMode/STM32_WPAN/Target/linklayer_plat.c
Projects/NUCLEO-WBA65RI/Applications/BLE/BLE_TransparentMode/STM32_WPAN/Target/ll_sys_if.c
Projects/NUCLEO-WBA65RI/Applications/BLE/BLE_TransparentMode/STM32_WPAN/Target/ll_sys_if.h
Projects/NUCLEO-WBA65RI/Applications/BLE/Zigbee_OnOff_Client_SED/System/Config/Debug_GPIO/debug_config.h
Projects/NUCLEO-WBA65RI/Applications/BLE/Zigbee_OnOff_Client_SED/System/Config/Log/log_module_conf.h
Projects/NUCLEO-WBA65RI/Applications/BLE/Zigbee_OnOff_Client_SED/STM32_WPAN/Target/power_table.c
Projects/NUCLEO-WBA65RI/Applications/BLE/Zigbee_OnOff_Client_SED/STM32_WPAN/Target/linklayer_plat.c
Projects/NUCLEO-WBA65RI/Applications/BLE/Zigbee_OnOff_Client_SED/STM32_WPAN/Target/ll_sys_if.c
Projects/NUCLEO-WBA65RI/Applications/BLE/Zigbee_OnOff_Client_SED/STM32_WPAN/Target/ll_sys_if.h
Projects/NUCLEO-WBA65RI/Applications/Zigbee/Zigbee_OnOff_Client_SED/System/Config/Debug_GPIO/debug_config.h
Projects/NUCLEO-WBA65RI/Applications/Zigbee/Zigbee_OnOff_Client_SED/System/Config/Log/log_module_conf.h
Projects/NUCLEO-WBA65RI/Applications/Zigbee/Zigbee_OnOff_Client_SED/STM32_WPAN/Target/power_table.c
Projects/NUCLEO-WBA65RI/Applications/Zigbee/Zigbee_OnOff_Client_SED/STM32_WPAN/Target/linklayer_plat.c
Projects/NUCLEO-WBA65RI/Applications/Zigbee/Zigbee_OnOff_Client_SED/STM32_WPAN/Target/ll_sys_if.c
Projects/NUCLEO-WBA65RI/Applications/Zigbee/Zigbee_OnOff_Client_SED/STM32_WPAN/Target/ll_sys_if.h
Utilities/trace/adv_trace/stm32_adv_trace.h
Utilities/misc/stm32_mem.h
Utilities/tim_serv/stm32_timer.h
Expand All @@ -122,7 +123,7 @@ URL:
https://github.com/STMicroelectronics/STM32CubeWBA

Commit:
e7d27c496416aae8f4ba8b3e84f963f0c5a0b69f
f5b281ba4ca4d00aba59215728265f1d2cc80715

Maintained-by:
External
Expand All @@ -136,9 +137,10 @@ License Link:
opensource.org/license/mit

Patch List:
* Discard "static" implementation of ll_sys_bg_temperature_measurement_init to allow specific zephyr implementation
Impacted file: ll_sys_if.c
ll_sys.h

* Discard "static" implementation of ll_sys_bg_temperature_measurement_init to allow specific zephyr implementation
Impacted file: ll_sys_if.c
ll_sys.h

* Enabled extended advertising in CFG_BLE_OPTIONS:
Impacted file: app_conf.h
Expand All @@ -153,7 +155,6 @@ Patch List:
Impacted files: stm_list.h
main.h
app_conf.h
scm.c
ll_intf_cmn.h
ll_sys_if.c
linklayer_plat.c
Expand All @@ -170,8 +171,7 @@ Patch List:
Impacted files: ll_sys_if.c

* SCM_HSE_WaitUntilReady Cube mechanism not used
Impacted files: scm.c
linklayer_plat.c
Impacted files: linklayer_plat.c

* Changes from official delivery:
- dos2unix applied
Expand Down
Loading