Skip to content

Commit

Permalink
Merge pull request #18029 from haukepetersen/verbump_nimble_nrfx2022
Browse files Browse the repository at this point in the history
pkg/nimble: version bump to NimBLE 1.5.0 RC1
  • Loading branch information
fjmolinas authored Jun 10, 2022
2 parents f4691db + 9be4316 commit e5c7e3b
Show file tree
Hide file tree
Showing 20 changed files with 619 additions and 49 deletions.
2 changes: 1 addition & 1 deletion cpu/nrf51/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#include "cpu.h"
#include "nrf_clock.h"
#include "nrfx.h"
#include "nrfx_riot.h"
#include "periph_conf.h"
#include "periph/init.h"
#include "stdio_base.h"
Expand Down
6 changes: 1 addition & 5 deletions cpu/nrf51/include/cpu_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "cpu_conf_common.h"
#include "vendor/nrf51.h"
#include "vendor/nrf51_bitfields.h"
#include "vendor/nrf51822_peripherals.h"

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -57,11 +58,6 @@ extern "C" {
#define FLASHPAGE_WRITE_BLOCK_ALIGNMENT (4U)
/** @} */

/**
* @brief nRF51 only has one GPIO block
*/
#define GPIO_COUNT (1U)

/**
* @brief Due to RAM restrictions, we need to limit the default GNRC packet
* buffer size on these CPUs
Expand Down
171 changes: 171 additions & 0 deletions cpu/nrf51/include/vendor/nrf51822_peripherals.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
/*
Copyright (c) 2010 - 2021, Nordic Semiconductor ASA All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of Nordic Semiconductor ASA nor the names of its
contributors may be used to endorse or promote products derived from this
software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/


/* This file is deprecated */
#ifndef _NRF51822_PERIPHERALS_H
#define _NRF51822_PERIPHERALS_H


/* Clock Peripheral */
#define CLOCK_PRESENT
#define CLOCK_COUNT 1

/* Power Peripheral */
#define POWER_PRESENT
#define POWER_COUNT 1

#define POWER_FEATURE_RAMON_REGISTERS_PRESENT

/* Non-Volatile Memory Controller */
#define NVMC_PRESENT
#define NVMC_COUNT 1

/* Software Interrupts */
#define SWI_PRESENT
#define SWI_COUNT 6

/* GPIO */
#define GPIO_PRESENT
#define GPIO_COUNT 1

#define P0_PIN_NUM 32

#define P0_FEATURE_PINS_PRESENT 0xFFFFFFFFUL

/* MPU and BPROT */
#define BPROT_PRESENT

#define BPROT_REGIONS_SIZE 4096
#define BPROT_REGIONS_NUM 64

/* Radio */
#define RADIO_PRESENT
#define RADIO_COUNT 1

#define RADIO_TXPOWER_TXPOWER_Max RADIO_TXPOWER_TXPOWER_Pos4dBm

/* Accelerated Address Resolver */
#define AAR_PRESENT
#define AAR_COUNT 1

#define AAR_MAX_IRK_NUM 8

/* AES Electronic CodeBook mode encryption */
#define ECB_PRESENT
#define ECB_COUNT 1

/* AES CCM mode encryption */
#define CCM_PRESENT
#define CCM_COUNT 1

/* Peripheral to Peripheral Interconnect */
#define PPI_PRESENT
#define PPI_COUNT 1

#define PPI_CH_NUM 16
#define PPI_FIXED_CH_NUM 12
#define PPI_GROUP_NUM 4

/* Timer/Counter */
#define TIMER_PRESENT
#define TIMER_COUNT 3

#define TIMER0_MAX_SIZE 32
#define TIMER1_MAX_SIZE 16
#define TIMER2_MAX_SIZE 16

#define TIMER0_CC_NUM 4
#define TIMER1_CC_NUM 4
#define TIMER2_CC_NUM 4

/* Real Time Counter */
#define RTC_PRESENT
#define RTC_COUNT 2

#define RTC0_CC_NUM 3
#define RTC1_CC_NUM 4

/* RNG */
#define RNG_PRESENT
#define RNG_COUNT 1

/* Watchdog Timer */
#define WDT_PRESENT
#define WDT_COUNT 1

/* Temperature Sensor */
#define TEMP_PRESENT
#define TEMP_COUNT 1

/* Serial Peripheral Interface Master */
#define SPI_PRESENT
#define SPI_COUNT 2

/* Serial Peripheral Interface Slave with DMA */
#define SPIS_PRESENT
#define SPIS_COUNT 1

#define SPIS1_EASYDMA_MAXCNT_SIZE 8

/* Two Wire Interface Master */
#define TWI_PRESENT
#define TWI_COUNT 2

/* Universal Asynchronous Receiver-Transmitter */
#define UART_PRESENT
#define UART_COUNT 1

/* Quadrature Decoder */
#define QDEC_PRESENT
#define QDEC_COUNT 1

/* Analog to Digital Converter */
#define ADC_PRESENT
#define ADC_COUNT 1

/* GPIO Tasks and Events */
#define GPIOTE_PRESENT
#define GPIOTE_COUNT 1

#define GPIOTE_CH_NUM 4

/* Low Power Comparator */
#define LPCOMP_PRESENT
#define LPCOMP_COUNT 1

#define LPCOMP_REFSEL_RESOLUTION 8


#endif // _NRF51822_PERIPHERALS_H
2 changes: 1 addition & 1 deletion cpu/nrf52/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#define DONT_OVERRIDE_NVIC

#include "cpu.h"
#include "nrfx.h"
#include "nrfx_riot.h"
#include "nrf_clock.h"
#include "periph_conf.h"
#include "periph/init.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
* @author Koen Zandberg <koen@bergzand.net>
*/

#ifndef NRFX_H
#define NRFX_H
#ifndef NRFX_RIOT_H
#define NRFX_RIOT_H

#include "kernel_defines.h"
#include "cpu_conf.h"
Expand Down Expand Up @@ -63,5 +63,5 @@ static inline void nrfx_dcdc_init(void)
}
#endif

