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

Capture the HCI Messages using btmon via rpmsg

Would like to capture the HCI flow through rpmsg (Rx and TX) using the btmon tool between application and network core. could not successfully do it.

Procedure:

1. Build and flashed the samples\bluetooth\hci_rpmsg on Network Core

2. Build and flashed the samples\bluetooth\peripheral on Application Core

Jumper are connected as per the document

http://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.4.0/nrf/ug_nrf5340.html#getting-logging-output

$ btmon -d /dev/ttyS6 -B 1000000
Bluetooth monitor ver 5.53
--- /dev/ttyS6 opened ---
= New Index: 00:00:00:00:00:00 (Primary,Virtual,)
= New Index: 00:00:00:00:00:00 (Primary,Virtual,)
= New Index: 00:00:00:00:00:00 (Primary,Virtual,)
= New Index: 00:00:00:00:00:00 (Primary,Virtual,)
= New Index: 00:00:00:00:00:00 (Primary,Virtual,)
= New Index: 00:00:00:00:00:00 (Primary,Virtual,)
= New Index: 00:00:00:00:00:00 (Primary,Virtual,)
= New Index: 00:00:00:00:00:00 (Primary,Virtual,)
= New Index: 00:00:00:00:00:00 (Primary,Virtual,)
= New Index: 00:00:00:00:00:00 (Primary,Virtual,)
= New Index: 00:00:00:00:00:00 (Primary,Virtual,)
= New Index: 00:00:00:00:00:00 (Primary,Virtual,)
= New Index: 00:00:00:00:00:00 (Primary,Virtual,)
= New Index: 00:00:00:00:00:00 (Primary,Virtual,)
= New Index: 00:00:00:00:00:00 (Primary,Virtual,)

Have been following the video : https://www.youtube.com/watch?v=uqKxmsrP2Hc

Could not get the HCI flow between the Application core and Network core. Do we need to enable or disable any configuration during build. Please help.

