Skip to content

Commit 1012ead

Browse files
committed
lib/stm32: update stm32wba to cube version V1.5.0
Update Cube version for STM32WBAxx series on https://github.com/STMicroelectronics from version v1.4.1 to version v1.5.0 Signed-off-by: Alessandro Manganaro <[email protected]>
1 parent eae95a4 commit 1012ead

Some content is hidden

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

55 files changed

+1444
-603
lines changed

lib/stm32wba/BLE_TransparentMode/Core/Inc/app_common.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ extern "C"{
3030
#include <stdio.h>
3131
#include <stdlib.h>
3232
#include <stdarg.h>
33+
#include <inttypes.h>
3334

3435
#include "app_conf.h"
3536
#include "hw.h"

lib/stm32wba/BLE_TransparentMode/Core/Inc/app_conf.h

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,12 @@
6565
#define CFG_BLE_OPTIONS (0 | \
6666
0 | \
6767
0 | \
68-
BLE_OPTIONS_EXTENDED_ADV | \
68+
BLE_OPTIONS_EXTENDED_ADV | \
6969
0 | \
70+
BLE_OPTIONS_GATT_CACHING | \
7071
0 | \
7172
0 | \
72-
0 | \
73-
0)
73+
BLE_OPTIONS_ENHANCED_ATT)
7474

7575
/**
7676
* Maximum number of simultaneous connections and advertising that the device will support.
@@ -196,9 +196,6 @@ typedef enum
196196
/******************************************************************************
197197
* RTC
198198
******************************************************************************/
199-
#define RTC_N_PREDIV_S (10)
200-
#define RTC_PREDIV_S ((1<<RTC_N_PREDIV_S)-1)
201-
#define RTC_PREDIV_A ((1<<(15-RTC_N_PREDIV_S))-1)
202199

203200
/* USER CODE BEGIN RTC */
204201

@@ -221,6 +218,8 @@ typedef enum
221218
*/
222219
#define CFG_LOG_SUPPORTED (0U)
223220

221+
/* Usart used by LOG */
222+
224223
/* Configure Log display settings */
225224
#define CFG_LOG_INSERT_COLOR_INSIDE_THE_TRACE (0U)
226225
#define CFG_LOG_INSERT_TIME_STAMP_INSIDE_THE_TRACE (0U)
@@ -241,7 +240,7 @@ typedef enum
241240
* Configure Log level for Application
242241
******************************************************************************/
243242
#define APPLI_CONFIG_LOG_LEVEL LOG_VERBOSE_INFO
244-
243+
#define APPLI_CONFIG_LOG_REGION (LOG_REGION_ALL_REGIONS)
245244
/* USER CODE BEGIN Log_level */
246245

247246
/* USER CODE END Log_level */
@@ -320,7 +319,7 @@ typedef enum
320319
* NVM configuration
321320
******************************************************************************/
322321

323-
#define CFG_SNVMA_START_SECTOR_ID (FLASH_PAGE_NB - 2u)
322+
#define CFG_SNVMA_START_SECTOR_ID ((FLASH_SIZE / FLASH_PAGE_SIZE) - 2u)
324323

325324
#define CFG_SNVMA_START_ADDRESS (FLASH_BASE + (FLASH_PAGE_SIZE * (CFG_SNVMA_START_SECTOR_ID)))
326325

@@ -347,20 +346,20 @@ typedef enum
347346
* - 2 : Debugger available in low power mode.
348347
*
349348
******************************************************************************/
350-
#define CFG_DEBUGGER_LEVEL (2)
349+
#define CFG_DEBUGGER_LEVEL (2)
351350

352351
/******************************************************************************
353352
* RealTime GPIO debug module configuration
354353
******************************************************************************/
355354

356-
#define CFG_RT_DEBUG_GPIO_MODULE (0)
357-
#define CFG_RT_DEBUG_DTB (0)
355+
#define CFG_RT_DEBUG_GPIO_MODULE (0)
356+
#define CFG_RT_DEBUG_DTB (0)
358357

359358
/******************************************************************************
360359
* System Clock Manager module configuration
361360
******************************************************************************/
362361

363-
#define CFG_SCM_SUPPORTED (1)
362+
#define CFG_SCM_SUPPORTED (1)
364363

365364
/******************************************************************************
366365
* HW RADIO configuration
@@ -391,9 +390,14 @@ typedef enum
391390
/* RF TX power table ID selection:
392391
* 0 -> RF TX output level from -20 dBm to +10 dBm
393392
* 1 -> RF TX output level from -20 dBm to +3 dBm
393+
* 2 -> RF TX output level at +20 dBm with an external PA
394394
*/
395395
#define CFG_RF_TX_POWER_TABLE_ID (0)
396396

