Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

undefined reference to LOG_DBG showing after enabling in menuconfig SEGGERSTUDIO ZEPHYR & general question about application callbacks BT

Hey all

Board:
NRF53840 DK

ERROR: 
Building ‘zephyr/zephyr_prebuilt.elf’ from solution ‘build’ in configuration ‘Common’
undefined reference to `LOG_DBG' (to any area that uses it) <error appears in hci_core.c> 

steps i've taken:
1) https://docs.zephyrproject.org/latest/reference/kconfig/CONFIG_BT_LOG_LEVEL_DBG.html
2) Menu path: (Top) → Sub Systems and OS Services → Bluetooth → Max compiled-in log level for bt
3) change to debug for both the network and applicaiton kconfig

4) also changed my kconfig overlay file to add it all in

# BEGIN Configurations from basic/minimal

CONFIG_NCS_SAMPLES_DEFAULTS=y

CONFIG_BT=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_DEVICE_NAME="Nordic_LBS"
#####################################
# Enable the LBS service
CONFIG_BT_LBS=y
CONFIG_BT_LBS_POLL_BUTTON=y
CONFIG_DK_LIBRARY=y
#####################################
# Drivers and peripherals
CONFIG_I2C=y
#CONFIG_I2C=n

CONFIG_WATCHDOG=n

CONFIG_GPIO=y
#CONFIG_GPIO=n

CONFIG_PINMUX=n

CONFIG_SPI=n

#CONFIG_SERIAL=n

#####################################
# Power management
CONFIG_PM=n
#####################################
# Interrupts
CONFIG_DYNAMIC_INTERRUPTS=n
CONFIG_IRQ_OFFLOAD=n
#####################################
# Memory protection
CONFIG_THREAD_STACK_INFO=n
CONFIG_THREAD_CUSTOM_DATA=n
CONFIG_FPU=n
#####################################
# Boot
CONFIG_BOOT_BANNER=n
CONFIG_BOOT_DELAY=0
#####################################
# Console
#CONFIG_CONSOLE=n
#CONFIG_UART_CONSOLE=n
CONFIG_STDOUT_CONSOLE=n
#CONFIG_PRINTK=n
CONFIG_EARLY_CONSOLE=n
#####################################
# Build
CONFIG_SIZE_OPTIMIZATIONS=y
#####################################
# ARM
CONFIG_ARM_MPU=n
# END Configurations from basic/minimal

##########################################################################

# In order to correctly tune the stack sizes for the threads the following
# Configurations can enabled to print the current use:
CONFIG_THREAD_NAME=y
CONFIG_THREAD_ANALYZER=y
CONFIG_THREAD_ANALYZER_AUTO=y
CONFIG_THREAD_ANALYZER_RUN_UNLOCKED=y
CONFIG_THREAD_ANALYZER_USE_PRINTK=y
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
CONFIG_SERIAL=y
CONFIG_PRINTK=y

CONFIG_BT_DEBUG_HCI_CORE=y

# Example output of thread analyzer
# SDC RX              : unused 816 usage 208 / 1024 (20 %)
# BT RX               : unused 1784 usage 416 / 2200 (18 %)
# BT TX               : unused 992 usage 544 / 1536 (35 %)
# thread_analyzer     : unused 136 usage 376 / 512 (73 %)
# sysworkq            : unused 1824 usage 224 / 2048 (10 %)
# MPSL signal         : unused 520 usage 504 / 1024 (49 %)
# idle 00             : unused 192 usage 64 / 256 (25 %)
# main                : unused 136 usage 888 / 1024 (86 %)
# Configurations set based on thread analyzer output.
CONFIG_SDC_RX_STACK_SIZE=324
CONFIG_BT_RX_STACK_SIZE=1024
CONFIG_BT_HCI_TX_STACK_SIZE_WITH_PROMPT=y
CONFIG_BT_HCI_TX_STACK_SIZE=640
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=256
CONFIG_MPSL_SIGNAL_STACK_SIZE=640
CONFIG_MAIN_STACK_SIZE=1024
CONFIG_IDLE_STACK_SIZE=128
CONFIG_ISR_STACK_SIZE=1024

# Disable features not needed
CONFIG_TIMESLICING=n
CONFIG_MINIMAL_LIBC_MALLOC=n
CONFIG_LOG=y
CONFIG_ASSERT=n

# Disable Bluetooth features not needed
CONFIG_BT_DEBUG_NONE=n
CONFIG_BT_ASSERT=n
CONFIG_BT_DATA_LEN_UPDATE=n
CONFIG_BT_PHY_UPDATE=n
CONFIG_BT_GATT_CACHING=n
CONFIG_BT_GATT_SERVICE_CHANGED=n
CONFIG_BT_GAP_PERIPHERAL_PREF_PARAMS=n
CONFIG_BT_SETTINGS_CCC_LAZY_LOADING=y
CONFIG_BT_HCI_VS_EXT=n

# Disable Bluetooth controller features not needed
CONFIG_BT_CTLR_PRIVACY=n
CONFIG_BT_CTLR_PHY_2M=n

# Reduce Bluetooth buffers
CONFIG_BT_BUF_EVT_DISCARDABLE_COUNT=1
CONFIG_BT_BUF_EVT_DISCARDABLE_SIZE=43
CONFIG_BT_BUF_EVT_RX_COUNT=2

CONFIG_BT_CONN_TX_MAX=2
CONFIG_BT_L2CAP_TX_BUF_COUNT=2
CONFIG_BT_CTLR_RX_BUFFERS=1
CONFIG_BT_BUF_ACL_TX_COUNT=3
CONFIG_BT_BUF_ACL_TX_SIZE=27


After enabling it and runing cmake i still get the error, what have i done wrong ?
attached the project *im modifying the peripherals_lbs, is there potentially a cleaner bt example ie bt blinky ?

Q2:
Regarding the callbacks functions like app_button_cb and app_led_cb that are called as functions in read_button and write_led.
is it just out of clean code and seperation of logic that it's organised to appear as callbacks in main ? just curious to as why it's organised to appear as a callback when it's just a function apart of the ble callbacks.

Related