#endif /* NRFX_H */
#endif /* NRFX_RIOT_H */
/** @} */
1 change: 1 addition & 0 deletions makefiles/pseudomodules.inc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ PSEUDOMODULES += nimble_phy_2mbit
PSEUDOMODULES += nimble_rpble_ext
PSEUDOMODULES += nimble_statconn_ext
PSEUDOMODULES += nimble_autoadv_shell
PSEUDOMODULES += nrfx
PSEUDOMODULES += newlib
PSEUDOMODULES += newlib_gnu_source
PSEUDOMODULES += newlib_nano
Expand Down
1 change: 1 addition & 0 deletions pkg/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ rsource "mynewt-core/Kconfig"
rsource "nanocbor/Kconfig"
rsource "nanopb/Kconfig"
rsource "nanors/Kconfig"
rsource "nrfx/Kconfig"
rsource "qcbor/Kconfig"
rsource "qdsa/Kconfig"
rsource "qr-code-generator/Kconfig"
Expand Down
1 change: 1 addition & 0 deletions pkg/mynewt-core/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,6 @@ config MODULE_MYNEWT-CORE_UTIL

config MODULE_MYNEWT-CORE_NRF5X_HAL
bool "mynewt-core nrf52 and nrf51 timer hal"
select PACKAGE_NRFX

endif # PACKAGE_MYNEWT-CORE
4 changes: 4 additions & 0 deletions pkg/mynewt-core/Makefile.dep
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,9 @@ USEMODULE += mynewt-core

DEFAULT_MODULE += auto_init_mynewt-core

ifneq (,$(filter mynewt-core_nrf5x_hal,$(USEMODULE)))
USEPKG += nrfx
endif

# esp frequency is not pow2 so is incompatible with os_cputime
FEATURES_BLACKLIST += arch_esp
9 changes: 5 additions & 4 deletions pkg/nimble/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PKG_NAME = nimble
PKG_URL = https://github.com/apache/mynewt-nimble.git
PKG_VERSION = bc142016bdef082ba7997aea09aec1c1e4db0104
PKG_VERSION = 719bd3c435b728f07ce7aaffaf6cebbd9c659a46
PKG_LICENSE = Apache-2.0

include $(RIOTBASE)/pkg/pkg.mk
Expand Down Expand Up @@ -40,6 +40,10 @@ nimble_porting_nimble:
nimble_npl_riot:
$(QQ)"$(MAKE)" -C $(PDIR)/porting/npl/riot/src/ -f $(RIOTBASE)/Makefile.base MODULE=$@

