Arduino Ethernet wont compile Blink example?

Hey all,

Problem:
It's been a while since I've used my Arduino Ethernet (like 8 years a while). I figured that uploading the Blink Example to make sure my environment is set up correct would be a good call before I start writing an actual sketch. When I go to upload the Blink example, I'm getting a "collect2.exe: error: Id returned 1 exit status" error. Did some googling and I think that means that I am not even compiling the blink example.

Setup Hardware:
I have my Arduino Ethernet connected to a USB2Serial device which is connected to my computer. IIRC, I need that USB2Serial to be able to upload the sketch to the Arduino Ethernet.

Setup Software:
I installed the latest IDE, set the board type to Arduino Ethernet, and set the proper COM port in the IDE. I set the compile and upload to verbose (which the message compiling info will be seen below).

Compile log:

Arduino: 1.8.13 (Windows Store 1.8.42.0) (Windows 10), Board: "Arduino Ethernet"

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\hardware -tools C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\tools-builder -tools C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\hardware\tools\avr -built-in-libraries C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\libraries -libraries C:\Users\TMPUSR\Documents\Arduino\libraries -fqbn=arduino:avr:ethernet -vid-pid=2341_003B -ide-version=10813 -build-path C:\Users\TMPUSR\AppData\Local\Temp\arduino_build_911913 -warnings=none -build-cache C:\Users\TMPUSR\AppData\Local\Temp\arduino_cache_398260 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\hardware\tools\avr -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\hardware\tools\avr -prefs=runtime.tools.arduinoOTA.path=C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\hardware\tools\avr -prefs=runtime.tools.arduinoOTA-1.3.0.path=C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\hardware\tools\avr -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\hardware\tools\avr -verbose C:\Users\TMPUSR\AppData\Local\Temp\arduino_modified_sketch_769419\Blink.ino

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\arduino-builder -compile -logger=machine -hardware C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\hardware -tools C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\tools-builder -tools C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\hardware\tools\avr -built-in-libraries C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\libraries -libraries C:\Users\TMPUSR\Documents\Arduino\libraries -fqbn=arduino:avr:ethernet -vid-pid=2341_003B -ide-version=10813 -build-path C:\Users\TMPUSR\AppData\Local\Temp\arduino_build_911913 -warnings=none -build-cache C:\Users\TMPUSR\AppData\Local\Temp\arduino_cache_398260 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\hardware\tools\avr -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\hardware\tools\avr -prefs=runtime.tools.arduinoOTA.path=C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\hardware\tools\avr -prefs=runtime.tools.arduinoOTA-1.3.0.path=C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\hardware\tools\avr -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\hardware\tools\avr -verbose C:\Users\TMPUSR\AppData\Local\Temp\arduino_modified_sketch_769419\Blink.ino

Using board 'ethernet' from platform in folder: C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\hardware\arduino\avr

Using core 'arduino' from platform in folder: C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\hardware\arduino\avr

Detecting libraries used...

"C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_ETHERNET -DARDUINO_ARCH_AVR "-IC:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\hardware\\arduino\\avr\\variants\\ethernet" "C:\\Users\\TMPUSR\\AppData\\Local\\Temp\\arduino_build_911913\\sketch\\Blink.ino.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE

Generating function prototypes...

"C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_ETHERNET -DARDUINO_ARCH_AVR "-IC:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\hardware\\arduino\\avr\\variants\\ethernet" "C:\\Users\\TMPUSR\\AppData\\Local\\Temp\\arduino_build_911913\\sketch\\Blink.ino.cpp" -o "C:\\Users\\TMPUSR\\AppData\\Local\\Temp\\arduino_build_911913\\preproc\\ctags_target_for_gcc_minus_e.cpp" -DARDUINO_LIB_DISCOVERY_PHASE

"C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\tools-builder\\ctags\\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\\Users\\TMPUSR\\AppData\\Local\\Temp\\arduino_build_911913\\preproc\\ctags_target_for_gcc_minus_e.cpp"

Compiling sketch...

"C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_ETHERNET -DARDUINO_ARCH_AVR "-IC:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\hardware\\arduino\\avr\\variants\\ethernet" "C:\\Users\\TMPUSR\\AppData\\Local\\Temp\\arduino_build_911913\\sketch\\Blink.ino.cpp" -o "C:\\Users\\TMPUSR\\AppData\\Local\\Temp\\arduino_build_911913\\sketch\\Blink.ino.cpp.o"

Compiling libraries...

Compiling core...

Using precompiled core: C:\Users\TMPUSR\AppData\Local\Temp\arduino_cache_398260\core\core_arduino_avr_ethernet_d72cf7820821928d7aba3a85f82dacbf.a

Linking everything together...

"C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\hardware\\tools\\avr/bin/avr-gcc" -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega328p -o "C:\\Users\\TMPUSR\\AppData\\Local\\Temp\\arduino_build_911913/Blink.ino.elf" "C:\\Users\\TMPUSR\\AppData\\Local\\Temp\\arduino_build_911913\\sketch\\Blink.ino.cpp.o" "C:\\Users\\TMPUSR\\AppData\\Local\\Temp\\arduino_build_911913/..\\arduino_cache_398260\\core\\core_arduino_avr_ethernet_d72cf7820821928d7aba3a85f82dacbf.a" "-LC:\\Users\\TMPUSR\\AppData\\Local\\Temp\\arduino_build_911913" -lm

c:/program files/windowsapps/arduinollc.arduinoide_1.8.42.0_x86__mdqgnx93n4wtt/hardware/tools/avr/bin/../lib/gcc/avr/7.3.0/../../../../avr/lib/avr5/crtatmega328p.o:(.init9+0x0): undefined reference to `main'

collect2.exe: error: ld returned 1 exit status

exit status 1

Error compiling for board Arduino Ethernet.

No files were added to the sketch.

And if you set it to a different board and just hit 'verify' ?
I mean i just compiled blink for Arduino ethernet, and it compiles for me. I am running IDE 1.8.12, but i doubt there has been any specific change since (i just can't keep up with all the updates) Try uninstalling the IDE and re-installing it. (and reboot the computer, you know, turn it off, turn it on again..)

@Deva_Rishi

I tried compiling with an Arduino Undo vs Arduino ethernet and still no luck. From what I remember, the only difference between the ethernet and uno builds were some keywords going to specific pins.

I restarted my computer before commenting, should have added that in my original message.

I can try reinstalling, thats not a bad idea. I just wasnt sure if there was something I specifically had to do with the IDE in regards to using the Serial2USB device.

Error code with Uno:
The Compiler log had too many characters and it wouldn't let me post the entire message. last snippet from compiler seen below.

"C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\hardware\\tools\\avr/bin/avr-gcc-ar" rcs "C:\\Users\\TMPUSR\\AppData\\Local\\Temp\\arduino_build_911913\\core\\core.a" "C:\\Users\\TMPUSR\\AppData\\Local\\Temp\\arduino_build_911913\\core\\wiring_pulse.c.o"
"C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\hardware\\tools\\avr/bin/avr-gcc-ar" rcs "C:\\Users\\TMPUSR\\AppData\\Local\\Temp\\arduino_build_911913\\core\\core.a" "C:\\Users\\TMPUSR\\AppData\\Local\\Temp\\arduino_build_911913\\core\\wiring_shift.c.o"
"C:\\Program Files\\WindowsApps\\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\\hardware\\tools\\avr/bin/avr-gcc-ar" rcs "C:\\Users\\TMPUSR\\AppData\\Local\\Temp\\arduino_build_911913\\core\\core.a" "C:\\Users\\TMPUSR\\AppData\\Local\\Temp\\arduino_build_911913\\core\\CDC.cpp.o"
Error compiling for board Arduino Uno.

This sort of error could be caused by your antivirus software. Try TEMPORARILY disabling your antivirus for a single compilation to see if the problem goes away, then turn the antivirus back on. If the problem doesn't occur with the antivirus off you will need to adjust the settings of your antivirus to whitelist the appropriate file, folder, or process so it doesn't interfere with compilation.

Please be cautious about working without an antivirus. This is only about temporarily disabling it for a quick test. If you don't feel comfortable doing that, fine. You can try going straight to configuring the antivirus to whitelist the Arduino software.

I just wasnt sure if there was something I specifically had to do with the IDE in regards to using the Serial2USB device.

Since that part only comes into play after compiling during upload, this can not be the cause of your (current) problem.

Good news and bad news.

Good news, I can compile blink. Ended up uninstalling arduino IDE, then downloading the zip version, extracting it to desktop, then running arduino.exe. It may have been something with my antivirus, but I'm not sure.

Bad news, now I can't upload the Blink sketch to the Arduino Ethernet. Tried using a different USB port, no dice.

Error Log

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

         System wide configuration file is "C:\Users\TMPUSR\Desktop\arduino-1.8.13\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : COM3
         Using Programmer              : arduino
         Overriding Baud Rate          : 115200
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0xed
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0xed
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0xed
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0xed
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0xed
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0xed
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0xed
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0xed
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0xed
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0xed

avrdude done.  Thank you.

Please tell us how you have the USB2Serial device connected to the Arduino Ethernet board.

does your unit also connect to the 'RST" pin of the Arduino ? If not then press the reset button of the Arduino, and let go the moment the compile is completed (when the data from the compile is displayed)

pert:
Please tell us how you have the USB2Serial device connected to the Arduino Ethernet board.

I think images would probably be best, below are 2 images from the arduino store.

Arduino Ethernet

Serial2USB device

Basically, the Serial2USB device's left side (with 6 pin black jumpers) connects to the Arduino Ethernet's top right side (6 black jumpers). The Serial2USB device is connected to my computer via a USB mini to USB cable.

I'm not sure if I answered your question or not.

Still no luck with the reset plan. I'm still getting a no sync error. Does the USB2Serial device have to be a specific programmer?

alliedmt:
Basically, the Serial2USB device's left side (with 6 pin black jumpers) connects to the Arduino Ethernet's top right side (6 black jumpers).

OK, so as long as the USB2Serial is oriented so the pin marked "GND/BLK" on the USB2Serial is connected to the pin on the Arduino Ethernet that's closest to the pin on the female header pin marked "RX", then all the connections are correct.

alliedmt:
Does the USB2Serial device have to be a specific programmer?

No. The Tools > Programmer menu selection is only used when you are doing Tools > Burn Bootloader or "Upload Using Programmer". When you're doing a standard "Upload", the Tools > Programmer menu selection is completely ignored. So it makes no difference at all what you have selected from the Tools > Programmer menu.

You can try a loopback test to make sure your USB2Serial is working properly:

  • Connect a jumper wire from the RX pin to the TX pin.
  • Connect the USB2Serial to your computer with the USB cable.
  • Select the port of your USB2Serial from the Tools > Port menu.
  • Tools > Serial Monitor
  • Type some text into the input field at the top of the Serial Monitor window.
  • Press Enter. If the text you typed is shown in Serial Monitor's output window, the loopback test passed. If the text was not shown, the loopback test failed.
  • Close Serial Monitor.
  • Disconnect the USB2Serial from the computer.
  • Remove the jumper wire.

Loop back was successful. I was seeing the messages I am typing into the Serial Monitor Display in the bottom part.

Loop back was successful. I was seeing the messages I am typing into the Serial Monitor Display in the bottom part

So we can assume that the USB2Serial device is working properly and that you have selected the proper port. That leaves the issue with the Arduino

Still no luck with the reset plan

No well with your setup reset is automatic.
Does the power indicator led on the Arduino light up ?

Deva_Rishi:
Does the power indicator led on the Arduino light up ?

Yes, the ON light is green and when I press the reset button, L9 goes dark for a bit and then lihgts back up after a second or two (assuming thats the "boot" done LED).

I found this on the "Documentation" tab of the product page:

If you want to use a FTDI cable to download your sketches on the Arduino Ethernet, please refer to this guide: Upgrade the Arduino Ethernet bootloader to the latest version

The link is long dead, but I hunted that page down on the Wayback Machine and it basically says that there was a problem with the bootloader on the Arduino Ethernet and it needs to be replaced. So I recommend you to try burning the bootloader to your Arduino Ethernet. This will require an ISP programmer. If you don't own one, you can use a spare Arduino board as an "Arduino as ISP" programmer: