Problems uploading sketch

I have problems uploading a sketch to an arduino nano 33 BLE. I am trying to read it gyroscope data and display it to the serial monitor. At first the sketch did upload to the arduino, but when I did a minor change (adding a Serial.print() argument) the sketch did not upload to the arduino anymore. It takes a very long time and after a while it says: An error occured while uploading sketch.

I have the following code:

#include <Arduino_LSM9DS1.h>


void setup() {
  
  if(!IMU.begin()){
    Serial.println("Failed to initialize IMU!");
  }

}

void loop() {
  float x, y, z, phi, theta, psi;

    
    if(IMU.accelerationAvailable()){
      IMU.readAcceleration(x, y, z);
    }
    if(IMU.gyroscopeAvailable()){
      IMU.readGyroscope(phi, theta, psi);
    }
  
    Serial.print(x);
    Serial.print("\t");
    
    Serial.print(y);
    Serial.print("\t");
    
    Serial.print(z);
    Serial.print("\t");
    
    Serial.print(phi);
    Serial.print("\t");
    
    Serial.print(theta);
    Serial.print("\t");
    
    Serial.println(theta);
}

Any help is welcome!

I think I have a similar problem. However I can't find the path you state

pert:
Select Tools > Processor > ATmega328P (Old Bootloader) and then try uploading again.

I am using Arduino IDE 1.8.12(Windows store 1.8.33.0)

Are you talking about the error you reported in your other post?:

Please do this:

  • (In the Arduino IDE) File > Preferences
  • Uncheck the checkbox next to “Show verbose output during: compilation”
  • Check the checkbox next to "Show verbose output during: upload
  • Click “OK”
  • Sketch > Upload
  • After the upload fails, you’ll see a button on the right side of the orange bar “Copy error messages” (or the icon that looks like two pieces of paper at the top right corner of the black console window in the Arduino Web Editor). Click that button.
  • In a forum reply here, click on the reply field.
  • Click the </> button on the forum toolbar. This will add the forum’s code tags markup to your reply.
  • Press “Ctrl + V”. This will paste the upload output between the code tags.
  • Move the cursor outside of the code tags before you add any additional text to your reply.
Arduino: 1.8.12 (Windows Store 1.8.33.0) (Windows 10), Board: "Arduino Nano 33 BLE"

Sketch uses 88468 bytes (8%) of program storage space. Maximum is 983040 bytes.
Global variables use 44432 bytes (16%) of dynamic memory, leaving 217712 bytes for local variables. Maximum is 262144 bytes.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

This is the error message I got. It took about 20 minutes to get the error message.

I also tried to upload the example "Blink", which gave the same error message.

arthur1994:
I think I have a similar problem. However I can't find the path you state

I am using Arduino IDE 1.8.12(Windows store 1.8.33.0)

The provided solution applies to the Nano, not the Nano BLE. So which one are you using?

Sorry, I thought I checked "how verbose output during: upload", but I didn't. Can someone see what goes wrong here?

Arduino: 1.8.12 (Windows Store 1.8.33.0) (Windows 10), Board: "Arduino Nano 33 BLE"

Sketch uses 76340 bytes (7%) of program storage space. Maximum is 983040 bytes.
Global variables use 42160 bytes (16%) of dynamic memory, leaving 219984 bytes for local variables. Maximum is 262144 bytes.
Forcing reset using 1200bps open/close on port COM7
PORTS {COM3, COM4, COM7, } / {COM3, COM4, COM7, } => {}
PORTS {COM3, COM4, COM7, } / {COM3, COM4, COM7, } => {}
PORTS {COM3, COM4, COM7, } / {COM3, COM4, COM7, } => {}
PORTS {COM3, COM4, COM7, } / {COM3, COM4, COM7, } => {}
PORTS {COM3, COM4, COM7, } / {COM3, COM4, COM7, } => {}
PORTS {COM3, COM4, COM7, } / {COM3, COM4, COM7, } => {}
PORTS {COM3, COM4, COM7, } / {COM3, COM4, COM7, } => {}
PORTS {COM3, COM4, COM7, } / {COM3, COM4, COM7, } => {}
PORTS {COM3, COM4, COM7, } / {COM3, COM4, COM7, } => {}
PORTS {COM3, COM4, COM7, } / {COM3, COM4, COM7, } => {}
PORTS {COM3, COM4, COM7, } / {COM3, COM4, COM7, } => {}
PORTS {COM3, COM4, COM7, } / {COM3, COM4, COM7, } => {}
PORTS {COM3, COM4, COM7, } / {COM3, COM4, COM7, } => {}
PORTS {COM3, COM4, COM7, } / {COM3, COM4, COM7, } => {}
PORTS {COM3, COM4, COM7, } / {COM3, COM4, COM7, } => {}
PORTS {COM3, COM4, COM7, } / {COM3, COM4, COM7, } => {}
PORTS {COM3, COM4, COM7, } / {COM3, COM4, COM7, } => {}
PORTS {COM3, COM4, COM7, } / {COM3, COM4, COM7, } => {}
PORTS {COM3, COM4, COM7, } / {COM3, COM4, COM7, } => {}
PORTS {COM3, COM4, COM7, } / {COM3, COM4, COM7, } => {}
Uploading using selected port: COM7
C:\Users\Arthur\Documents\ArduinoData\packages\arduino\tools\bossac\1.9.1-arduino1/bossac.exe -d --port=COM7 -U -i -e -w C:\Users\Arthur\AppData\Local\Temp\arduino_build_105801/sketch_mar03b.ino.bin -R 
An error occurred while uploading the sketch

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

I am indeed referring to this post.

pert:
Are you talking about the error you reported in your other post?:
https://forum.arduino.cc/index.php?topic=668392

I am using a NANO 33 BLE!

sterretje:
The provided solution applies to the Nano, not the Nano BLE. So which one are you using?

Ok so lets move this to the NEW NANO sections.
I would suggest read the sticky posts whenyou get there as there is some VITAL information there.

Bob.

First reccomendation is to drop the windows app and go with the full blown IDE install as some people have issues with the app version.

Second is to rule out USB 3.0 issues by trying on USB 2.0 ports and or another computer.

Third is to rule out any additional security software or other terminal software by temporarily disabling just to test.

But ...
But ...
But ...

The original OP is about a normal Nano, not the BLE.

Oh FLUFF.

@arthur1994

TOPIC SPLIT
DO NOT HIJACK / NECRO POST !

Could you take a few moments to Learn How To Use The Forum.
Other general help and troubleshooting advice can be found here.
It will help you get the best out of the forum in the future.

Bob.

I fixed it, the arduino seemed to be stuck due to the code. It was as easy as pressing the reset button two time to reset the arduino.

Thanks for the help!