micropython / micropython

MicroPython - a lean and efficient Python implementation for microcontrollers and constrained systems
https://micropython.org
Other
19.16k stars 7.67k forks source link

[nrf-port] NRF51822 BLE is not working (can't apply GAP parameters) #7840

Open katte opened 3 years ago

katte commented 3 years ago

I've tried to compile and use bluetooth on a NRF51822 on a PCA10028, but I think that something in the code is broken.. If I compile for PCA10028 the board hang and REPL don't start. if I compile for PCA10000, PCA10001, PCA10031 I always get this error: No problem on the PCA10040.

>>> MicroPython v1.17-63-g67d1dca9c-dirty on 2021-09-21; PCA10001 with NRF51822
Type "help()" for more information.
>>> import ble
>>> ble.enable()
SoftDevice enabled
Traceback (most recent call last):
  File "<stdin>", in <module>
OSError: can't apply GAP parameters
arduino12 commented 1 year ago

Hi,

I also get the same OSError: can't apply GAP parameters, I tried compiling both microbit and pca10001 boards, tried on v1.14, v1.15, v1.17, v1.18, v1.19 and master- got the same error!

My HW is 2 nrf51822 boards (chip is nRF51822QFAA - 16KB RAM 256KB flash) I have purple and black EVB versions.

Compiled with: make BOARD=pca10001 SD=s110 and make BOARD=microbit SD=s110 under WSL ubuntu22.04 LTS.

I got: drivers/bluetooth/s110_nrf51_8.0.0/s110_nrf51_8.0.0_softdevice.hex build-pca10001-s110/firmware.hex and build-microbit-s110/firmware.hex

I flashed the .hex file using both SEGGAR J-Flash V7.66a and nRF Connect Programmer V3.0.6- It seems OK because I get the REPL over UART, but always fails calling ble.enable()..

image

image

  1. Am I flashing it wrong @dpgeorge ? (I see that if I don't flash the s110_nrf51_8.0.0_softdevice.hex it won't even print the REPL)
  2. Did you find a solution @katte ?
  3. I can upload the .hex files if needed. Thanks for the NRF support! I can do a PR for adding my boards (purple and black) if needed :)