Periodic Advertising has issues when operating as a host only.

Hi,

I tried running the \zephyr\samples\bluetooth\periodic_adv program as a host-only application on the nrf52840 development board, with the controller using an nrf52832, and the two devices connected via HCI UART.The nrf52832 has been flashed with the Zephyr HCI_UART program.

However, the program has an error when executing the following line of code:

err = le_ext_adv_param_set(adv, param, false);

I used the logic analyzer to capture the communication instructions between the two devices, and found that the controller returned the following instructions: 04 0F 04 01 01 36 20. According to Bluetooth Core v5.4, this appears to prompt "UNKNOWN HCI COMMAND".  I want to know how to solve this problem.

The prj.conf file used on nrf52840 looks like this:

CONFIG_BT=y
CONFIG_BT_EXT_ADV=y
CONFIG_BT_PER_ADV=y
CONFIG_LOG=y
CONFIG_BT_DEVICE_NAME="Test Periodic Advertising"

CONFIG_BT_HCI=y
CONFIG_BT_CTLR=n
CONFIG_BT_H4=y

The overlay file used on nrf52840 looks like this:

&pinctrl {
	uart1_default: uart1_default {
		group1 {
			psels = <NRF_PSEL(UART_TX, 0, 28)>,
				<NRF_PSEL(UART_RTS, 0, 29)>;
		};
		group2 {
			psels = <NRF_PSEL(UART_RX, 0, 30)>,
				<NRF_PSEL(UART_CTS, 0, 31)>;
			bias-pull-up;
		};
	};

	uart1_sleep: uart1_sleep {
		group1 {
			psels = <NRF_PSEL(UART_TX, 0, 28)>,
				<NRF_PSEL(UART_RX, 0, 30)>,
				<NRF_PSEL(UART_RTS, 0, 29)>,
				<NRF_PSEL(UART_CTS, 0, 31)>;
			low-power-enable;
		};
	};
};
&uart0 {
	compatible = "nordic,nrf-uarte";
	status = "okay";
	current-speed = <115200>;
	hw-flow-control;
};
&uart1 {
    compatible = "nordic,nrf-uarte";
    status = "okay";
    current-speed = <115200>;
    hw-flow-control;
    pinctrl-0 = <&uart1_default>;
    pinctrl-1 = <&uart1_sleep>;
    pinctrl-names = "default", "sleep";
};
&spi1 {
	status = "disabled";
};
/ {
   chosen {
		nordic,nus-uart = &uart0;
		zephyr,bt-uart = &uart1;
	
   };
};

Parents
  • Hi,

    What is the configuration for the application running on the controller (nRF52832) side?
    Are the same functionalities enabled via config also there?

    Regards,
    Terje

  • I am very sorry! Due to an issue with my email settings, I missed the update on this ticket.

    On the controller (nRF52832) side, the prj.conf file I used is as follows:

    CONFIG_CONSOLE=n
    CONFIG_STDOUT_CONSOLE=n
    CONFIG_UART_CONSOLE=n
    CONFIG_GPIO=y
    CONFIG_SERIAL=y
    CONFIG_UART_INTERRUPT_DRIVEN=y
    CONFIG_BT=y
    CONFIG_BT_HCI_RAW=y
    CONFIG_BT_HCI_RAW_H4=y
    CONFIG_BT_HCI_RAW_H4_ENABLE=y
    CONFIG_BT_BUF_ACL_RX_SIZE=255
    CONFIG_BT_BUF_CMD_TX_SIZE=255
    CONFIG_BT_BUF_EVT_DISCARDABLE_SIZE=255
    CONFIG_BT_CTLR_ASSERT_HANDLER=y
    CONFIG_BT_MAX_CONN=16
    CONFIG_BT_TINYCRYPT_ECC=n
    CONFIG_BT_CTLR_DTM_HCI=y
    
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512
    
    CONFIG_BT_BUF_CMD_TX_COUNT=10

    The overlay file looks like this:

    &uart0 {
    	compatible = "nordic,nrf-uart";
    	current-speed = <115200>;
    	status = "okay";
    	hw-flow-control;
    };
    

    Besides the baud rate, there is no difference in the content from the Zephyr repository's HCI_UART code.

Reply
  • I am very sorry! Due to an issue with my email settings, I missed the update on this ticket.

    On the controller (nRF52832) side, the prj.conf file I used is as follows:

    CONFIG_CONSOLE=n
    CONFIG_STDOUT_CONSOLE=n
    CONFIG_UART_CONSOLE=n
    CONFIG_GPIO=y
    CONFIG_SERIAL=y
    CONFIG_UART_INTERRUPT_DRIVEN=y
    CONFIG_BT=y
    CONFIG_BT_HCI_RAW=y
    CONFIG_BT_HCI_RAW_H4=y
    CONFIG_BT_HCI_RAW_H4_ENABLE=y
    CONFIG_BT_BUF_ACL_RX_SIZE=255
    CONFIG_BT_BUF_CMD_TX_SIZE=255
    CONFIG_BT_BUF_EVT_DISCARDABLE_SIZE=255
    CONFIG_BT_CTLR_ASSERT_HANDLER=y
    CONFIG_BT_MAX_CONN=16
    CONFIG_BT_TINYCRYPT_ECC=n
    CONFIG_BT_CTLR_DTM_HCI=y
    
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512
    
    CONFIG_BT_BUF_CMD_TX_COUNT=10

    The overlay file looks like this:

    &uart0 {
    	compatible = "nordic,nrf-uart";
    	current-speed = <115200>;
    	status = "okay";
    	hw-flow-control;
    };
    

    Besides the baud rate, there is no difference in the content from the Zephyr repository's HCI_UART code.

Children
Related