Bluetooth configuration disabled sensor trigger

Hi Nordic,

when I enable the Bluetooth configuration, the sensor trigger stop to work. when I comment the Bluetooth configuration, the sensor trigger back to work.

I recorded the screen as below:

the expected result is the Bluetooth configuration will not have any negative effect to the function already developed.

Parents
  • Hi Scott, 
    I'm not sure if you need CONFIG_BT_HCI=y. If you simply do:
    CONFIG_BT=y
    CONFIG_BT_PERIPHERAL=y

    Would it work ?

    Also please check if there is any timing issue with your sensor that the trigger stopped working ? Maybe you can check the SPI lines to see if there is any activity ? 

  • Hi Hung,

    It is same if ONLY enable BT and BT_PERIPHERAL, I will ckeck if SPI registers can be read properly after BT enabled in a polling loop.

    How to check if there is any timing issue with the sensor that the trigger stopped working ?

  • Hi Scott, 
    The tutorial you quoted was very old and it's for the legacy nRF5 SDK not NRF Connect SDK. 

    I would suggest to follow this or this.

    I suspect a change in timing may cause an issue with your SPI sensor. A logic analyzer would really help to find what could be wrong. 
    My understanding is that the SPI sensor would require some commands before it can provide the trigger/interrupt ? Please double check to see if the command(s) is sent. 

    Regarding your question about the MTU size, you would need to configure CONFIG_BT_CTLR_DATA_LENGTH_MAX, CONFIG_BT_BUF_ACL_RX_SIZE and CONFIG_BT_BUF_ACL_TX_SIZE. I would suggest to have a look at the \nrf\samples\bluetooth\throughput example. 

  • Hi Hung,

    when I hook the logic analyzer on the SPI lines, I can see the SPI send data to sensor are correct whatever the Bluetooth subsystem is enabled or not. the problem is when the Bluetooth configuration added in prj.conf file, the sensor does not response, the data get always 0.

    the SPI activity when Bluetooth config NOT added: 

    the SPI activity when Bluetooth config added:

    for the Bluetooth, the link gave is wrong, the guide I followed is exactly you sugged in last post. for the MTU limitation, I added the  CONFIG_BT_CTLR_DATA_LENGTH_MAX, CONFIG_BT_BUF_ACL_RX_SIZE and CONFIG_BT_BUF_ACL_TX_SIZE. the problem is same.

  • Hi Scott, 

    It's strange that the SPI sensor act differently when you enable Bluetooth or not. To avoid any timing issue, I would suggest to delay the initialization of SPI sensor, for example until you press a button. This way it should be exactly the same if you initialize Bluetooth or not. Please also check if VDD is provided to the SPI sensor correctly. 
    Regarding the BLE notification of larger payload, please try to capture a sniffer trace.  
    Note that at least on one side (central or peripheral) you need to call bt_conn_le_data_len_update() to update to higher data length. Please refer the throughput example that I pointed to. 

  • Hi Hung,

    the guide I followed to initialize SPI senor is Option 1: create devices using instance numbers

    I think it is initiate automatically and can not be changed to initiate by press a button. 

    Please also check if VDD is provided to the SPI sensor correctly

    since the sensor works fine when the Bluetooth configurations not enabled, why I have to check VDD to the sensor, there no any lines change when I enable Bluetooth.

  • Hi Hung,

    it is same even 'bt_conn_le_data_len_update()' called, no more than 20 bytes can send.

Reply Children
No Data
Related