Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkg/nimble: Update to 1.8.0 #21108

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
26 changes: 13 additions & 13 deletions cpu/esp32/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,19 @@ ifeq (xtensa,$(CPU_ARCH))
FEATURES_PROVIDED += esp_hw_counter
endif

ifeq (esp32,$(CPU_FAM))
FEATURES_PROVIDED += ble_nimble
FEATURES_PROVIDED += ble_nimble_netif
FEATURES_PROVIDED += esp_ble
FEATURES_PROVIDED += esp_ble_esp32
else ifneq (,$(filter esp32c3 esp32s3,$(CPU_FAM)))
FEATURES_PROVIDED += ble_adv_ext
FEATURES_PROVIDED += ble_nimble
FEATURES_PROVIDED += ble_nimble_netif
FEATURES_PROVIDED += ble_phy_2mbit
FEATURES_PROVIDED += esp_ble
FEATURES_PROVIDED += esp_ble_esp32c3
endif
# ifeq (esp32,$(CPU_FAM))
# FEATURES_PROVIDED += ble_nimble
# FEATURES_PROVIDED += ble_nimble_netif
# FEATURES_PROVIDED += esp_ble
# FEATURES_PROVIDED += esp_ble_esp32
# else ifneq (,$(filter esp32c3 esp32s3,$(CPU_FAM)))
# FEATURES_PROVIDED += ble_adv_ext
# FEATURES_PROVIDED += ble_nimble
# FEATURES_PROVIDED += ble_nimble_netif
# FEATURES_PROVIDED += ble_phy_2mbit
# FEATURES_PROVIDED += esp_ble
# FEATURES_PROVIDED += esp_ble_esp32c3
# endif

ifneq (,$(filter esp32 esp32s3,$(CPU_FAM)))
FEATURES_PROVIDED += periph_sdmmc_auto_clk
Expand Down
8 changes: 6 additions & 2 deletions pkg/nimble/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
PKG_NAME = nimble
PKG_URL = https://github.com/apache/mynewt-nimble.git
PKG_VERSION = 719bd3c435b728f07ce7aaffaf6cebbd9c659a46
# tag: nimble_1_8_0_tag
PKG_VERSION = ca67e3015eec30eb97c853112441082d709e43ba
PKG_LICENSE = Apache-2.0

include $(RIOTBASE)/pkg/pkg.mk
Expand Down Expand Up @@ -76,7 +77,10 @@ nimble_controller:
$(QQ)"$(MAKE)" -C $(PDIR)/nimble/controller/src/ -f $(RIOTBASE)/Makefile.base MODULE=$@

nimble_drivers_nrf5x:
$(QQ)"$(MAKE)" -C $(PDIR)/nimble/drivers/$(CPU_FAM)/src/ -f $(RIOTBASE)/Makefile.base MODULE=$@
$(QQ)"$(MAKE)" -C $(PDIR)/nimble/drivers/nrf5x/src/ -f $(RIOTBASE)/Makefile.base MODULE=$@

nimble_drivers_nrf5x_specific:
$(QQ)"$(MAKE)" -C $(PDIR)/nimble/drivers/nrf5x/src/$(CPU_FAM)/ -f $(RIOTBASE)/Makefile.base MODULE=$@

# additional, RIOT specific nimble modules
nimble_addr:
Expand Down
3 changes: 2 additions & 1 deletion pkg/nimble/Makefile.dep
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ endif
ifeq (,$(filter nimble_host nimble_controller,$(USEMODULE)))
USEMODULE += nimble_host
USEMODULE += nimble_controller
USEMODULE += random
endif

# include host dependencies
Expand All @@ -54,7 +55,7 @@ endif
# nimble controller dependencies
ifneq (,$(filter nimble_controller,$(USEMODULE)))
ifneq (,$(filter nrf51 nrf52,$(CPU_FAM)))
USEMODULE += nimble_drivers_nrf5x
USEMODULE += nimble_drivers_nrf5x nimble_drivers_nrf5x_specific
endif
endif

