Pages: 1 ... 12 13 [14] 15 16 ... 46   Go Down
Author Topic: Arduino on Xcode Project — Official Thread  (Read 146327 times)
0 Members and 2 Guests are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Arduino IDE 1.0.2.  Just deleted the whole thing (including sketch folder) and reinstalled.  (I think it was 1.0.1, before, they must have updated it quite recently).
embedxcode downloaded installer package from your website on 21 oct 2012 (where do I see the version?)
Same result...
I will try a little more over the weekend
Logged

France
Offline Offline
God Member
*****
Karma: 11
Posts: 647
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Strange indeed.  This is the first time such error is reported.
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Can I ask you or some other Xcode/Makefile craig again if you have some clues?
I discovered the following:

When I add in main.cpp the full path of BlinkTest.ino (i.e. #include"/Users/myname/Documents/Arduino/BlinkTest/BlinkTest/BlinkTest.ino") the test project compiles in the Arduino IDE.
The warnings are still present.  They appear in Libraries HardwareSerial.cpp, Print.cpp and Tone.cpp which are included from a previous compile (although I installed the whole Arduino.app new).
E.g. the last lines of the compiler output before the warnings are:

Code:
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega2560 -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=102 \
  -I/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino \
  -I/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/variants/mega /Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/HardwareSerial.cpp \
  -o /var/folders/gq/_c97z0614fj267w8732pn4r00000gn/T/build4731805130703822254.tmp/HardwareSerial.cpp.o
/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/HardwareSerial.cpp: In function 'void store_char(unsigned char, ring_buffer*)':
I suspect this may be independent from the build errors in XCode, but on the other hand, I was able to avoid all warnings in previous sketches.

What I also observed:  If I insert some rubbish into the main.cpp (either within main{} or outside), it is not picked up during the build target, at all.  This can be because it lists too many other errors and parses all includes, first, but may still be a clue.

I still believe this may be some problem with errors due to function overloading which would normally work in C++ (maybe some functions are not interpreted as being part of a class ??)

If I look at the first bit that generates an error:

Code:
#ifdef __cplusplus
#include "WCharacter.h"
#include "WString.h"
#include "HardwareSerial.h"
uint16_t makeWord(uint16_t w);
uint16_t makeWord(byte h, byte l);

#define word(...) makeWord(__VA_ARGS__)
Which is some part of Arduino.h I get the first error in the lower line of uint16_t makeWord saying Declaration of C function 'uint16_t makeWord(byte, byte)' conflicts with and in the line above the error is Previous declaration 'uint16_t makeWord(uint16_t)' here.

I also included in Arduino1.mk the line
Code:
$(shell env>theEnvironment)
and the anonymized result is attached...

Thank you anyone for your help.

* theEnvironment.txt (9.91 KB - downloaded 23 times.)
Logged

France
Offline Offline
God Member
*****
Karma: 11
Posts: 647
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm sorry not to be able to help you on your specific case.

I don't understand why the blink.ino file isn't inside the folder of the Xcode project:

MyProject/
. MyProject.xcode
. MyProject/
. . blink.ino
. . main.cpp
. . and other files
Logged


France
Offline Offline
God Member
*****
Karma: 11
Posts: 647
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Please find the new release of embedXcode

  • Oct 26, 2012 release 18 • Support for Arduino Due
  • Oct 28, 2012 release 19 • Support for StellarPad
  • Nov 09, 2012 release 20 • Support for Teensy 3.0

The user manual has been updated too

  • Nov 09, 2012 release 16 • Updated with new boards

Please note the Arduino 1.5, Energia for StellarPad and Teensy 3.0 softwares are in development.

I've tested build, link and upload successfully for all boards except for the Arduino Due I don't own.

Website: http://embedxcode.weebly.com
Download: http://embedxcode.weebly.com/download
User guide: http://embedxcode.weebly.com/tutorial

Enjoy smiley-wink
« Last Edit: November 11, 2012, 11:15:06 am by avenue33 » Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

ok, I got it to work.   (The directory structure was correct, it was just as you mentioned it should be, above, btw).
The problem was that apparently from Arduino 1.0.1 (?) but definitely in 1.0.2 there is a library WiFi in the libraries path in the applications folder, which is included automatically by the makefiles (the APP_LIB_PATH directory seems to be parsed in step2.mk).
Uncommenting the BOARD_TAG and and other variables in the root makefile and running a "make build" from the Terminal gave me that clue.
(btw, is there any way to make XCode give you the verbose build output.  It would give better clues, sometimes).

The triggering error was actually
/Applications/Arduino.app/Contents/Resources/Java/libraries/WiFi/WiFiClient.cpp: In member function 'uint8_t WiFiClient::getFirstSocket()':
/Applications/Arduino.app/Contents/Resources/Java/libraries/WiFi/WiFiClient.cpp:177: error: 'SOCK_NOT_AVAIL' was not declared in this scope
make: *** [Builds/libs/WiFi/WiFiClient.o] Error 1


SOCK_NOT_AVAIL is some preprocessor definition in a utility header from that WiFi library, which probably was not parsed.
The duplicates appeared then because it probably messed up the whole preprocessing.

I worked around this by just adding WiFi to the EXCLUDE_NAMES tag definition of step1.mk.
The build target then went straight through without any errors or warnings.

I tried to manually copy the WiFi library to the project folder and included it to all targets in XCode, but that did not work.  You probably understand why  smiley-wink and may want to add that library to the next release (or could it not be parsed, anyway?).

Thanks for the tool, it looks great and I will now try out my real projects with it smiley
Logged

France
Offline Offline
God Member
*****
Karma: 11
Posts: 647
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm glad it works for you now.

Uncommenting the BOARD_TAG and and other variables in the root makefile and running a "make build" from the Terminal gave me that clue.

The BOARD_TAG variable is defined when you select the board on Info pane.
Please refer to section 4.2. Change the Board on the User Manual.

(btw, is there any way to make XCode give you the verbose build output.  It would give better clues, sometimes).

All the build, link and upload commands as well as the error messages are available on the Issue navigator.
Please refer to section 5.4. Error Messages on the User Manual.

Xcode is a professional IDE and requires some learning. I strongly recommend Xcode 4 Unleashed by Fritz F. Anderson I bought thanks to contributions I've received.

Logged


France
Offline Offline
God Member
*****
Karma: 11
Posts: 647
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Please find the new release of embedXcode

   Nov 13, 2012 release 21 • Stability enhancement and better information

• Stability enhancement, especially for Arduino Due and StellarPad linking
• Better information in a more structured presentation

As always,

• Website: http://embedxcode.weebly.com
• Download: http://embedxcode.weebly.com/download
• User guide: http://embedxcode.weebly.com/tutorial

Enjoy smiley-wink
Logged


France
Offline Offline
God Member
*****
Karma: 11
Posts: 647
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Please find the new release of embedXcode

   Nov 17, 2012 release 22 • New Make and Fast optimised targets

embedXcode release 22 includes two new targets: Make and Fast.



The Make and Fast targets feature an optimisation for the build of the foundation libraries.
 
The new targets are much faster than the corresponding Build and All targets. This is especially important for the ARM-based boards.

Learn more.
 
As always,
• Website: http://embedxcode.weebly.com
• Download: http://embedxcode.weebly.com/download
• User guide: http://embedxcode.weebly.com/tutorial

Enjoy smiley-wink
 
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Context - OSX MountainLion, Xcode4.5.2

I have installed embeddedXcode and I can (after some messing about ) generate an Arduino (Uno) project.

I find I cannot compile it  here is the error report - the Arduino is not connected and I have not editted the code created

# embedXcode
# ----------------------------------
# Embedded Computing on Xcode 4
#
# Copyright © Rei VILO, 2010-2012
# Licence CC = BY NC SA
#

# References and contribution
# ----------------------------------
# See About folder
#


include $(MAKEFILE_PATH)/Avrdude.mk

ifneq ($(MAKECMDGOALS),boards)
    ifneq ($(MAKECMDGOALS),build)
        ifneq ($(MAKECMDGOALS),make)
            ifneq ($(MAKECMDGOALS),document)
                ifneq ($(MAKECMDGOALS),clean)
                    ifeq ($(AVRDUDE_PORT),)
                        $(error Serial port not available)
                    endif
                endif
            endif
        endif
    endif
endif

I would like to be more explicit - but I simply dont know what to say - except that I would expect it to be able to compile a 'null program'! Earlier attempts encountered other errors ( like 'init()' not defined) - but these have now gone away!

Any help will be much appreciated before I am forced to use VisualStudio!

Thank-you
Logged

France
Offline Offline
God Member
*****
Karma: 11
Posts: 647
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

What target have you selected?

« Last Edit: November 22, 2012, 07:35:31 am by avenue33 » Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank-you for such a quick response!

The only option I can have is All->My Mac 32bit.

The Project Targets/All Build Settings show
      Debug Board Port as tty.usbmodem*, and the Debug Board Tag as uno
Logged

France
Offline Offline
God Member
*****
Karma: 11
Posts: 647
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank-you for such a quick response!

You're welcome!

The only option I can have is All->My Mac 32bit.

Strange, you should have also Build, which builds and links without uploading, and many other options as shown is my previous post.

The Project Targets/All Build Settings show
      Debug Board Port as tty.usbmodem*, and the Debug Board Tag as uno

I the case your genuine Arduino Uno board —and not a compatible board that may use another driver to upload— is connected, open the Terminal and type
Code:
ls /dev/tty.usb*

It might be the serial port is managed by /dev/tty.usbserial* instead of the default /dev/tty.usbmodem*

  • Arduino Uno rev 2 board = /dev/tty.usbmodem411
  • Compatible Uno board = /dev/tty.usbserial-A40084mc

In such a case, just edit the the Arduino UNO.xcconfig file with the USB port.
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank-you all for your attention.

I have run Blink under OSX Arduino - on port tty.usbmodem*, (As reported by /dev/tty) and no problem.

It would appear that I need to have the Arduino plugged in when I use XCode (?)

I then returned to Xcode and set the Option to BUILD (as suggested) and got 30 plus failures concerned with wiFi.cpp  - e.g. wifi_drv.h no such file or directory. No Serial Port error reported.




Logged

France
Offline Offline
God Member
*****
Karma: 11
Posts: 647
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I have run Blink under OSX Arduino - on port tty.usbmodem*, (As reported by /dev/tty) and no problem.

It would appear that I need to have the Arduino plugged in when I use XCode (?)

As mentioned page 49 of the User Manual, each target has a specific agenda:

Quote
• All cleans the files from a previous compilation, compiles and links, uploads and opens a serial window in Terminal.
So you need the board to be plugged-in to upload.

Quote
• Build compiles all the files, changed and unchanged, and links them.
No plugged-in board is required.


I then returned to Xcode and set the Option to BUILD (as suggested) and got 30 plus failures concerned with wiFi.cpp  - e.g. wifi_drv.h no such file or directory. No Serial Port error reported.

Please, you're going too fast...

If the blink example works on the Arduino IDE, have you tried it on Xcode before trying a more complex example?

You need to validate each step, with one single change per step.

About the WiFi, I guess some specific libraries need to be installed. Have you installed them? Does the sketch compile on the Arduino IDE? Have you check the sketchbook is correctly defined —page 9 sq., ibid.? Have you restricted some libraries for faster compilation —page 51, ibid.?


Logged


Pages: 1 ... 12 13 [14] 15 16 ... 46   Go Up
Jump to: