Skip to content

nordic 9.1.0: restart VM after advertising causes disconnect and (hard?) restart #9432

@dhalbert

Description

@dhalbert

CircuitPython version

Adafruit CircuitPython 9.1.0 on 2024-07-10; Adafruit Feather nRF52840 Express with nRF52840

Code/REPL

from adafruit_ble import BLERadio
from adafruit_ble.advertising.standard import ProvideServicesAdvertisement
from adafruit_ble.services.nordic import UARTService
import time

ble = BLERadio()
uart = UARTService()
advertisement = ProvideServicesAdvertisement(uart)

while True:
    ble.start_advertising(advertisement)
    while not ble.connected:
        pass

Behavior

code.py output:
Traceback (most recent call last):
  File "code.py", line 13, in <module>
KeyboardInterrupt: 

Code done running.

Press any key to enter the REPL. Use CTRL-D to reload.

Adafruit CircuitPython 9.1.0 on 2024-07-10; Adafruit Feather nRF52840 Express with nRF52840
>>> 

[13:37:44.406] Disconnected
[13:37:45.407] Warning: Could not open tty device (No such file or directory)
[13:37:45.407] Waiting for tty device..
[13:37:47.409] Connected

If these lines are commented out, I don't see the disconnect:

    ble.start_advertising(advertisement)
    while not ble.connected:
        pass

Description

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions