Arduino

How I fixed my Arduino ISP ‘Device signature = …’ errors

Problem:

I was trying to program my Arduino using an AVRISP MK II programmer, but every time I tried to program it (using avrdude or the Arduino software), I encountered errors like this:

avrdude: stk500v2_command(): command failed
avrdude: stk500v2_program_enable(): bad AVRISPmkII connection status: MOSI fail, RST fail, SCK fail, Target reverse inserted
avrdude: initialization failed, rc=-1
avrdude: AVR device initialized and ready to accept instructions
avrdude: Device signature = 0xb058e2
avrdude: Expected signature for ATmega2560 is 1E 98 01
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.

Solution:

In my case, the reason for this issue was that there was a shield connected to the SPI bus.

Since the SPI bus on the Arduino is shared with the ICSP header for In-System Programming (ISP), which is the protocol used by external programmers for programming AVR chips, connecting anything else to the SPI bus may cause issues.

Try to disconnect anything from the SPI bus. If the CS (chip select) signal of the extra device on the SPI bus is low, it might interfere with the communication with the AVR chip!

Posted by Uli Köhler in Arduino

How to fix Arduino ‘U8glib.h: No such file or directory’

Problem:

You want to compile an Arduino sketch, but you see an error message like

In file included from sketch/ultralcd.cpp:96:0:
ultralcd_impl_DOGM.h:46:20: error: U8glib.h: No such file or directory
compilation terminated.
exit status 1
U8glib.h: No such file or directory

Solution:

In Arduino, click on the Tools menu, then click on Manage libraries. Now enter u8glib into the search bar an press Enter.

Scroll down to the U8glib library, hover over it with your mouse and click Install on the bottom right. Now the error should be gone.

Posted by Uli Köhler in Arduino

How to fix Arduino SigFox.h: No such file or directory

Problem:

You are trying to run the Arduino SigFox first configuration tutorial but when trying to upload the sketch, you get this error message:

SigFox.h: No such file or directory

Solution:

While you have installed the board libraries and compiler for the SigFox boards, you have not installed the SigFox library itself.

Press Ctrl+Shift+I to open the library manager (you can also open it from the Tools menu).

Look for Arduino SigFox for MKRFox1200 by Arduino and click the Install button

Since the SigFox sketches also require the Arduino low power libraries (i.e. you would get the error message ArduinoLowPower.h: No such file or directory), also click the Install button for the Arduino Low Power by Arduino library.

After that, enter RTCZero in the search bar at the top of the library manager and click the Install button for the RTCZero by Arduino library.

After that, retry uploading the sketch.

Posted by Uli Köhler in Arduino, Electronics, Embedded