"cpu reset" after upload

Hi!, I'm trying to use MKR1000 in the blink example, but when i upload this message appears:

Atmel SMART device 0x10010005 found
Device : ATSAMD21G18A
Chip ID : 10010005
Version : v2.0 [Arduino:XYZ] Dec 20 2016 15:36:43
Address : 8192
Pages : 3968
Page Size : 64 bytes
Total Size : 248KB
Planes : 1
Lock Regions : 16
Locked : none
Security : false
Boot Flash : true
BOD : true
BOR : true
Arduino : FAST_CHIP_ERASE
Arduino : FAST_MULTI_PAGE_WRITE
Arduino : CAN_CHECKSUM_MEMORY_BUFFER
Erase flash
done in 0.844 seconds

Write 10996 bytes to flash (172 pages)
[==============================] 100% (172/172 pages)
done in 0.110 seconds

Verify 10996 bytes of flash with checksum.
Verify successful
done in 0.010 seconds
CPU reset.

After that, nothing happens.
A similar thread show more about the problem but doesnt work for me.
Thanks!

Hi Nicholas,

Might be a good idea if you start by posting your formatted sketch - with tags - so we can see what you're telling it to do.

Cheers,

I try the blink example first, but doesnt work

void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(LED_BUILTIN, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);                       // wait for a second
  digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);                       // wait for a second
}

Code looks good.

What have you got selected under Tools -> Board in the IDE?

In board "Arduino MKR1000". in port, COM5 which is the port that appears in the device manager

Any change if you hit the reset button on the board?

No, i tried reset manually and looking for new drivers

Does the LED flash at any point during power-up or programming? (just trying to work out if it might just be a faulty LED)

Yes, today was my first time using the board, and when i was installing libraries and trying examples, was a moment when 3 LEDs was on, the green 'ON', the orange 'CHRG' and a third blinking. I assume the third is what i looking for

To be honest I've never worked with that board. Do you have any other boards you can try?

From what I've read the LED is on D6 - might be worth trying replacing LED_BUILTIN with "6" - or even hooking up an LED to another port (via a 220 ohm resistor) and see if that works.

That is the output from a successful upload, including the "cpu reset" part. It's only some helpful information provided by the upload tool. So this is normal and expected. If your sketch is not working as expected, it has absolutely nothing to do with this output.

Ah! ok thanks. But in this case why when i use the ScanNetworks exmple of Wifi101 it doesnt show anything but the message of CPU reset? Thats actually the reason for why i come to the blink example.
(I dont nknow if i have to put this in another thread)

ScanNetworks code:


#include <SPI.h>
#include <WiFi101.h>

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

  // check for the presence of the shield:
  if (WiFi.status() == WL_NO_SHIELD) {
    Serial.println("WiFi shield not present");
    // don't continue:
    while (true);
  }

  // Print WiFi MAC address:
  printMacAddress();

  // scan for existing networks:
  Serial.println("Scanning available networks...");
  listNetworks();
}

void loop() {
  delay(10000);
  // scan for existing networks:
  Serial.println("Scanning available networks...");
  listNetworks();
}

void printMacAddress() {
  // the MAC address of your WiFi shield
  byte mac[6];

  // print your MAC address:
  WiFi.macAddress(mac);
  Serial.print("MAC: ");
  printMacAddress(mac);
}

void listNetworks() {
  // scan for nearby networks:
  Serial.println("** Scan Networks **");
  int numSsid = WiFi.scanNetworks();
  if (numSsid == -1)
  {
    Serial.println("Couldn't get a wifi connection");
    while (true);
  }

  // print the list of networks seen:
  Serial.print("number of available networks:");
  Serial.println(numSsid);

  // print the network number and name for each network found:
  for (int thisNet = 0; thisNet < numSsid; thisNet++) {
    Serial.print(thisNet);
    Serial.print(") ");
    Serial.print(WiFi.SSID(thisNet));
    Serial.print("\tSignal: ");
    Serial.print(WiFi.RSSI(thisNet));
    Serial.print(" dBm");
    Serial.print("\tEncryption: ");
    printEncryptionType(WiFi.encryptionType(thisNet));
    Serial.flush();
  }
}

void printEncryptionType(int thisType) {
  // read the encryption type and print out the name:
  switch (thisType) {
    case ENC_TYPE_WEP:
      Serial.println("WEP");
      break;
    case ENC_TYPE_TKIP:
      Serial.println("WPA");
      break;
    case ENC_TYPE_CCMP:
      Serial.println("WPA2");
      break;
    case ENC_TYPE_NONE:
      Serial.println("None");
      break;
    case ENC_TYPE_AUTO:
      Serial.println("Auto");
      break;
  }
}

void printMacAddress(byte mac[]) {
  for (int i = 5; i >= 0; i--) {
    if (mac[i] < 16) {
      Serial.print("0");
    }
    Serial.print(mac[i], HEX);
    if (i > 0) {
      Serial.print(":");
    }
  }
  Serial.println();
}

You need to open Tools > Serial Monitor from the Arduino IDE's menus to see the Serial.println() messages from the sketch. You won't see those in the black console window at the bottom of the Arduino IDE's window where the upload output is shown.

Here's a good sketch for testing out serial output:

void setup() {
  Serial.begin(9600);
}
void loop() {
  Serial.println("hello");
  delay(1000);
}

It's sort of the serial print version of "Blink".
If you upload that to your Arduino board and then open Serial Monitor, do you see it printing "hello" at 1 Hz?

Ahh ok, yes now i see it. That explains a lot :sweat_smile:. Thanks, its my first arduino and i just learning the basics.

So the serial test is working but the LED blink sketch isn't?

No, actually was my mistake. The LED was blinking all the time, even before upload the code. So how it doesnt display anything after the reset, even at codes when it have to, and it continue blinking like usual, i assume that it was working wrong

Got it. Ah well - welcome to the community!