BLE works fine, no problems. ESP32Servo360 works great. No problems... But when I add my standard BLE "boilerplate" setup (that I've used many times) to my ESP32Servo360 project I get the following compile errors that I don't understand...? Errors only happen when I combine BLE and ESP32Servo360. One or the other compiles properly, but not both together... Because I have used the BLE a number of times in the past I am suspicious of the ESP32Servo360 library and wonder if anyone has any advice on how to get BLE incorporated?
[Starting] Verifying sketch 'Rapid_Emitter_Tester.ino'
Please see the build logs in output path: c:\Users\mej\Documents\Arduino_Rapid_Emitter_Tester
C:\Users\mej\Documents\Arduino_Rapid_Emitter_Tester\libraries\ESP32Servo360\ESP32Servo360.cpp.o: in function `ESP32Servo360::_isr(void*)':
C:\Users\mej\Documents\Arduino\libraries\ESP32Servo360\src/ESP32Servo360.h:104:(.iram1.30[_ZN13ESP32Servo3604_isrEPv]+0x6): dangerous relocation: l32r: literal placed after use: .literal._ZN13ESP32Servo3604_isrEPv
collect2.exe: error: ld returned 1 exit status
Error during build: exit status 1
IntelliSense configuration already up to date. To manually rebuild your IntelliSense configuration run "Ctrl+Alt+I"
[Error] Verifying sketch 'Rapid_Emitter_Tester.ino': Exit with code=1
Thanks. Good Advice... it's hundreds of lines and multiple files and I wasn't sure what I could exclude for my question...
I have narrowed it down to using: #include <ESP32Servo360.h> with the ConstantSpeed example (which works fine) but initializing BLE: BLEDevice::init(_projectName) from this function will trigger the problem. I tried in both Arduino IDE and VS Code IDE:
#include <BLEDevice.h>
#include <BLEServer.h>
#include <BLEUtils.h>
#include <BLE2902.h>
#define SERVICE_UUID "bb525000-57d1-11ee-8c99-0242ac120002"
#define CHARACTERISTIC_UUID "bb525001-57d1-11ee-8c99-0242ac120002"
void ble_ServerSetup()
{
const char _projectName[] = "testing only";
// Create the BLE Device
BLEDevice::init(_projectName);
BLEDevice::setMTU(128);
// Create the BLE Server
pServer = BLEDevice::createServer();
pServer->setCallbacks(new MyServerCallbacks());
// Create the BLE Service
BLEService *pService = pServer->createService(SERVICE_UUID);
pCharacteristic = pService->createCharacteristic(
CHARACTERISTIC_UUID,
BLECharacteristic::PROPERTY_READ |
BLECharacteristic::PROPERTY_WRITE |
BLECharacteristic::PROPERTY_NOTIFY
);
// Create a BLE Descriptor
pCharacteristic->addDescriptor(new BLE2902());
pCharacteristic->setCallbacks(new MyCallbacks());
pCharacteristic->setValue(_projectName);
pService->start();
BLEAdvertising *pAdvertising = BLEDevice::getAdvertising();
pAdvertising->addServiceUUID(SERVICE_UUID);
pAdvertising->setScanResponse(true);
pAdvertising->setMinPreferred(0x06); // functions that help with iPhone connections issue
pAdvertising->setMinPreferred(0x12);
BLEDevice::startAdvertising();
printf("\nINFO: START BLE ADVERTISING\n");
// Serial.printf("Characteristic defined! Now you can read it in your phone!\n");
delay(500); //wait for connection so as not to create multple advertisments on iphone
}