This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Is it possible to record HCI logs using nRF52840?

Hi all.

I have written an application using a softdevice and I want to analyse an interesing behavior I don't understand at the moment.
So I want to record a trace/log of the used HCI commands to see what's going on on deeper levels.

Is this possible?

Thanks in advance
Cheers Michael

Parents
  • HI Vidar.

    I have used your code to monitor the not resolved advertised addresses.
    My address to resolve is not listed in this list.
    This means the address has been resolved immediately after the first appearance? Right?

    But it is still possible that the connection-request it not sent immediately after resolving the address after the same advertisement.
    How long does it take to resolve a random address? Maybe it takes too long, so the next advertisement has to be used for the connection request or the connect request can't be sent just after resolving the address due to other limitations.

    Cheers Michael

  • Hi Michael,

    The address resolving happens on the fly.

    My address to resolve is not listed in this list.

    The application is responsible for managing the list, and it should contain IRK for your peer device, not the address. Does the "input address" ever match your address though?

    Cheers,

    Vidar

  • Hi Michael,

    Do you get a connection request to the first adv. packet sometimes, and are you starting scanning by calling sd_ble_gap_connect() or do you call sd_ble_gap_scan_start() first?

    The Softdevice should have no problem with sending a connection request to the first packet if it actually receives it. But some advertisements will be lost if you are testing in a noisy environment or if you don't scan 100% of the time (ie scan_windows != scan_interval).

    Michael-1965 said:
    Please use the Ellisys trace for better resolution to see it better

     Maybe you could double-check to see if you sent me the correct trace. I didn't find any connections in the one you sent, only advertising from the peripheral was displayed.

    Cheers,

    Vidar

  • Hi Vidar.

    I have done a lot of tries and have never seen a connection request to the first adv. packets.
    I use "nrf_ble_scan_start" which calls "sd_ble_gap_scan_start".

    The environment is not very noisy and scan_window = scan_interval = 80.

    Maybe the filters are still set in your Ellisys trace, please delete the filters. You should see traffic then.

    I have also done another try: I have paired two different devices and configured the white-list to look for these two. The effect is similar:
    The advs of the first device is visible, but no connection is taking place.
    Then the advs of the second device is visible, a connection request is sent then and it works.
    This proves the address is resolved in real-time, because both devices have different IRKs.

    It looks for me like the client needs to resolve first an address and has to do some preparations to be able to resolve and connect at the next time.

    Cheers Michael

  • Hi Michael,

    Michael-1965 said:
    Maybe the filters are still set in your Ellisys trace, please delete the filters. You should see traffic then.

     Yes, that was it. Thanks.

    Michael-1965 said:
    I use "nrf_ble_scan_start" which calls "sd_ble_gap_scan_start".

     Can you try to call sd_ble_gap_connect with the same scan parameters instead? This way the softdevice will not have to wait for the app to confirm that it wants to connect.

    Cheers,

    Vidar

  • Hi Vidar.

    It works with sd_ble_gap_connect. Thanks a lot! Now it connects mostly on the first advs.

    But I have set "connect_if_match" in m_scan to true, so I would assume it connects directly after resolving the address also with sd_ble_gap_scan_start.

    So the softdevice needs a confirmation for connection, can you give me a bit more details.

    Thanks and Cheers
    Michael

  • Hi Michael,

    Glad to hear that it performs better now:) The reason why it's slower is maybe best illustrated by this MSC here: Message sequence chart example 3: Scanning with whitelist. sd_ble_gap_can_start() instructs the Softdevice to start scanning and notify the application when it receives an advertisement packet from a whitelisted peer, whereas sd_ble_gap_connect() tells the Softdevice to start scanning and simply connect to the first whitelisted peer it finds.

    Regards,

    Vidar

Reply Children
Related