1CONFIG_BT=y
2CONFIG_BT_SMP=y
3CONFIG_BT_PERIPHERAL=y
4CONFIG_BT_DIS=y
5CONFIG_BT_DIS_PNP=n
6CONFIG_BT_BAS=y
7CONFIG_BT_HRS=y
8CONFIG_BT_DEVICE_NAME="Zephyr Heartrate Sensor"
9CONFIG_BT_DEVICE_APPEARANCE=833
10
11# Drivers and peripherals
12CONFIG_I2C=n
13CONFIG_WATCHDOG=n
14CONFIG_PINCTRL=n
15CONFIG_SPI=n
16CONFIG_GPIO=n
17CONFIG_SERIAL=n
18
19# Power management
20CONFIG_PM=n
21
22# Interrupts
23CONFIG_DYNAMIC_INTERRUPTS=n
24CONFIG_IRQ_OFFLOAD=n
25
26# Memory protection
27CONFIG_THREAD_STACK_INFO=n
28CONFIG_THREAD_CUSTOM_DATA=n
29CONFIG_FPU=n
30
31# Boot
32CONFIG_BOOT_BANNER=n
33CONFIG_BOOT_DELAY=0
34
35# Console
36CONFIG_CONSOLE=n
37CONFIG_UART_CONSOLE=n
38CONFIG_STDOUT_CONSOLE=n
39CONFIG_PRINTK=n
40CONFIG_EARLY_CONSOLE=n
41
42# Build
43CONFIG_SIZE_OPTIMIZATIONS=y
44
45# ARM
46CONFIG_ARM_MPU=n
47
48# In order to correctly tune the stack sizes for the threads the following
49# Configurations can enabled to print the current use:
50# CONFIG_THREAD_NAME=y
51# CONFIG_THREAD_ANALYZER=y
52# CONFIG_THREAD_ANALYZER_AUTO=y
53# CONFIG_THREAD_ANALYZER_RUN_UNLOCKED=y
54# CONFIG_THREAD_ANALYZER_USE_PRINTK=y
55# CONFIG_THREAD_ANALYZER_AUTO_INTERVAL=20
56# CONFIG_CONSOLE=y
57# CONFIG_UART_CONSOLE=y
58# CONFIG_SERIAL=y
59# CONFIG_PRINTK=y
60
61# Example output of thread analyzer
62# BT RX               : STACK: unused 576 usage 448 / 1024 (43 %); CPU: 0 %
63# BT RX pri           : STACK: unused 260 usage 188 / 448 (41 %); CPU: 0 %
64# BT ECC              : STACK: unused 256 usage 888 / 1144 (77 %); CPU: 1 %
65# BT TX               : STACK: unused 296 usage 344 / 640 (53 %); CPU: 0 %
66# thread_analyzer     : STACK: unused 128 usage 384 / 512 (75 %); CPU: 1 %
67# sysworkq            : STACK: unused 856 usage 168 / 1024 (16 %); CPU: 0 %
68# logging             : STACK: unused 232 usage 536 / 768 (69 %); CPU: 0 %
69# idle 00             : STACK: unused 208 usage 48 / 256 (18 %); CPU: 97 %
70# main                : STACK: unused 576 usage 448 / 1024 (43 %); CPU: 0 %
71CONFIG_BT_RX_STACK_SIZE=1024
72CONFIG_BT_HCI_TX_STACK_SIZE_WITH_PROMPT=y
73CONFIG_BT_HCI_TX_STACK_SIZE=640
74CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512
75CONFIG_IDLE_STACK_SIZE=128
76CONFIG_MAIN_STACK_SIZE=640
77CONFIG_ISR_STACK_SIZE=1024
78
79# Disable features not needed
80CONFIG_TIMESLICING=n
81CONFIG_COMMON_LIBC_MALLOC=n
82CONFIG_LOG=n
83CONFIG_ASSERT=n
84
85# Disable Bluetooth features not needed
86# CONFIG_BT_DEBUG_NONE=y
87CONFIG_BT_ASSERT=n
88CONFIG_BT_DATA_LEN_UPDATE=n
89CONFIG_BT_PHY_UPDATE=n
90CONFIG_BT_GATT_CACHING=n
91CONFIG_BT_GATT_SERVICE_CHANGED=n
92CONFIG_BT_GAP_PERIPHERAL_PREF_PARAMS=n
93CONFIG_BT_SETTINGS_CCC_LAZY_LOADING=y
94CONFIG_BT_HCI_VS=n
95
96# Disable Bluetooth controller features not needed
97CONFIG_BT_CTLR_PRIVACY=n
98CONFIG_BT_CTLR_PHY_2M=n
99
100# Reduce Bluetooth buffers
101CONFIG_BT_BUF_EVT_DISCARDABLE_COUNT=1
102CONFIG_BT_BUF_EVT_DISCARDABLE_SIZE=45
103CONFIG_BT_BUF_EVT_RX_COUNT=2
104
105CONFIG_BT_L2CAP_TX_BUF_COUNT=2
106CONFIG_BT_CTLR_RX_BUFFERS=1
107CONFIG_BT_BUF_ACL_TX_COUNT=3
108CONFIG_BT_BUF_ACL_TX_SIZE=27
109
110# Limit the number of key slots in PSA Crypto core to reduce
111# RAM footprint
112CONFIG_MBEDTLS_PSA_KEY_SLOT_COUNT=5
113
114# This is required because otherwise there won't be
115# __heap_start/__heap_end symbols defined in the build. This
116# is due to Mbed TLS which at boot uses standard calloc/free
117# functions and only after the initialization done from Zephyr
118# it switches to its internal memory management functions.
119CONFIG_COMMON_LIBC_MALLOC=y
120