Expand Down
10 changes: 6 additions & 4 deletions pkg/nimble/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,17 @@ ifneq (,$(filter nimble_controller,$(USEMODULE)))
CFLAGS += -DMYNEWT_VAL_OS_CPUTIME_FREQ=32768
endif
ifneq (,$(filter nimble_drivers_nrf5x,$(USEMODULE)))
INCLUDES += $(NIMIBASE)/nimble/drivers/$(CPU_FAM)/include
INCLUDES += $(NIMIBASE)/nimble/drivers/nrf5x/include -I$(PKGDIRBASE)/nrfx/hal/
endif

# Enable additional PHY modes if requested by the build
ifneq (,$(filter ble_phy_2mbit,$(FEATURES_USED)))
CFLAGS += -DMYNEWT_VAL_BLE_LL_CFG_FEAT_LE_2M_PHY=1
CFLAGS += -DMYNEWT_VAL_BLE_LL_PHY=1
endif
ifneq (,$(filter ble_phy_coded,$(FEATURES_USED)))
CFLAGS += -DMYNEWT_VAL_BLE_LL_CFG_FEAT_LE_CODED_PHY=1
CFLAGS += -DMYNEWT_VAL_BLE_LL_PHY=1
endif
endif

Expand Down Expand Up @@ -118,9 +120,9 @@ ifneq (,$(filter nimble_adv_ext,$(USEMODULE)))
CFLAGS += -DMYNEWT_VAL_BLE_MULTI_ADV_INSTANCES=$(BLE_MULTI_ADV_INSTANCES)
endif
else
# when only using non-extended advertisements the maximum HCI event size is
# 45 bytes
CFLAGS += -DMYNEWT_VAL_BLE_TRANSPORT_EVT_SIZE=45
# Messages of size 70 were observed starting between 1.5.0 and 1.8.0; this is
# consistent with syscfg.h values in nimble.
CFLAGS += -DMYNEWT_VAL_BLE_TRANSPORT_EVT_SIZE=70
endif

ifneq (,$(filter nimble_netif,$(USEMODULE)))
Expand Down
26 changes: 26 additions & 0 deletions pkg/nimble/patches/0002-include.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
From 734dc3dece986b63078bd133d6eec69cae7d6a0b Mon Sep 17 00:00:00 2001
From: chrysn <[email protected]>
Date: Tue, 24 Dec 2024 02:53:56 +0100
Subject: [PATCH] porting: Add missing include

Forwarded: https://github.com/apache/mynewt-nimble/pull/1950

---
porting/npl/riot/include/nimble/nimble_npl_os_log.h | 1 +
1 file changed, 1 insertion(+)

diff --git a/porting/npl/riot/include/nimble/nimble_npl_os_log.h b/porting/npl/riot/include/nimble/nimble_npl_os_log.h
index 5fcce6ae..24315a21 100644
--- a/porting/npl/riot/include/nimble/nimble_npl_os_log.h
+++ b/porting/npl/riot/include/nimble/nimble_npl_os_log.h
@@ -21,6 +21,7 @@
#define _NIMBLE_NPL_OS_LOG_H_

#include <stdarg.h>
+#include <stdio.h>

/* Example on how to use macro to generate module logging functions */
#define BLE_NPL_LOG_IMPL(lvl) \
--
2.45.2

32 changes: 32 additions & 0 deletions pkg/nimble/patches/0003-dead-code.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
From 65cd7b07c186d8084606271d30d5f5419c5a1f11 Mon Sep 17 00:00:00 2001
From: chrysn <[email protected]>
Date: Tue, 24 Dec 2024 02:55:20 +0100
Subject: [PATCH] nimble: Fix dead code warning

---
nimble/transport/src/rx_task.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/nimble/transport/src/rx_task.c b/nimble/transport/src/rx_task.c
index 4e7d7196..957ab790 100644
--- a/nimble/transport/src/rx_task.c
+++ b/nimble/transport/src/rx_task.c
@@ -45,6 +45,7 @@ rx_event_func(struct ble_npl_event *ev)
rx_func(rx_func_arg);
}

+#ifdef MYNEWT
static void
rx_task_func(void *arg)
{
@@ -57,6 +58,7 @@ rx_task_func(void *arg)
ble_npl_event_run(ev);
}
}
+#endif

void
ble_transport_rx_register(ble_transport_rx_func_t *func, void *arg)
--
2.45.2

Loading
Loading