397+
#define CFG_EXTERNAL_PA_ENABLE (0)
398+
399+
#define CFG_BLE_AOA_AOD_ENABLE (0)
400+
397401
/* Custom LSE sleep clock accuracy to use if both conditions are met:
398402
* - LSE is selected as Link Layer sleep clock source
399403
* - the LSE used is different from the default one.
@@ -425,8 +429,8 @@ typedef enum
425429
#define CFG_AMM_VIRTUAL_STACK_BLE_BUFFER_SIZE (400U) /* words (32 bits) */
426430
#define CFG_AMM_VIRTUAL_APP_BLE (2U)
427431
#define CFG_AMM_VIRTUAL_APP_BLE_BUFFER_SIZE (200U) /* words (32 bits) */
428-
#define CFG_AMM_POOL_SIZE DIVC(CFG_MM_POOL_SIZE, sizeof (uint32_t)) \
429-
+ (AMM_VIRTUAL_INFO_ELEMENT_SIZE * CFG_AMM_VIRTUAL_MEMORY_NUMBER)
432+
#define CFG_AMM_POOL_SIZE ( DIVC(CFG_MM_POOL_SIZE, sizeof (uint32_t)) \
433+
+ (AMM_VIRTUAL_INFO_ELEMENT_SIZE * CFG_AMM_VIRTUAL_MEMORY_NUMBER) )
430434

431435
/* USER CODE BEGIN MEMORY_MANAGER_Configuration */
432436

lib/stm32wba/BLE_TransparentMode/Core/Inc/app_entry.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ extern "C" {
5656
#define CFG_FW_BUILD (0)
5757
#define CFG_FW_BRANCH (0)
5858
#define CFG_FW_SUBVERSION (0)
59-
#define CFG_FW_MINOR_VERSION (4)
59+
#define CFG_FW_MINOR_VERSION (5)
6060
#define CFG_FW_MAJOR_VERSION (1)
6161

6262
/* USER CODE BEGIN EC */

lib/stm32wba/BLE_TransparentMode/Core/Inc/main.h

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,22 @@ extern "C" {
2929
/* Includes ------------------------------------------------------------------*/
3030
#include "stm32wbaxx_hal.h"
3131
#include "app_conf.h"
32-
/* #include "app_entry.h" */
32+
#include "app_entry.h"
3333
#include "app_common.h"
34-
/* #include "app_debug.h" */
34+
#include "app_debug.h"
35+
36+
#include "stm32wbaxx_ll_icache.h"
37+
#include "stm32wbaxx_ll_tim.h"
38+
#include "stm32wbaxx_ll_bus.h"
39+
#include "stm32wbaxx_ll_cortex.h"
40+
#include "stm32wbaxx_ll_rcc.h"
41+
#include "stm32wbaxx_ll_system.h"
42+
#include "stm32wbaxx_ll_utils.h"
43+
#include "stm32wbaxx_ll_pwr.h"
44+
#include "stm32wbaxx_ll_gpio.h"
45+
#include "stm32wbaxx_ll_dma.h"
46+
47+
#include "stm32wbaxx_ll_exti.h"
3548

3649
/* Private includes ----------------------------------------------------------*/
3750
/* USER CODE BEGIN Includes */

lib/stm32wba/BLE_TransparentMode/STM32_WPAN/Target/linklayer_plat.c

Lines changed: 83 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
1-
/*
2-
* Copyright (c) 2023 STMicroelectronics
3-
*
4-
* SPDX-License-Identifier: Apache-2.0
5-
*/
6-
7-
8-
1+
/* USER CODE BEGIN Header */
2+
/**
3+
******************************************************************************
4+
* @file linklayer_plat.c
5+
* @author MCD Application Team
6+
* @brief Source file for the linklayer plateform adaptation layer
7+
******************************************************************************
8+
* @attention
9+
*
10+
* Copyright (c) 2022 STMicroelectronics.
11+
* All rights reserved.
12+
*
13+
* This software is licensed under terms that can be found in the LICENSE file
14+
* in the root directory of this software component.
15+
* If no LICENSE file comes with this software, it is provided AS-IS.
16+
*
17+
******************************************************************************
18+
*/
919
/* USER CODE END Header */
1020

1121
#ifndef __ZEPHYR__
@@ -27,6 +37,8 @@
2737
#endif /* (CFG_LPM_LEVEL != 0) */
2838
/* USER CODE BEGIN Includes */
2939

40+
/* USER CODE END Includes */
41+
3042
#else
3143
#include "scm.h"
3244
#endif
@@ -104,6 +116,44 @@ void LINKLAYER_PLAT_WaitHclkRdy(void)
104116
while(HAL_RCCEx_GetRadioBusClockReadiness() != RCC_RADIO_BUS_CLOCK_READY);
105117
}
106118

119+
/**
120+
* @brief Notify the Link Layer platform layer the system will enter in WFI
121+
* and AHB5 clock may be turned of regarding the 2.4Ghz radio state.
122+
* @param None
123+
* @retval None
124+
*/
125+
void LINKLAYER_PLAT_NotifyWFIEnter(void)
126+
{
127+
/* Check if Radio state will allow the AHB5 clock to be cut */
128+
129+
/* AHB5 clock will be cut in the following cases:
130+
* - 2.4GHz radio is not in ACTIVE mode (in SLEEP or DEEPSLEEP mode).
131+
* - RADIOSMEN and STRADIOCLKON bits are at 0.
132+
*/
133+
if((LL_PWR_GetRadioMode() != LL_PWR_RADIO_ACTIVE_MODE) ||
134+
((__HAL_RCC_RADIO_IS_CLK_SLEEP_ENABLED() == 0) && (LL_RCC_RADIO_IsEnabledSleepTimerClock() == 0)))
135+
{
136+
AHB5_SwitchedOff = 1;
137+
}
138+
}
139+
140+
/**
141+
* @brief Notify the Link Layer platform layer the system exited WFI and AHB5
142+
* clock may be resynchronized as is may have been turned of during
143+
* low power mode entry.
144+
* @param None
145+
* @retval None
146+
*/
147+
void LINKLAYER_PLAT_NotifyWFIExit(void)
148+
{
149+
/* Check if AHB5 clock has been turned of and needs resynchronisation */
150+
if (AHB5_SwitchedOff)
151+
{
152+
/* Read sleep register as earlier as possible */
153+
radio_sleep_timer_val = ll_intf_cmn_get_slptmr_value();
154+
}
155+
}
156+
107157
/**
108158
* @brief Active wait on bus clock readiness.
109159
* @param None
@@ -273,9 +323,9 @@ void LINKLAYER_PLAT_EnableSpecificIRQ(uint8_t isr_type)
273323
{
274324
/* When specific counter for link layer high ISR reaches 0, interrupt is enabled */
275325
HAL_NVIC_EnableIRQ(RADIO_INTR_NUM);
276-
/* USER CODE BEGIN LINKLAYER_PLAT_EnableSpecificIRQ_1*/
326+
/* USER CODE BEGIN LINKLAYER_PLAT_EnableSpecificIRQ_1 */
277327

278-
/* USER CODE END LINKLAYER_PLAT_EnableSpecificIRQ_1*/
328+
/* USER CODE END LINKLAYER_PLAT_EnableSpecificIRQ_1 */
279329
}
280330
}
281331

