Skip to content

Commit 4b4bba4

Browse files
asm5878henrikbrixandersen
authored andcommitted
soc: st: stm32: stm32wbax: STM32WBA Cube 1.4.1 integration
Removed unnecessary pure HAL stm32 functions Headers cleanup Signed-off-by: Alessandro Manganaro <[email protected]>
1 parent 13f1200 commit 4b4bba4

File tree

4 files changed

+4
-80
lines changed

4 files changed

+4
-80
lines changed

soc/st/stm32/stm32wbax/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@ config SOC_SERIES_STM32WBAX
1414
select CPU_CORTEX_M_HAS_DWT
1515
select HAS_STM32CUBE
1616
select USE_STM32_HAL_PWR_EX
17+
select USE_STM32_HAL_CORTEX
1718
select HAS_PM
1819
select SOC_EARLY_INIT_HOOK

soc/st/stm32/stm32wbax/hci_if/linklayer_plat_adapt.c

Lines changed: 1 addition & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,14 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7-
#include <zephyr/irq.h>
87
#include <zephyr/kernel.h>
9-
#include <zephyr/arch/cpu.h>
10-
#include <zephyr/sys/util.h>
118
#include <zephyr/drivers/entropy.h>
129
#include <zephyr/logging/log.h>
13-
#include <cmsis_core.h>
14-
15-
#include <linklayer_plat_local.h>
16-
17-
#include <stm32_ll_pwr.h>
1810

1911
#include "scm.h"
2012

2113
#define LOG_LEVEL CONFIG_SOC_LOG_LEVEL
22-
LOG_MODULE_REGISTER(linklayer_plat);
14+
LOG_MODULE_REGISTER(linklayer_plat_adapt);
2315

2416
#define RADIO_INTR_PRIO_HIGH_Z (RADIO_INTR_PRIO_HIGH + _IRQ_PRIO_OFFSET)
2517
#define RADIO_INTR_PRIO_LOW_Z (RADIO_INTR_PRIO_LOW + _IRQ_PRIO_OFFSET)
@@ -36,52 +28,17 @@ extern const struct device *rng_dev;
3628
volatile int32_t prio_high_isr_counter;
3729
volatile int32_t prio_low_isr_counter;
3830
volatile int32_t prio_sys_isr_counter;
39-
volatile int32_t irq_counter;
4031
volatile uint32_t local_basepri_value;
4132

4233
/* Radio SW low ISR global variable */
4334
volatile uint8_t radio_sw_low_isr_is_running_high_prio;
4435

45-
void LINKLAYER_PLAT_ClockInit(void)
46-
{
47-
LL_PWR_EnableBkUpAccess();
48-
49-
/* Select LSE as Sleep CLK */
50-
__HAL_RCC_RADIOSLPTIM_CONFIG(RCC_RADIOSTCLKSOURCE_LSE);
51-
52-
LL_PWR_DisableBkUpAccess();
53-
54-
/* Enable AHB5ENR peripheral clock (bus CLK) */
55-
__HAL_RCC_RADIO_CLK_ENABLE();
56-
}
5736

5837
void LINKLAYER_PLAT_DelayUs(uint32_t delay)
5938
{
6039
k_busy_wait(delay);
6140
}
6241

63-
void LINKLAYER_PLAT_WaitHclkRdy(void)
64-
{
65-
while (HAL_RCCEx_GetRadioBusClockReadiness() != RCC_RADIO_BUS_CLOCK_READY) {
66-
}
67-
}
68-
69-
void LINKLAYER_PLAT_AclkCtrl(uint8_t enable)
70-
{
71-
LOG_DBG("enable: %d", enable);
72-
if (enable) {
73-
/* Enable RADIO baseband clock (active CLK) */
74-
HAL_RCCEx_EnableRadioBBClock();
75-
76-
/* Polling on HSE32 activation */
77-
while (LL_RCC_HSE_IsReady() == 0) {
78-
}
79-
} else {
80-
/* Disable RADIO baseband clock (active CLK) */
81-
HAL_RCCEx_DisableRadioBBClock();
82-
}
83-
}
84-
8542
void LINKLAYER_PLAT_GetRNG(uint8_t *ptr_rnd, uint32_t len)
8643
{
8744
int ret;
@@ -191,22 +148,6 @@ void LINKLAYER_PLAT_TriggerSwLowIT(uint8_t priority)
191148
NVIC_SetPendingIRQ((IRQn_Type)RADIO_SW_LOW_INTR_NUM);
192149
}
193150

194-
void LINKLAYER_PLAT_EnableIRQ(void)
195-
{
196-
irq_counter = MAX(0, irq_counter - 1);
197-
198-
if (irq_counter == 0) {
199-
__enable_irq();
200-
}
201-
}
202-
203-
void LINKLAYER_PLAT_DisableIRQ(void)
204-
{
205-
__disable_irq();
206-
207-
irq_counter++;
208-
}
209-
210151
void LINKLAYER_PLAT_Assert(uint8_t condition)
211152
{
212153
__ASSERT_NO_MSG(condition);
@@ -267,16 +208,6 @@ void LINKLAYER_PLAT_DisableSpecificIRQ(uint8_t isr_type)
267208
}
268209
}
269210

270-
void LINKLAYER_PLAT_EnableRadioIT(void)
271-
{
272-
irq_enable((IRQn_Type)RADIO_INTR_NUM);
273-
}
274-
275-
void LINKLAYER_PLAT_DisableRadioIT(void)
276-
{
277-
irq_disable((IRQn_Type)RADIO_INTR_NUM);
278-
}
279-
280211
void LINKLAYER_PLAT_StartRadioEvt(void)
281212
{
282213
__HAL_RCC_RADIO_CLK_SLEEP_ENABLE();

soc/st/stm32/stm32wbax/hci_if/ll_sys_if_adapt.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,9 @@
88

99
#include <zephyr/logging/log.h>
1010
#define LOG_LEVEL CONFIG_SOC_LOG_LEVEL
11-
LOG_MODULE_REGISTER(ll_sys_if);
11+
LOG_MODULE_REGISTER(ll_sys_if_adapt);
1212

13-
#include "ll_intf.h"
1413
#include "ll_sys.h"
15-
#include "linklayer_plat.h"
16-
#include "app_conf.h"
1714

1815
extern struct k_mutex ble_ctlr_stack_mutex;
1916
extern struct k_work_q ll_work_q;
@@ -40,8 +37,3 @@ void ll_sys_bg_process_init(void)
4037
{
4138
k_work_init(&ll_sys_work, &ll_sys_bg_process_handler);
4239
}
43-
44-
void ll_sys_config_params(void)
45-
{
46-
ll_intf_config_ll_ctx_params(USE_RADIO_LOW_ISR, NEXT_EVENT_SCHEDULING_FROM_ISR);
47-
}

west.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ manifest:
233233
groups:
234234
- hal
235235
- name: hal_stm32
236-
revision: 6f0e5f70cb540c487e3e3678af2e95d0937f9863
236+
revision: 019d8255333f96bdd47d26b44049bd3e7af8ef55
237237
path: modules/hal/stm32
238238
groups:
239239
- hal

0 commit comments

Comments
 (0)