user65262: 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>1000){
         return false;  
         }
        }

even simply having:
while (!Serial.availableForWrite());

generates error ONLY for nano 33 BLE board!
Thoughts?

user37622: 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.  

65262: <p>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:</p>

<pre><code>error: 'class Arduino::USBSerial' has no member named 'availableForWrite'; did you mean 'available'?"
</code></pre>

<p>my code:</p>

<pre><code>NoreplyTime=millis();
TimePassed= millis()-NoreplyTime;

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

<p>even simply having:</p>

<pre><code>while (!Serial.availableForWrite());
</code></pre>

<p>generates error ONLY for nano 33 BLE board!</p>

<p>Thoughts?</p>
 37622: <p>The new Arduino cores use <a href="https://github.com/arduino/ArduinoCore-API" rel="nofollow noreferrer">a common API maintained in a separate repository</a>. This was copied from AVR core long time ago and doesn't contain some function added later to other cores. The function Stream.availableForWrite <a href="https://github.com/arduino/ArduinoCore-API/pull/104" rel="nofollow noreferrer">was added</a> to Arduino API repository 5 months ago.</p>

<p>For the Arduino Mbed core they created <a href="https://github.com/arduino/ArduinoCore-API/tree/namespace_arduino" rel="nofollow noreferrer">a branch in the Arduino API repository</a> 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.</p>

<p>I reported it as <a href="https://github.com/arduino/ArduinoCore-API/issues/108" rel="nofollow noreferrer">issue</a>. Even if they add the function to API I doubt they add an implementation of it to Serial.  </p>
