Unable to connect to device with pc-ble-driver-py 0.16.3

I'm running on Windows 10 and am trying to connect to my BMD-350 development board with an NRF52832. 

I've also attempted to execute this with Python 3.9 and 3.8 (both installed via source, both 32-bit).

When attempting to run the heart_rate_collector.py example, this is the error I'm receiving:

> python .\heart_rate_collector.py NRF52 COM4
Serial port used: COM4
2022-06-09 12:30:24,180 [28100/LogThread] Successfully opened COM4. Baud rate: 1000000. Flow control: none. Parity: none.
2022-06-09 12:30:24,180 [28100/LogThread] evt> severity(20) message(Successfully opened COM4. Baud rate: 1000000. Flow control: none. Parity: none.)
2022-06-09 12:30:24,181 [28292/StatusThread] RpcAppStatus.resetPerformed: Target Reset performed
2022-06-09 12:30:24,181 [28292/StatusThread] evt> status code(RpcAppStatus.resetPerformed) message(Target Reset performed)
2022-06-09 12:30:26,368 [28292/StatusThread] RpcAppStatus.pktSendMaxRetriesReached: No response from device. Tried to send packet 6 times.
2022-06-09 12:30:26,387 [28292/StatusThread] evt> status code(RpcAppStatus.pktSendMaxRetriesReached) message(No response from device. Tried to send packet 6 times.)
Traceback (most recent call last):
File ".\heart_rate_collector.py", line 216, in <module>
main(serial_port)
collector.open()
File ".\heart_rate_collector.py", line 86, in open
self.adapter.driver.open()
File "<path-to>\venv\lib\site-packages\pc_ble_driver_py\ble_driver.py", line 106, in wrapper
raise NordicSemiException(
pc_ble_driver_py.exceptions.NordicSemiException: Failed to open. Error code: NRF_ERROR_TIMEOUT

I've already flashed the BMD-350 with connectivity_4.1.4_usb_with_s132_5.1.0.hex and have attempted this with flashing all the other available hex files as well.

I've already had this board working when when running on on Python 2.7 and using the pc-ble-driver-py 0.11.4 library. The goal here is to upgrade the libraries to Python3.

I've looked over some of the other support tickets here and I haven't been able to resolve my issue.

Any help would be appreciated!

  • Hi,

    (No response from device. Tried to send packet 6 times.)

    Are you sure that you are using the correct COM port? Does running the serial_port_enum.py example work?

  • Hi, yes serial_port_enum.py works fine. I get that COM4 is the only COM port available for the NRF which is correct.

  • LimeSlice said:
    Hi, yes serial_port_enum.py works fine. I get that COM4 is the only COM port available for the NRF which is correct.

    Can you post the output from that? Did you get "Port "{}" already flashed with connectivity firmware" ? or "Flashing Port"-> "Firmware flashed" ?

    Does heart_rate_collector.py work after you run serial_port_enum.py ?

  • Can you post the output from that? Did you get "Port "{}" already flashed with connectivity firmware" ? or "Flashing Port"-> "Firmware flashed" ?

    > python .\venv\Lib\site-packages\pc_ble_driver_py\examples\serial_port_enum.py NRF52 COM4
    enum_serial_ports: 1 serial ports found

    Serial port #0:
    |
    |- Port: "COM4"
    |- Manufacturer: "SEGGER"
    |- Serial Number: "682623702"
    |- PnP ID: "USB\VID_1366&PID_1015&MI_00\8&2B796293&0&0000"
    |- Location ID: ""
    |- Vendor ID: ""
    |_ Product ID: ""
    Port "COM4" already flashed with connectivity firmware

    > python .\venv\Lib\site-packages\pc_ble_driver_py\examples\heart_rate_collector.py NRF52 COM4
    Serial port used: COM4
    2022-06-13 09:01:40,265 [7748/LogThread] Successfully opened COM4. Baud rate: 1000000. Flow control: none. Parity: none.
    2022-06-13 09:01:40,266 [7748/LogThread] evt> severity(20) message(Successfully opened COM4. Baud rate: 1000000. Flow control: none. Parity: none.)
    2022-06-13 09:01:40,266 [10860/StatusThread] RpcAppStatus.resetPerformed: Target Reset performed
    2022-06-13 09:01:40,267 [10860/StatusThread] evt> status code(RpcAppStatus.resetPerformed) message(Target Reset performed)
    2022-06-13 09:01:42,452 [10860/StatusThread] RpcAppStatus.pktSendMaxRetriesReached: No response from device. Tried to send packet 6 times.
    2022-06-13 09:01:42,452 [10860/StatusThread] evt> status code(RpcAppStatus.pktSendMaxRetriesReached) message(No response from device. Tried to send packet 6 times.)
    Traceback (most recent call last):
    File ".\venv\Lib\site-packages\pc_ble_driver_py\examples\heart_rate_collector.py", line 216, in <module>
    main(serial_port)
    File ".\venv\Lib\site-packages\pc_ble_driver_py\examples\heart_rate_collector.py", line 174, in main
    collector.open()
    File ".\venv\Lib\site-packages\pc_ble_driver_py\examples\heart_rate_collector.py", line 86, in open
    self.adapter.driver.open()
    File "<path-to>\venv\lib\site-packages\pc_ble_driver_py\ble_driver.py", line 103, in wrapper
    raise NordicSemiException(
    pc_ble_driver_py.exceptions.NordicSemiException: Failed to open. Error code: NRF_ERROR_TIMEOUT

    I've also tried this with both 32-bit and 64-bit Python versions without success. This run was testing with pc-ble-driver-py 0.14.2 as I wanted to check if a previous version would work, but you can see this fails as well.

  • I resolved my issue. I was apparently programming the connectivity hex file incorrectly. Before, I was flashing the device through:

    nrfjprog --snr <mac-id> --program <connectivity-hex-file> --chiperase --family NRF52

    I ended up getting it to work by flashing the device through the nRF Connect For Desktop UI. Not sure why this is the case, but good enough for me Stuck out tongue

Related