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

IEEE802.15.4 support for nrf52 #11617

Merged
merged 4 commits into from
Feb 18, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
arch/arm/src/nrf52/CMakeLists.txt: format file
  • Loading branch information
raiden00pl committed Feb 18, 2024
commit 16a12f18da1af70f77a065ad41f9412d91475562
127 changes: 65 additions & 62 deletions arch/arm/src/nrf52/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
############################################################################
# ##############################################################################
# arch/arm/src/nrf52/CMakeLists.txt
xiaoxiang781216 marked this conversation as resolved.
Show resolved Hide resolved
#
# 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
# 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:https://www.apache.org/licenses/LICENSE-2.0
# http:https://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.
# License for the specific language governing permissions and limitations under
# the License.
#
############################################################################
# ##############################################################################

xiaoxiang781216 marked this conversation as resolved.
Show resolved Hide resolved
set(SRCS
nrf52_start.c
Expand Down Expand Up @@ -144,65 +144,68 @@ endif()

if(CONFIG_NRF52_SOFTDEVICE_CONTROLLER)

set(NRFXLIB_VER "2.3.0")
set(NRFXLIB_URL "https://github.com/nrfconnect/sdk-nrfxlib/archive")

if(NOT EXISTS ${CMAKE_CURRENT_LIST_DIR}/sdk-nrfxlib)
FetchContent_Declare(
sdk-nrfxlib
DOWNLOAD_NAME "sdk-nrfxlib-v${NRFXLIB_VER}.tar.gz"
DOWNLOAD_DIR ${CMAKE_CURRENT_LIST_DIR}
URL "${NRFXLIB_URL}/v${NRFXLIB_VER}.tar.gz"
SOURCE_DIR
${CMAKE_CURRENT_LIST_DIR}/sdk-nrfxlib
BINARY_DIR
${CMAKE_BINARY_DIR}/arch/sdk-nrfxlib
CONFIGURE_COMMAND
""
BUILD_COMMAND
""
INSTALL_COMMAND
""
TEST_COMMAND
""
DOWNLOAD_NO_PROGRESS true
TIMEOUT 30)

FetchContent_GetProperties(sdk-nrfxlib)

if(NOT sdk-nrfxlib_POPULATED)
FetchContent_Populate(sdk-nrfxlib)
set(NRFXLIB_VER "2.3.0")
set(NRFXLIB_URL "https://github.com/nrfconnect/sdk-nrfxlib/archive")

if(NOT EXISTS ${CMAKE_CURRENT_LIST_DIR}/sdk-nrfxlib)
FetchContent_Declare(
sdk-nrfxlib
DOWNLOAD_NAME "sdk-nrfxlib-v${NRFXLIB_VER}.tar.gz"
DOWNLOAD_DIR ${CMAKE_CURRENT_LIST_DIR}
URL "${NRFXLIB_URL}/v${NRFXLIB_VER}.tar.gz"
SOURCE_DIR
${CMAKE_CURRENT_LIST_DIR}/sdk-nrfxlib
BINARY_DIR
${CMAKE_BINARY_DIR}/arch/sdk-nrfxlib
CONFIGURE_COMMAND
""
BUILD_COMMAND
""
INSTALL_COMMAND
""
TEST_COMMAND
""
DOWNLOAD_NO_PROGRESS true
TIMEOUT 30)

FetchContent_GetProperties(sdk-nrfxlib)

if(NOT sdk-nrfxlib_POPULATED)
FetchContent_Populate(sdk-nrfxlib)
endif()
endif()
endif()

set(NRFXLIB_DIR "${NUTTX_CHIP_ABS_DIR}/sdk-nrfxlib")
set(NRFXLIB_DIR "${NUTTX_CHIP_ABS_DIR}/sdk-nrfxlib")

target_include_directories(arch PRIVATE ${NUTTX_CHIP_ABS_DIR}/sdc)
target_include_directories(arch PRIVATE ${NRFXLIB_DIR}/mpsl/include)
target_include_directories(arch PRIVATE ${NRFXLIB_DIR}/softdevice_controller/include)
target_include_directories(arch PRIVATE ${NUTTX_CHIP_ABS_DIR}/sdc)
target_include_directories(arch PRIVATE ${NRFXLIB_DIR}/mpsl/include)
target_include_directories(
arch PRIVATE ${NRFXLIB_DIR}/softdevice_controller/include)

list(APPEND SRCS nrf52_sdc.c)
list(APPEND SRCS nrf52_sdc.c)

add_compile_options(-DNRF52_SERIES)
add_compile_options(-DNRF52_SERIES)

if(CONFIG_ARCH_FPU)
set(NRFXLIB_LIB_VARIANT hard-float)
else ()
set(NRFXLIB_LIB_VARIANT soft-float)
endif()
if(CONFIG_ARCH_FPU)
set(NRFXLIB_LIB_VARIANT hard-float)
else()
set(NRFXLIB_LIB_VARIANT soft-float)
endif()

if(CONFIG_NRF52_SDC_PERIPHERAL)
set(SOFTDEVICE_LIB_VARIANT libsoftdevice_controller_peripheral.a)
elseif(CONFIG_NRF52_SDC_CENTRAL)
set(SOFTDEVICE_LIB_VARIANT libsoftdevice_controller_central.a)
elseif(CONFIG_NRF52_SDC_MULTIROLE)
set(SOFTDEVICE_LIB_VARIANT libsoftdevice_controller_multirole.a)
endif()
if(CONFIG_NRF52_SDC_PERIPHERAL)
set(SOFTDEVICE_LIB_VARIANT libsoftdevice_controller_peripheral.a)
elseif(CONFIG_NRF52_SDC_CENTRAL)
set(SOFTDEVICE_LIB_VARIANT libsoftdevice_controller_central.a)
elseif(CONFIG_NRF52_SDC_MULTIROLE)
set(SOFTDEVICE_LIB_VARIANT libsoftdevice_controller_multirole.a)
endif()

target_link_libraries(arch
${NRFXLIB_DIR}/mpsl/lib/cortex-m4/${NRFXLIB_LIB_VARIANT}/libmpsl.a)
target_link_libraries(arch
${NRFXLIB_DIR}/softdevice_controller/lib/cortex-m4/${NRFXLIB_LIB_VARIANT}/${SOFTDEVICE_LIB_VARIANT})
target_link_libraries(
arch ${NRFXLIB_DIR}/mpsl/lib/cortex-m4/${NRFXLIB_LIB_VARIANT}/libmpsl.a)
target_link_libraries(
arch
${NRFXLIB_DIR}/softdevice_controller/lib/cortex-m4/${NRFXLIB_LIB_VARIANT}/${SOFTDEVICE_LIB_VARIANT}
)

endif()

Expand Down
Loading