Parents
  • Hi,

     

    In the peripheral prj.conf, add these configs:

    CONFIG_BT_DEBUG_MONITOR=y
    CONFIG_UART_CONSOLE=n
    

    Then you open the serial port via this command (you want the third com port of the DK, might be different on your PC):

    btmon --tty /dev/ttyACM2 --tty-speed 115200

    And you should see this output:

    Bluetooth monitor ver 5.56
    --- /dev/ttyACM3 opened ---
    = New Index: 00:00:00:00:00:00 (Primary,SMD,RPMsg)                                                                                                                                                                                                                                                                  0.276800
    = Note: *** Booting Zephyr OS build v2.4.99-ncs2  ***                                                                                                                                                                                                                                                               0.279900
    = Open Index: 00:00:00:00:00:00                                                                                                                                                                                                                                                                                     0.287700
    < HCI Command: Reset (0x03|0x0003) plen 0                                                                                                                                                                                                                                                                        #1 0.288700
    = bt: fs_nvs: 2 Sectors of 4096 bytes                                                                                                                                                                                                                                                                               0.862900
    * Drops: cmd 4 evt 4 acl_tx 0 acl_rx 0 sco_tx 0 sco_rx 0 other 0
    = bt: fs_nvs: alloc wra: 0, fc0                                                                                                                                                                                                                                                                                     0.862900
    * Drops: cmd 5 evt 5 acl_tx 0 acl_rx 0 sco_tx 0 sco_rx 0 other 0
    > HCI Event: Command Complete (0x0e) plen 4                                                                                                                                                                                                                                                                      #2 0.304100
          Host Buffer Size (0x03|0x0033) ncmd 1
            Status: Success (0x00)
    < HCI Command: Set Controller To Host Flow Control (0x03|0x0031) plen 1                                                                                                                                                                                                                                          #3 0.306200
            Flow control: ACL Data Packets (0x01)
    = bt: fs_nvs: data wra: 0, 4c                                                                                                                                                                                                                                                                                       0.863000
    * Drops: cmd 4 evt 4 acl_tx 0 acl_rx 0 sco_tx 0 sco_rx 0 other 0
    > HCI Event: Command Complete (0x0e) plen 12                                                                                                                                                                                                                                                                     #4 0.312000
          LE Read Maximum Data Length (0x08|0x002f) ncmd 1
            Status: Success (0x00)
            Max TX octets: 251
            Max TX time: 2704
            Max RX octets: 251
            Max RX time: 2704
    < HCI Command: LE Write Suggested Default Data Length (0x08|0x0024) plen 4                                                                                                                                                                                                                                       #5 0.314800
            TX octets: 251
            TX time: 2704
    > HCI Event: Command Complete (0x0e) plen 4                                                                                                                                                                                                                                                                      #6 0.317200
          LE Write Suggested Default Data Length (0x08|0x0024) ncmd 1
            Status: Success (0x00)
    < HCI Command: LE Set Resolvable Private Address Timeout (0x08|0x002e) plen 2                                                                                                                                                                                                                                    #7 0.318800
            Timeout: 900 seconds
    > HCI Event: Command Complete (0x0e) plen 4                                                                                                                                                                                                                                                                      #8 0.321000
          LE Set Resolvable Private Address Timeout (0x08|0x002e) ncmd 1
            Status: Success (0x00)
    < HCI Command: LE Read Resolving List Size (0x08|0x002a) plen 0                                                                                                                                                                                                                                                  #9 0.322600
    > HCI Event: Command Complete (0x0e) plen 5                                                                                                                                                                                                                                                                     #10 0.324600
          LE Read Resolving List Size (0x08|0x002a) ncmd 1
            Status: Success (0x00)
            Size: 8
    < HCI Command: LE Set Event Mask (0x08|0x0001) plen 8                                                                                                                                                                                                                                                           #11 0.326300
            Mask: 0x0000000000000a5e
              LE Advertising Report
              LE Connection Update Complete
              LE Read Remote Used Features Complete
              LE Long Term Key Request
              LE Data Length Change
              LE Enhanced Connection Complete
              LE PHY Update Complete
    > HCI Event: Command Complete (0x0e) plen 4                                                                                                                                                                                                                                                                     #12 0.329200
          LE Set Event Mask (0x08|0x0001) ncmd 1
            Status: Success (0x00)
    < HCI Command: Set Event Mask (0x03|0x0001) plen 8                                                                                                                                                                                                                                                              #13 0.330800
            Mask: 0x2000800002008890
              Disconnection Complete
              Encryption Change
              Read Remote Version Information Complete
              Hardware Error
              Data Buffer Overflow
              Encryption Key Refresh Complete
              LE Meta
    > HCI Event: Command Complete (0x0e) plen 4                                                                                                                                                                                                                                                                     #14 0.333500
          Set Event Mask (0x03|0x0001) ncmd 1
            Status: Success (0x00)
    < HCI Command: Vendor (0x3f|0x0001) plen 0                                                                                                                                                                                                                                                                      #15 0.335100
    > HCI Event: Command Complete (0x0e) plen 16                                                                                                                                                                                                                                                                    #16 0.337200
          Vendor (0x3f|0x0001) ncmd 1
            Status: Success (0x00)
            02 00 03 00 00 d9 e2 43 71 3b 2d c0              .......Cq;-.    
    < HCI Command: Vendor (0x3f|0x0002) plen 0                                                                                                                                                                                                                                                                      #17 0.340000
    > HCI Event: Command Complete (0x0e) plen 68                                                                                                                                                                                                                                                                    #18 0.342000
          Vendor (0x3f|0x0002) ncmd 1
            Status: Success (0x00)
            23 05 03 00 00 d9 e2 43 71 3b 2d c0 00 00 28 22  #......Cq;-...("
            00 00 00 00 00 00 04 00 00 f7 ff ff 7f 00 00 00  ................
            30 c0 79 fe 01 00 80 04 00 00 00 00 00 00 00 00  0.y.............
            00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    = Note: Bluetooth initialized                                                                                                                                                                                                                                                                                       0.349700
    < HCI Command: Read BD ADDR (0x04|0x0009) plen 0                                                                                                                                                                                                                                                                #19 0.353000
    > HCI Event: Command Complete (0x0e) plen 10                                                                                                                                                                                                                                                                    #20 0.355100
          Read BD ADDR (0x04|0x0009) ncmd 1
            Status: Success (0x00)
            Address: 00:00:00:00:00:00 (OUI 00-00-00)
    < HCI Command: Vendor (0x3f|0x0009) plen 0                                                                                                                                                                                                                                                                      #21 0.357300
    > HCI Event: Command Complete (0x0e) plen 27                                                                                                                                                                                                                                                                    #22 0.359300
          Vendor (0x3f|0x0009) ncmd 1
            Status: Success (0x00)
            01 36 4e 94 4e 1a f9 e5 2b b3 af eb 90 fc 33 0c  .6N.N...+.....3.
            c4 34 60 eb e7 78 b3                             .4`..x.         
    < HCI Command: LE Set Random Address (0x08|0x0005) plen 6                                                                                                                                                                                                                                                       #23 0.369100
            Address: 68:8C:F8:76:CE:46 (Resolvable)
    > HCI Event: Command Complete (0x0e) plen 4                                                                                                                                                                                                                                                                     #24 0.371700
          LE Set Random Address (0x08|0x0005) ncmd 1
            Status: Success (0x00)
    < HCI Command: LE Set Advertising Parameters (0x08|0x0006) plen 15                                                                                                                                                                                                                                              #25 0.373400
            Min advertising interval: 100.000 msec (0x00a0)
            Max advertising interval: 150.000 msec (0x00f0)
            Type: Connectable undirected - ADV_IND (0x00)
            Own address type: Random (0x01)
            Direct address type: Public (0x00)
            Direct address: 00:00:00:00:00:00 (OUI 00-00-00)
            Channel map: 37, 38, 39 (0x07)
            Filter policy: Allow Scan Request from Any, Allow Connect Request from Any (0x00)
    > HCI Event: Command Complete (0x0e) plen 4                                                                                                                                                                                                                                                                     #26 0.376800
          LE Set Advertising Parameters (0x08|0x0006) ncmd 1
            Status: Success (0x00)
    < HCI Command: LE Set Advertising Data (0x08|0x0008) plen 32                                                                                                                                                                                                                                                    #27 0.378400
            Length: 29
            Flags: 0x06
              LE General Discoverable Mode
              BR/EDR Not Supported
            16-bit Service UUIDs (complete): 3 entries
              Heart Rate (0x180d)
              Battery Service (0x180f)
              Current Time Service (0x1805)
            128-bit Service UUIDs (complete): 1 entry
              Vendor specific (12345678-1234-5678-1234-56789abcdef0)
    > HCI Event: Command Complete (0x0e) plen 4                                                                                                                                                                                                                                                                     #28 0.383500
          LE Set Advertising Data (0x08|0x0008) ncmd 1
            Status: Success (0x00)
    < HCI Command: LE Set Scan Response Data (0x08|0x0009) plen 32                                                                                                                                                                                                                                                  #29 0.385200
            Length: 31
            Name (short): Zephyr Peripheral Sample Long
    > HCI Event: Command Complete (0x0e) plen 4                                                                                                                                                                                                                                                                     #30 0.390200
          LE Set Scan Response Data (0x08|0x0009) ncmd 1
            Status: Success (0x00)
    < HCI Command: LE Set Advertise Enable (0x08|0x000a) plen 1                                                                                                                                                                                                                                                     #31 0.391800
            Advertising: Enabled (0x01)
    > HCI Event: Command Complete (0x0e) plen 4                                                                                                                                                                                                                                                                     #32 0.394500
          LE Set Advertise Enable (0x08|0x000a) ncmd 1
            Status: Success (0x00)
    = Note: Advertising successfully started                                                                                                                                                                                                                                                                            0.396100
    = bt: bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)                                                                                                                                                                                                                                                       0.339900
    = bt: bt_hci_core: HW Variant: nRF53x (0x0003)                                                                                                                                                                                                                                                                      0.340000
    = bt: bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 217.17378 Build 3224189809                                                                                                                                                                                                                0.340000
    = bt: bt_hci_core: ECC HCI commands not available                                                                                                                                                                                                                                                                   0.349700
    = bt: bt_hci_core: No ID address. App must call settings_load()                                                                                                                                                                                                                                                     0.349700
    = bt: bt_hci_core: Identity: F9:1A:4E:94:4E:36 (random)                                                                                                                                                                                                                                                             0.367300
    = bt: bt_hci_core: HCI: version 5.2 (0x0b) revision 0x21c2, manufacturer 0x0059                                                                                                                                                                                                                                     0.367300
    = bt: bt_hci_core: LMP: version 5.2 (0x0b) subver 0x21c2                                   

     

    Kind regards,

    Håkon

  • Thanks it works.

    The following is used  in prj.conf

    CONFIG_UART_CONSOLE=n
    CONFIG_BT_DEBUG_MONITOR_UART=y

Reply Children
No Data
Related