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.

  • 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.

  • Hi Wan, 

    What I suspect was if there is any timing delay that would cause the issue. Please try to capture the logic trace of the whole process from the time you turn on the board, with and without Bluetooth enabled. 

    It would be easier to explain if the sensor actually send the interrupt but the NRF53 chip doesn't catch it but in this case the sensor behaves differently with and without Bluetooth even with the same SPI input data. I would suggest to focus on what's the difference from the sensor's side when receiving the signal from the NRF53. 

    Regarding the issue with max data length for notification, please capture a sniffer trace. Please double check what's the data length used in the connection (check the le_data_len_updated callback) 

Related