Problem with starting advertising in Bluetooth

Hello.
The problems with starting advertising started after I wanted to add NVS (most likely). The error occurs in the bt_le_adv_start function

What does this error mean and how can I fix it?

Here is my overlay for new memory partition (sensor_data_in_partition here for NVS):

/delete-node/ &slot0_partition;
/delete-node/ &slot1_partition;
/delete-node/ &storage_partition;

&flash0 {
	partitions {
		compatible = "fixed-partitions";
		#address-cells = <1>;
		#size-cells = <1>;

		boot_partition: partition@0 {
			label = "mcuboot";
			reg = <0x00000000 DT_SIZE_K(48)>;
		};

		slot0_partition: partition@c000 {
			label = "image-0";
			reg = <0x0000c000 DT_SIZE_K(204)>;
		};

		slot1_partition: partition@3f000 {
			label = "image-1";
			reg = <0x003f000 DT_SIZE_K(204)>;
		};

		storage_partition: partition@72000 {
			label = "storage";
			reg = <0x00072000 DT_SIZE_K(24)>;
		};

		sensor_data_in_partition: partition@78000 {
			label = "sensor_data";
			reg = <0x00078000 DT_SIZE_K(24)>;
		};
	};
};

Here is prj.conf

CONFIG_LOG=y

# Button and LED library
CONFIG_DK_LIBRARY=y

# Bluetooth LE
CONFIG_BT=y

CONFIG_BT_PERIPHERAL=y
CONFIG_BT_DEVICE_NAME="MY_LBS1"
CONFIG_BT_SMP=y

# Increase stack size for the main thread and System Workqueue
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
CONFIG_MAIN_STACK_SIZE=2048

CONFIG_NVS=y
CONFIG_BT_NSMS=y


CONFIG_SPI=y
CONFIG_GPIO=y
CONFIG_PRINTK=y
CONFIG_USE_SEGGER_RTT=y

I use ncs 2.8.0 with the custom board with an nrf52832 chip.

I would be grateful for help.

Parents
  • Hello, 

    Advertising start is returning with -EAGAIN (-11) which indicates that the Bluetooth stack is not ready. Does your code call settings_load() before it attempts to start the advertiser?

    You also need to keep the settings storage partition if you want to keep "CONFIG_BT_STATUS_SECURITY_ENABLED" enabled. Please note that memory partitions are controlled by the partition manager  which means the Devictree partitions will be ignored.

    To include both partitions, you can place the static partitioning file included in the zip file below in your project root and do a pristine build.

    3731.pm_static.zip

    This should give you the following memory layout:

    Best regards,

    Vidar

Reply
  • Hello, 

    Advertising start is returning with -EAGAIN (-11) which indicates that the Bluetooth stack is not ready. Does your code call settings_load() before it attempts to start the advertiser?

    You also need to keep the settings storage partition if you want to keep "CONFIG_BT_STATUS_SECURITY_ENABLED" enabled. Please note that memory partitions are controlled by the partition manager  which means the Devictree partitions will be ignored.

    To include both partitions, you can place the static partitioning file included in the zip file below in your project root and do a pristine build.

    3731.pm_static.zip

    This should give you the following memory layout:

    Best regards,

    Vidar

Children
Related