arduino-libraries / ArduinoBLE

ArduinoBLE library for Arduino
GNU Lesser General Public License v2.1
313 stars 205 forks source link

BLE.begin() fail if run without bootloader on MKR1010 #275

Closed fterretf closed 1 year ago

fterretf commented 1 year ago

With official bootloader and the application, BLE.begin () is OK.

Without bootloader i.e application built with flash_without_bootloader.ld instead of flash_with_bootloader.ld, BLE.begin() failed:

BLE.begin is calling HCIClass::reset(), which call Hci::sendCommand

image

The command is tx to NINA but no rx from NINA. Look like NINA fail to boot.

How can I debug this issue? There is no 'easy' pins to monitor NINA rx, tx


Also reported at https://github.com/arduino/nina-fw/issues/83

fterretf commented 1 year ago

On the MKR1010 board is the BQ24195 battery manager than needs to be configured by I2c for NINA chips to works correctly. See https://github.com/arduino/ArduinoCore-samd.git/bootloaders/zero/main.c line 192:configure_pmic()

This configuration is not made by the official arduino firmware. So if you want to build your own bootloader or to run without bootloader, BQ24195 needs to be configured as configure_pmic() do.