Arduino DUE not loading sketches

by voodoochemist on Fri Mar 01, 2013 3:02 pm

I purchased the Arduino Due: http://www.adafruit.com/products/1076

I have not been able to upload sketches. I have worked on the UNO without any problem - I purchased the DUE to have more memory for bigger sketches. However, I keep getting an error message when trying to upload even the bare minimum sketch (setup and loop).

I am connected to my Mac OS v10.5.8 using a single USB cable. I have tried two different cable connections (first one purchased via adafruit:
http://www.adafruit.com/products/1099 (this USB male micro B which goes into the DUE, but it's a female USB A). This connection still needed another cable: a male to male USB Type A. So I bought one from ebay, but I received the error message.

After I received the error message, I guessed maybe it was a bad cable from ebay, so I bought a single USB micro B male to USB type A male from digikey, and I still get the same error message, so it's not the cable! :)

In the IDE, I've changed the board setting from UNO to Duemilanove. I'm hoping there's a board setting I'm not aware of that I can install?

For "programmer" on the IDE, I've tried AVR ISP and AVRISP mkII, but I get the same error. Am I missing something here?

The device is receiving power (both the green LED "on" and yellow "L" are continuously illuminated.

When I attempt to upload a sketch, I can see the "RX" light flicker on three times before the error on the IDE is displayed. The error message is as follows:

Problem uploading to board. See [arduino URL for troubleshooting]
Binary sketch size.... 466 bytse of a 30,720 byte max
"avrdude: stk500_recv(): programmer is not responding"

Help please!
voodoochemist
 
Posts: 12
Joined: Fri Mar 01, 2013 2:47 pm
Location: East Village, NY

Re: Arduino DUE not loading sketches

by adafruit_support_bill on Fri Mar 01, 2013 4:08 pm

In the IDE, I've changed the board setting from UNO to Duemilanove. I'm hoping there's a board setting I'm not aware of that I can install?

To connect to the Due, you need IDE V 1.5 Beta (download here: http://arduino.cc/en/Main/Software )
The Due choices are: Programming Port or Native USB port. I recommend you use the Programming Port. Refer to the port labels on the back of the board.
User avatar
adafruit_support_bill
 
Posts: 25367
Joined: Sat Feb 07, 2009 9:11 am

Re: Arduino DUE not loading sketches

by voodoochemist on Fri Mar 01, 2013 5:37 pm

Thank you for the quick response, but now I have a different error message using the IDE version 1.5.2 (the most current version)

I receive the following error immediately (the IDE never gets far enough to communicate with the Arduino hardware, as it did last time. this error happens about a quarter second after clicking 'upload sketch'):

"Error compiling
dyld: unknown required load command 0x80000022
/Applications/Arduino152.app/Contents/Resources/Java/hardware/tools/g++_arm_non_eabi/bin/arm-none-eabi-g++ returned 133"

In addition, I receive the command prompt:
"The application arm-none-eabi-G+ + quit unexpectedly" although the IDE never actually closes. (options are "ignore", "report..." or "relaunch") I click ignore and the IDE stays open.

Board is set to "DUE"
Programmer "AVR ISP"

Thank you!
voodoochemist
 
Posts: 12
Joined: Fri Mar 01, 2013 2:47 pm
Location: East Village, NY

Re: Arduino DUE not loading sketches

by voodoochemist on Fri Mar 01, 2013 5:41 pm

In addition, board is set to DUE (PROGRAMMING), and i'm connected to the programming port.
voodoochemist
 
Posts: 12
Joined: Fri Mar 01, 2013 2:47 pm
Location: East Village, NY

Re: Arduino DUE not loading sketches

by adafruit_support_rick on Fri Mar 01, 2013 10:15 pm

I just installed Arduino 1.5.2 on a MacBook Pro running 10.7.5. No driver installation required - it just came up working.
The "Programmer setting" should be irrelevant. FWIW, the first time I ran it, it came up with the programmer set to AVR ISP II.

The errors you're seeing tell me that there is some problem with your installation of 1.5.2. I suggest deleting the app entirely and downloading a fresh copy.

You might also try running MacOSX Software Update, and make sure you're up-to-date on Java.

It's also possible that Arduino 1.5.2 is not compatible with MacOSX 10.5, which is a fairly old version of MacOSX.
User avatar
adafruit_support_rick
 
Posts: 8456
Joined: Tue Mar 15, 2011 10:42 am
Location: Buffalo, NY

Re: Arduino DUE not loading sketches

by voodoochemist on Sat Mar 02, 2013 2:20 pm

Thanks Driverblock, it was the OS. I tried the DUE with IDE 1.5.2 on my friend's macbook air running 10.6.8 and now sketches are uploading. (now i wish i could figure out why i can't get 10.6 to install on my mac - damn thing freezes on blue screen using the install disc. a question for a different forum, i guess...)

Thanks everyone.
voodoochemist
 
Posts: 12
Joined: Fri Mar 01, 2013 2:47 pm
Location: East Village, NY

Re: Arduino DUE not loading sketches

by adafruit_support_rick on Sat Mar 02, 2013 3:22 pm

Hmmm … at a guess, I'd say that your 10.5.8 install is semi-corrupted. That's why Arduino 1.5.2 won't run, and it's probably why the 10.6 installer won't run.

What you want to do is backup your whole system to another disk, then do a clean install of 10.6.

Or, is it that it won't even boot from the install disk? If you've got another mac, you connect the two with a firewire cable. Boot the other mac, and connect your mac in target disk mode. You ought to be able to install the system that way.
User avatar
adafruit_support_rick
 
Posts: 8456
Joined: Tue Mar 15, 2011 10:42 am
Location: Buffalo, NY

Re: Arduino DUE not loading sketches

by voodoochemist on Sat Mar 02, 2013 8:47 pm

Good ideas Driverblock. I may try that method using the firewire link to initialize my crotchety old mac to get it up to 10.6. In the meantime, I'm borrowing my friend's Macbook Air.

While we have momentum, back to the DUE using this shiny new Macbook Air... it seems all of my sketches trip errors when I try to upload them, but these sketches worked fine on the UNO. (I confirmed both these two sketches still upload fine using this Macbook Air)

1) I attempt to get a little OLED sketch to load, but I get an error. (http://www.adafruit.com/products/661)
2) I try loading a sketch for a temperature/humidity sensor, but I get an error. (http://www.adafruit.com/products/386)
Again, if I hook up the UNO (and set the IDE to "UNO" from "DUE") and load these sketches, they load no problem.

For example, for the temp/humidity sensor, I get "error compiling" followed by:
/Users/name/Documents/Arduino/libraries/DHumidTemp/DHT.cpp: In member function 'boolean DHT::read()':
/Users/name/Documents/Arduino/libraries/DHumidTemp/DHT.cpp:110: error: 'cli' was not declared in this scope
/Users/name/Documents/Arduino/libraries/DHumidTemp/DHT.cpp:140: error: 'sei' was not declared in this scope

For the OLED, the error is:
error: expected initializer before 'logo16_glcd_bmp'

The lazy DUE isn't going to the libraries... not sure why.
voodoochemist
 
Posts: 12
Joined: Fri Mar 01, 2013 2:47 pm
Location: East Village, NY

Re: Arduino DUE not loading sketches

by adafruit_support_bill on Sun Mar 03, 2013 7:20 am

/Users/name/Documents/Arduino/libraries/DHumidTemp/DHT.cpp:110: error: 'cli' was not declared in this scope
/Users/name/Documents/Arduino/libraries/DHumidTemp/DHT.cpp:140: error: 'sei' was not declared in this scope

Looks like inline assembly code. The Due is a different processor with a different instruction set. I suspect that this library has not been ported to the Due yet.
User avatar
adafruit_support_bill
 
Posts: 25367
Joined: Sat Feb 07, 2009 9:11 am

Re: Arduino DUE not loading sketches

by voodoochemist on Sun Mar 03, 2013 12:34 pm

So all these peripherals I have won't work on the DUE, if I understand correctly. :evil: Great... is the DUE temporarily incompatible? (is there a plan in the works to upgrade the IDE to make the DUE's core chip compatible with the UNO sketches?)

My goal is to use all these peripherals together. Should I go back to my UNO since at least the libraries are compatible with the processor? I ran out of memory in my UNO when I load all the libraries for the OLED, the temp/humidity sensors, the SD Card, (not to mention the needed variables) -- which is why I thought the DUE was a good next step. Didn't realize the UNO and DUE had such a significant incompatibility.

1) Is there a way of boosting my UNO memory (SRAM?) for sketches?
2) Or is there an Arduino that has more memory for sketches whose processor... processes like the UNO? I guess the MEGA? I went with the DUE because it had the most memory, but maybe I need to take my chances with the smaller MEGA.
3) Or... should I explore microprocessors outside the realm of Arduino?

