2019-04-06 09:08:09 -04:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
2017-10-27 15:43:34 +02:00
|
|
|
zephyr_library()
|
|
|
|
zephyr_library_sources(
|
|
|
|
util/mem.c
|
|
|
|
util/memq.c
|
|
|
|
util/mayfly.c
|
|
|
|
util/util.c
|
|
|
|
ticker/ticker.c
|
2018-01-09 15:17:15 +01:00
|
|
|
ll_sw/ll_addr.c
|
|
|
|
ll_sw/ll_tx_pwr.c
|
2017-10-27 15:43:34 +02:00
|
|
|
hci/hci_driver.c
|
|
|
|
hci/hci.c
|
|
|
|
)
|
|
|
|
|
2018-06-26 11:51:18 +02:00
|
|
|
zephyr_library_sources_ifdef(
|
|
|
|
CONFIG_BT_CTLR_CRYPTO
|
|
|
|
crypto/crypto.c
|
|
|
|
)
|
|
|
|
|
2019-07-16 21:17:17 +05:30
|
|
|
if(CONFIG_BT_LL_SW_LEGACY)
|
2018-12-17 10:46:13 +01:00
|
|
|
zephyr_library_sources(
|
|
|
|
ll_sw/ctrl.c
|
|
|
|
ll_sw/ll.c
|
|
|
|
)
|
|
|
|
zephyr_library_sources_ifdef(
|
|
|
|
CONFIG_BT_BROADCASTER
|
|
|
|
ll_sw/ll_adv.c
|
|
|
|
)
|
|
|
|
zephyr_library_sources_ifdef(
|
|
|
|
CONFIG_BT_OBSERVER
|
|
|
|
ll_sw/ll_scan.c
|
|
|
|
)
|
|
|
|
zephyr_library_sources_ifdef(
|
|
|
|
CONFIG_BT_CTLR_FILTER
|
|
|
|
ll_sw/ll_filter.c
|
|
|
|
)
|
|
|
|
zephyr_library_sources_ifdef(
|
|
|
|
CONFIG_BT_CENTRAL
|
|
|
|
ll_sw/ll_master.c
|
|
|
|
)
|
|
|
|
zephyr_library_sources_ifdef(
|
|
|
|
CONFIG_BT_CTLR_ADV_EXT
|
|
|
|
ll_sw/ll_adv_aux.c
|
|
|
|
)
|
2019-01-09 21:25:14 +05:30
|
|
|
zephyr_library_sources_ifdef(
|
|
|
|
CONFIG_BT_HCI_MESH_EXT
|
|
|
|
ll_sw/ll_mesh.c
|
|
|
|
)
|
2018-12-17 10:46:13 +01:00
|
|
|
zephyr_library_sources_ifdef(
|
|
|
|
CONFIG_BT_CTLR_DTM
|
|
|
|
ll_sw/ll_test.c
|
|
|
|
)
|
|
|
|
endif()
|
2018-01-09 15:17:15 +01:00
|
|
|
|
2018-12-18 05:48:20 +01:00
|
|
|
if(CONFIG_BT_LL_SW_SPLIT)
|
|
|
|
zephyr_library_sources(
|
|
|
|
ll_sw/ull.c
|
|
|
|
ll_sw/lll_chan.c
|
|
|
|
)
|
|
|
|
zephyr_library_sources_ifdef(
|
|
|
|
CONFIG_BT_LLL_VENDOR_NORDIC
|
|
|
|
ll_sw/nordic/lll/lll.c
|
|
|
|
)
|
|
|
|
if(CONFIG_BT_BROADCASTER)
|
|
|
|
zephyr_library_sources(
|
|
|
|
ll_sw/ull_adv.c
|
|
|
|
)
|
|
|
|
zephyr_library_sources_ifdef(
|
|
|
|
CONFIG_BT_CTLR_ADV_EXT
|
|
|
|
ll_sw/ull_adv_aux.c
|
|
|
|
)
|
|
|
|
zephyr_library_sources_ifdef(
|
|
|
|
CONFIG_BT_LLL_VENDOR_NORDIC
|
|
|
|
ll_sw/nordic/lll/lll_adv.c
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
if(CONFIG_BT_OBSERVER)
|
|
|
|
zephyr_library_sources(
|
|
|
|
ll_sw/ull_scan.c
|
|
|
|
)
|
|
|
|
zephyr_library_sources_ifdef(
|
|
|
|
CONFIG_BT_LLL_VENDOR_NORDIC
|
|
|
|
ll_sw/nordic/lll/lll_scan.c
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
if(CONFIG_BT_CONN)
|
|
|
|
zephyr_library_sources(
|
|
|
|
ll_sw/ull_conn.c
|
|
|
|
)
|
|
|
|
zephyr_library_sources_ifdef(
|
|
|
|
CONFIG_BT_LLL_VENDOR_NORDIC
|
|
|
|
ll_sw/nordic/lll/lll_clock.c
|
|
|
|
ll_sw/nordic/lll/lll_conn.c
|
|
|
|
)
|
|
|
|
if(CONFIG_BT_PERIPHERAL)
|
|
|
|
zephyr_library_sources(
|
|
|
|
ll_sw/ull_slave.c
|
|
|
|
)
|
|
|
|
zephyr_library_sources_ifdef(
|
|
|
|
CONFIG_BT_LLL_VENDOR_NORDIC
|
|
|
|
ll_sw/nordic/lll/lll_slave.c
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
if(CONFIG_BT_CENTRAL)
|
|
|
|
zephyr_library_sources(
|
|
|
|
ll_sw/ull_master.c
|
|
|
|
)
|
|
|
|
zephyr_library_sources_ifdef(
|
|
|
|
CONFIG_BT_LLL_VENDOR_NORDIC
|
|
|
|
ll_sw/nordic/lll/lll_master.c
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
if(CONFIG_BT_CTLR_SCHED_ADVANCED)
|
|
|
|
zephyr_library_sources(
|
|
|
|
ll_sw/ull_sched.c
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
zephyr_library_sources_ifdef(
|
|
|
|
CONFIG_BT_CTLR_FILTER
|
2019-05-09 18:39:26 +05:30
|
|
|
ll_sw/ull_filter.c
|
2018-12-18 05:48:20 +01:00
|
|
|
)
|
|
|
|
zephyr_library_sources_ifdef(
|
|
|
|
CONFIG_BT_HCI_MESH_EXT
|
|
|
|
ll_sw/ll_mesh.c
|
|
|
|
)
|
|
|
|
if(CONFIG_BT_LLL_VENDOR_NORDIC)
|
|
|
|
zephyr_library_include_directories(
|
|
|
|
ll_sw/nordic/lll
|
|
|
|
)
|
2019-04-26 14:00:04 +02:00
|
|
|
zephyr_library_sources_ifdef(
|
|
|
|
CONFIG_BT_CTLR_DTM
|
|
|
|
ll_sw/nordic/lll/lll_test.c
|
|
|
|
)
|
2018-12-18 05:48:20 +01:00
|
|
|
zephyr_library_sources_ifdef(
|
|
|
|
CONFIG_BT_CTLR_PROFILE_ISR
|
|
|
|
ll_sw/nordic/lll/lll_prof.c
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
endif()
|
2018-01-09 15:17:15 +01:00
|
|
|
|
2019-07-18 10:04:06 +02:00
|
|
|
zephyr_library_sources_ifdef(
|
|
|
|
CONFIG_BT_CTLR_SETTINGS
|
|
|
|
ll_sw/ll_settings.c
|
|
|
|
)
|
|
|
|
|
2018-01-09 15:17:15 +01:00
|
|
|
zephyr_library_sources_ifdef(
|
2018-10-03 16:37:18 +02:00
|
|
|
CONFIG_SOC_COMPATIBLE_NRF
|
2018-12-17 10:46:13 +01:00
|
|
|
ll_sw/nordic/hal/nrf5/cntr.c
|
|
|
|
ll_sw/nordic/hal/nrf5/ecb.c
|
|
|
|
ll_sw/nordic/hal/nrf5/radio/radio.c
|
|
|
|
ll_sw/nordic/hal/nrf5/mayfly.c
|
|
|
|
ll_sw/nordic/hal/nrf5/ticker.c
|
2018-01-09 15:17:15 +01:00
|
|
|
)
|
2017-10-27 15:43:34 +02:00
|
|
|
|
|
|
|
zephyr_library_include_directories(
|
|
|
|
.
|
|
|
|
include
|
2018-12-17 10:46:13 +01:00
|
|
|
ll_sw
|
2018-01-09 15:17:15 +01:00
|
|
|
)
|
2017-10-27 15:43:34 +02:00
|
|
|
|
2018-12-17 10:46:13 +01:00
|
|
|
if(CONFIG_SOC_COMPATIBLE_NRF)
|
|
|
|
zephyr_library_include_directories(
|
|
|
|
ll_sw/nordic
|
2019-04-26 15:31:12 +02:00
|
|
|
hci/nordic
|
2018-12-17 10:46:13 +01:00
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2017-10-27 15:43:34 +02:00
|
|
|
zephyr_library_compile_options_ifdef(
|
|
|
|
CONFIG_BT_CTLR_FAST_ENC
|
Bluetooth: Controller: Use a different flag for speed optimization
The bluetooth controller has been using the flag '-Ofast' to keep
within a real-time limit. There are two problems with this; firstly,
when a project should be optimized for size it is standard to use -O2,
not -Ofast.
Secondly, optimization flags have been deemed to be non-portable, so
instead of directly using "-Ofast" we should use the intent-macro
OPTIMIZE_FOR_SPEED_FLAG to ensure toolchain portability.
Testing has shown that we are still within the real-time limit when
changing from -Ofast to -O2. -Ofast is about 1us and 1% faster, but
increases the code size by 13kB (5% of the available flash on a
nRF51).
Since the slowdown is comparatively small compared to the code size
increase we have decided to use -O2 in place of -Ofast.
Other optimization combinations were also measured and their results
can be seen below:
-Ofast in BLE Controller and in #pragma in entropy driver.
Memory region Used Size Region Size %age Used
FLASH: 138920 B 256 KB 52.99%
[bt] [INF] encode_control: l: 6, 6, 7; t: 75, 45, 132.
-O2 in BLE Controller and in #pragma in entropy driver.
Memory region Used Size Region Size %age Used
FLASH: 125840 B 256 KB 48.00%
[bt] [INF] encode_control: l: 6, 6, 7; t: 75, 51, 133
-O3 in BLE Controller and in #pragma in entropy driver.
Memory region Used Size Region Size %age Used
FLASH: 138920 B 256 KB 52.99%
[bt] [INF] encode_control: l: 6, 6, 7; t: 75, 50, 132.
No extra CFLAGS for BLE and entropy driver (pragmas removed), using
CONFIG_SIZE_OPTIMIZATIONS=y
Memory region Used Size Region Size %age Used
FLASH: 120124 B 256 KB 45.82%
[bt] [ERR] isr_rx_conn: assert: '!radio_is_ready()' failed
No extra CFLAGS for BLE and entropy driver (pragmas removed), using
CONFIG_SPEED_OPTIMIZATIONS=y
Memory region Used Size Region Size %age Used
FLASH: 138004 B 256 KB 52.64%
[bt] [INF] encode_control: l: 6, 6, 7; t: 61, 51, 130.
NB: RAM usage differences were insignificant.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-10-09 17:33:51 +02:00
|
|
|
${OPTIMIZE_FOR_SPEED_FLAG}
|
2017-10-27 15:43:34 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
zephyr_library_link_libraries(subsys__bluetooth)
|