Skip to content
Merged
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
6 changes: 4 additions & 2 deletions drivers/bluetooth/hci/hci_stm32wba.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ static K_SEM_DEFINE(hci_sem, 1, 1);
+ CFG_BLE_MBLOCK_COUNT_MARGIN)

#define BLE_DYN_ALLOC_SIZE \
(BLE_TOTAL_BUFFER_SIZE(CFG_BLE_NUM_LINK, MBLOCK_COUNT))
(BLE_TOTAL_BUFFER_SIZE(CFG_BLE_NUM_LINK, \
MBLOCK_COUNT, \
(CFG_BLE_EATT_BEARER_PER_LINK * CFG_BLE_NUM_LINK)))

/* GATT buffer size (in bytes)*/
#define BLE_GATT_BUF_SIZE \
Expand Down Expand Up @@ -376,7 +378,7 @@ uint8_t BLECB_Indication(const uint8_t *data, uint16_t length,

k_sem_take(&hci_sem, K_FOREVER);

err = receive_data(dev, data, (size_t)length - 1,
err = receive_data(dev, data, (size_t)length,
ext_data, (size_t)ext_length);

k_sem_give(&hci_sem);
Expand Down
21 changes: 17 additions & 4 deletions drivers/ieee802154/ieee802154_stm32wba.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#if defined(CONFIG_NET_L2_OPENTHREAD)
#include <zephyr/net/openthread.h>
#include <zephyr/net/ieee802154_radio_openthread.h>
#endif
#endif /* CONFIG_NET_L2_OPENTHREAD */

#ifdef CONFIG_PM_DEVICE
#include <zephyr/pm/policy.h>
Expand Down Expand Up @@ -136,7 +136,7 @@ static void stm32wba_802154_rx_thread(void *arg1, void *arg2, void *arg3)

#if defined(CONFIG_NET_L2_OPENTHREAD)
net_pkt_set_ieee802154_ack_seb(pkt, rx_frame->ack_seb);
#endif
#endif /* CONFIG_NET_L2_OPENTHREAD */

if (net_recv_data(stm32wba_radio->iface, pkt) < 0) {
LOG_ERR("Packet dropped by NET stack");
Expand Down Expand Up @@ -650,11 +650,19 @@ static int stm32wba_802154_driver_init(const struct device *dev)
k_fifo_init(&stm32wba_802154_data.rx_fifo);
k_sem_init(&stm32wba_802154_data.tx_wait, 0, 1);
k_sem_init(&stm32wba_802154_data.cca_wait, 0, 1);

#if defined(CONFIG_NET_L2_OPENTHREAD)
stm32wba_802154_ral_set_config_lib_params(1, 0);
#else
stm32wba_802154_ral_set_config_lib_params(0, 1);
#endif /* CONFIG_NET_L2_OPENTHREAD */
stm32wba_802154_ral_init();
stm32wba_802154_ral_promiscuous_set(false);

#if !defined(CONFIG_NET_L2_CUSTOM_IEEE802154_STM32WBA) && !defined(CONFIG_NET_L2_OPENTHREAD)
stm32wba_802154_data.rx_on_when_idle = true;
#else
stm32wba_802154_data.rx_on_when_idle = false;
#endif /* CONFIG_NET_L2_CUSTOM_IEEE802154_STM32WBA && CONFIG_NET_L2_OPENTHREAD */
stm32wba_802154_ral_set_continuous_reception(stm32wba_802154_data.rx_on_when_idle);

k_thread_create(&stm32wba_802154_data.rx_thread, stm32wba_802154_data.rx_stack,
CONFIG_IEEE802154_STM32WBA_RX_STACK_SIZE,
Expand Down Expand Up @@ -851,6 +859,11 @@ static int stm32wba_802154_configure(const struct device *dev,
stm32wba_802154_data.event_handler = config->event_handler;
break;

case IEEE802154_CONFIG_RX_ON_WHEN_IDLE:
stm32wba_802154_data.rx_on_when_idle = config->rx_on_when_idle;
stm32wba_802154_ral_set_continuous_reception(config->rx_on_when_idle);
break;

default:
#if defined(CONFIG_NET_L2_CUSTOM_IEEE802154)
ret = stm32wba_802154_configure_extended(
Expand Down
2 changes: 1 addition & 1 deletion west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ manifest:
groups:
- hal
- name: hal_stm32
revision: ec75ca23c6610c26ecc91250c2585c7ccf31f51e
revision: 5d27023564c9fbd9bb3aa51b0529ac3d2cf18134
path: modules/hal/stm32
groups:
- hal
Expand Down
Loading