Go Down

Topic: Arduino on Xcode Project — Official Thread (Read 154 times) previous topic - next topic

avenue33


Wow! I just recently found the mpIDE app and the mpide xcode project, and wanted to try this with my UNO. I'm getting some strange
errors so far. I got as far as a clean compile, but uploader returns with error 2 (programmer not responding). I might be
doing something wrong.

I experienced the same error.

Just add the -F flag to AVRDUDE_COM_OPTS:
Code: [Select]
AVRDUDE_COM_OPTS  = -q -V -F -p $(MCU)

avenue33

The original structure of the makefiles in mpideXcode was limiting further development (because it was depending on the sole MPIDE application for both Arduino and chipKIT boards) and wasn't flexible enough (with one single file for all).

Now, the new makefiles suite uses Arduino IDE and chipKIT MPIDE for their corresponding boards. Adding a new platform only requires adding a new makefile specific to that platform.

So the new name for the project is embedXcode!

Robhuhn

#137
Feb 12, 2012, 07:51 pm Last Edit: Feb 12, 2012, 07:52 pm by Robhuhn Reason: 1
Hi,

just read all the posts of this thread - So you all don't have any problems with the output from Serial.println();? I just cloned tims Arduino-With-XCode project and also tested some other projects but I don't get any logs in xcode. The rate is set to 9600 bps Serial.begin(9600); Did I miss something to get the output?

Oh, and thanks for all the help getting a projet to work in xcode!

avenue33

Actually, the output from [font=Courier]Serial.println()[/font] goes to a separate Terminal window.

I can't manage to get it on the Xcode debug window.

Someone has found a trick but I can't replicate it.

blubyu

avenue33 -

Can't you simply associate the .pde extension with the Xcode app in order for it to appear as a C++ Source file inside of Xcode?

avenue33

I've just added to release 1 an Installation Guide.

As usual, the repository is rei-vilo/embedXcode

glasspusher

ave33 et. al.

Awesome work! Just stumbled upon this. Tried to get a project working as per the pdf instructions, there appear to be a couple of snags. I don't have a "Libraries" folder in my ~/Documents/Arduino folder. Also, some funny business with the Build and Make targets- at first glance, it looks like the location that is expected for the arduino_pins.h is incorrect, and the script ends up making empty .h and .c files for it? Build and Make fail because of this.

I have to run, but will give this a good look later and report back. The thought of being able to use XCode for this is too cool.

Note- The Serial target works just fine, puts up a Terminal window that does communicate with the Arduino.

Dave

glasspusher

Oh, yeah, I'm using the Arduino 1.0. Is the project template compatible with this?

Dave

avenue33

#143
Feb 29, 2012, 07:25 pm Last Edit: Feb 29, 2012, 07:32 pm by avenue33 Reason: 1
Thank you for the accolade.

Just add a Libraries folder into your sketchbook folder.

I know there are too many targets. [font=Courier]Build[/font] includes [font=Courier]Clean[/font] and so compile everything from scratch, while Make only compile updated files for faster answer. [font=Courier]Build = Clean + Make[/font], as in Borland Turbo Pascal ;) .

Arduino 1.0 ins't supported yet. Among the main reasons:
  • Based on feed-back from the forum, Arduino 1.0 doesn't seem to be stable enough.

  • chipKIT UNO32 IDE is still 0023 based, as other boards.


So I rather prefer to wait before updating the project and template.

Nothing worse than addressing two different and incompatible releases!

Has the Installation Guide helped you?

Feel free to participate. I've listed the open issues on the GitHub repository.

glasspusher

Hey,

Thanks for the fast reply. No prob, I'll be happy to go back to 0023 if I can use XCode as the IDE ;)

My board of choice is the Teensy right now, maybe I can figure out how to make it one of the board options...

Cheers,

Dave

avenue33

New releases add Arduino 1.0 support.

embedXcode • Mar 06, 2012 release 4 - Arduino 1.0 support
mpideXcode • Mar 06, 2012 release 7 - Arduino 1.0 support

Code is here and documentation there.

Next step is to add Wiring, if I find a Wiring S board to test the upload.

Elijahg

#146
Mar 12, 2012, 03:39 am Last Edit: Mar 12, 2012, 03:52 am by Elijahg Reason: 1
Unfortunately your template doesn't seem to work for me without quite a few tweaks. I have Arduino 1.0. I've followed all the steps in your guide, but I firstly get an error in Step1.mk "Error: no application found". That's because in Step1.mk ARDUINO_APP = /Applications/Arduino23.app when it should be just Arduino.app.

Upon fixing that, I then get
Quote
grep: /Applications/Arduino23.app/Contents/Resources/Java/hardware/arduino/boards.txt: No such file or directory

Sometimes I get an error that the compiler can't locate "pins_arduino.h". Doing the following fixes both errors.
In Step1.mk, change
Quote
include $(MAKEFILE_PATH)/Arduino23.mk

to
Quote
include $(MAKEFILE_PATH)/Arduino1.mk


Also, inside Arduino1.mk "APP_HEADER = WProgram.h" appears to be wrong, as Arduino 1.0 uses Arduino.h.
APPLICATION_PATH in the same file assumes the Arduino 1.0 is called "Arduino1.app" also. Most people won't have a number in their Arduino app name, it'll just be the default Arduino.app. CORE_LIB_PATH should have a lower case "Arduino" in the path, as it's lower case in the filesystem (in Arduino 1.0 at least). Currently, this won't work on case sensitive filesystems. USER_LIB_PATH should have a lower case "libraries".

If leaving the target on All, an error "/bin/sh: Builds/nil: No such file or directory" occurs. After using other targets, the Builds folder is created so the error goes away. A Builds folder should be in the file template.

main.cpp in the project template should be Arduino.h not WProgram.h. Same in the C++ and Library file templates.


Another thing, why do you force people to enter their name and email address to access the files through Google Docs? Why did you remove everything from GitHub? Makes it rather difficult to see what changes have been made... Don't get me wrong, it's great that you're helping out with your template, just seems you're trying to hide it from everyone!

avenue33

#147
Mar 12, 2012, 06:56 am Last Edit: Mar 12, 2012, 07:02 am by avenue33 Reason: 1
Elijahg,

Thank you very much for the detailed feed-back on the template.

I'm working on the points you mention.

I've been obliged to implement this indirect download mode due to unpleasant experience with other projects, not to mention cooperation on GitHub close to nil.


avenue33


Unfortunately your template doesn't seem to work for me without quite a few tweaks. I have Arduino 1.0. I've followed all the steps in your guide, but I firstly get an error in Step1.mk "Error: no application found". That's because in Step1.mk ARDUINO_APP = /Applications/Arduino23.app when it should be just Arduino.app.

Upon fixing that, I then get
Sometimes I get an error that the compiler can't locate "pins_arduino.h". Doing the following fixes both errors.
In Step1.mk, change


Fixed. Arduino.mk now points to Arduino.app.

Also, inside Arduino1.mk "APP_HEADER = WProgram.h" appears to be wrong, as Arduino 1.0 uses Arduino.h.
APPLICATION_PATH in the same file assumes the Arduino 1.0 is called "Arduino1.app" also.


Fixed.

Most people won't have a number in their Arduino app name, it'll just be the default Arduino.app.


Fixed.
Arduino.mk addresses Arduino.app.
Arduino1.mk and Arduino23.mk makefiles are supplied for convenience.

CORE_LIB_PATH should have a lower case "Arduino" in the path, as it's lower case in the filesystem (in Arduino 1.0 at least). Currently, this won't work on case sensitive filesystems. USER_LIB_PATH should have a lower case "libraries".


Fixed for SketchBook/Library or library.
Fixed for /Applications/Arduino.app/Contents/Resources/Java/hardware/arduino
By default, OS X is case insensitive.


If leaving the target on All, an error "/bin/sh: Builds/nil: No such file or directory" occurs. After using other targets, the Builds folder is created so the error goes away. A Builds folder should be in the file template.


Fixed.


main.cpp in the project template should be Arduino.h not WProgram.h. Same in the C++ and Library file templates.


Actually, the #include in main.cpp is used to activate code-sense.
Fixed in the Library file template.

I hope to release the updated version soon.

Thanks again for the detailed feed-back.

Feel free to explore Xcode 4.3-related issues!

Elijahg


By default, OS X is case insensitive.

It is yes, but it's always best to write code that handles unexpected or unusual conditions rather than just failing :)

Quote

Actually, the #include in main.cpp is used to activate code-sense.
Fixed in the Library file template.


With WProgram.h included in main.cpp code sense doesn't work for me. If I change it to Arduino.h it works right away. The default .pde file includes WProgram.h too when it should again just include Arduino.h

There's a small problem with uploading too, for some reason the port for AVRdude to use gets lost somewhere. Changing AVRDUDE_PORT in Avrdude.mk to $(BOARD_PORT) fixes that.

Quote

Thanks again for the detailed feed-back.

No problem, thanks for the template!

Go Up