Thank you!
voodoochemist
 
Posts: 12
Joined: Fri Mar 01, 2013 2:47 pm
Location: East Village, NY

Re: Arduino DUE not loading sketches

by adafruit_support_bill on Sun Mar 03, 2013 1:00 pm

The devices are electrically compatible, but not all libraries have been updated yet. The two most recent Arduino hardware releases (Leonardo and Due) have significant hardware differences requiring substantial re-writes of most libraries. We are still playing catch-up with these, but expect to get to all of them eventually.

There are techniques for optimizing memory utilization on the Uno. If you have a lot of string literals, you should look into the F() macro for storing these in flash.
In the short term, the Mega will give you substantially more memory to work with.
User avatar
adafruit_support_bill
 
Posts: 25367
Joined: Sat Feb 07, 2009 9:11 am

Re: Arduino DUE not loading sketches

by voodoochemist on Sun Mar 03, 2013 6:25 pm

The Mega 2560 is fully compatible with the UNO sketches, correct?
https://www.adafruit.com/products/191
voodoochemist
 
Posts: 12
Joined: Fri Mar 01, 2013 2:47 pm
Location: East Village, NY

Re: Arduino DUE not loading sketches

by adafruit_support_bill on Mon Mar 04, 2013 6:01 am

From a software perspective, it is a superset of the UNO. But there are a couple of pin-mapping differences to be aware of:

Hardware SPI and I2C are on different pins from the UNO. http://arduino.cc/en/Main/arduinoBoardMega For shields with SD cards, we typically work around this with soft-SPI.

Software Serial can only be used on digital pins that support pin-change interrupts. (On the UNO, all pins are supported.)
http://arduino.cc/en/Reference/SoftwareSerial

What shields/breakouts etc. are you planning to attach?
User avatar
adafruit_support_bill
 
Posts: 25367
Joined: Sat Feb 07, 2009 9:11 am

Re: Arduino DUE not loading sketches

by voodoochemist on Mon Mar 04, 2013 10:47 am

My plan was to use the following:

1) Four DHT11: http://www.adafruit.com/products/386
2) Data logging shield & and the real time clock built in: http://www.adafruit.com/products/1141
3) OLED: http://www.adafruit.com/products/661
4) and possibly this relay shield: http://seeedstudio.com/wiki/Relay_Shield_V1.0

Thank you.
voodoochemist
 
Posts: 12
Joined: Fri Mar 01, 2013 2:47 pm
Location: East Village, NY

Re: Arduino DUE not loading sketches

by adafruit_support_bill on Mon Mar 04, 2013 1:25 pm

Here is a link to a logger sketch for the Mega using software SPI.: viewtopic.php?f=31&t=27245
The display is an SPI display. You should be able to use the Mega's hardware SPI pins for that.
User avatar
adafruit_support_bill
 
Posts: 25367
Joined: Sat Feb 07, 2009 9:11 am