Need Help getting MKR Zero running

Just started using MKR Zero.
I've read all the Starting Tutorials I can find.
I get BLINK example to run
Trying to get CARDINFO to run
Problem is I can not get Serial Monitor to show anything?
I'm using PIN 28
I double-click before uploading
Just need some basic advice to get the MKR Zero running
Thank you

Forgot my Sketch

/*
SD card test

This example shows how use the utility libraries on which the'
SD library is based in order to get info about your SD card.
Very useful for testing a card when you're not sure whether its working or not.

The circuit:
SD card attached to SPI bus as follows:
** MOSI - pin 11 on Arduino Uno/Duemilanove/Diecimila
** MISO - pin 12 on Arduino Uno/Duemilanove/Diecimila
** CLK - pin 13 on Arduino Uno/Duemilanove/Diecimila
** CS - depends on your SD card shield or module.
Pin 4 used here for consistency with other Arduino examples

created 28 Mar 2011
by Limor Fried
modified 9 Apr 2012
by Tom Igoe
*/
// include the SD library:
#include <SPI.h>
#include <SD.h>

// set up variables using the SD utility library functions:
Sd2Card card;
SdVolume volume;
SdFile root;

// change this to match your SD shield or module;
// Arduino Ethernet shield: pin 4
// Adafruit SD shields and modules: pin 10
// Sparkfun SD shield: pin 8
// MKRZero SD: SDCARD_SS_PIN
const int chipSelect = 28;

void setup() {
// Open serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}

Serial.print("\nInitializing SD card...");

// we'll use the initialization code from the utility libraries
// since we're just testing if the card is working!
if (!card.init(SPI_HALF_SPEED, chipSelect)) {
Serial.println("initialization failed. Things to check:");
Serial.println("* is a card inserted?");
Serial.println("* is your wiring correct?");
Serial.println("* did you change the chipSelect pin to match your shield or module?");
while (1);
} else {
Serial.println("Wiring is correct and a card is present.");
}

// print the type of card
Serial.println();
Serial.print("Card type: ");
switch (card.type()) {
case SD_CARD_TYPE_SD1:
Serial.println("SD1");
break;
case SD_CARD_TYPE_SD2:
Serial.println("SD2");
break;
case SD_CARD_TYPE_SDHC:
Serial.println("SDHC");
break;
default:
Serial.println("Unknown");
}

// Now we will try to open the 'volume'/'partition' - it should be FAT16 or FAT32
if (!volume.init(card)) {
Serial.println("Could not find FAT16/FAT32 partition.\nMake sure you've formatted the card");
while (1);
}

Serial.print("Clusters: ");
Serial.println(volume.clusterCount());
Serial.print("Blocks x Cluster: ");
Serial.println(volume.blocksPerCluster());

Serial.print("Total Blocks: ");
Serial.println(volume.blocksPerCluster() * volume.clusterCount());
Serial.println();

// print the type and size of the first FAT-type volume
uint32_t volumesize;
Serial.print("Volume type is: FAT");
Serial.println(volume.fatType(), DEC);

volumesize = volume.blocksPerCluster(); // clusters are collections of blocks
volumesize *= volume.clusterCount(); // we'll have a lot of clusters
volumesize /= 2; // SD card blocks are always 512 bytes (2 blocks are 1KB)
Serial.print("Volume size (Kb): ");
Serial.println(volumesize);
Serial.print("Volume size (Mb): ");
volumesize /= 1024;
Serial.println(volumesize);
Serial.print("Volume size (Gb): ");
Serial.println((float)volumesize / 1024.0);

Serial.println("\nFiles found on the card (name, date and size in bytes): ");
root.openRoot(volume);

// list all files in the card with date and size
root.ls(LS_R | LS_DATE | LS_SIZE);
}

void loop(void) {
}

When I'm having trouble with serial output, I like to do a quick check with the most simple possible sketch. If this works, then I know the problem has something to do with my real sketch. If it doesn't work, then I know the problem is not related to my sketch code. It seems maybe a little silly, but it allows me to be sure I'm focusing my troubleshooting efforts in the right direction.

Try uploading this sketch to your Arduino board:

  1. Copy and paste this code as a new sketch in the Arduino IDE:
    void setup() {
      Serial.begin(9600);
    }
    
    void loop() {
      Serial.println("hello");
      delay(1000);
    }
    
  2. Upload the sketch to your Arduino board.
  3. Select Tools > Serial Monitor from the Arduino IDE's menus.

Do you now see the word "hello" being printed in the Serial Monitor's output field once a second?

