adafruit / Adafruit_nRF52_Arduino

Adafruit code for the Nordic nRF52 BLE SoC on Arduino
Other
623 stars 497 forks source link

As a peripheral, Bluefruit.begin() with more than 2 peripherals doesn't work #567

Closed eraguzin closed 4 years ago

eraguzin commented 4 years ago

Describe the bug Using the stock blueart_multi.ino example sketch, I can't get more than 2 connections to work.

By default, MAX_PRPH_CONNECTION is 2. The Bluefruit Connect app can spot it and connect fine. But if I change MAX_PRPH_CONNECTION to 3, then the Bluefruit Connect app does not see the device.

Furthermore, by adding a Serial.print() statement in the loop section, I can see that the program locks up at some point when MAX_PRPH_CONNECTION is 3. When it's 2, the print statement continues going without any issue. With the IDE debug log set to Level 2, I get a message about not enough SRAM. Is there a way to allow more SRAM? I found this page here:

https://learn.adafruit.com/introducing-the-adafruit-nrf52840-feather/hathach-memory-map But the functions like configPrphConn(), configPrphBandwidth() don't work, they're not declared in the top level scope, and there's no indication of what arguments they should take. If this isn't implemented yet, can I get pointed to the relevant docs, and I'll try to submit a Pull Request? Or is there an explanation on how to change the linker script?

Set up (mandatory)

To Reproduce Steps to reproduce the behavior:

  1. Run the bleuart_multi.ino sketch, change MAX_PRPH_CONNECTION to 3. Set a higher debug level on the log to see the message.

Serial Log

Bluefruit52 BLEUART Example
---------------------------

[CFG   ] SoftDevice config require more SRAM than provided by linker.
App Ram Start must be at least 0x20003768 (provided 0x20003600)
Please update linker file or re-config SoftDevice
[CFG   ] SoftDevice's RAM requires: 0x20003768
bool AdafruitBluefruit::begin(uint8_t, uint8_t): 440: verify failed, error = NRF_ERROR_NO_MEM
bool BLEUuid::begin(): 113: verify failed, error = BLE_ERROR_NOT_ENABLED
virtual err_t BLEService::begin(): 69: verify failed, error = BLE_ERROR_NOT_ENABLED
virtual err_t BLEDfu::begin(): 201: verify failed, error = BLE_ERROR_NOT_ENABLED
virtual err_t BLEService::begin(): 69: verify failed, error = BLE_ERROR_NOT_ENABLED
virtual err_t BLEDis::begin(): 114: verify failed, error = BLE_ERROR_NOT_ENABLED
bool BLEUuid::begin(): 113: verify failed, error = BLE_ERROR_NOT_ENABLED
virtual err_t BLEService::begin(): 69: verify failed, error = BLE_ERROR_NOT_ENABLED
virtual err_t BLEUart::begin(): 161: verify failed, error = BLE_ERROR_NOT_ENABLED
uint8_t AdafruitBluefruit::getName(char*, uint16_t): 529: verify failed, error = BLE_ERROR_NOT_ENABLED
bool BLEAdvertising::_start(uint16_t, uint16_t): 363: verify failed, error = BLE_ERROR_NOT_ENABLED
Please use Adafruit's Bluefruit LE app to connect in UART mode
Once connected, enter character(s) that you wish to send

BSP Library : 0.20.1
Bootloader  : s132 6.1.1
Serial No   : 2362A8EFF2B59F57
hathach commented 4 years ago

the log did give the hint, you could edit the linker file to increased memory allocated to Softdeivce. configABC() is for reducing memory required by softdevice. This is not a bug, this is a question for more question, please post it to our support forum.