uploading error to NANO

There was an error when loading a sketch to NANO.

error code:
An error occurred while uploading the sketch
Invalid library found in C:\Program Files (x86)\Arduino\libraries\utility: no headers files (.h) found in C:\Program Files (x86)\Arduino\libraries\utility
Invalid library found in C:\Program Files (x86)\Arduino\libraries\utility: no headers files (.h) found in C:\Program Files (x86)\Arduino\libraries\utility

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

#include <mcp_can.h>
#include <mcp_can_dfs.h>

// the cs pin of the version after v1.1 is default to D9
// v0.9b and v1.0 is default D10
const int SPI_CS_PIN = 9;
MCP_CAN CAN(SPI_CS_PIN);                                    // Set CS pin

unsigned char flagRecv = 0;
unsigned char len = 0;
unsigned char buf[8];
char str[20];

void setup()
{
  ////Serial.begin(115200);
  Serial.begin(9600);

  while (CAN_OK != CAN.begin(CAN_1000KBPS))              // init can bus : baudrate = 500k
  {
    Serial.println("CAN BUS Shield init fail");
    Serial.println(" Init CAN BUS Shield again");
    delay(100);
  }
  Serial.println("CAN BUS Shield init ok!");

  attachInterrupt(0, MCP2515_ISR, FALLING); // start interrupt


}

void MCP2515_ISR()
{
  flagRecv = 1;
}

void loop()
{
  if (flagRecv)
  { // check if get data

    flagRecv = 0;                   // clear flag

    // read data,  len: data length, buf: data buf
    CAN.readMsgBuf(&len, buf);

    // print the data
    for (int i = 0; i < len; i++)
    {
      Serial.print(buf[i]); Serial.print("\t"); ////exit status 1 call of overloaded 'print(unsigned char [8])' is ambiguous

    }
    Serial.println();

  }
}
[code/]

What do you have in the C:\Program Files (x86)\Arduino\libraries\utility folder ?

Have you tried compiling with the option set to verbose to potentially get more information about the problem ?

Brattain Member, thanks.
There are two folders : [U8glib] and [U8glib_Arduino] there.
I didn't tried compiling with the option set to verbose yet.

UKHeliBob:
What do you have in the C:\Program Files (x86)\Arduino\libraries\utility folder ?

Have you tried compiling with the option set to verbose to potentially get more information about the problem ?

Thanks.
Here is the error message with Verbose shown.

error with verbose.txt (37.5 KB)

Based on below from your error message, try the 'old bootloader' option under tools -> processor.

Arduino: 1.8.8 (Windows 7), TD: 1.45, Board: "Arduino Nano, ATmega328P"
...
...
C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CC:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -carduino -PCOM15 -b115200 -D -Uflash:w:C:\Users\HUA~1.DEL\AppData\Local\Temp\arduino_build_89131/receiver.ino.hex:i 

avrdude: Version 6.3-20171130
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : COM15
         Using Programmer              : arduino
         Overriding Baud Rate          : 115200
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x00

PS when you have upload errors, switch off 'verbose output during compile'; it makes the output a lot shorter and could have probably been put in the post :slight_smile: