Call to bt_enable in main returns EAGAIN (-11) on uBlox NORA B126 module with no external 32kHz crystal

I'm using NCS v2.2.0, and made a modified version of the peripheral_lbs project with a pretty minimal configuration and most of the hardware functionality (e.g. GPIOs, buttons, LEDs) disabled. I also am configured to use the internal 32kHz RCOSC and not an external 32kHz crystal. I've included my config file details below.

I'm currently building based on the nrf5340_dk_nrf5340_cpuapp board configuration, though since all the GPIO, button, and LED functionality is disabled I figured that it should be safe to load on hardware aside from the nRF5340 DK itself.

Here's the issue that I'm having.

When I make a build with this setup, it runs fine on either an nRF5340 DK board or on a uBlox NORA B106 dev kit. But when I try to run the exact same build (no modifications whatsoever) on my custom hardware containing a uBlox NORA B126 module, the call to bt_enable in main returns EAGAIN (-11) and I can't figure out why. Note that I have seen this DevZone post with a similar problem, and in my case I am calling bt_enable from the main thread so it is not the same issue. Also, I know that the code is OK because as I mentioned it runs fine on the nRF5340 DK and uBlox NORA B106 dev kit board.

There are two key differences between my custom hardware and the two dev kits that might be relevant here:

1. My custom hardware does not contain a 32kHz crystal. This is why have configured the project to use the internal RC oscillator.

2. My custom hardware is based on the NORA B126 part, which means that there is an integrated FEM within the module. For now I haven't done anything specific to the FEM, and I'm not even using any board / overlay files to set up control of the FEM. I figured that this shouldn't have any impact on the getting basic functionality working, and would try to get the FEM working later.

Any idea why the call to bt_enable fails on my custom hardware and not on the dev kits? Besides the above two points, is there anything else in the hardware design itself that could cause the EAGAIN error?

Here is the config file that I'm using, which is a modified version of the prj_minimal.conf file included with the peripheral_lbs project:

CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=n
CONFIG_NO_OPTIMIZATIONS=y


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=n
CONFIG_BT_LBS_POLL_BUTTON=n
CONFIG_DK_LIBRARY=n

# Enable the DIS service
CONFIG_BT_DIS=y
CONFIG_BT_DIS_FW_REV=y
CONFIG_BT_DIS_FW_REV_STR="FW Rev Str Test"

# Drivers and peripherals
CONFIG_I2C=n
CONFIG_WATCHDOG=n
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

# 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_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_WORK_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=n
CONFIG_ASSERT=n

# Disable Bluetooth features not needed
CONFIG_BT_DEBUG_NONE=y
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
Parents Reply Children
No Data
Related