# generic modules
nimble_transport:
$(QQ)"$(MAKE)" -C $(PDIR)/nimble/transport/src/ -f $(RIOTBASE)/Makefile.base MODULE=$@

# host modules
nimble_host:
$(QQ)"$(MAKE)" -C $(PDIR)/nimble/host/src/ -f $(TDIR)/nimble.host.mk
Expand All @@ -61,9 +65,6 @@ nimble_svc_ipss:
$(QQ)"$(MAKE)" -C $(PDIR)/nimble/host/services/ipss/src/ -f $(RIOTBASE)/Makefile.base MODULE=$@

# controller specific modules
nimble_transport_ram:
$(QQ)"$(MAKE)" -C $(PDIR)/nimble/transport/ram/src/ -f $(RIOTBASE)/Makefile.base MODULE=$@

nimble_controller:
$(QQ)"$(MAKE)" -C $(PDIR)/nimble/controller/src/ -f $(RIOTBASE)/Makefile.base MODULE=$@

Expand Down
6 changes: 5 additions & 1 deletion pkg/nimble/Makefile.dep
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ USEMODULE += sema
USEMODULE += event_callback
USEMODULE += ztimer_msec

USEPKG += nrfx

# Requires nimble feature
FEATURES_REQUIRED += ble_nimble

Expand All @@ -12,6 +14,9 @@ USEMODULE += nimble_riot_contrib
# RIOT port
USEMODULE += nimble_porting_nimble

# Generic modules used by host and controller
USEMODULE += nimble_transport

# Pull in dependencies based on used features
ifneq (,$(filter ble_phy_coded,$(FEATURES_USED)))
USEMODULE += nimble_phy_coded
Expand Down Expand Up @@ -50,7 +55,6 @@ endif

# nimble controller dependencies
ifneq (,$(filter nimble_controller,$(USEMODULE)))
USEMODULE += nimble_transport_ram
ifneq (,$(filter nrf5%,$(CPU_FAM)))
USEMODULE += nimble_drivers_nrf5x
endif
Expand Down
10 changes: 7 additions & 3 deletions pkg/nimble/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ ifneq (,$(filter nimble_host_util,$(USEMODULE)))
endif

# include transport headers
ifneq (,$(filter nimble_transport_ram,$(USEMODULE)))
INCLUDES += $(NIMIBASE)/nimble/transport/ram/include
endif
INCLUDES += $(NIMIBASE)/nimble/transport/include

# include services
ifneq (,$(filter nimble_svc_ans,$(USEMODULE)))
Expand Down Expand Up @@ -96,6 +94,8 @@ ifneq (,$(filter nimble_autoconn,$(USEMODULE)))
endif

ifneq (,$(filter nimble_adv_ext,$(USEMODULE)))
# extended advertising HCI events can be up to 257 bytes
CFLAGS += -DMYNEWT_VAL_BLE_TRANSPORT_EVT_SIZE=257
CFLAGS += -DMYNEWT_VAL_BLE_EXT_ADV=1
CFLAGS += -DMYNEWT_VAL_BLE_LL_EXT_ADV_AUX_PTR_CNT=2
CFLAGS += -DMYNEWT_VAL_BLE_LL_SCAN_AUX_SEGMENT_CNT=1
Expand All @@ -112,6 +112,10 @@ ifneq (,$(filter nimble_adv_ext,$(USEMODULE)))
ifneq (-1,$(BLE_MULTI_ADV_INSTANCES))
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
endif

ifneq (,$(filter nimble_netif,$(USEMODULE)))
Expand Down
31 changes: 0 additions & 31 deletions pkg/nimble/patches/0001-porting-nimble-silence-Wcast-align.patch

This file was deleted.

10 changes: 10 additions & 0 deletions pkg/nrfx/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright (c) 2022 Freie Universität Berlin
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
#

config PACKAGE_NRFX
bool "Nordic nrfx HAL"
depends on TEST_KCONFIG
8 changes: 8 additions & 0 deletions pkg/nrfx/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
PKG_NAME=nrfx
PKG_URL=https://github.com/NordicSemiconductor/nrfx
PKG_VERSION=3521c97df0b9549daecf867fb588f62819c317b4 # Release 2.7.0
PKG_LICENSE=BSD-3-Clause

include $(RIOTBASE)/pkg/pkg.mk

all:
Loading

0 comments on commit e5c7e3b

Please sign in to comment.