Thanks Pert
I tried your sketch
After uploading to COM7 I set the COM to COM 1 (only other option)
Then opened Serial Monitor -->> Nothing Blank
I then added "while(!Serial);" after Serial.begin(9600);
serial monitor set to 9600
still nothing
Ed

Let me make sure I understand correctly. Please tell me whether this was the exact sequence of events you experienced:

  1. You press the MKR Zero's reset button twice quickly.
  2. You see the MKR Zero's on-board LED pulsing.
  3. If you open the Arduino IDE's Tools > Port menu, you will now see "COM7 (Arduino MKRZERO)" on the list.
  4. You upload the test sketch I shared.
  5. Once the upload is finished, the only port listed under the Arduino IDE's Tools > Port menu is COM1.

Did I get that all right?

Correct

After you do that, in the Arduino IDE's Tools > Port menu, does it say only "COM1", or does it say "COM1 (Arduino MKRZERO)"

COM1
and
COM6(Arduino MKRZERO)

OK, then the problem is that you have selected the wrong COM port. You need to select Tools > Port > COM6.

The fact that the port changes is very confusing. The reason for this is that when you put the board in bootloader mode with the double reset, it is seen as a different device by Windows, so Window assigns it a different COM port. The same actually happens when you do an upload in normal mode, but in this case the board switches from COM6 to COM7 and then back to COM6 during the course of the upload and the Arduino IDE is smart enough to follow it through these changes. Since the port is the same before and after the upload, the user is not affected the the port change when in bootloader mode. So this is specific to the double reset technique.

This line causes the board to wait there until the serial port is opened. Without that line, all serial output is lost between the time the sketch starts (after upload or power on) and when you open Serial Monitor. Sometimes that can be important information about what happened at startup. In the case of my silly sketch that only prints "hello" over and over again, we aren't so bothered if some of those "hello"s are lost because there will always be more where that came from.

Something to note about this code is that it can actually cause undesirable results in the case where you want the Arduino device to be able to run even without the serial port open. In this case you would want to remove or comment out that line when you no longer need the wait behavior.

Because the MKR Zero has native USB capabilities, the baud rate setting does not matter, so I left out that step. However, for other boards that use real serial communication (e.g., Uno) it is essential to make sure there is a match between Serial.begin() and the Serial Monitor's baud rate menu.

OK rebooted my PC
Still COM6 does not show up.
In did last week when I first tried running the MKR ZERO

Actuall it shows as
COM6(Arduino MKR ZERO)
So it's BUSY

I apologize for the confusion. I should have written this: You need to select Tools > Port > COM6 (Arduino MKRZERO) .

Please try that and then check if you see the expected "hello"s when you open Serial Monitor.

I keep getting PORT BUSY when I try to start the Serial Monitor
Serial Monitor will NOT open

There are two possible causes of this type of issue:

  • A glitch has caused the port to get stuck in an unusable state.
  • Another application has the port open.

The first is solved by restarting your computer, which restores the port to a usable state. Since you say you already tried rebooting, it sees this is not the cause of the problem.

So this leaves the second possibility. Only one application is allowed to have a serial port open at a time. Do you have any other applications running that might be opening this port?

Well I went to a New Computer
Downloaded and installed IDE
Installed SAMD boards
Set to MKRZERO
connected MKRZERO with double-click
Uploaded Cadinfo on COM4(Arduino MKRZERO)
when complete
only port showing was
COM3(Arduino MKRZERO)
Tried to open Serial Monitor...... PORT BUSY
Ed

If I press reset button on board
Computer beeps and switches to COM3(Arduino MKRZERO)

OK, I've tried all the 'fixes' I can find on the forum.
Basically, they say re-boot the PC
I guess I just throw the MKRZERO in the trash
It's a shame, I had high hopes for it in my project.
Ed

BTW I switched back to my Arduino Nano project without re-booting the PC
All was fine
Nano sketch loaded and then there appeared an open COM port for the Serial Monitor.
Which them works as usual.

So, I think Arduino needs to looks in another direction for the cause of this problem.
I may order another MRKZERO, just to satisfy myself that the problem was not the hardware, but I'm skeptical of that since it runs Blink nicely.

Is there someplace or someone else that I can contact about this problem?

Thank you
Ed

MKRZERO-1
For chuckles I downloaded IDE v2.0 beta
When I connected the MKRZERO and then tried opening the serial port (as there was still only 1 available) I got these reputing messages at the bottom right of the screen
When the Connection failed to the port the message disappeared and then it tried again the reconnect.
This time under Tools --> Port just COM 3 appears
but when you point at it it opens to COM 3(Arduino MKRZERO)
So, the Zero is still stuck on the port
I re-booted the PC and the same happened.
Ed

Why are you using 28 instead of SDCARD_SS_PIN?