arch/nrf53: add SoftDevice support

This commit is contained in:
raiden00pl
2023-03-05 13:24:18 +01:00
committed by Alan Carvalho de Assis
parent 5fd321e54d
commit 9dc8f27dda
9 changed files with 1189 additions and 2 deletions
+1 -1
View File
@@ -68,7 +68,7 @@ config ALLOW_MIT_COMPONENTS
config ALLOW_BSDNORDIC_COMPONENTS config ALLOW_BSDNORDIC_COMPONENTS
bool "Use components that have 5-Clause Nordic licenses" bool "Use components that have 5-Clause Nordic licenses"
depends on ARCH_CHIP_NRF52 depends on ARCH_CHIP_NRF52 || ARCH_CHIP_NRF53
default n default n
---help--- ---help---
When this option is enabled the project will allow the use When this option is enabled the project will allow the use
+2
View File
@@ -0,0 +1,2 @@
sdk-nrfxlib*
*.tar.gz
+87
View File
@@ -163,3 +163,90 @@ config NRF53_SYSTIMER_SYSTICK
endchoice endchoice
endmenu # System Timer endmenu # System Timer
menuconfig NRF53_SOFTDEVICE_CONTROLLER
bool "SoftDevice Controller"
depends on ALLOW_BSDNORDIC_COMPONENTS
depends on NRF53_NETCORE
select ARMV8M_USEBASEPRI
select ARCH_RAMVECTORS
select ARCH_IRQPRIO
select CRYPTO
select CRYPTO_RANDOM_POOL
select NRF53_USE_LFCLK
---help---
This enables use of Nordic SoftDevice controller
(SDC). It is a library version of a subset of
full SoftDevice, which only includes the BLE
controller implementation.
It makes use of RTC0, TIMER0 and RADIO so
these will be unavailable for direct use by user.
It also makes use of DPPI channel range 0-13.
if NRF53_SOFTDEVICE_CONTROLLER
config NRF53_SDC_CLOCK_ACCURACY
int "Clock Accuracy [PPM]"
default 250
---help---
Select the clock accuracy depending on the chosen low-frequency clock
source
config NRF53_SDC_PERIPHERAL_COUNT
int "Number of peripheral roles to support (also central)"
default 1
---help---
This controls how many peripheral connections will be supported. It also
determines the number of central roles from the following:
CENTRAL_ROLES = CONFIG_BLUETOOTH_MAX_CONN - NRF53_SDC_PERIPHERAL_COUNT
So by choosing these two variables you can control both capabilities.
config NRF53_SDC_ADVERTISING
bool "Support advertising"
default y
config NRF53_SDC_SCANNING
bool "Support scanning"
default y
if NRF53_SDC_SCANNING
config NRF53_SDC_SCAN_BUFFER_COUNT
int "Scanning buffer count"
default 3
---help---
The minimum allowed number of buffers is 2.
endif
config NRF53_SDC_LE_2M_PHY
bool "Support LE 2M PHY"
default y
config NRF53_SDC_LE_CODED_PHY
bool "Support LE Coded PHY"
default n if ARCH_CHIP_NRF53832
default y if ARCH_CHIP_NRF53840
depends on NRF53_SDC_MULTIROLE
config NRF53_SDC_DLE
bool "Support Data Length Extension (DLE)"
default y
config NRF53_BLE_TTY_NAME
string "BLE TTY device name"
default "/dev/ttyHCI0"
depends on UART_BTH4
config NRF53_SDC_FICR_STATIC_ADDR
bool "Configure factory generated static random address"
default n
config NRF53_SDC_PUB_ADDR
hex "Configure BT public address"
default 0x0000000000
endif
+50
View File
@@ -41,3 +41,53 @@ endif
ifeq ($(CONFIG_NRF53_APPCORE),y) ifeq ($(CONFIG_NRF53_APPCORE),y)
CHIP_CSRCS += nrf53_cpunet.c CHIP_CSRCS += nrf53_cpunet.c
endif endif
ifeq ($(CONFIG_NRF53_SOFTDEVICE_CONTROLLER),y)
NRFXLIB_UNPACK := sdk-nrfxlib
NRFXLIB_VER := 2.3.0
NRFXLIB_REF := v$(NRFXLIB_VER)
NRFXLIB_TGZ := $(NRFXLIB_REF).tar.gz
NRFXLIB_URL := https://github.com/nrfconnect/sdk-nrfxlib/archive
$(NRFXLIB_TGZ):
$(Q) echo "Downloading: NRFXLIB"
$(Q) curl -L $(NRFXLIB_URL)/$(NRFXLIB_TGZ) -o chip/$(NRFXLIB_TGZ)
chip/$(NRFXLIB_UNPACK): $(NRFXLIB_TGZ)
$(Q) echo "Unpacking: NRXFLIB"
$(Q) cd chip && tar zxf $(NRFXLIB_TGZ)
$(Q) mv chip/$(NRFXLIB_UNPACK)-$(NRFXLIB_VER)* chip/$(NRFXLIB_UNPACK)
$(Q) touch chip/$(NRFXLIB_UNPACK)
ifeq ($(wildcard chip/$(NRFXLIB_UNPACK)/.git),)
context:: chip/$(NRFXLIB_UNPACK)
distclean::
$(call DELFILE, chip/$(NRFXLIB_TGZ))
$(call DELDIR, chip/$(NRFXLIB_UNPACK))
endif
CHIP_CSRCS += nrf53_sdc.c
NRFX_DIR = $(ARCH_SRCDIR)$(DELIM)chip$(DELIM)nrfx
NRFXLIB_DIR = $(ARCH_SRCDIR)$(DELIM)chip$(DELIM)sdk-nrfxlib
CMSIS_DIR = $(ARCH_SRCDIR)$(DELIM)chip$(DELIM)CMSIS_5
INCLUDES += \
$(shell $(INCDIR) "$(CC)" $(ARCH_SRCDIR)$(DELIM)chip$(DELIM)sdc) \
$(shell $(INCDIR) "$(CC)" $(NRFXLIB_DIR)$(DELIM)mpsl$(DELIM)include) \
$(shell $(INCDIR) "$(CC)" $(NRFXLIB_DIR)$(DELIM)softdevice_controller$(DELIM)include)
CFLAGS += -DNRF53_SERIES
LIB_VARIANT=soft-float
EXTRA_LIBPATHS += \
-L $(NRFXLIB_DIR)$(DELIM)mpsl$(DELIM)lib$(DELIM)cortex-m33+nodsp$(DELIM)$(LIB_VARIANT) \
-L $(NRFXLIB_DIR)$(DELIM)softdevice_controller$(DELIM)lib$(DELIM)cortex-m33+nodsp$(DELIM)$(LIB_VARIANT)
EXTRA_LIBS += -lmpsl
EXTRA_LIBS += -lsoftdevice_controller_multirole
endif
File diff suppressed because it is too large Load Diff
+65
View File
@@ -0,0 +1,65 @@
/****************************************************************************
* arch/arm/src/nrf53/nrf53_sdc.h
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
#ifndef __ARCH_ARM_SRC_NRF53_NRF53_SDC_H
#define __ARCH_ARM_SRC_NRF53_NRF53_SDC_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Public Types
****************************************************************************/
/****************************************************************************
* Public Data
****************************************************************************/
#ifdef __cplusplus
#define EXTERN extern "C"
extern "C"
{
#else
#define EXTERN extern
#endif
/****************************************************************************
* Inline Functions
****************************************************************************/
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
int nrf53_sdc_initialize(void);
#undef EXTERN
#ifdef __cplusplus
}
#endif
#endif /* __ARCH_ARM_SRC_NRF53_NRF53_SDC_H */
+2
View File
@@ -0,0 +1,2 @@
This directory holds stub files for building Nordic SoftDevice Controller without having to pull
NRFX and CMSIS just to have a few definitions.
+30
View File
@@ -0,0 +1,30 @@
/****************************************************************************
* arch/arm/src/nrf53/sdc/nrf.h
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
#ifndef __ARCH_ARM_SRC_NRF53_SDC_NRF_H
#define __ARCH_ARM_SRC_NRF53_SDC_NRF_H
/****************************************************************************
* Public Types
****************************************************************************/
typedef int IRQn_Type;
#endif /* __ARCH_ARM_SRC_NRF53_SDC_NRF_H */
+30
View File
@@ -0,0 +1,30 @@
/****************************************************************************
* arch/arm/src/nrf53/sdc/nrf_peripherals.h
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
#ifndef __ARCH_ARM_SRC_NRF53_SDC_NRF_PERIPHERALS_H
#define __ARCH_ARM_SRC_NRF53_SDC_NRF_PERIPHERALS_H
/****************************************************************************
* Public Definitions
****************************************************************************/
#define DPPIC_PRESENT 1
#endif /* __ARCH_ARM_SRC_NRF53_SDC_NRF_PERIPHERALS_H */