@@ -318,9 +368,9 @@ void LINKLAYER_PLAT_DisableSpecificIRQ(uint8_t isr_type)
318368
prio_high_isr_counter++;
319369
if(prio_high_isr_counter == 1)
320370
{
321-
/* USER CODE BEGIN LINKLAYER_PLAT_DisableSpecificIRQ_1*/
371+
/* USER CODE BEGIN LINKLAYER_PLAT_DisableSpecificIRQ_1 */
322372

323-
/* USER CODE END LINKLAYER_PLAT_DisableSpecificIRQ_1*/
373+
/* USER CODE END LINKLAYER_PLAT_DisableSpecificIRQ_1 */
324374
/* When specific counter for link layer high ISR value is 1, interrupt is disabled */
325375
HAL_NVIC_DisableIRQ(RADIO_INTR_NUM);
326376
}
@@ -358,15 +408,15 @@ void LINKLAYER_PLAT_DisableSpecificIRQ(uint8_t isr_type)
358408
*/
359409
void LINKLAYER_PLAT_EnableRadioIT(void)
360410
{
361-
/* USER CODE BEGIN LINKLAYER_PLAT_EnableRadioIT_1*/
411+
/* USER CODE BEGIN LINKLAYER_PLAT_EnableRadioIT_1 */
362412

363-
/* USER CODE END LINKLAYER_PLAT_EnableRadioIT_1*/
413+
/* USER CODE END LINKLAYER_PLAT_EnableRadioIT_1 */
364414

365415
HAL_NVIC_EnableIRQ((IRQn_Type) RADIO_INTR_NUM);
366416

367-
/* USER CODE BEGIN LINKLAYER_PLAT_EnableRadioIT_2*/
417+
/* USER CODE BEGIN LINKLAYER_PLAT_EnableRadioIT_2 */
368418

369-
/* USER CODE END LINKLAYER_PLAT_EnableRadioIT_2*/
419+
/* USER CODE END LINKLAYER_PLAT_EnableRadioIT_2 */
370420
}
371421

