Re: Testing Bluetooth with QEMU


Priyanka
 

Hi Paul


Yes, first I did use "make run".


In the Zephyr's application console QEMU :

-------------------------------------------------------------

Bluetooth gets initialized and Beacon started. All looks fine there.


Then, in the Host PC ( Linux console) :

-----------------------------------------------------

I do "hciconfig"  to see hci0 and hci1

With 'hciconfig" it looks all ok.


It is only when I use "hciconfig -a"  in the Host PC (Linux console) then

I get the following in the Zephyr's app console QEMU.

In the Zephyr's application console QEMU :

------------------------------------------

[bt] [ERR] read_payload: Not enough space in buffer [bt] [WRN] hci_cmd_done: pool id 1 pool 0x00405098 != &hci_cmd_pool 0x00405078

I get this error for other bluetooth samples (e.g., peripheral_hr and IPSP) as well.

Here is my set up to make it more clear to you.

Terminal 1

----------------

# zephyr/samples/bluetooth/beacon$ make run

Starting Beacon Demo
[bt] [INF] show_dev_info: Identity: 00:aa:01:00:00:23 (public)
[bt] [INF] show_dev_info: HCI: version 5.0 (0x09) revision 0x0000, manufacturer 0x003f
[bt] [INF] show_dev_info: LMP: version 5.0 (0x09) subver 0x0000
Bluetooth initialized
Beacon started


Host PC (Terminal 2)
--------------------
$ sudo tools/btproxy -u
Listening on /tmp/bt-server-bredr
Opening user channel for hci0
New client connected


Host PC (Terminal 3)

-------------------------------

$ hciconfig

hci2:    Type: BR/EDR  Bus: USB
    BD Address: 08:ED:B9:DD:DD:86  ACL MTU: 1021:8  SCO MTU: 64:1
    UP RUNNING
    RX bytes:589 acl:0 sco:0 events:36 errors:0
    TX bytes:2564 acl:0 sco:0 commands:36 errors:0

hci1:    Type: BR/EDR  Bus: VIRTUAL
    BD Address: 00:AA:01:01:00:24  ACL MTU: 192:1  SCO MTU: 0:0
    UP RUNNING
    RX bytes:0 acl:0 sco:0 events:77 errors:0
    TX bytes:1205 acl:0 sco:0 commands:77 errors:0

hci0:    Type: BR/EDR  Bus: VIRTUAL
    BD Address: 00:AA:01:00:00:23  ACL MTU: 192:1  SCO MTU: 0:0
    UP RUNNING
    RX bytes:0 acl:0 sco:0 events:77 errors:0
    TX bytes:1389 acl:0 sco:0 commands:97 errors:0



Host PC (Terminal 3)

-------------------------------


$ sudo hciconfig  -a


gives me the following
Can't read class of device on hci0: Connection timed out (110)


hci0: Type: BR/EDR Bus: VIRTUAL

BD Address: 00:AA:01:00:00:23 ACL MTU: 192:1 SCO MTU: 0:0

UP RUNNING

RX bytes:0 acl:0 sco:0 events:203 errors:0

TX bytes:7024 acl:0 sco:0 commands:636 errors:0

Features: 0xa4 0x08 0x08 0xc0 0x58 0x1e 0x7b 0x83

Packet type: DM1 DH1 HV1

Link policy: RSWITCH SNIFF

Link mode: SLAVE ACCEPT

Name: 'xxxxxx #1'

Can't read class of device on hci0: Connection timed out (110)

Whereas at the other end on Terminal 1 (Zephyr's application console QEMU), I get the following.

Terminal 1 (Zephyr's application console QEMU) :

-------------------------------------------------

[bt] [ERR] read_payload: Not enough space in buffer [bt] [WRN] hci_cmd_done: pool id 1 pool 0x00405098 != &hci_cmd_pool 0x00405078

I restarted QEMU to see if it works, but I get the same error again.

Thanks
Priyanka


From: Paul Sokolovsky <paul.sokolovsky@...>
Sent: Monday, September 18, 2017 4:41 PM
To: Priyanka Rawat
Cc: zephyr-users@...
Subject: Re: [Zephyr-users] Testing Bluetooth with QEMU
 
Hello Priyanka,

On Mon, 18 Sep 2017 09:24:55 +0000
Priyanka Rawat <priyanka.rawat@...> wrote:

[]


> When I do "make qemu" : Bluetooth is initialized and Beacon started.
> BD address is 00:aa:01:00:00:23 (public).

I can't say much of BT emulation using QEMU - never tried that, but
you should use "make run" instead of "make qemu". It's an oversight
that the latter still works, and at least some issues were spotted
with it: https://github.com/zephyrproject-rtos/zephyr/issues/1522

>
>
> However, "hciconfig -a" gives
>
> [bt] [ERR] read_payload: Not enough space in buffer
>
> [bt] [WRN] hci_cmd_done: pool id 1 pool 0x00405098 != &hci_cmd_pool
> 0x00405078

I'd suggest to describe more explicitly where/how '"hciconfig -a"
gives' that: at the Linux console while running the command, in the
Linux syslog, in Zephyr's application console QEMU, etc. (Maybe it's
obvious, but I wouldn't jump to reproduce it with the info given, though
again, I may be biased as I never tried that).



Otherwise, if you don't receive a reply here, can you consider joining
the IRC channel and try to ping @jhe and other Bluetooth folks there?
(I'd hope they read the list, but I sometimes myself skip to check it
for few days.)

Sorry for not bringing more specific answers.

[]

>
> Thanks
> Priyanka
>



--
Best Regards,
Paul

Linaro.org | Open source software for ARM SoCs
Follow Linaro: http://www.facebook.com/pages/Linaro
http://twitter.com/#!/linaroorg - http://www.linaro.org/linaro-blog
twitter.com
1,732 tweets • 605 photos/videos • 3,058 followers. Check out the latest Tweets from Linaro (@LinaroOrg)

Join users@lists.zephyrproject.org to automatically receive all group messages.