how do I send a array looks like this
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 25, 255]
via bluetoothctl to my BLE device.
Here are my commands
Code: Select all
sudo bluetoothctl
[bluetooth]# connect EB:01:9D:FE:27:B1
Attempting to connect to EB:01:9D:FE:27:B1
[CHG] Device EB:01:9D:FE:27:B1 Connected: yes
Connection successful
[CHG] Device EB:01:9D:FE:27:B1 ServicesResolved: yes
[Nuimo]# menu gatt
[Nuimo]# select-attribute f29b152d-cb19-40f3-be5c-7241ecb82fd2
[Nuimo:/service001b/char002f]#
[Nuimo:/service001b/char002f]# write data="[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 25, 255]"
Invalid value at index 0
Attempting to write /org/bluez/hci0/dev_EB_01_9D_FE_27_B1/service001b/char002f
[Nuimo:/service001b/char002f]#
[Nuimo:/service001b/char002f]# attribute-info f29b152d-cb19-40f3-be5c-7241ecb82fd2
Characteristic - Vendor specific
UUID: f29b152d-cb19-40f3-be5c-7241ecb82fd2
Service: /org/bluez/hci0/dev_EB_01_9D_FE_27_B1/service001b
Flags: read
Flags: write-without-response
Flags: write
But nothing happend.....
You can select and write to an attribute without going in to the gatt menu by prepending gatt. to the command. For example:
gatt.select-attribute f29b152d-cb19-40f3-be5c-7241ecb82fd2
To write to a characteristic use the hex values in quotes. For example:
gatt.write "0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x10 0x19 0xff"
Here a log of a session on my system connecting to a BBC micro:bit:
$ bluetoothctl
Agent registered
[bluetooth]# connect E1:4B:6C:22:56:F0
Attempting to connect to E1:4B:6C:22:56:F0
[CHG] Device E1:4B:6C:22:56:F0 Connected: yes
Connection successful
[CHG] Device E1:4B:6C:22:56:F0 UUIDs: 00001800-0000-1000-8000-00805f9b34fb
[CHG] Device E1:4B:6C:22:56:F0 UUIDs: 00001801-0000-1000-8000-00805f9b34fb
[CHG] Device E1:4B:6C:22:56:F0 UUIDs: 0000180a-0000-1000-8000-00805f9b34fb
[CHG] Device E1:4B:6C:22:56:F0 UUIDs: 0000fe59-0000-1000-8000-00805f9b34fb
[CHG] Device E1:4B:6C:22:56:F0 UUIDs: 6e400001-b5a3-f393-e0a9-e50e24dcca9e
[CHG] Device E1:4B:6C:22:56:F0 UUIDs: e95d6100-251d-470a-a062-fa1922dfa9a8
[CHG] Device E1:4B:6C:22:56:F0 UUIDs: e95d93af-251d-470a-a062-fa1922dfa9a8
[CHG] Device E1:4B:6C:22:56:F0 UUIDs: e95d9882-251d-470a-a062-fa1922dfa9a8
[CHG] Device E1:4B:6C:22:56:F0 UUIDs: e95dd91d-251d-470a-a062-fa1922dfa9a8
[CHG] Device E1:4B:6C:22:56:F0 UUIDs: e97dd91d-251d-470a-a062-fa1922dfa9a8
[CHG] Device E1:4B:6C:22:56:F0 ServicesResolved: yes
[BBC micro:bit [toveg]]# gatt.select-attribute e95d93ee-251d-470a-a062-fa1922dfa9a8
[BBC micro:bit [toveg]:/service0035/char0038]# gatt.write "0x42 0x4C 0x45 0x23"
Attempting to write /org/bluez/hci0/dev_E1_4B_6C_22_56_F0/service0035/char0038
[BBC micro:bit [toveg]:/service0035/char0038]#
This sent the values successfully.
Related
I'm experiencing a strange issue with one of my applications:
Background:
One of my features requires Bluetooth connectivity. Once a device (i.e. phone) is paired with the host, I continuously "poll" the device, to extract the RSSI (signal strength).
The polling is achieved by connecting to the device on PSM port 0x0001 (1), via Bluetooth sockets on L2CAP, sending an HCI request to query for signal strength, extracting the signal strength, and closing the connection.
Issue:
Everything works fine, and as expected, until I integrate the Simcom 7600G LTE module (Needed for internet connectivity) via PCI.
When I plug the module in, I am no longer able to do an L2CAP Bluetooth socket connection, with an error message of "Time Out" (it will time out depending on what I set the socket.settimeout(...)
As soon as I unplug the LTE module, everything works as expected and I am able to establish the socket connection with the remote Bluetooth device.
Observation:
What is strange is that the Bluetooth discovery and pairing process still works as expected, with the LTE module integrated. It is only the L2CAP Bluetooth sockets that I've written in code (Python) that no longer work, timing out every time a connection is attempted.
So, simply, when the LTE module is not in the PCI slot, everything works flawlessly - the discovery, pairing, BluetoothSocket L2CAP connection, and RSSI querying.
When it is plugged out, the discovery and pairing work, but I get Timed Out when attempting to establish a BluetoothSocket connection via L2CAP. (I've also tried RFCOMM with no luck).
Another strange observation is, when I am monitoring bluetoothctl, I can see the Agent displaying:
[CHG] Device BB:BB:BB:BB:BB:BB Connected: yes
[CHG] Device BB:BB:BB:BB:BB:BB Connected: no
And it displays this in both scenarios, with the LTE module in and out, yet at the application layer, it times out.
Questions and Assumptions:
As a general question, why might this be occurring?
Could it be some form of interference? And if so, given other protocols seem to be working fine, with all other protocols presumably on the same band (2.4GHz), why is it that L2CAP is affected? As far as I understand, the Bluetooth Stack specifies L2CAP as the underlying layer 3 protocol.
If not interference, what other settings could be interfering between
two completely different chips, and network interfaces?
Additional Data:
Test code:
import traceback
import bluetooth
import bluetooth._bluetooth as bt
bt_sock = bluetooth.BluetoothSocket(bluetooth.L2CAP)
bt_sock.settimeout(5)
# [0, 672, 65535, 0, 1, 3, 63]
print(bt_sock.get_l2cap_options())
try:
print("Connecting...")
bt_sock.connect(("BB:BB:BB:BB:BB:BB", 1))
print("Closing...")
bt_sock.close()
except Exception as e:
print(e)
print(traceback.format_exc())
I've run a btmon on my adapter, with the below problem dump:
Bluetooth monitor ver 5.55
= Note: Linux version 5.4.154-5.5.0-devel+git.c65f1622951c (aarch64) 0.210966
= Note: Bluetooth subsystem version 2.22 0.210971
= New Index: AA:AA:AA:AA:AA:AA (Primary,USB,hci0) [hci0] 0.210973
= Open Index: AA:AA:AA:AA:AA:AA [hci0] 0.210973
= Index Info: AA:AA:AA:AA:AA:AA (Marvell Technology Group Ltd.) [hci0] 0.210975
# MGMT Open: bluetoothd (privileged) version 1.14 {0x0001} 0.210976
# RAW Open: python3 (privileged) version 2.22 {0x0002} 13.767587
# RAW Close: python3 {0x0002} 13.767635
# RAW Open: python3 (privileged) version 2.22 {0x0002} [hci0] 13.767704
< HCI Command: Create Connection (0x01|0x0005) plen 13 #1 [hci0] 13.771761
Address: BB:BB:BB:BB:BB:BB (OUI AC-6C-90)
Packet type: 0xcc18
DM1 may be used
DH1 may be used
DM3 may be used
DH3 may be used
DM5 may be used
DH5 may be used
Page scan repetition mode: R2 (0x02)
Page scan mode: Mandatory (0x00)
Clock offset: 0x0000
Role switch: Allow slave (0x01)
> HCI Event: Command Status (0x0f) plen 4 #2 [hci0] 13.776071
Create Connection (0x01|0x0005) ncmd 1
Status: Success (0x00)
> HCI Event: Role Change (0x12) plen 8 #3 [hci0] 14.798704
Status: Success (0x00)
Address: BB:BB:BB:BB:BB:BB (OUI AC-6C-90)
Role: Slave (0x01)
> HCI Event: Page Scan Repetition Mode Change (0x20) plen 7 #4 [hci0] 14.804429
Address: BB:BB:BB:BB:BB:BB (OUI AC-6C-90)
Page scan repetition mode: R0 (0x00)
> HCI Event: Connect Complete (0x03) plen 11 #5 [hci0] 14.804676
Status: Success (0x00)
Handle: 1
Address: BB:BB:BB:BB:BB:BB (OUI AC-6C-90)
Link type: ACL (0x01)
Encryption: Disabled (0x00)
< HCI Command: Read Remote Supported Features (0x01|0x001b) plen 2 #6 [hci0] 14.804842
Handle: 1
> HCI Event: Command Status (0x0f) plen 4 #7 [hci0] 14.806679
Read Remote Supported Features (0x01|0x001b) ncmd 1
Status: Success (0x00)
< HCI Command: Write Scan Enable (0x03|0x001a) plen 1 #8 [hci0] 14.806804
Scan enable: No Scans (0x00)
> ACL Data RX: Handle 1 flags 0x02 dlen 10 #9 [hci0] 14.816323
L2CAP: Information Request (0x0a) ident 2 len 2
Type: Extended features supported (0x0002)
> HCI Event: Max Slots Change (0x1b) plen 3 #10 [hci0] 14.822810
Handle: 1
Max slots: 5
> HCI Event: Read Remote Supported Features (0x0b) plen 11 #11 [hci0] 14.826428
Status: Success (0x00)
Handle: 1
Features: 0xbf 0xfe 0x8f 0xfe 0xdb 0xff 0x7b 0x87
3 slot packets
5 slot packets
Encryption
Slot offset
Timing accuracy
Role switch
Sniff mode
Power control requests
Channel quality driven data rate (CQDDR)
SCO link
HV2 packets
HV3 packets
u-law log synchronous data
A-law log synchronous data
CVSD synchronous data
Paging parameter negotiation
Power control
Transparent synchronous data
Broadcast Encryption
Enhanced Data Rate ACL 2 Mbps mode
Enhanced Data Rate ACL 3 Mbps mode
Enhanced inquiry scan
Interlaced inquiry scan
Interlaced page scan
RSSI with inquiry results
Extended SCO link (EV3 packets)
EV4 packets
EV5 packets
AFH capable slave
AFH classification slave
LE Supported (Controller)
3-slot Enhanced Data Rate ACL packets
5-slot Enhanced Data Rate ACL packets
Sniff subrating
Pause encryption
AFH capable master
AFH classification master
Enhanced Data Rate eSCO 2 Mbps mode
Enhanced Data Rate eSCO 3 Mbps mode
3-slot Enhanced Data Rate eSCO packets
Extended Inquiry Response
Simultaneous LE and BR/EDR (Controller)
Secure Simple Pairing
Encapsulated PDU
Erroneous Data Reporting
Non-flushable Packet Boundary Flag
Link Supervision Timeout Changed Event
Inquiry TX Power Level
Enhanced Power Control
Extended features
> HCI Event: Command Complete (0x0e) plen 4 #12 [hci0] 14.834553
Write Scan Enable (0x03|0x001a) ncmd 1
Status: Success (0x00)
< HCI Command: Read Remote Extended Features (0x01|0x001c) plen 3 #13 [hci0] 14.834600
Handle: 1
Page: 1
> HCI Event: Command Status (0x0f) plen 4 #14 [hci0] 14.836925
Read Remote Extended Features (0x01|0x001c) ncmd 1
Status: Success (0x00)
> HCI Event: Read Remote Extended Features (0x23) plen 13 #15 [hci0] 14.845426
Status: Success (0x00)
Handle: 1
Page: 1/2
Features: 0x0f 0x00 0x00 0x00 0x00 0x00 0x00 0x00
Secure Simple Pairing (Host Support)
LE Supported (Host)
Simultaneous LE and BR/EDR (Host)
Secure Connections (Host Support)
< HCI Command: Remote Name Request (0x01|0x0019) plen 10 #16 [hci0] 14.845484
Address: BB:BB:BB:BB:BB:BB (OUI AC-6C-90)
Page scan repetition mode: R2 (0x02)
Page scan mode: Mandatory (0x00)
Clock offset: 0x0000
< ACL Data TX: Handle 1 flags 0x00 dlen 10 #17 [hci0] 14.845502
L2CAP: Information Request (0x0a) ident 1 len 2
Type: Extended features supported (0x0002)
< ACL Data TX: Handle 1 flags 0x00 dlen 16 #18 [hci0] 14.845526
L2CAP: Information Response (0x0b) ident 2 len 8
Type: Extended features supported (0x0002)
Result: Success (0x0000)
Features: 0x000002b8
Enhanced Retransmission Mode
Streaming Mode
FCS Option
Fixed Channels
Unicast Connectionless Data Reception
> HCI Event: Link Supervision Timeout Changed (0x38) plen 4 #19 [hci0] 14.845680
Handle: 1
Timeout: 5000.000 msec (0x1f40)
> HCI Event: Command Status (0x0f) plen 4 #20 [hci0] 14.847801
Remote Name Request (0x01|0x0019) ncmd 1
Status: Success (0x00)
> HCI Event: Remote Name Req Complete (0x07) plen 255 #21 [hci0] 14.859923
Status: Success (0x00)
Address: BB:BB:BB:BB:BB:BB (OUI AC-6C-90)
Name: Sasa's S21 Ultra
# MGMT Event: Device Connected (0x000b) plen 31 {0x0001} [hci0] 14.859948
BR/EDR Address: BB:BB:BB:BB:BB:BB (OUI AC-6C-90)
Flags: 0x00000000
Data length: 18
Name (complete): Sasa's S21 Ultra
# RAW Close: python3 {0x0002} [hci0] 15.848984
< HCI Command: Disconnect (0x01|0x0006) plen 3 #22 [hci0] 17.852261
Handle: 1
Reason: Remote User Terminated Connection (0x13)
> HCI Event: Command Status (0x0f) plen 4 #23 [hci0] 17.853904
Disconnect (0x01|0x0006) ncmd 1
Status: Success (0x00)
> HCI Event: Disconnect Complete (0x05) plen 4 #24 [hci0] 17.867262
Status: Success (0x00)
Handle: 1
Reason: Connection Terminated By Local Host (0x16)
# MGMT Event: Device Disconnected (0x000c) plen 8 {0x0001} [hci0] 17.867286
BR/EDR Address: BB:BB:BB:BB:BB:BB (OUI AC-6C-90)
Reason: Connection terminated by local host (0x02)
< HCI Command: Write Scan Enable (0x03|0x001a) plen 1 #25 [hci0] 17.920401
Scan enable: Page Scan (0x02)
> HCI Event: Command Complete (0x0e) plen 4 #26 [hci0] 17.924903
Write Scan Enable (0x03|0x001a) ncmd 1
Status: Success (0x00)
I'm working with a smart watch and raspberry Pi, and I'm able to successfully connect smart watch and get data from smart watch, there is no problem with getting data from smart watch using raspberry pi, but only problem is connection, some I'm able to connect without any errors and problems, but sometimes watch keeps on connecting and disconnecting automatically, see this log of bluetoothctl.
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
Raspberry Pi specs
Distributor ID: Raspbian
Description: Raspbian GNU/Linux 11 (bullseye)
Release: 11
Codename: bullseye
I'm trying to test a flutter app on iOS using my macOS virtual machine, but I can't get my old iPhone 6 to connect. I was able to get it to connect once last week, but since then it will immediately disconnect from the guest and back to the host whenever I plug it in. Here's some info about my setup:
Host OS: Ubuntu 20.04
Guest OS: macOS Big Sur 11.2
Phone: iPhone 6, iOS 12.5.1
Virtualization: VMWare player 16.1.0
I have the vm stored in a 2TB external USB drive
I added the line usb.quirks.device0 = "0x05ac:0x12a8 skip-reset, skip-refresh, skip-setconfig" to my vmx file which at least stops an infinite loop of connecting and disconnecting.
I have the vm settings to USB 2 and have all the options checked
If I plug the phone into a USB 3 port, I get a driver error, and if I plug it into a USB 2 port I sometimes get a message saying the device is busy.
I also get similar messages in the vmware log
2021-02-15T20:41:21.288-07:00| vmx| I005: USBGA: device 1000001d05ac12a8 arrived
2021-02-15T20:41:21.291-07:00| vmx| I005: MsgHint: msg.usb.disconnectHostProcess
2021-02-15T20:41:21.291-07:00| vmx| I005+ The specified device is in use by process:3922 /usr/libexec/gvfs-gphoto2-volume-monitor on the host operating system. Continuing will detach the device from the host operating system.
2021-02-15T20:41:21.291-07:00| vmx| I005+ ---------------------------------------
2021-02-15T20:41:21.297-07:00| vmx| W003: USBGL: failed to claim device (fd=19), interface 0. Retrying
2021-02-15T20:41:21.297-07:00| vmx| I005: USBGL: disconnect driver 'usbfs' from device 19, interface 0
2021-02-15T20:41:21.297-07:00| vmx| I005: USBGL: claimed device 19, interface 0 successfully
2021-02-15T20:41:21.297-07:00| vmx| I005: USBGL: Connected device 0x1000001d05ac12a8 successfully
2021-02-15T20:41:21.297-07:00| vmx| I005: USBG: Quirks for device 05ac:12a8 (user-defined,skip-setconfig,skip-reset,skip-refresh,slow-reconnect)
...
2021-02-15T20:41:21.617-07:00| vcpu-1| I005: USBGL: Disable port is not supported.
2021-02-15T20:41:21.719-07:00| vcpu-0| I005: USBG: Skipping device reset for 0x1000001d05ac12a8
2021-02-15T20:41:21.874-07:00| vmx| I005: USBG: Skipping SetConfiguration(1) for 0x1000001d05ac12a8
2021-02-15T20:41:21.879-07:00| vmx| W003: USBGL: failed to set device 19 to config 5: Device or resource busy
2021-02-15T20:41:21.879-07:00| vmx| I005: USBGL: claimed device 19, interface 0 successfully
2021-02-15T20:41:26.578-07:00| vmx| W003: USBGL: failed to submit urb to device 19: Device or resource busy
...
2021-02-15T20:41:26.579-07:00| vmx| W003: USBGL: failed to submit urb to device 19: Device or resource busy
2021-02-15T20:41:53.340-07:00| vmx| I005: USB: Disconnecting device 0x1000001e05ac12a8
2021-02-15T20:41:53.340-07:00| vmx| I005: USBG: Disconnecting 1000001e05ac12a8, port:0 reservedPort:5574C8CD9D20
2021-02-15T20:41:53.340-07:00| vmx| I005: USBGA: device 1000001e05ac12a8 already disconnected from host
The iPhone shows up under USB in system information. Manually connecting or disconnecting the device in the removable devices section of vmware doesn't seem to do anything.
Is there any other setting I can change or something I can try to get the iPhone to stay connected to the guest macOS?
Thanks so much!
Had the same problem. Need disable gvfs-gphoto2-volume-monitor and usbmuxd services in host OS (Ubuntu). Detail solution found here: https://www.insanelymac.com/forum/topic/326555-vmware-cant-connect-iphone/
Is the usbmuxd daemon that you need to disable but also to mask in order to prevent it from auto start again.
When you need to attach your iPhone to the VMWare Guest you need to execute the following commands:
sudo systemctl mask usbmuxd
sudo systemctl stop usbmuxd
When you finished and need to enable again the usbmuxd daemon you need to execute the following commands:
sudo systemctl unmask usbmuxd
sudo systemctl start usbmuxd
Also you may need to kill gvfs-gphoto2-volume-monitor by executing:
sudo killall gvfs-afc-volume-monitor
Tested and working on Fedora 36 with WMWare Workstation 16.2.3 and OSX guest 12.4
in the vmx file.... change the following line
usb_xhci:7.speed = "4"
like this
usb_xhci:7.speed = "2"
but it resets.Change the line after you open vmware...before starting the virtual machine....
you can check the port that iphone connects to from log....
in my case ... usb_xhci:7
Configuration:
Using Nucleo-L476RG. Using GNU ARM Eclipse. I have generated a minimalist code from STM32CubeMX. I have flashed J-link driver in my on board ST-Link.
Have been trying to run debugger for my code but my program counter is not setting at main().Instead it fails to read a certain memory address. The error "Break at address "0xXXXXXXXX" with no debug information available, or outside of program code." appears.
I've included the screenshot and debugger log in which we can see the error.
Please help
IMAGES:
https://ibb.co/bBRHxn https://ibb.co/mGDKA7 https://ibb.co/mE4gOS https://ibb.co/fh5AHn https://ibb.co/jNFMOS https://ibb.co/ibmT3S https://ibb.co/gpJaiS https://ibb.co/jgaMOS
LOGS:
SEGGER J-Link GDB Server V6.30f Command Line Version
JLinkARM.dll V6.30f (DLL compiled Mar 2 2018 17:29:18)
Command line: -if swd -device STM32L476RG -endian little -speed 1000 -port 2331 -swoport 2332 -telnetport 2333 -vd -ir -localhostonly 1 -singlerun -strict -timeout 0 -nogui
-----GDB Server start settings-----
GDBInit file: none
GDB Server Listening port: 2331
SWO raw output listening port: 2332
Terminal I/O port: 2333
Accept remote connection: localhost only
Generate logfile: off
Verify download: on
Init regs on start: on
Silent mode: off
Single run mode: on
Target connection timeout: 0 ms
------J-Link related settings------
J-Link Host interface: USB
J-Link script: none
J-Link settings file: none
------Target related settings------
Target device: STM32L476RG
Target interface: SWD
Target interface speed: 1000kHz
Target endian: little
Connecting to J-Link...
J-Link is connected.
Firmware: J-Link STLink V21 compiled Jun 26 2017 10:35:16
Hardware: V1.00
S/N: 770526094
Checking target voltage...
Target voltage: 3.30 V
Listening on TCP/IP port 2331
Connecting to target...
WARNING: T-bit of XPSR is 0 but should be 1. Changed to 1.
Connected to target
Waiting for GDB connection...Connected to 127.0.0.1
Reading all registers
Read 4 bytes # address 0x00000000 (Data = 0x4C05B510)
Read 2 bytes # address 0x00000000 (Data = 0xB510)
Received monitor command: speed 1000
Target interface speed set to 1000 kHz
Received monitor command: clrbp
Received monitor command: reset
Resetting target
Received monitor command: halt
Halting target CPU...
...Target halted (PC = 0xB9337822)
Received monitor command: regs
R0 = 00000000, R1 = 00000000, R2 = 00000000, R3 = 00000000
R4 = 00000000, R5 = 00000000, R6 = 00000000, R7 = 00000000
R8 = 00000000, R9 = 00000000, R10= 00000000, R11= 00000000
R12= 00000000, R13= 4C05B510, MSP= 4C05B510, PSP= 00000000
R14(LR) = FFFFFFFF, R15(PC) = B9337822
XPSR 01000000, APSR 00000000, EPSR 01000000, IPSR 00000000
CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00
Reading all registers
Received monitor command: speed auto
Select auto target interface speed (2000 kHz)
Received monitor command: flash breakpoints 1
Flash breakpoints enabled
Received monitor command: semihosting enable
Semi-hosting enabled (Handle on BKPT)
Received monitor command: semihosting IOClient 1
Semihosting I/O set to TELNET Client
Received monitor command: SWO DisableTarget 0xFFFFFFFF
SWO disabled successfully.
Received monitor command: SWO EnableTarget 0 0 0x1 0
SWO enabled successfully.
Read 4 bytes # address 0xB9337822 (Data = 0x00000000)
Read 2 bytes # address 0xB9337822 (Data = 0x0000)
Downloading 88 bytes # address 0x08000000 - Verified OK
Downloading 8 bytes # address 0x08000058 - Verified OK
Downloading 8 bytes # address 0x08000060 - Verified OK
Comparing flash [....................] Done.
Verifying flash [....................] Done.
Writing register (PC = 0x08000000)
Read 4 bytes # address 0x08000000 (Data = 0x4C05B510)
Read 2 bytes # address 0x08000000 (Data = 0xB510)
Received monitor command: clrbp
Received monitor command: reset
Resetting target
Received monitor command: halt
Halting target CPU...
...Target halted (PC = 0xB9337822)
Received monitor command: regs
R0 = 00000000, R1 = 00000000, R2 = 00000000, R3 = 00000000
R4 = 00000000, R5 = 00000000, R6 = 00000000, R7 = 00000000
R8 = 00000000, R9 = 00000000, R10= 00000000, R11= 00000000
R12= 00000000, R13= 4C05B510, MSP= 4C05B510, PSP= 00000000
R14(LR) = FFFFFFFF, R15(PC) = B9337822
XPSR 01000000, APSR 00000000, EPSR 01000000, IPSR 00000000
CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00
Reading all registers
Starting target CPU...
WARNING: T-bit of XPSR is 0 but should be 1. Changed to 1.
...Target halted (DBGRQ, PC = 0xF3AF4804)
Reading all registers
WARNING: Failed to read memory # address 0xF3AF4804
WARNING: Failed to read memory # address 0x4C05B50C
Reading 64 bytes # address 0x4C05B500
WARNING: Failed to read memory # address 0x4C05B500
WARNING: Failed to read memory # address 0x4C05B508
Reading 64 bytes # address 0x4C05B500
WARNING: Failed to read memory # address 0x4C05B500
WARNING: Failed to read memory # address 0x4C05B508
Reading 64 bytes # address 0xF3AF4800
WARNING: Failed to read memory # address 0xF3AF4800
WARNING: Failed to read memory # address 0xF3AF4804
Reading 64 bytes # address 0xF3AF4800
WARNING: Failed to read memory # address 0xF3AF4800
WARNING: Failed to read memory # address 0xF3AF4804
Reading 64 bytes # address 0xF3AF4800
WARNING: Failed to read memory # address 0xF3AF4800
WARNING: Failed to read memory # address 0xF3AF4806
Your issue might be caused by a missing startup file. Check your compilation console for this message: "warning: cannot find entry symbol Reset_Handler". If you find it, then refer to this other answer: https://stackoverflow.com/a/68381702/3567351.
I encountered the same issue when using j-link to debug my Board(STM32F407ZG), after changing the startup_stm32f407xx.s into startup_stm32f407xx.S(with uppercase 's' ), the problem disappeared. The reason might be gcc handles .s and .S in different ways
Change your startup_xx.s file suffix to uppercase.
I have fresh STM32 L1 discovery board, and it seems to be broken.
But I am not completely sure.
When connecting board via USB to the Linux machine, board starts
perfectly fine, and the demo works just as described by vendor.
But I am unable to actually connect to this board.
➜ lsusb -s 002:074
Bus 002 Device 074: ID 0483:3748 STMicroelectronics ST-LINK/V2
Board seems to be connected, big jumper (CN3) to switch between ST-LINK and DISCOVERY is set to DISCOVERY. But when I try to use st-link utility
I am receiving.
➜ stlink git:(master) ./st-flash --reset erase
libusb_handle_events() timeout
[!] send_recv
libusb_submit_transfer(-6)
[!] send_recv
libusb_submit_transfer(-6)
[!] send_recv
libusb_submit_transfer(-6)
[!] send_recv
libusb_submit_transfer(-6)
[!] send_recv
2015-12-25T19:24:57 INFO src/stlink-common.c: Loading device parameters....
libusb_submit_transfer(-6)
[!] send_recv
libusb_submit_transfer(-6)
[!] send_recv
libusb_submit_transfer(-6)
[!] send_recv
2015-12-25T19:24:57 WARN src/stlink-common.c: unknown chip id! 0
fish: Job 1, './st-flash --reset erase' terminated by signal SIGSEGV (Address boundary error)
Also OpenOCD is unable to talk to the board.
openocd -f board/stm32ldiscovery.cfg
Open On-Chip Debugger 0.9.0 (2015-12-25-18:43)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
adapter speed: 300 kHz
adapter_nsrst_delay: 100
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
none separate
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
Info : Unable to match requested speed 300 kHz, using 240 kHz
Info : Unable to match requested speed 300 kHz, using 240 kHz
Info : clock speed 240 kHz
Error: reset device failed
in procedure 'init'
in procedure 'ocd_bouncer'
The chip on board is STM32L152RCT6. I worked with STM32F0..4 before and had never such problems, but I did not worked with L series before, so I am not sure if this is board problem or I am skipping something important here.
EDIT: Using OpenOCD i found out not expected behaviour. At first run I am receiving error:
Error: init mode failed (unable to connect to the target)
At second run:
Error: reset device failed
Then device dissapears from the system, dmesg leaves messages:
[ 1336.080239] usb 2-1.1: reset full-speed USB device number 4 using ehci-pci
[ 1336.154250] usb 2-1.1: device descriptor read/64, error -32
[ 1336.329341] usb 2-1.1: device descriptor read/64, error -32
[ 1336.503334] usb 2-1.1: reset full-speed USB device number 4 using ehci-pci
[ 1336.566330] usb 2-1.1: device descriptor read/64, error -32
[ 1336.741385] usb 2-1.1: device descriptor read/64, error -32
[ 1336.915427] usb 2-1.1: reset full-speed USB device number 4 using ehci-pci
[ 1337.317517] usb 2-1.1: device not accepting address 4, error -32
[ 1337.390532] usb 2-1.1: reset full-speed USB device number 4 using ehci-pci
[ 1337.792623] usb 2-1.1: device not accepting address 4, error -32
[ 1337.793110] usb 2-1.1: USB disconnect, device number 4
[ 1337.855642] usb 2-1.1: new full-speed USB device number 5 using ehci-pci
[ 1337.918651] usb 2-1.1: device descriptor read/64, error -32
[ 1338.093691] usb 2-1.1: device descriptor read/64, error -32
[ 1338.267730] usb 2-1.1: new full-speed USB device number 6 using ehci-pci
[ 1338.330727] usb 2-1.1: device descriptor read/64, error -32
[ 1338.505783] usb 2-1.1: device descriptor read/64, error -32
[ 1338.679823] usb 2-1.1: new full-speed USB device number 7 using ehci-pci
[ 1339.081921] usb 2-1.1: device not accepting address 7, error -32
[ 1339.154935] usb 2-1.1: new full-speed USB device number 8 using ehci-pci
[ 1339.557024] usb 2-1.1: device not accepting address 8, error -32
[ 1339.557168] usb 2-1-port1: unable to enumerate USB device
I think there might be a problem with adapter speed, but I am not sure for now.
EDIT2: I tried with Windows ST Link Utility and I am not able to connect to the board, board causing "Detection Error" or "Connection Error", software suggests changing SWD frequency or mode. I tired with literally every combination but none works.
EDIT3: If this helps somebody, board was sent back, I have got information that it is actually broken and I have got new one. New one works flawlessly as expected.
Sometimes I work with the same L1 Discovery board on GNU/Linux. Both texane/stlink and OpenOCD detect it flawlessly without any modification. You can see the outputs:
$ st-util
2016-01-08T21:55:59 INFO src/stlink-common.c: Loading device parameters....
2016-01-08T21:55:59 INFO src/stlink-common.c: Device connected is: L1 Med-density device, id 0x10186416
2016-01-08T21:55:59 INFO src/stlink-common.c: SRAM size: 0x4000 bytes (16 KiB), Flash: 0x20000 bytes (128 KiB) in pages of 256 bytes
2016-01-08T21:55:59 INFO gdbserver/gdb-server.c: Chip ID is 00000416, Core ID is 2ba01477.
2016-01-08T21:55:59 INFO gdbserver/gdb-server.c: Target voltage is 2917 mV.
2016-01-08T21:55:59 INFO gdbserver/gdb-server.c: Listening at *:4242...
$ openocd -f board/stm32ldiscovery.cfg
GNU ARM Eclipse 64-bits Open On-Chip Debugger 0.10.0-dev-00141-g09aeb96-dirty (2015-10-28-11:56)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
adapter speed: 300 kHz
adapter_nsrst_delay: 100
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
none separate
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
Info : Unable to match requested speed 300 kHz, using 240 kHz
Info : Unable to match requested speed 300 kHz, using 240 kHz
Info : clock speed 240 kHz
Info : STLINK v2 JTAG v25 API v2 SWIM v0 VID 0x0483 PID 0x3748
Info : using stlink api v2
Info : Target voltage: 2.913980
Info : stm32l1.cpu: hardware has 6 breakpoints, 4 watchpoints
Maybe your board is really broken but before recycle it I suggest you two different trials. (a) I think after your question you have another ST (as you mentioned STM32F0..4) board perhaps with ST-LINK adaptor. You can use it as an external ST-LINK (follow eg. this). (b) Try to upgrade your embedded ST-LINK firmware with the STSW-LINK005 which java version works also in GNU/Linux environment. The board performs well for me both before and after upgrade.