Error uploading to Arduino MKR1000

I'm trying to upload the sketch below and I'm getting an error. I tried uploading a blink sketch and that works, but not the following code:

/*
  ST25DV64KC Example
  By: Ricardo Ramos and Paul Clark
  SparkFun Electronics
  Date: July, 2022
  License: MIT. Please see the license file for more information but you can
  basically do whatever you want with this code.

  This example reads the tag device ID and revision number over I2C and outputs
  them to the serial port
  
  Feel like supporting open source hardware?
  Buy a board from SparkFun!
  SparkFun Qwiic RFID Tag - ST25DV64KC : https://www.sparkfun.com/products/19035

  Hardware Connections:
  Plug a Qwiic cable into the Qwiic RFID Tag and a RedBoard
  If you don't have a platform with a Qwiic connection use the SparkFun Qwiic Breadboard Jumper (https://www.sparkfun.com/products/14425)
  Open the serial monitor at 115200 baud to see the output
*/

#include <SparkFun_ST25DV64KC_Arduino_Library.h> // Click here to get the library:  http://librarymanager/All#SparkFun_ST25DV64KC

SFE_ST25DV64KC tag;

void setup()
{
  delay(1000);

  Serial.begin(115200);
  Wire.begin();

  Serial.println(F("ST25DV64KC example."));

  if (!tag.begin(Wire))
  {
    Serial.println(F("ST25 not detected. Freezing..."));
    while (1) // Do nothing more
      ;
  }

  Serial.println(F("ST25 connected."));

  uint8_t values[8] = {0};
  if (tag.getDeviceUID(values))
  {
    Serial.print(F("Device UID: "));
    for (uint8_t i = 0; i < 8; I++)
    {
      if (values[i] < 0x0a)
        Serial.print(F("0"));
      Serial.print(values[i], HEX);
      Serial.print(F(" "));
    }
    Serial.println();
  }
  else
    Serial.println(F("Could not read device UID!"));
  
  uint8_t rev;
  if (tag.getDeviceRevision(&rev))
  {
    Serial.print(F("Revision: "));
    Serial.println(rev);
  }
  else
    Serial.println(F("Could not read device revision!"));
}

void loop()
{
  // Nothing to do here
}

The upload takes a long time. About halfway through, I get this error:

No upload port found, using /dev/cu.usbmodem11101 as fallback

And eventually, I get this error:

Timeout. The IDE has not received the 'success' message from the monitor after successfully connecting to it. Could not connect to /dev/cu.usbmodem11101 serial port.

I will note that I have a sensor with the following connections:

SCL to SCL
SDA to SDA
Vcc to 3.3v
GND to GND

Any help would be greatly appreciated. Thank you.

did you try a different cable?

Yes, with the same result.

Update: Now, even a blink sketch won't upload.

use double reset to activate the bootloader. the L LED should pulsate

I'm still getting the same error. The blink sketch uploaded successfully after double resetting the board, but not the sketch in the OP.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.