-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BLE on the ESP32-S3 causes CircuitPython to hard fault under certain conditions #9708
Comments
I was able to reproduce the Some observations on the code: Error2 is So just spin until while not connection.paired:
print("checking pairing")
time.sleep(1) Also note that the rest of the code: dis = connection[DeviceInfoService]
print(dis.manufacturer)
print(dis.model_number) doesn't work, because the connection is not going the resolve the central's (the phone's) DeviceInfoService. If you, as a peripheral, want to use services provided by the central, you use a By the way the It is of course the case that we should not crash, and so I will keep this issue open. I think that the previous errors are getting BLE into a bad state in some way, and we are assuming something about the state that we shouldn't be. |
I think this should have a more useful error message than "unknown system firmware error", if it's so easily triggerable.
I based my code off of the device info example, so it would probably be a good idea to update that. |
CircuitPython version
Code/REPL
# See https://gist.github.com/gingershaped/d0336649c3da9f89775b22fcb78ea451
Behavior
Under specific conditions, connecting to the Memento board over Bluetooth Low Energy causes CircuitPython to hard fault and enter safe mode. Usually it happens after doing some variation on these steps:
ctstest.py
import supervisor; supervisor.runtime.ble_workflow = False
inboot.py
import ctstest
nonetheless, my phone paired to it
7.
import ctstest
again; my phone automatically connects to it, even though I passedbond=False
topair()
, and it produces a different error:import ctstest
again; this causes a hard faultIf my phone is able to pair, the board will occasionally show
BLE:Reconnecting
in the top status bar when it enters safe mode after faulting; when this happens, resetting the board will continue to showBLE:Reconnecting
(instead ofBLE:Off
as would be expected) and runningctftest
again causes it to stall on the call topair
when attempting to connect to it with my phone, and calling_bleio.adapter.erase_bonding()
makespair
work again even thoughctftest
explicitly passesbond=False
topair
.Description
No response
Additional information
The phone I have is a Google Pixel 6a. The vanilla CircuitPython build for the Memento does not have
_bleio
enabled, I'm using a modified version which includes it.The text was updated successfully, but these errors were encountered: