Serial does not print anything after bleperipheral setup

I’m trying to start writing code to control a BLE module via my phone and I wrote it so the serial should print something after the bleperipheral setup is done so I can see that it’s working but nothing prints. The only thing that prints is the first thing I set it to write before the bleperipheral setup.

      #include <BLEPeripheral.h>

#include <SoftwareSerial.h>

BLEPeripheral blePeripheral; 
BLEService BTSerial ("0000ffe0-0000-1000-8000-00805f9b34fb");
BLEUnsignedIntCharacteristic switchCharacteristic ("0000ffe1-0000-1000-8000-00805f9b34fb" , BLERead | BLEWrite);
int bluetoothTX = 11;
int bluetoothRX = 10;

void setup() {
Serial.print("serial works");




Serial.print("SwitchC:  ");



void loop() {

You print something. You do a bunch of stuff. You try to print again. Nothing appears. Why do you jump to any conclusion about which of the many things you do between prints is the culprit?

Print, do something, print. Then, you KNOW which something causes the issue.

When you know WHAT the issue is, you can fix that specific issue.

any reason for why that line stops the process?

In general, a begin() method asks the instance to do something that involves the hardware. If begin() fails to return, it is because it is still waiting for the appropriate reply from the hardware.

You will probably need to add more Serial.print() statements to the BLEPeripheral class, specifically in the begin() method, to find out where it stops and waits.

Well It appears to stop and wait at the first line of the Ble class.

Classes have methods. It is stopping, for some as-yet-unknown reason in the begin() method.

You have access to the complete source for the class. Use that power to debug the code.

Do you know what a library is, as far as the Arduino IDE is concerned?

No binary files that you can't read. Nothing but header files and source files that need to be compiled as part of your project.

So, if you have problems with a class, you have all the source code for that class. It isn't even read-only. You are free to edit it, to add Serial.print() statements here and there, for debugging purposes or to correct errors in the library.

If you do that, you should share the corrections.