availableForWrite() function return error when compiling for Arduino nano 33 BLE I used availableForWrite() function as below in my code. When I compile it for nano 33 IoT, everything is OK and compiles perfectly. However, when I change the board to nano 33 BLE, I end up with two scenarios:
1. using Arduino IDE as compiler > gives no error but the board doesn't after programming.
2. using the web-based compiler in Arduino website > give the following error:

error: 'class Arduino::USBSerial' has no member named 'availableForWrite'; did you mean 'available'?"


my code:

NoreplyTime=millis();
TimePassed= millis()-NoreplyTime;

         while(!Serial.availableForWrite()){
         TimePassed= millis()-NoreplyTime;
         if (TimePassed&gt;1000){
         return false;  
         }
        }


even simply having:

while (!Serial.availableForWrite());


generates error ONLY for nano 33 BLE board!

Thoughts?
The new Arduino cores use a common API maintained in a separate repository. This was copied from AVR core long time ago and doesn't contain some function added later to other cores. The function Stream.availableForWrite was added to Arduino API repository 5 months ago.

For the Arduino Mbed core they created a branch in the Arduino API repository to move the Arduino core in C++ namespace 'arduino'. But this was before availableForWrite was added. So the API version used in Mbed core doesn't have the function.

I reported it as issue. Even if they add the function to API I doubt they add an implementation of it to Serial.