Config for using sdc_hci_cmd functions

Hello,

I'm using a nRF5340 DK and ncs version 2.3.0.

What i try is, to use calls like

  •  sdc_hci_cmd_vs_zephyr_read_chip_temp()  that is available in header file sdc_hci_vs.h (ncs/v2.3.0/nrfxlib/softdevice_controller/include) and source file hci_internal.c (\ncs\v2.3.0\nrf\subsys\bluetooth\controller) or
  • bt_ctlr_set_public_addr() that uses sd_hci_cmd_vs_zephyr_write_bd_addr() function that is available in the hci_driver.c and the same header file.

I'm always getting the error messages:

  • undefined reference to `sdc_hci_cmd_vs_zephyr_read_chip_temp' and
  • undefined reference to `bt_ctlr_set_public_addr'

So I'm pretty sure I'm missing a CONFIG in my prj.conf, but can't find the right one. Any Ideas, what i need to add here?

I've started my evaluation with the zephyr beacon sample.

Thanks a lot.

Parents Reply Children
  • Hi Steffen, 

    I'm taking over the case as I have done some more test related to the topic. 

    I haven't tested on SDC_HCI_OPCODE_CMD_VS_ZEPHYR_READ_CHIP_TEMP but instead using  BT_HCI_OP_VS_READ_CHIP_TEMP which is similar to how we control TX Power. 
    And I can get good result out, I can see temperature around 0x19, 0x1a meaning 25-26 Celsius. 

    int temperature_measure(void)
    {
    
    	int err = 0;
    	struct net_buf *buf, *rsp = NULL;
    	struct bt_hci_rp_vs_read_chip_temp *cmd_params;
    	struct bt_hci_rp_vs_read_chip_temp *rsp_params;
    
    	buf = bt_hci_cmd_create(BT_HCI_OP_VS_READ_CHIP_TEMP, sizeof(*cmd_params));
    	if (!buf) {
    		printk("Could not allocate command buffer");
    		return -ENOMEM;
    	}
    
    	cmd_params = net_buf_add(buf, sizeof(*cmd_params));
    
    	err = bt_hci_cmd_send_sync(BT_HCI_OP_VS_READ_CHIP_TEMP, buf, &rsp);
    	if (err) {
    		printk("bt_hci_cmd_send_sync failed (err: %d)",err);
    		return err;
    	}
    
    	rsp_params = (void *) rsp->data;
    	printk("result: 0x%x",rsp_params->temps);
    	net_buf_unref(rsp);
    
    	return 0;
    }

    I attached the project here. 

    peripheral_lbs_txpower_temp.zip

  • Hi  

    thanks for your answer. With BT_HCI_OP_VS_READ_CHIP_TEMP I can also get an result. Thanks a lot.

Related