[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 574: sizeof(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 630: sizeof(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 113: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 113: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
Plum Geek Forum • SOLVED: problem uploading Arduino Sketch
Page 1 of 3

SOLVED: problem uploading Arduino Sketch

Posted: Sat Feb 03, 2018 11:08 pm
by gpvillamil
Problem is solved. In the Arduino IDE, select board "Arduino Pro or Pro Mini", then processor "AtMega328P 3.3V 8Mhz" and everything works fine! Thanks to some detective work by Erik Bailey!

===========================================

I'm having a problem uploading an Arduino sketch:

Board type is set to "Arduino/Genuino Uno"

When trying to upload, I get:

Sketch uses 14130 bytes (43%) of program storage space. Maximum is 32256 bytes.
Global variables use 657 bytes (32%) of dynamic memory, leaving 1391 bytes for local variables. Maximum is 2048 bytes.
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x80
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x78
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x1e
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x78
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0xfe
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x80
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x78
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x1e
An error occurred while uploading the sketch

I can upload with board type set to "Duemilanove" and there is some functionality, but LEDs do not respond correctly (the LEDs light to all white).

The bootloader must be responding, because I've uploaded the base sketch (no function), then the demo sketch (Spirit responds to ultrasonic sensor) but the LEDs don't change color, probably because the board type is wrong.

I've tried this on Mac OS X High Sierra and Windows 7, behavior is identical.

Anything else to try?

Re: problem uploading Arduino Sketch

Posted: Sun Feb 04, 2018 1:02 am
by esba1ley
You're using the Arduino IDE, correct?

Re: problem uploading Arduino Sketch

Posted: Sun Feb 04, 2018 1:08 am
by gpvillamil
Yep, version 1.8.5

Re: problem uploading Arduino Sketch

Posted: Sun Feb 04, 2018 1:23 am
by esba1ley
What programmer are you using?

Re: problem uploading Arduino Sketch

Posted: Sun Feb 04, 2018 1:40 am
by gpvillamil
Just over USB. I don’t see any populated headers for another ISP.

The weird thing is that I can upload programs with the “wrong” board (duemilenove): the demo sketch mostly works but the LEDs act weird (they go to full white). I will see if I can configure the Neopixel library to work w a different board type.

I wonder if this related to power or the RPi. I tried disabling the interfaces on the Pi (SPI and I2C), and actually also tried shutting down the Pi over VNC before programming the Arduino.

Re: problem uploading Arduino Sketch

Posted: Sun Feb 04, 2018 1:42 am
by esba1ley
Hmmm... have you tried using avrdude directly and trying to read what the board type is? It should be an ATMega328p ... so the signature coming back should be 0x1E 95 0F, I think... Let me look...

Re: problem uploading Arduino Sketch

Posted: Sun Feb 04, 2018 2:10 am
by esba1ley

Re: problem uploading Arduino Sketch

Posted: Sun Feb 04, 2018 2:54 am
by esba1ley

Re: problem uploading Arduino Sketch

Posted: Sun Feb 04, 2018 2:58 am
by gpvillamil
Yep that is exactly what I’m seeing: all pixels white, and some functions are slow.

I thought there might be a power issue so I disconnected the wing LEDs.

What board did you select for programming?

Kevin, it would be great to at least restore the demo behaviors!

Re: problem uploading Arduino Sketch

Posted: Sun Feb 04, 2018 4:09 am
by esba1ley
I don't think the problem is with the avrdude tool... if it can upload code (which it can) I bet it's how the Arduino IDE is compiling the code in the first place -- I bet there is some kind of pre-complier statement that is assuming the clock rate is twice as fast as it really is. Let me take a look at Kevin's code...