BLE sense crashes when files are loaded

Hello, I am new to using the BLE libraries. These two files are made to bluetooth together on the Arduino 33 nano sense, to each other to simulate a control room that recieves data on the status of an other area. Currently the only piece I am trying to get to work to begin with, is the central device sending a byte to the peripherial to turn on the “Fire Pump” (LED). Currently, when these files are loaded onto the boards via Arduino IDE, the boards crash and they become unrecognizable by the computer unles I double press the reset button to clear it. Im not quite sure where the error occurs in this. Any help would be appreciated.

Central-Fire_Controller.ino (4.68 KB)

Peripherial-Fire_Controller.ino (2.21 KB)

You are calling BLE.begin twice. Remove the first one and leave the one in the if statement.

  if (!BLE.begin()) {
   Serial.println("starting BLE failed!");
   while (1);