372422
/**
@@ -376,15 +426,15 @@ void LINKLAYER_PLAT_EnableRadioIT(void)
376426
*/
377427
void LINKLAYER_PLAT_DisableRadioIT(void)
378428
{
379-
/* USER CODE BEGIN LINKLAYER_PLAT_DisableRadioIT_1*/
429+
/* USER CODE BEGIN LINKLAYER_PLAT_DisableRadioIT_1 */
380430

381-
/* USER CODE END LINKLAYER_PLAT_DisableRadioIT_1*/
431+
/* USER CODE END LINKLAYER_PLAT_DisableRadioIT_1 */
382432

383433
HAL_NVIC_DisableIRQ((IRQn_Type) RADIO_INTR_NUM);
384434

385-
/* USER CODE BEGIN LINKLAYER_PLAT_DisableRadioIT_2*/
435+
/* USER CODE BEGIN LINKLAYER_PLAT_DisableRadioIT_2 */
386436

387-
/* USER CODE END LINKLAYER_PLAT_DisableRadioIT_2*/
437+
/* USER CODE END LINKLAYER_PLAT_DisableRadioIT_2 */
388438
}
389439

390440
#ifndef __ZEPHYR__
@@ -473,6 +523,12 @@ void LINKLAYER_PLAT_RequestTemperature(void)
473523
*/
474524
void LINKLAYER_PLAT_EnableOSContextSwitch(void)
475525
{
526+
/* USER CODE BEGIN LINKLAYER_PLAT_EnableOSContextSwitch_0 */
527+
528+
/* USER CODE END LINKLAYER_PLAT_EnableOSContextSwitch_0 */
529+
/* USER CODE BEGIN LINKLAYER_PLAT_EnableOSContextSwitch_1 */
530+
531+
/* USER CODE END LINKLAYER_PLAT_EnableOSContextSwitch_1 */
476532
}
477533

478534
/**
@@ -482,6 +538,12 @@ void LINKLAYER_PLAT_EnableOSContextSwitch(void)
482538
*/
483539
void LINKLAYER_PLAT_DisableOSContextSwitch(void)
484540
{
541+
/* USER CODE BEGIN LINKLAYER_PLAT_DisableOSContextSwitch_0 */
542+
543+
/* USER CODE END LINKLAYER_PLAT_DisableOSContextSwitch_0 */
544+
/* USER CODE BEGIN LINKLAYER_PLAT_DisableOSContextSwitch_1 */
545+
546+
/* USER CODE END LINKLAYER_PLAT_DisableOSContextSwitch_1 */
485547
}
486548

487549
/**
@@ -515,50 +577,7 @@ uint32_t LINKLAYER_PLAT_GetUDN(void)
515577
{
516578
return LL_FLASH_GetUDN();
517579
}
518-
519-
/* USER CODE BEGIN LINKLAYER_PLAT 0 */
520-
521-
/* Radio bus clock control variables */
522-
uint8_t AHB5_SwitchedOff = 0;
523-
uint32_t radio_sleep_timer_val = 0;
524580
#endif
525-
526-
/**
527-
* @brief Notify the Link Layer platform layer the system will enter in WFI
528-
* and AHB5 clock may be turned of regarding the 2.4Ghz radio state.
529-
* @param None
530-
* @retval None
531-
*/
532-
void LINKLAYER_PLAT_NotifyWFIEnter(void)
533-
{
534-
/* Check if Radio state will allow the AHB5 clock to be cut */
535-
536-
/* AHB5 clock will be cut in the following cases:
537-
* - 2.4GHz radio is not in ACTIVE mode (in SLEEP or DEEPSLEEP mode).
538-
* - RADIOSMEN and STRADIOCLKON bits are at 0.
539-
*/
540-
if((LL_PWR_GetRadioMode() != LL_PWR_RADIO_ACTIVE_MODE) ||
541-
((__HAL_RCC_RADIO_IS_CLK_SLEEP_ENABLED() == 0) && (LL_RCC_RADIO_IsEnabledSleepTimerClock() == 0)))
542-
{
543-
AHB5_SwitchedOff = 1;
544-
}
545-
}
546-
547-
/**
548-
* @brief Notify the Link Layer platform layer the system exited WFI and AHB5
549-
* clock may be resynchronized as is may have been turned of during
550-
* low power mode entry.
551-
* @param None
552-
* @retval None
553-
*/
554-
void LINKLAYER_PLAT_NotifyWFIExit(void)
555-
{
556-
/* Check if AHB5 clock has been turned of and needs resynchronisation */
557-
if (AHB5_SwitchedOff)
558-
{
559-
/* Read sleep register as earlier as possible */
560-
radio_sleep_timer_val = ll_intf_cmn_get_slptmr_value();
561-
}
562-
}
581+
/* USER CODE BEGIN LINKLAYER_PLAT 0 */
563582

564583
/* USER CODE END LINKLAYER_PLAT 0 */

0 commit comments

Comments
 (0)