Arduino Forum

Development => Other Software Development => Topic started by: avenue33 on Jan 26, 2011, 06:37 pm

Title: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Jan 26, 2011, 06:37 pm
Develop your sketches for Arduino using Xcode!

(http://embedxcode.weebly.com/uploads/1/1/6/2/11624344/6593998_orig.png)

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

Enjoy :)





Hello!

This is the continuation of the thread initiated by Robert aka. Ratkins in the now read-only old forum.

I've the same problem woth Arduino Uno on Xcode  :(

Please find what I've found so far:

On his blog (http://robertcarlsen.net/2009/02/28/using-arduino-in-xcode-532), Robert Carlsen was pretty close to a solution. But as the last two comments suggest, the Arduino Uno differs from the Duemilanove.

Quote
Robert Atkins Says:
January 3rd, 2011 at 7:41
I'm trying to get this working on a Uno, which I believe
has different USB/serial hardware than previous Arduino models?
Anyhow, I've changed the makefile to say: PORT = /dev/tty.usbmodem*
… but I'm getting a whole series of error messages: avrdude:
stk500_2_ReceiveMessage(): timeout And it doesn't look like the
sketch is uploading to the board (rx/tx LEDs aren't flashing.)
Anybody got any hints?

Davide Says:
January 9th, 2011 at 23:39
Also I am trying to work with Xcode ArduinoUno but gives me
this error --- "rm -f main.hex main.eep main.cof main.elf \
main.map main.sym main.lss core.a \ make: *** No rule to make target
`/Applications/Arduino.app/Contents/Resources/Java/hardware/cores/arduino//pins_arduino.o',
needed by `core.a'. Stop. -- someone managed to make it work?


Also, Mattias Gunneras posted on Twitter but didn't explain how

Quote
@mattiasgunneras
Mattias Gunneras
Finally got Xcode working with the Arduino UNO. I'm looking forward to a productivity gain of about 318%.
9 Jan via Twitter for Mac Favorite Undo Retweet Reply


Good luck!
Title: Re: Help! — Arduino Uno and Xcode (cont'd)
Post by: westfw on Jan 29, 2011, 10:14 am
Quote
Anyhow, I've changed the makefile to say: PORT = /dev/tty.usbmodem*

minimally, you would also have to change the bitrate to 115200...
Title: Re: Help! — Arduino Uno and Xcode (cont'd)
Post by: avenue33 on Feb 13, 2011, 05:47 pm
Hello,

I tried Nick's modified version of ArduinoOnXcode template (http://www.makesomecode.com/2010/07/30/programming-arduino-with-xcode/) plus all the following hints



It works fine  :) on my Arduino Uno with Arduino 0022 IDE and Xcode 3.2.5 on Mac OS X 10.6.6 for small projects, as LED blinking and "Hello World".

However, I can't manage to use libraries  :~ previously developed with Arduino 0022 IDE.

Probable cause might be a mismatch between C and C++ but I don't know how to fix it.

Any idea ?
Title: Re: In Progress! — Arduino Uno and Xcode (cont'd)
Post by: avenue33 on Feb 16, 2011, 01:59 pm
Hi!

Here are two working :) projects


and one non-working :( project


I'm sure it's something trivial  :~ but I can't find it.

Code: (Xcode error) [Select]
/usr/local/CrossPack-AVR/bin//avr-gcc -mmcu=atmega328p  -I. -gstabs  -DF_CPU=16000000L -I/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino -Os -Wall -Wstrict-prototypes  -std=gnu99  -o main.elf main.cpp -L. core.a -lm
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-std=gnu99" is valid for C/ObjC but not for C++
/var/folders/gA/gAXpDd7ZEBG06Owk-4lV4++++TI/-Tmp-//cc1xTugb.o: In function `global constructors keyed to myLed':
main.cpp:9: undefined reference to `LED::LED()'
/var/folders/gA/gAXpDd7ZEBG06Owk-4lV4++++TI/-Tmp-//cc1xTugb.o: In function `loop':
main.cpp:31: undefined reference to `LED::blink(int, int)'
/var/folders/gA/gAXpDd7ZEBG06Owk-4lV4++++TI/-Tmp-//cc1xTugb.o: In function `setup':
main.cpp:18: undefined reference to `LED::begin(int)'
main.cpp:24: undefined reference to `LED::on()'
make: *** [main.elf] Error 1


Warning! Before compiling, always launch Build > Clean or Shift-Command-K.

Any idea? Thank you for your help!
Title: Re: In Progress! — Arduino Uno and Xcode (cont'd)
Post by: avenue33 on Feb 16, 2011, 03:39 pm
Hi!

After some research, it seems to be related to the link options.

The library LED.h LED.cpp doesn't figure on the compile line:

Quote
/usr/local/CrossPack-AVR/bin//avr-gcc -mmcu=atmega328p  -I. -gstabs  -DF_CPU=16000000L -I/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino -Os -Wall -Wstrict-prototypes  -std=gnu99  -o main.elf main.cpp -L. core.a -lm


Enclosed: Makefile, full build log report

What are the parameters to be changed on the Makefile, not only for this specific project for any future projects?

Thank you and best regards,



Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: ratkins on May 08, 2011, 10:32 am
Good news, using the Makefile supplied by avenue33 I've successfully uploaded the Blink script to my Uno!

Xcode4 still won't acknowledge the existence of the template, but I guess that's just an afternoon of manual-digging. I'll post here when I have anything more to report.

Cheers, Robert.
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: avenue33 on Jun 07, 2011, 07:17 pm
Hi Robert,

On Xcode 3.2.5, I select File > New Project and then a window pops-up with the following options:
(https://lh5.googleusercontent.com/-CrO_3IAcjEQ/Te5cHqyQ9AI/AAAAAAAAIQk/7TwQ_dtCJV4/s600/2011-06-07%25252019.11.37.png)
Choose Other > ArduinoOnXcode.

I don't know how it runs on Xcode 4 but I guess it's similar.

I still don't manage to get my own libraries compiled, as Example-4 attached in a previous post. There's no problem with standard Arduino libraries.

Nice to hear from your progress  ;)
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: avenue33 on Nov 04, 2011, 06:48 pm
Hi!

Please find on this GitHub repository (http://github.com/rei-vilo/Xcode-for-MPIDE-Arduino) a Xcode project for Arduino UNO.



I tested it successfully with the Arduino UNO and the chipKIT UNO32 platforms.

The Xcode 3 template is no longer valid because Xcode 4 has changed everything about the templates.

More details on my  (http://sites.google.com/site/vilorei/arduino/20--arduino-makefile-for-xcode)website (http://website).

I'd greatly appreciate some help on Xcode 4 about templates and libraries linking.
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: timKnapen on Nov 12, 2011, 02:11 am
Hi,

I have been struggling to get Arduino to work with XCode for the longest time.
Finally, it is working. even with libraries ( but for some reason not the SD library... I'm not really sure why. )

I have been recycling makefiles that other people posted on the web, but none that I found could make libraries link correctly or even include extra .cpp files in my project's src folder.
So I have been adjusting and changing makefiles so many times I have no clue where my original source came from :-s

Here is the makefile that I'm using now for working with a Makerbot Sanguino based board:

Code: [Select]

ARDUINO = /Applications/Arduino.app/Contents/Resources/Java/hardware/Sanguino/cores/arduino
LIBRARIES = /Applications/Arduino.app/Contents/Resources/Java/libraries
AVRDUDE_DIR = /usr/local/CrossPack-AVR/bin
SIZE = $(AVRDUDE_DIR)/avr-size
SOURCES = $(wildcard src/*.cpp)

#loading libraries
STEPPER = $(LIBRARIES)/Stepper
SERVO = $(LIBRARIES)/Servo
EEPROM = $(LIBRARIES)/EEPROM
SD_UTIL = $(LIBRARIES)/SD/utility
INCLUDE_LIBRARIES = -I$(STEPPER) -I$(SERVO) -I$(EEPROM)
CPP_LIBRARIES = $(wildcard $(STEPPER)/*.cpp) $(wildcard $(SERVO)/*.cpp) \
$(wildcard $(EEPROM)/*.cpp)

PORT = /dev/tty.usbserial*
TARGET = main
SRC = $(ARDUINO)/pins_arduino.c $(ARDUINO)/wiring.c \
$(ARDUINO)/wiring_analog.c $(ARDUINO)/wiring_digital.c \
$(ARDUINO)/wiring_pulse.c \
$(ARDUINO)/wiring_shift.c $(ARDUINO)/WInterrupts.c
CXXSRC = $(ARDUINO)/HardwareSerial.cpp $(ARDUINO)/WMath.cpp $(ARDUINO)/Print.cpp \
$(CPP_LIBRARIES) $(SOURCES)
MCU = atmega644p
F_CPU = 16000000
FORMAT = ihex
UPLOAD_RATE = 38400

# Name of this Makefile (used for "make depend").
MAKEFILE = Makefile

# Debugging format.
# Native formats for AVR-GCC's -g are stabs [default], or dwarf-2.
# AVR (extended) COFF requires stabs, plus an avr-objcopy run.
DEBUG = stabs

OPT = s

# Place -D or -U options here
CDEFS = -DF_CPU=$(F_CPU)
CXXDEFS = -DF_CPU=$(F_CPU)

# Place -I options here : include libraries
CINCS = -I$(ARDUINO) $(INCLUDE_LIBRARIES)
CXXINCS = -I$(ARDUINO) $(INCLUDE_LIBRARIES)

# Compiler flag to set the C Standard level.
# c89   - "ANSI" C
# gnu89 - c89 plus GCC extensions
# c99   - ISO C99 standard (not yet fully implemented)
# gnu99 - c99 plus GCC extensions
CSTANDARD = -std=gnu99
CDEBUG = -g$(DEBUG)
CWARN = -Wall -Wstrict-prototypes
CTUNING = -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -ffunction-sections -fdata-sections -Wl,-gc-sections

CFLAGS = $(CDEBUG) $(CDEFS) $(CINCS) -O$(OPT) $(CWARN) $(CSTANDARD) $(CEXTRA) $(CTUNING)
CXXFLAGS = $(CDEFS) $(CXXINCS) -O$(OPT) $(CTUNING)
LDFLAGS = -lm -Wl,-gc-sections -mmcu=$(MCU)

# Programming support using avrdude. Settings and variables.
AVRDUDE_PROGRAMMER = stk500v1
AVRDUDE_PORT = $(PORT)
AVRDUDE_WRITE_FLASH = -U flash:w:bin/$(TARGET).hex
AVRDUDE_FLAGS = -F -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) \
 -b $(UPLOAD_RATE) -D
 

# Program settings
CC = $(AVRDUDE_DIR)/avr-gcc
CXX = $(AVRDUDE_DIR)/avr-g++
OBJCOPY = $(AVRDUDE_DIR)/avr-objcopy
OBJDUMP = $(AVRDUDE_DIR)/avr-objdump
AR  = $(AVRDUDE_DIR)/avr-ar
SIZE = $(AVRDUDE_DIR)/avr-size
NM = $(AVRDUDE_DIR)/avr-nm
AVRDUDE = $(AVRDUDE_DIR)/avrdude
REMOVE = rm -f
MV = mv -f

# Define all object files.
OBJ = $(SRC:.c=.o) $(CXXSRC:.cpp=.o) $(ASRC:.S=.o)

# Define all listing files.
LST = $(ASRC:.S=.lst) $(CXXSRC:.cpp=.lst) $(SRC:.c=.lst)

# Combine all necessary flags and optional flags.
# Add target processor to flags.
ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS)
ALL_CXXFLAGS = -mmcu=$(MCU) -I. $(CXXFLAGS)
ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)


# Default target.
all: sizebefore clean build  sizeafter

build: info folder elf hex


elf: bin/$(TARGET).elf
hex: bin/$(TARGET).hex
eep: bin/$(TARGET).eep
lss: bin/$(TARGET).lss
sym: bin/$(TARGET).sym

# print info
info:
@echo "compiling sources: " $(SOURCES);
@echo "compiling libraries sources: " $(CPP_LIBRARIES);
@echo "----------";

# create the bin folder if it doesn't exist
folder:
mkdir -p bin

# Program the device.  
upload: bin/$(TARGET).hex
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH)


# Display size of file.
HEXSIZE = $(SIZE) --target=$(FORMAT) bin/$(TARGET).hex
ELFSIZE = $(SIZE)  bin/$(TARGET).elf
sizebefore:
@echo "size before: ";
@if [ -f bin/$(TARGET).elf ]; then echo; echo $(MSG_SIZE_BEFORE); $(HEXSIZE); echo; fi

sizeafter:
@echo "size after:";
@if [ -f bin/$(TARGET).elf ]; then echo; echo $(MSG_SIZE_AFTER); $(HEXSIZE); echo; fi



# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
COFFCONVERT=$(OBJCOPY) --debugging \
--change-section-address .data-0x800000 \
--change-section-address .bss-0x800000 \
--change-section-address .noinit-0x800000 \
--change-section-address .eeprom-0x810000


coff: bin/$(TARGET).elf
$(COFFCONVERT) -O coff-avr bin/$(TARGET).elf $(TARGET).cof


extcoff: $(TARGET).elf
$(COFFCONVERT) -O coff-ext-avr bin/$(TARGET).elf $(TARGET).cof


.SUFFIXES: .elf .hex .eep .lss .sym

.elf.hex:
$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@

.elf.eep:
-$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
--change-section-lma .eeprom=0 -O $(FORMAT) $< $@

# Create extended listing file from ELF output file.
.elf.lss:
$(OBJDUMP) -h -S $< > $@

# Create a symbol table from ELF output file.
.elf.sym:
$(NM) -n $< > $@


bin/core.a: $(OBJ)
@for i in $(OBJ); do echo $(AR) rcs bin/core.a $$i; $(AR) rcs bin/core.a $$i; done

# Link: create ELF output file from library.
bin/$(TARGET).elf: bin/core.a
$(CC) $(ALL_CFLAGS) -o $@ src/$(TARGET).cpp -L. bin/core.a $(LDFLAGS)

# Compile: create object files from C++ source files.
.cpp.o:
$(CXX) -c $(ALL_CXXFLAGS) $< -o $@

# Compile: create object files from C source files.
.c.o:
$(CC) -c $(ALL_CFLAGS) $< -o $@


# Compile: create assembler files from C source files.
.c.s:
$(CC) -S $(ALL_CFLAGS) $< -o $@


# Assemble: create object files from assembler source files.
.S.o:
$(CC) -c $(ALL_ASFLAGS) $< -o $@



# Target: clean project.
clean:
$(REMOVE) bin/$(TARGET).hex bin/$(TARGET).eep bin/$(TARGET).cof bin/$(TARGET).elf \
bin/$(TARGET).map bin/$(TARGET).sym bin/$(TARGET).lss bin/core.a \
$(OBJ) $(LST) $(SRC:.c=.s) $(SRC:.c=.d) $(CXXSRC:.cpp=.s) $(CXXSRC:.cpp=.d)

depend:
if grep '^# DO NOT DELETE' $(MAKEFILE) >/dev/null; \
then \
sed -e '/^# DO NOT DELETE/,$$d' $(MAKEFILE) > \
$(MAKEFILE).$$$$ && \
$(MV) $(MAKEFILE).$$$$ $(MAKEFILE); \
fi
echo '# DO NOT DELETE THIS LINE -- make depend depends on it.' \
>> $(MAKEFILE); \
$(CC) -M -mmcu=$(MCU) $(CDEFS) $(CINCS) $(SRC) $(ASRC) >> $(MAKEFILE)

.PHONY: all build elf hex eep lss sym program coff extcoff clean depend


I'm using this with XCode 3.2, I have attached a zip file of a working sample project.

hope this helps someone, I for one got a little bit balder trying to get this to work :-)

best,
tim.
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: timKnapen on Nov 12, 2011, 04:36 pm
I have create a project on Github where I've put the XCode project templates:
https://github.com/timknapen/Arduino-With-XCode

With a little help from people who know about makefiles and compilers, I'm sure we can get decent XCode support for Arduino.

best,
tim.
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: timKnapen on Nov 14, 2011, 01:30 pm
Hi all,

I don't know if this is the right place for this, but I've updated my XCode projects on Github. It has now been updated to work with the UNO. I did a quick test and it seems to work fine.

Still only XCode 3.2 because I'm not running Lion yet..

go get it here: https://github.com/timknapen/Arduino-With-XCode

best,
tim.
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: timKnapen on Nov 14, 2011, 01:41 pm
Hey anyone doing the same sort of thing,

Shouldn't we create a specific thread for Arduino + XCode (both XCode3.2 and XCode4) so that everybody who know how to write proper C++ can benefit from our efforts? It seems that all the information is now spread over multiple blogs, github repositories etc..

And even on the playgrond: http://arduino.cc/playground/Main/DevelopmentTools there is no mention.

anyone?

best,
tim.
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: avenue33 on Nov 14, 2011, 02:59 pm
I fully agree with you.

I find here (http://github.com/turicas/arduinoMakefile/blob/master/resources.markdown) an extensive list of Arduino-related makefiles.

What we need:
• Actions: Build and Upload
• Boards choice: Arduino UNO, ... , chipKIT UNO32
• #include libraries compiled and linked
• Xcode template

I could easily close my repository and point to yours.

Is there an Xcode specialist around? Please!

Best regards,
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: timKnapen on Nov 14, 2011, 05:14 pm

I fully agree with you.

I'll find here (http://github.com/turicas/arduinoMakefile/blob/master/resources.markdown) an extensive list of Arduino-related makefiles.

What we need:
• Actions: Build and Upload
• Boards choice: Arduino UNO, ... , chipKIT UNO32
• #include libraries compiled and linked
• Xcode template

I could easily close my repository and point to yours.

Is there an Xcode specialist around? Please!

Best regards,



That list of makefiles is very interesting for learning, thanks!

I don't want to come in and take over the show, so I don't think you should close your repository, but a central place for working on this would be great. Like maybe a XCode + Arduino thread on this forum where we discuss the progress and one github repository where multiple people can work on this project.
I'm very new to git and github, so I don't really know how to do this. Do you?

I'm just starting to learn about makefiles so we could use someone that really is fluent with these thing. It would be great that people who download the templates don't have to go into the makefile and change a bunch of parameters just to add a library.
Right now I'm trying to have the choice of Board in the build settings of the project instead of in the makefile. I'm fairly close, but I can't find how to make a drowdown list in the build settings like the ones you have in a Cocoa project when selecting the "Base SDK"...

Avenue33, did you try my project template with XCode 4? I think you can just open it as a normal project with XCode4.
I don't have a computer that runs Lion yet, so I can't test this.

best,
tim
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: westfw on Nov 14, 2011, 05:44 pm
What we "need" is a command-line mode of the Arduino app that does the Arduino-style preprocessing on a set of .pde (or .ino) files.
Having to figure out exactly what it does (slightly differently) with each Arduino release is a pain, and makes implementing Arduino program builds in other IDEs an exercise in chasing not-fully-documented behaviors. :-(
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: avenue33 on Nov 14, 2011, 05:58 pm
I agree with this approach: all the parameters are on the files

/Applications/Mpide.app/Contents/Resources/Java/hardware/arduino/platforms.txt
/Applications/Mpide.app/Contents/Resources/Java/hardware/pic32/platforms.txt

The Arduino IDE or the chipKIT MPIDE are great tools. However, they are closed.

Both Arduino and chipKIT should disclose more so any standard IDE could be used: Visual Studio, Eclipse, Xcode, to name a few.
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: westfw on Nov 14, 2011, 07:01 pm
Quote
The Arduino IDE or the chipKIT MPIDE are great tools. However, they are closed.

They're not "closed."  They are just rather tightly controlled.  You can download the sources and make the patches to do what I described, but the chance that the patches will be accepted for inclusion in future releases is quite small.
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: timKnapen on Nov 14, 2011, 07:14 pm

What we "need" is a command-line mode of the Arduino app that does the Arduino-style preprocessing on a set of .pde (or .ino) files.
Having to figure out exactly what it does (slightly differently) with each Arduino release is a pain, and makes implementing Arduino program builds in other IDEs an exercise in chasing not-fully-documented behaviors. :-(


What do you mean with "preprocessing" exactly? In the XCode version, we are just using the Arduino C and Cpp libraries and avr-gcc to compile for the arduino, but no special preprocessing.

Or do you mean the converting from .pde files into .h and .cpp files that probably happens behind the screens in the Arduino IDE?

best,
tim.
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: westfw on Nov 14, 2011, 07:18 pm
Quote
do you mean the converting from .pde files into .h and .cpp files

Yep; that.  Concatenate the .pde files, generate function prototypes, add the default .h files, and detect the used libraries.  More or less.  Subject to change.
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: timKnapen on Nov 14, 2011, 07:27 pm

Quote
do you mean the converting from .pde files into .h and .cpp files

Yep; that.  Concatenate the .pde files, generate function prototypes, add the default .h files, and detect the used libraries.  More or less.  Subject to change.


hmmm I'm not sure about that... I have absolutely no problem with writing good code when I get all the advantages in XCode.
Also, the code completion probably wouldn't work if you start working with .pde files without proper header files, right?

I think it would make more sense to have two types of working: the easy to learn and quick-sketch Arduino IDE way and a way for more experienced programmers to work with their preferred IDE and a good makefile.

best,
tim.
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: westfw on Nov 14, 2011, 08:15 pm
sure, as long as you don't end up creating sketches that can ONLY be compiled from the XCode environment.  Assuming that you want to share your code, it'll need to compile from the Arduino IDE as well.  I don't think that this has been a problem so far, but I can see it becoming one as programs get larger.
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: timKnapen on Nov 15, 2011, 03:02 am
hey Westfw,

I think this won't be such a big problem. The things people share are more like snippets of code to do something specific and explain a concept or libraries, and they of course would work in any environment as they seem to be always made up of proper .h, .cpp and .c files.

When working in XCode, there is no reason to stick to the Arduino convention of naming the main .pde file the same as the project folder, so when going from XCode to Arduino IDE you'll need to re-name that main file.

That is the only compatibility problem in the XCode -> Arduino IDE direction that I can think of.. The other direction could be a bit more involved because of the preprocessing, but still not a big deal.

I can't really imagine anything that would be workable in XCode (it's still the same compiler..) and would not work in the Arduino IDE.

best,
tim.
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: westfw on Nov 15, 2011, 03:44 am
Quote
always made up of proper .h, .cpp and .c files.
   :
I can't really imagine anything that would be workable in XCode and would not work in the Arduino IDE.


Well, you could send out a supposedly complete project with no .pde file, for example.
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: avenue33 on Nov 15, 2011, 07:47 am
@Westfw

Feel free to join the project.

As the thread title stands, we plan to deal with Xcode.

Presently, the linker problem is solved and Xcode can compile sketches with #include libraries.

Now, next step is a template.
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: avenue33 on Nov 15, 2011, 10:19 am
Tim,


Avenue33, did you try my project template with XCode 4? I think you can just open it as a normal project with XCode4.
I don't have a computer that runs Lion yet, so I can't test this.


The templates on Xcode 4 are totally different from and incompatible with those on Xcode 3.

Building fails with the following error message:

Code: [Select]
    make

pic32-g++    -Wl,--gc-sections -mprocessor=32MX795F512L -Xlinker -T/Applications/Mpide.app/Contents/Resources/Java/hardware/pic32/cores/pic32/chipKIT-MAX32-application-32MX795F512L.ld -Xlinker -o/Users/avenue33/Desktop/Xcode_chipKIT/main.elf -Xlinker -M -Xlinker -Map=/Users/avenue33/Desktop/Xcode_chipKIT/main.map
/Applications/Mpide.app/Contents/Resources/Java/hardware/pic32/compiler/pic32-toavenue33/bin/../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/lib/cpp-startup.o: In function `_main_entry':
(.text+0x10): undefined reference to `main'
collect2: ld returned 1 exit status
make[1]: *** [/Users/avenue33/Desktop/Xcode_chipKIT/main.elf] Error 1
make: *** [build] Error 2
Command make failed with exit code 2



On top of that, Xcode doesn't recognise the symbols and doesn't jump to the definition.

Enclosed the culprit.

My template for chipKIT is broken and I don't know why :(

I hope you'll be luckier than me ;)
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: timKnapen on Nov 15, 2011, 01:45 pm

Well, you could send out a supposedly complete project with no .pde file, for example.


right, similar to this:
Quote

When working in XCode, there is no reason to stick to the Arduino convention of naming the main .pde file the same as the project folder, so when going from XCode to Arduino IDE you'll need to re-name that main file.


the "no .pde" problem is as easily solved by renaming your main file. The Arduino IDE has no problem with having other .h and .cpp files in your project as far as I know.
And the syntax doesn't change so even if you share a project that has no .pde file in it, people can just as easily understand what you are doing.
I think you're right, whatever you do, there will be a tiny little compatibility problem but it it's still all C++ code...

On the other hand what is the benefit of working with pde files in XCode?

best,
tim.
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: timKnapen on Nov 15, 2011, 02:03 pm

Tim,
The templates on Xcode 4 are totally different from and incompatible with those on Xcode 3.


Yes, I know the templates are completely different now, I will try to look into that over the weekend when I might be able to steal my sister's macbook running Lion... :-)
But I thought the XCode projects were still compatible... no?



Building fails with the following error message:
Code: [Select]
    make
pic32-g++    -Wl,--gc-sections -mprocessor=32MX795F512L -Xlinker -T/Applications/Mpide.app/Contents/Resources/Java/hardware/pic32/cores/pic32/chipKIT-MAX32-application-32MX795F512L.ld -Xlinker -o/Users/avenue33/Desktop/Xcode_chipKIT/main.elf -Xlinker -M -Xlinker -Map=/Users/avenue33/Desktop/Xcode_chipKIT/main.map
/Applications/Mpide.app/Contents/Resources/Java/hardware/pic32/compiler/pic32-toavenue33/bin/../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/lib/cpp-startup.o: In function `_main_entry':
(.text+0x10): undefined reference to `main'
collect2: ld returned 1 exit status
make[1]: *** [/Users/avenue33/Desktop/Xcode_chipKIT/main.elf] Error 1
make: *** [build] Error 2
Command make failed with exit code 2



Wait, that is a completely different log, that can't be from the makefile in my XCode example


On top of that, Xcode doesn't recognise the symbols and doesn't jump to the definition.

I've had the same problem in XCode 3.2 The solution was to go to Project>Edit Project Settings>General and set "Project Format" to XCode3.2 compatible. Maybe try to set yours to XCode4 if this option still exists?

Otherwise, try rebuilding your codesense index... ?


Enclosed the culprit.

My template for chipKIT is broken and I don't know why :(

I hope you'll be luckier than me ;)


I think I will download your complete project from github and try it this weekend, maybe new eyes see something new :-)

best,
tim.
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: avenue33 on Nov 15, 2011, 03:31 pm
Bonjour Tim,

Sorry, I missed the most important:

#include libraries are compiled on Arduino UNO!

Thank you so much for your help :) .

I pushed a commit to your repository suggesting taking avr/bin from within Arduino.app.

But for chipKIT, the Makefile no longer works.

I try to deal with both platforms.

Is there an Xcode 4 expert around?
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: timKnapen on Nov 15, 2011, 03:41 pm

Bonjour Tim,

Sorry, I missed the most important:

#include libraries are compiled on Arduino UNO!

Thank you so much for your help :) .

I pushed a commit to your repository suggesting taking avr/bin from within Arduino.app.

But for chipKIT, the Makefile no longer works.

I try to deal with both platforms.

Is there an Xcode 4 expert around?


Hey great! so it is working now? With codesense etc?

I noticed your commit to github with the comment about using the avr-gcc from Arduino.app. I'm very new to GIT and github, so I had no clue how to import your adjustments... so I simply edited it in the makefile I was working on.
It was anyway already a completely different version than the one you branched from.
I just had one weird error with the inclusion of avrdude.conf but that was fixed easily and now it is working the way you suggested.

I'm going to try to become an XCode4 expert over the weekend.

ahoy!
tim.
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: avenue33 on Nov 15, 2011, 04:21 pm
References about Makefile

Short http://makepp.sourceforge.net/1.19/makepp_tutorial.html (http://makepp.sourceforge.net/1.19/makepp_tutorial.html)
Long http://www.gnu.org/software/make/manual/html_node/index.html (http://www.gnu.org/software/make/manual/html_node/index.html)
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: westfw on Nov 15, 2011, 06:10 pm
Quote
the "no .pde" problem is as easily solved by renaming your main file.

Easily solved by the typical XCode user.  I don't think you're properly visualizing the level of cluelessness of the would-be consumer of a pre-made Arduino sketch.  "rename main.cpp to foo.pde in a directory name foo, and put all the other file there too" just has SO many things that could go wrong.

Quote
On the other hand what is the benefit of working with pde files in XCode?

given a sketch containing .pde, .ino, .cpp, .c, and .S files, the .cpp, .c, and .S files are all compiled using standard c/c++/assembler conventions, while the .pde and .ino files are concatenated and (potentially)  get special preprocessing and automatic #includes.  Which is just a separate makefile rule, really, although the "preprocess" function doesn't exist.  While there's no big reason not to make .pde files have their own #includes and prototypes so that the preprocessing isn't needed in an XCode environment, excluding the processing of .pde/.ino files from your Xcode processing makes SW developed there "gratuitously incompatible" with the Arduino environment.

It is (I claim) desirable that the XCode Arduino developer be able to pack his Arduino project into a .zip file and ship it to an Arduino IDE user, where it should compile without any changes.  (I suppose that the zip file in question could be a separate XCode "target", but that seems to be unnecesarilly complicated.)
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: timKnapen on Nov 16, 2011, 12:46 am
hmm there's some interesting stuff there...

Quote

Easily solved by the typical XCode user.  I don't think you're properly visualizing the level of cluelessness of the would-be consumer of a pre-made Arduino sketch.  "rename main.cpp to foo.pde in a directory name foo, and put all the other file there too" just has SO many things that could go wrong.

To me, it seems this point of view is a little bit overly cautious towards the "beginner Arduino User".
We were all beginners at a certain time and I think this little challenge of renaming a main.cpp file into a project_folder_name.pde file is only a small step to make you learn something new. Compared to learning about pointers, inheritance or even functions, renaming a file seems like a piece of cake. (mmm.. cake :-))

Before I started this effort to try to make an Arduino project with XCode, I had no knowledge at all about makefiles. Just by doing this I already learned so much about this completely new topic. It's fun! And it's a great way to learn too: trying to take this next step and looking through other people's code trying to make sense of it...
It's great that the Arduino IDE is working so good "out of the box" so beginners can get their hands dirty immediately. But at a certain point, if you want to create more complex programs you'll want to learn about classes, pointers, etc and then it is actually a good thing to have a more advanced software community that can happily program in their "professional" IDEs and assist those people.

But what if the Arduino IDE would allow correctly formatted C/C++ code? Then there would be no compatibility problem anymore, right?

I feel we're getting a little bit off topic here.. this thread was going to be about getting XCode to compile Arduino projects I believe.
So let's first get the templates ready for XCode 3.2.x and XCode 4.x and all the different boards, get them properly working for everybody and then worry about the potentially more complex problem of compatibility with the Arduino IDE.

If you have any suggestions on how to solve this problem, let's hear 'em! Maybe there is a very simple solution that I'm not seeing right now... like a simple text file included in the XCode template that explains what to modify for use in an Arduino IDE and vice versa?

best,
tim

Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: lefstin on Nov 17, 2011, 07:24 am
Hi I've been playing around with this and can compile and upload sketches.  Could you explain exactly how I can include a user-defined library with this template?

Suppose I have a library named foo located in the standard places:

~/Documents/Arduino/libraries/Foo/foo.h
~/Documents/Arduino/libraries/Foo/foo.cpp
~/Documents/Arduino/libraries/Foo/keywords.txt

how can I include it in the Xcode project?


Also, is it necessary to have the "ArduinoProgram" class with setup() and loop() methods, or can I write setup() and loop() functions in main.cpp?

Thanks much
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: timKnapen on Nov 17, 2011, 11:57 am
Hi Professor,

That's a very good question. I suddenly realize that I've made this not so user friendly.
Basically, what you need to do is find the variables CPP_LIBRARIES, INCLUDE_LIBRARIES and CXXSRC and add some things.

I will update the github repository as soon as possible with a new makefile and build settings that allow you to add libraries of your own without needing to touch the makefile. I will report back here when that's uploaded to github.

Meanwhile, here is an example of how you could modify the makefile:
Make sure not to use ~/ for your home path, but the full name : /Users/yourUserName/ ... (because of a mistake I made)
Code: [Select]


#.. beginning of makefile...

# loading libraries
LIBRARIES = EEPROM Ethernet/utility SPI \
Firmata LiquidCrystal Matrix Sprite \
SD SD/utility Servo SoftwareSerial \
Stepper Wire Wire/utility

# Here you add the paths to the folders that contains the cpp files of your libraries:
OTHER_LIBRARIES = /Users/yourName/Documents/arduino_sketchbook/library1 \ # << backslash means "continue on next line"
/Users/yourName/Documents/arduino_sketchbook/library2

# make the correct paths for the libraries
INCLUDE_LIBRARIES = $(addprefix -I$(LIB_ROOT)/,$(LIBRARIES))
INCLUDE_LIBRARIES += $(addprefix -I,$(OTHER_LIBRARIES)) #<<<<<<<<<<<<<<<<<<<<<<<<<<<< add this line

# find .cpp files in libraries
CPP_LIBRARIES = $(foreach lib,$(LIBRARIES),$(wildcard $(LIB_ROOT)/$(lib)/*.cpp))
CPP_LIBRARIES += $(foreach lib,$(OTHER_LIBRARIES),$(wildcard $(lib)/*.cpp))  #<<<<<<<<<<<<<<<<<<<<<<<<<<<< add this line

# main file
TARGET = main

# find .c files in arduino directory
SRC = $(wildcard $(ARDUINO)/*.c)

# .cpp files from libraries and arduino directory
CXXSRC = $(wildcard $(ARDUINO)/*.cpp) $(CPP_LIBRARIES) $(SOURCES)
CXXSRC += $(wildcard $(OTHER_LIBRARIES)/*.cpp) #<<<<<<<<<<<<<<<<<<<<<<<<<<<< add this line


#.... rest of makefile...


You are right about ArduinoProgram, you don't really need it. It's only my preferred way of working.
Here's an example of main.cpp without the ArduinoProgram class:
Code: [Select]

#include "WProgram.h"

// Arduino doesn't know about new and delete, so let's teach 'm :
#include <stdlib.h> // for malloc and free
void* operator new(size_t size) { return malloc(size); }
void operator delete(void* ptr) { free(ptr); }
// from: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1230935955


// you'll need to add function prototypes now...
void setup();
void loop();


// functions

void setup(){
Serial.begin(9600);
Serial.println("this a test without ArduinoProgram");
delay(100);
}

void loop(){
Serial.println("we are looping...");
delay(100);
}


int main(void)
{
init();
setup();
for (;;)
loop();
return 0;
}




I also have a question for you: What OS are you on and what board did you use to test?

Thanks for the feedback professor! Let me know if there is something else we can make better / easier to use...

best,
tim.
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: lefstin on Nov 17, 2011, 07:33 pm
Thanks Tim - I'll try this out this evening.

I an running Snow Leopard (10.6.8) and loading to a Duemilanove.
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: avenue33 on Nov 17, 2011, 07:39 pm
Hi!

Things seem a more complicated with Xcode 4.2 running on Lion 10.7.2.

I had a look at Ino (http://inotool.org): maybe some ideas to grab?

I'm using 2 boards: Arduino UNO and chipKIT UNO32, with only one IDE Mpide 0022.


Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: timKnapen on Nov 18, 2011, 01:04 am
Hi Chaos & Avenue,

I have uploaded a new version of the XCode3.2 template to github. The adding of external libraries has been simplified a lot and it has (hopefully) clear instructions now in the README file. Get it here: https://github.com/timknapen/Arduino-With-XCode and let me know what you think :-)

I have also made a working XCode 4 project in Lion, but it seems that making templates is still a little too obscure. I haven't done too much research yet (just installed Lion today) so it might not be as hard as it looks.

At the moment, I think it might be better to not go for a project template, but do it the way openFrameworks does it: creating a blank project that has everything setup and just copy the whole project folder to start a new Arduino project in XCode 4

Thanks for the info Chaos, I will check the box on Duemilanove :-)

What are .ino files?

best,
tim.
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: timKnapen on Nov 18, 2011, 02:23 am
I've added a first version of an example XCode 4 project to the github repository.
Not a template, a blank project that you can copy and start from. When documentation on XCode 4 templates starts appearing I might have a go at it...

I'm not working in OSX Lion myself, so I'm going to wait for complaints/suggestions before I continue working on the XCode 4 project.

best,
tim.
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: lefstin on Nov 18, 2011, 02:54 am
Very cool Tim - I followed the instructions in the new Readme and was able to compile a sketch with the Streaming and Flash libraries under Xcode 3.2.6!

Thanks!
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: avenue33 on Nov 18, 2011, 12:23 pm
Congratulations Tim for your hard work!

Here's a minimal template for Xcode 4 you could use as inspiration.

http://blog.boreal-kiss.net/2011/03/11/a-minimal-project-template-for-xcode-4/ (http://blog.boreal-kiss.net/2011/03/11/a-minimal-project-template-for-xcode-4/)
https://github.com/borealkiss/Minimal-Template (https://github.com/borealkiss/Minimal-Template)

Best regards,
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: timKnapen on Nov 18, 2011, 05:21 pm
Thanks Avenue,

I had checked that blog post, but it doesn't really give a lot more information than what you can find in the templates that Apple provides with XCode.

For now, I'm going to wait until there is decent documentation on XCode4 templates. There are just too many things that we'd have to find by trial&error...

But if anyone is up for the task, don't let my laziness stop you! :-)

best,
tim.
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: timKnapen on Nov 18, 2011, 05:23 pm

Very cool Tim - I followed the instructions in the new Readme and was able to compile a sketch with the Streaming and Flash libraries under Xcode 3.2.6!

Thanks!



ah that's great news, I'm glad it's starting to become useable!

best,
tim.
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: avenue33 on Nov 18, 2011, 09:04 pm

What we "need" is a command-line mode of the Arduino app that does the Arduino-style preprocessing on a set of .pde (or .ino) files.
Having to figure out exactly what it does (slightly differently) with each Arduino release is a pain, and makes implementing Arduino program builds in other IDEs an exercise in chasing not-fully-documented behaviors. :-(


I fully agree. Learning Makefile is just horrendous.

Another big benefit is to ensure consistency of the code between the Arduino IDE and alternative IDEs.

So a command-line mode of the Arduino app should be great!
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: avenue33 on Nov 21, 2011, 09:11 pm
Some interesting info about command-line usage (http://arduino.cc/forum/index.php/topic,79454.0.html) of Arduino.
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: gianmarcoodorizzi on Dec 14, 2011, 09:35 am
Hello,
I've just tried Tim's Xcode project on Xcode 4.2.1 running on Lion *.

Trying to compile it i get

Code: [Select]
make: *** No rule to make target `/Applications/Arduino.app/Contents/Resources/Java/hardware/Sanguino/cores/arduino/pins_arduino.o', needed by `bin/core.a'.  Stop.
Command make failed with exit code 2


Any ideas how to solve this issue?

Thanks

* EDIT: I'm using UNO.
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: timKnapen on Dec 14, 2011, 01:02 pm
hi Avenue33 and gianmarco

if you get this:
make: *** No rule to make target `/Applications/Arduino.app/Contents/Resources/Java/hardware/Sanguino/cores/arduino/pins_arduino.o', needed by `bin/core.a'.  Stop.

It means you are trying to compile for sanguino and he can't find a file in the Sanguino folder. In this case you would need to have the sanguino sources in your arduino app. You can find instructions about that here: http://sanguino.cc/

Also, if you are not trying to build for Sanguino, you should change the build setting in XCode to make it build for your specific board. I have put the instructions on how to do that in the Readme inside the XCode project:
https://github.com/timknapen/Arduino-With-XCode/blob/master/Arduino/ArduinoOnXCode4_2/README

And maybe you didn't download the specific project for XCode4 on github. It is called "ArduinoOnXCode4_2" , I just re-uploaded that.
The one called "ArduinoOnXcode/" is the template for XCode 3.2

let me know if it still fails, I can't test on Lion right now because I'm out of the country.

best,
tim
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: avenue33 on Dec 14, 2011, 01:38 pm
Quote
I don't understand git… :(


Neither do I, even with the nice Git front client installed on my MacBook ;) .
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: gianmarcoodorizzi on Dec 14, 2011, 01:42 pm
Thanks Tim,
I've downloaded the correct project, tried to compile it (after verifying that the current board is UNO) and still an error appears inside Arduino.h: This header seems not available.

Code: [Select]
#include "pins_arduino.h"
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: avenue33 on Dec 14, 2011, 01:44 pm
Try

Code: [Select]
#include <pins_arduino.h>
instead of
Code: [Select]
#include "pins_arduino.h"

The same problem arises with Eclipse.
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: timKnapen on Dec 14, 2011, 01:48 pm
are you using the new Arduino app (arduino 1.0) ? My projects are not updated to that version yet. Will try to do it as soon as possible.

For now, it is only tested with Arduino app 0022 like it says in the readme: https://github.com/timknapen/Arduino-With-XCode/blob/master/README

best,
tim.
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: gianmarcoodorizzi on Dec 14, 2011, 02:05 pm
@Tim: yes, I'm new to C and Arduino and and I downloaded the last version last week.
Having the project for the last version would be great


@avenue33: unfortunately, nothing has changed =(
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: timKnapen on Dec 14, 2011, 02:10 pm
yes, the newest version (1.0) has changed quite a bit I think.

An example from the release notes of Arduino 1.0:
Quote
The WProgram.h file, which provides declarations for the Arduino API,
  has been renamed to Arduino.h. ...


Your problem is probably related to that.

Just download the 0022 version and see if that works for now. I'll get the a working project with the new Arduino version up on github after next week.

best,
tim.
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: gianmarcoodorizzi on Dec 14, 2011, 03:11 pm
Thanks Tim, I'll take a look at that trying to solve this issue. I hope so.

Thanks, I'll let you know :)
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: avenue33 on Dec 14, 2011, 06:55 pm
Tim,

On Xcode 4.2.1 running on Mac OS X 10.7.2 with Arduino 0022, I have the following error message

Code: [Select]
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin//avr-ar: bin/core.a: No such file or directory


I haven't installed the FTDIUSBSerialDriver_10_4_10_5_10_6 since it isn't required on OS X.

Any clue?
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: timKnapen on Dec 14, 2011, 08:16 pm
Hey Avenue,

I think that's a big "whoops" on my part...
there is one "/" too many in

/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin//avr-ar: bin/core.a: No such file or directory

so my guess is that the AVRDUDE_DIR variable in the makefile is wrong. It was
Code: [Select]
AVRDUDE_DIR = /Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/

and I changed it to
Code: [Select]
AVRDUDE_DIR = /Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin


You can adjust it yourself or get the updated one from github.

let me know if it works, I can't test on Lion right now.

best,
tim
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: avenue33 on Dec 14, 2011, 10:14 pm
Never mind about the oops!

Code: [Select]
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avr-ar: bin/core.a: No such file or directory


Unfortunately, the bin/core.a remains orphan.



Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: Swany on Dec 16, 2011, 11:42 pm
Trying to get things going. I am running...

- Lion 10.7.2
- Xcode 4.2.1
- Arduino Version 0022
- timknapen-Arduino-With-XCode-08ce0ae
- Duemilanove 168 (also have a Mega and a few clones)

Sample project builds and upload fine. I started a project that uses the Wire library and get...
Quote
bin/core.a(Wire.o): In function `TwoWire::send(unsigned char)':
Wire.cpp:(.text._ZN7TwoWire4sendEh+0x3c): undefined reference to `twi_transmit'

plus a couple more similar errors. It appears twi.h can't be found. I've tried changing #includes from angle brackets to quotes (and visa versa), moving the twi.c and twi.h out of the "utility" folder and into the same folder as wire.h and wire.cpp, changing stuff in the compat folder (#include "util/twi.h" to #include "utility/twi.h", etc, etc, etc.

Boy there are a bunch of copies of the include files inside the Arduino app. One thing I noticed about the "starter folder" from GitHIb: There references to "arduino" and "libraries" in the project tree were bad (red) so I deleted them and re-added them from the  Arduino app. Was this the right thing to do?

Chasing my tail... Any ideas?
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: avenue33 on Dec 17, 2011, 12:22 am
The bin/core.a seems to be a source of troubles...

I hope timKnapen could consolidate all the feed-back, fix the issues and release a new version!

Good luck timKnapen :)
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: timKnapen on Dec 17, 2011, 11:01 pm
haha thanks Avenue,

I am following this conversation, but I am traveling without a computer that runs Lion. I'll be able to fix all these issues in two weeks.

Also thank Swany and gianmarcoodorizzi for all the great feedback!

best,
tim.
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: avenue33 on Dec 18, 2011, 10:52 am
Bonjour Tim,

No problem.

I've played with the Visual Micro (http://www.visualmicro.com), an Arduino plug-in for Microsoft Visual Studio and it's really nice.

Back to Xcode, the 4.2 release looks really buggy: I had many "Xcode has crashed" messages when I was coding some plain C++.

I'm considering downgrading to the previous stable release Xcode 3. Other candidates are Eclipse (http://www.baeyens.it/eclipse/) and NetBeans (http://www.kerrywong.com/2010/05/16/arduino-development-using-netbeans/). Both have a dedicated Arduino plug-in available.

Since the makefile is too cumbersome, have you considered Ino (https://github.com/amperka/ino)? It's a command-line version of the Arduino pre-compiler / compiler. It works fine on my MacBook.

Best regards,

Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: HaakonStorm on Jan 18, 2012, 11:14 pm
Hi all, just wanted to say I'm ALL IN on your Xcode 4.2.x + Arduino efforts!

I'm currently studying computer science at University of Oslo, and one of my topics of
study right now includes a project based on Arduino. To check out what previous
students of this topic have done with Arduino, see: http://sonen.ifi.uio.no/soneprosjekter
(it's in Norwegian, but there's plenty of pictures and video).

I worked as an OS X Server consultant for some years, before I decided I wanted to
move on and go full time as a developer and so went back to
school to learn computer science proper. In particular: iOS, OS X and Arduino projects.

SO :-), I'm very motivated to help out as best I can to get a decent environment for
doing Arduino projects on Xcode 4.2.x up and running. For now I'm reading everything
I can find to educate myself; starting with cloning Tim's excellent git repository to
get everything running. (Thanks, Tim!)

I'm determined to study and do whatever it takes to master Xcode and Arduino, in
particular using the iPhone and iPad to communicate with the Arduino over TCP/IP.

I've got the feeling there must be thousands of people like us around, wanting to
use Xcode for serious Arduino development. So how about we organize ourselves in
some way and launch arduinoandxcode.com, xcodeuino.com or similar? I can put up a simple Joomla-site
in two nights with the primary resources we need: a forum, a news blog, a downloads
section. We could start by setting up a Yahoo Group, having good experiences with it
from past projects, primarily the 'email group' functionality. Emails to xcodeuino@yahoogroups.com from
registered users go to all other registered users with a [xcodeuino] tag in the email header,
just like good ole UseNet used to do. Very simple and very clean.

Let me know what you guys are thinking :)
All the best, //Storm
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: avenue33 on Jan 18, 2012, 11:43 pm
God kveld Storm,

That's great news.

I started the project (http://sites.google.com/site/vilorei/arduino/20--arduino-makefile-for-xcode) a long time ago --July 2010-- before joining Tim's project late 2011.


Compiling does work under Xcode 4.2, see the project available at https://github.com/rei-vilo/Arduino-With-XCode (https://github.com/rei-vilo/Arduino-With-XCode). The makefile is stable. There's only the user library point to check.

Actually, most of the problems come from Xcode:

•   No console
•   No tooltips for user created items
•   No syntax colouring for user created items

and

•   No template

I managed to run Jantje's plug-in for Eclipse (https://github.com/jantje/arduino-eclipse-plugin) but I didn't succeed in installing the plug-in for NetBeans.

Another option I tried is Ino (https://github.com/amperka/ino), a command-line compiler for Arduino sketches.There are presently issues with the user's libraries hosted in the Sketchbook/Libraries folder.

I also use the chipKIT UNO32 (http://sites.google.com/site/vilorei/arduino/19--chipkit-uno32-board) board, which requires the PIC32 tool-chain. So I'd like to be able to compile for the two platforms.

So making Arduino usable under Xcode is going to be mainly a Xcode 4.2 issue! But it will open the door to all iOS devices.


Back to the project, gathering and organising the resources are key. I fully agree with you on having a shared website to give maximum visibility to the project.

So let's go!


Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: HaakonStorm on Jan 19, 2012, 12:14 am
@avenue33,

thanks for all the work you've put in over the years. Big up!

A common web site for Xcode, Arduino and iOS development will be nice. I'll get to
work as soon as the workload at Uni permits. Would be nice to get more
peoples opinions as well before speccing the requirements for the site, maybe
even get more people aboard our project.

Have you been looking into what needs to be done getting everything up
and running with Arduino 1.0?

I had to downgrade to the 022 release to get the Xcode project to compile.
Even so, I'm having problems getting actual code running on the Arduino. Everything
appears to upload fine, but my sample code doesn't run. I added
Code: [Select]
pinMode(13, OUTPUT);
to setup(), and changed loop() to
Code: [Select]

digitalWrite(13, HIGH);   // set the LED on
delay(100);              // wait for a second
digitalWrite(13, LOW);    // set the LED off
delay(100);              // wait for a second

but the on-board LED doesn't flash. Uploading the same sample code from Arduino.app
produces the expected results.
The .xcconfig line
Code: [Select]
PORT = /dev/tty.usbmodem*
makes the TX/RX flash as it should, but this line reads
Code: [Select]
PORT = /dev/cu.usbmodem3d11
in Arduino.app -- is it vital that these match? I've tried changing to match but get the same results.

Also, I know very little C++, only C and Objective-C, so I need to read up on C++ in order
to get up to speed. I didn't even know it was possible to use C++ with the Arduino.
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: avenue33 on Jan 19, 2012, 12:31 am

Have you been looking into what needs to be done getting everything up
and running with Arduino 1.0?


Yes, I did.

Please refer to this page (http://sites.google.com/site/vilorei/arduino/13--serial-touch-320x240-lcd-screen/roadmap) with 2 must-read articles!

It implies rewriting all my libraries. So I'm waiting for MPIDE to be on release 1.0 to upgrade.

I can't maintain two different versions for each of my libraries.



I had to downgrade to the 022 release to get the Xcode project to compile.
Even so, I'm having problems getting actual code running on the Arduino.


Are you playing with this example https://github.com/rei-vilo/Arduino-With-XCode (https://github.com/rei-vilo/Arduino-With-XCode)?

It works fine on my MacBook / Xcode 4.2 / OS X 10.7.2



Also, I know very little C++, only C and Objective-C, so I need to read up on C++ in order
to get up to speed. I didn't even know it was possible to use C++ with the Arduino.


Actually, the language used in the Arduino IDE is a C / C++ dialect. If you're fluent in C, C++ shouldn't be a problem.


Keep in mind the main benefit / drawback of the Arduino IDE is to hide all the pre-processing work before building and linking.

So one of the topic to discuss is to define how much the Xcode implementation hides.

Let's keep a little for tomorrow...
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: timKnapen on Jan 19, 2012, 06:09 pm
Hi All,

I've been away from the Lion machine for a while, but I have updated the Xcode 4.2 project now with all the fancy new features I had added to the Xcode3.2 version.

Check it out at:
https://github.com/timknapen/Arduino-With-XCode

I hope this resolves all the problems with Xcode I've been hearing about the last weeks.

best,
tim.
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: avenue33 on Jan 19, 2012, 07:07 pm
Tom,

Have you included my pull request?
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: avenue33 on Jan 19, 2012, 11:15 pm
It works but:

•   No build report
•   No console
•   No tooltips for user created items
•   No syntax colouring for user created items

and

•   No template
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: timKnapen on Jan 19, 2012, 11:45 pm
Hi,

The build report should be there, XCode 4 actually generates a build log for every time you compile. It's one of the buttons next to the "Project Navigator" button. (above the source tree)

With
Quote
No tooltips for user created items
No syntax colouring for user created items

you mean code completion / code sense for the classes you add, right?
This has been bothering me too... there's really no use working in XCode when you don't get those features...

I'm still on Snow Leopard because I think Lion sucks, so I work with XCode 3.2 and everything works nicely there (see attached image) :(http://arduino.cc/forum/index.php?action=dlattach;topic=49956.0;attach=11735)

I don't really understand why the code completion would fail on XCode 4, what could be different from the one that I use?
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: timKnapen on Jan 20, 2012, 12:11 am
oh now I get it! by "no console" you mean "no serial communication", right? I thought you meant built output... sorry!

I never experienced this as a problem. The Arduino Serial monitor does everything it needs, especially now you can decide the line endings...
Before they added this feature to the Arduino IDE I actually had written my own serial monitor app that did the same thing, but now I never use it anymore, just because of this one little feature.

I also don't see why Xcode would need to do this.

I'm going to take a look at that code completion stuff now...

best,
tim.
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: avenue33 on Jan 20, 2012, 12:27 am
Hi Tim,

No problem. Yes, I mean no serial communication.

Problem is, if I open Terminal or whatever communication app, I need to close it before uploading to the Arduino, otherwise there's a conflict and a message pops-up "Serial port already used."

One idea could adding to the Makefile
• "screen $(PORT) 9600" after uploading
• and for safety reasons, "kill screen" before compiling.

Yes again, I mean code completion and code sense.

I tested with Xcode 3 and code sense works as you show it.

With Xcode 4, code sense and code completion don't work for the classes, variables, functions I add.

Strange enough, opening the same sketch as a plain C++ Xcode project does provide code sense and code completion.

So there's a parameter somewhere to fix.

Or, it Xcode bugged?

Could Storm help us on the Xcode issues?
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: timKnapen on Jan 20, 2012, 01:12 am

No problem. Yes, I mean no serial communication.

Problem is, if I open Terminal or whatever communication app, I need to close it before uploading to the Arduino, otherwise there's a conflict and a message pops-up "Serial port already used."

One idea could adding to the Makefile
• "screen $(PORT) 9600" after uploading
• and for safety reasons, "kill screen" before compiling.


right, didn't think of that. That might be a good idea...
Maybe we should have build settings flag then, I can imagine it being pretty annoying to have this pop up every time when you're working on a project without serial...

Code: [Select]

With Xcode 4, code sense and code completion don't work for the classes, variables, functions I add.

Strange enough, opening the same sketch as a plain C++ Xcode project does provide code sense and code completion.


Did the same test just now, it seems that Xcode has no problem with C++, but I can imagine it needing the compiler for code completion...
and then the makefile is maybe a step too far for Xcode?

Quote

Could Storm help us on the Xcode issues?

fingers crossed! :-)

best,
tim.
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: timKnapen on Jan 20, 2012, 02:00 am
Xcode 4 + makefile + code completion = trouble.
I have found this nice post on stack overflow and will try this next:
http://stackoverflow.com/questions/8726869/xcode-4-external-build-system-code-completion

... and so I did:
https://github.com/timknapen/Arduino-With-XCode/tree/master/Arduino/ArduinoOnXCode4_3
:-)

It's a very stupid workaround, but it seems to be working!
I hope you guys have the same experience...

good night,
tim.
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: avenue33 on Jan 20, 2012, 06:53 pm
Please find the new release 4.3c (https://github.com/rei-vilo/Arduino-With-XCode)

Declare your library repository
    1. Select Project > Build settings   
    2. Click on Add build setting > Add user-defined setting
    3. Add new key = SKETCHBOOK_PATH with value = ~/Documents/SketchBook/
        ~ is accepted

Add a library
    1. Click-and-drop the folder where the .h and .cpp files are into the User folder on the left pane
    2. Uncheck Copy items into destination group's folder
    3. Select Create groups for any added folders
    4. Press Finish
    5. Add the #include statement to the sketch
   
Other items
    New groups
    Simplified project without unnecesary Sketch.h
    Renamed Index (false target) for code sense
   

To Do
    Open serial console after uploading
    Close serial console before building and before uploading
    Hints
        screen $(PORT) 19200

... and obviously a template!

@Tim: I've done a pull request!

Enjoy ;)
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: timKnapen on Jan 20, 2012, 07:09 pm
Hey Avenue,

What is a "pull request"? I don't get all that git at all..

I will check your version out when I get back to the Lion machine... maybe I can steal some of your ideas :-)

oy!
tim.
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: avenue33 on Jan 20, 2012, 07:24 pm
A pull request is just I'm asking you to include in your repository my updated code.

Go to your repository, click on Pull Requests: my update is there.

Review the code and accept/refuse to update with the appropriate button.

It makes release management easier.
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: avenue33 on Jan 21, 2012, 12:20 am
Three things are missing:

• code sense for Arduino basic libraries, like Serial.print which remains in black
• automatic closing before uploading / launching after uploading of the serial console connected to the right port
• true Xcode 4 template

Help is welcome!
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: jet_ on Jan 22, 2012, 06:12 am
I'm not sure to understand the difference between the version for Xcode 4.2 and 4.3.

And this is weird to have 2 directories if differences are needed. It would have been better to have branches inside git. This way, we could modify the makefile for example in both version (using merge between 4.2 and 4.3).
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: avenue33 on Jan 22, 2012, 10:20 am

I'm not sure to understand the difference between the version for Xcode 4.2 and 4.3.


Changes:



I'm not sure to understand the differenceAnd this is weird to have 2 directories if differences are needed. It would have been better to have branches inside git. This way, we could modify the makefile for example in both version (using merge between 4.2 and 4.3).


Back to ArduinoOnXCode4_2 folder name
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: jet_ on Jan 22, 2012, 10:16 pm
So I guess you are rei-vilo from github? Is timknapen here too? I'm jeromelebel. So we are back only 2 version of Xcode project (for each repository).  This is a total mess.

So now the most advance project on rei-vilo is 4_2?

by the way, why 4_3??? Xcode 4.3 is not released?
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: HaakonStorm on Jan 22, 2012, 11:05 pm
Hi all, and WOW, nice to see such nice activity on this project!

I cloned jeromelebel's git repo and got it to compile and upload the
test program (blinking on-board diode) successfully. I'm running Xcode 4.2.1.

I understand I really need to read up on Xcode to get up to speed in order
to help out. I downloaded the book "Xcode 4 developer reference" by Richard
Wentk as a start. You guys know anything about this book? Got good reviews.

I'm currently in two topics in Uni in order to learn electronics + arduino
proper, in addition to my main programming track. Bear with me as I tag
along and learn as fast as I can.

Regarding the xcodeuino.com site, I can have something up and running just as
soon as we spec our requirements. I am thinking along the lines of a simple Joomla!
installation with a 1.6-based Template from somewhere, with modules for
- forum
- files
- news blog
- wiki? (maybe use wikispaces.com instead?)

Any input on this? Do we need and want for this purpose at all? Maybe not / overkill?

I am thinking the purpose of this site over time is to facilitate
a quick start and a growing resource for Arduino development on OSX as well
as integration with iOS (think Prowl, push notifications and remote control) as I know
you guys have successfully done. I'm thinking there has to be large number of people
interested in the intersection Mac / Arduino / iOS.
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: jet_ on Jan 22, 2012, 11:17 pm
Hi

I'm glad you tested my repository... Because, I didn't... Unfortunately I don't have any aduino with me this weekend.

I never heard anything between iOS and arduino. Is there anything to do between those 2?
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: HaakonStorm on Jan 22, 2012, 11:25 pm
Quote
I never heard anything between iOS and arduino. Is there anything to do between those 2?


Arduino with a WiFi shield :)

Then your Arduino can e.g. use Avviso (http://avvisoapp.com/) and Prowl (http://www.prowlapp.com/) for
an easy way to create even more interrupts in your already fragmented concentration :)

I'm looking to use iOS as a two-way remote control for Arduino. I'm thinking the easiest way to do
this is to set up a third party web service somewhere in the middle for the two to connect to to
facilitate a link. I'm not sure how, yet, but I have a thorough networking topic in this semester at Uni to
grind me in the right way.

I'm curious, what kind of projects are you guys working on regarding Arduino these days?
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: avenue33 on Jan 22, 2012, 11:41 pm

So I guess you are rei-vilo from github? Is timknapen here too? I'm jeromelebel. So we are back only 2 version of Xcode project (for each repository).  This is a total mess.


Yes, it is.

Actually, I started the project. Tim Knapen tool a branch. Then I closed my repository and now I'm working on a fork.

I issued pull requests to Tim Knapen repository.

I fully agree we need to pool resources and maintain one single repository.

Because I own a chipKIT UNO32 (http://sites.google.com/site/vilorei/arduino/19--chipkit-uno32-board) board, I use MPIDE which can address both platforms.

My goal is to build the makefile(s) I could use for Arduino and chipKIT boards from Xcode.

(https://lh5.googleusercontent.com/-OpA5C7TrxKE/Tju7eURIknI/AAAAAAAAIa0/msPUKZMjHSc/s400/v_IMG_2641.JPG)



by the way, why 4_3??? Xcode 4.3 is not released?


I've made a confusion about which program was concerned by the .2: .2 stands for Xcode 4.2 and not for the second release of the makefile.

It's fixed now.

To avoid confusion, I posted the MPIDE on Xcode 4.2 project on this mpideOnXCode42 (https://github.com/rei-vilo/mpideOnXCode42) repository.



Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: jet_ on Jan 23, 2012, 08:02 am
Creating another repository not related to any previous repositories, was definitely not what I had in mind... The number of repository is not a problem if all are forks from each others, and if in all branches contains only one version of the code.

I hoped to convince "timknapen" to remove either 4_2 or 4_3 from his repository (and eventually he could create a branch to work on the second version), then you and I would have to merge, and eventually apply our diffs again on the remaining Xcode project.
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: avenue33 on Jan 23, 2012, 10:00 am

Regarding the xcodeuino.com site, I can have something up and running just as
soon as we spec our requirements. I am thinking along the lines of a simple Joomla!
installation with a 1.6-based Template from somewhere, with modules for
- forum
- files
- news blog
- wiki? (maybe use wikispaces.com instead?)


I think we badly need this website give maximum visibility on the project and to clarify the different versions.

So, let's go!
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: avenue33 on Jan 23, 2012, 10:05 am

Creating another repository not related to any previous repositories, was definitely not what I had in mind... The number of repository is not a problem if all are forks from each others, and if in all branches contains only one version of the code.


I opened a new repository because I don't want to impose the MPIDE on Xcode project on Arduino on Xcode. Reviewing and accepting a pull request ask for time.

Converting a repository into a branch isn't that difficult.

Both projects share the same issues.

I think Haakon Storm has the solution with the xcodeuino.com website.
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: jet_ on Jan 23, 2012, 10:26 am
I still believe it would be better to either create a branch in your repository, or even fork your own fork. That way, ArduinoOnXcode and your project could be benefit from each others.
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: timKnapen on Jan 23, 2012, 12:00 pm
Hi all,

Sorry for the mess. I just wanted to quickly share my findings about the code sense issue on XCode4 with Avenue and all the others.
Because I didn't really know if my solution was stable and I don't understand one bit of git, I just created a new folder and appended _3.
I had already run in trouble with git before, so there was also a _2 folder... had nothing to do with XCode 4.2 ... uhm yes... sorry about that.

I've cleaned it up now. There is again only one XCode4 project and I will try to learn about git as soon as possible so I can join the branching and pulling and pushing fun.

Also I don't use Lion or XCode4 myself, so all I'm doing is just suggesting some solutions, but I will be slower than the people who actually use XCode 4. I'm still on Snow Leopard and XCode 3.2.

best,
tim.
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: avenue33 on Jan 23, 2012, 12:02 pm
Tim,

Thanks for your hard work.

I don't know how to place the MPIDE on Xcode project along the Arduino on Xcode project.

I think Storm's idea is great.

Have a nice day.
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: jet_ on Jan 23, 2012, 12:59 pm
Thanks a lot !

I will update my fork as soon as I can.
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: timKnapen on Jan 23, 2012, 03:03 pm
Hey Avenue33 (olivier?)

I was looking through your version of the XCode project on github and noticed that you have a way to allow paths to use '~/' for the user path. How did you manage to do that?
When I was testing this, my makefile didn't understand ~/ as the current user's home path??

Everyone else:
I will continue making a bit of a mess of the repository for a while as I start learning git and try to set my repo up as a collaborative project.
This repo only makes sense if all of you can update to it and add your improvements. 
I think I should split the repo up into 4 projects because of the changes introduced in Arduino 1.0 :

1) Arduino0022OnXCode3 : Template for Arduino 0022 with XCode 3.2 on OSX Snow Leopard
2) Arduino1OnXCode3 :      Template for Arduino 1.0 with XCode 3.2 on OSX Snow Leopard
3) Arduino0022OnXCode4:  Empty project for Arduino 0022 with XCode4 on OSX Lion
4) Arduino1OnXCode4:       Empty project for Arduino 1 with XCode4 on OSX Lion

What do you guys think? Does this make sense? I would split it up like this because making an XCode project that works with both Arduino 002x and Arduino 1.0 will become quite complicated. There are too many renamed files...
Or should we just abandon 0022 and go ahead with the latest and greatest version of Arduino.. ?

best,
tim.
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: avenue33 on Jan 23, 2012, 03:40 pm
@Tim

Yes, my first name is Oliver, and Rei Vilo in reverse ;).

Here's the trick for the ~:

Quote
1. Select Project > Build settings    
2. Click on Add build setting > Add user-defined setting
3. Add new key = SKETCHBOOK_PATH with value = ~/Documents/SketchBook/ ( ~ accepted)


(https://lh4.googleusercontent.com/-typRMV2rYyI/Tx1w5Gq2nFI/AAAAAAAAI5E/Gej-IgRNMyo/s800/home.jpg)
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: avenue33 on Jan 23, 2012, 03:44 pm

Or should we just abandon 0022 and go ahead with the latest and greatest version of Arduino.. ?


MPIDE is still on release 0022, so I'd like to continue with this release.

Most of the issues we're presently facing aren't Arduino- or chipKIT-releated.

They're Xcode 4-related, as code sense, serial console and template.
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: timKnapen on Jan 23, 2012, 03:47 pm
Hey Olivier,

"verlan" right? this much french I know :-)

I still don't get it, from your picture I can see how you add it in XCode, that's not the problem. My problem was that the makefile didn't understand ~/ and couldn't translate it into /Users/YourUserName/
That's what I'm curious about!

oh and I think I'll be able to fix code sense for the Arduino libraries too. I will test & upload it as soon as I can get to the Lion machine.

best,
tim.
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: avenue33 on Jan 23, 2012, 04:14 pm
The makefile:

Code: [Select]
# print info
info:
@echo "------------------------ some info for debugging ------------------";
@echo "\nUsing AVRDUDE: " $(AVRDUDE);
@echo "\nUsing board: " $(BOARD);
@echo "\nUsing BF_CPU: " $(BF_CPU);
@echo "\nUsing SKETCHBOOK_PATH: " $(SKETCHBOOK_PATH);
        ...


The result:

Quote
------------------------ some info for debugging ------------------
Using AVRDUDE:  /Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avrdude
Using board:  Arduino_UNO
Using BF_CPU:  16000000L
Using SKETCHBOOK_PATH:  /Users/OlS/Documents/Arduino/_Projets
...
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: timKnapen on Jan 23, 2012, 06:54 pm
oh right, I just checked my makefile and it appears that the problem was this:

INCLUDE_LIBRARIES = $(addprefix -I, $(LIBRARY_PATHS))

somehow by doing the $(addprefix ..) doesn't expand the ~/ in LIBRARY_PATHS.
Just passing a build setting as a single variable does expand the ~/
I'm cleaning that up in my makefile, because ~/ is awesome! :-)

best,
tim.
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: timKnapen on Jan 24, 2012, 01:42 am
Hi all,

I think we've finally managed to have code completion working decently on Xcode 4.
(http://arduino.cc/forum/index.php?action=dlattach;topic=49956.0;attach=12002)
The updated project is here:
(http://Screen Shot 2012-01-24 at 01.05.46.png)
https://github.com/timknapen/Arduino-With-XCode/tree/experimental/Arduino/ArduinoOnXCode4
This is the 'experimental' branch. I will merge it into the main branch once I get some feedback from other people that can get it to work too.

There is a little trick to it:
You need to add all the sources ( .c, .cpp and .h files) to the 'Compile sources' build phase of the Fake Target. This fake target is only used for triggering the code completion in Xcode 4.

In the project navigator click on your project > Targets > fake target > build phases > expand "Compile sources"
press the "+" button at the bottom and in the list that pops up, just select all your .c, .cpp and .h files.

To add your own libraries, just drag them into the source tree with these options:
(http://arduino.cc/forum/index.php?action=dlattach;topic=49956.0;attach=12004)
You will still have to add the path to those files in the build settings

hope this helps,
tim.
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: avenue33 on Jan 24, 2012, 08:44 am
Tim,

Great work! Thanks.

In the screen-shot you supply, Serial.print is still in black :(
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: avenue33 on Jan 24, 2012, 10:51 am
I posted two suggestions on the GitHub issues list:

#3-- Codesense not working all the time in Xcode 3.2
Serial.print() is still in black  :~

#4-- Auto-Launch of the Console
Serial console parameters
Close serial console before upload OK
Open serial console after upload Error: screen /dev/tty.usbmodem641 -b19200 Must be connected to a terminal.
How to make the connection with the terminal?

#12-- User libraries easy declaration
Just type the name of the folder of your library
Example:
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: timKnapen on Jan 24, 2012, 03:09 pm

In the screen-shot you supply, Serial.print is still in black :(


Look here: :-)
(http://arduino.cc/forum/index.php?action=dlattach;topic=49956.0;attach=12028)

Latest changes for XCode 4 to be found here:
https://github.com/timknapen/Arduino-With-XCode/tree/experimental/Arduino/ArduinoOnXCode4 (https://github.com/timknapen/Arduino-With-XCode/tree/experimental/Arduino/ArduinoOnXCode4)

Any more code completion that is not working?
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: HaakonStorm on Jan 25, 2012, 01:39 pm
Hi all,

I've secured the xcodeuino.com domain (I considered xcodeui.no for .Norway but relented;) and web
hosting with mySQL databases for a year. I planned to implement it as a Joomla!-site but talking
with a collegue I've decided to use Drupal instead. This means I no longer know
what modules are good or not, so if you have any preferences, let me know.

I'm thinking something like this:
Forums: Drupal Advanced Forum module(s) (screenshots: http://drupal.org/node/867944)
Wiki: demo of the wiki-installation module http://acme.yourbizwiki.com/ (login with test/test!!)
File upload functionality
Unregistered/Registered/Admin/SuperAdmin granularity for permissions

Lets start with just one discussion board, put it on the front page, and go from there
as we build the wiki, coordinate our efforts and get to master how git works with
branching and pulling and requesting :)

If everything goes according to plan, it should be live monday and open for registrations.

Again guys, thank you so much for all the work you've put in to creating makefiles and what not
to get xcode+arduino running together. I'm way behind atm but will get up to speed asap.

/Storm
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: avenue33 on Jan 25, 2012, 02:01 pm

Any more code completion that is not working?


That world fine on my MacBook.

Could you please detail how you reach the result? I've already noticed the HEADER_SEARCH_PATHS parameter, but are there other?

Please keep in mind I'm working on a Makefile with MPIDE for Arduimo and chipKIT platforms.

I also posted a new idea worth considering: a cleaner make with a specific directory for OBJ files, with a reference to another Makefile repository.
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: HaakonStorm on Jan 25, 2012, 02:26 pm
Olivier et al:

If it isn't too much hassle, I know that myself and many with me would appreciate a lot if
you could do a write-up of what you have learned so far about how this Xcode+Arduino.app setup
works. I'm thinking about a sequential description of how you understand everything runs from
the point to click Build&Upload, what happens with the makefile, documentation about the makefile
and other important knowledge like customizing code completion, syntax coloring et al.

I'm thinking this can be the starting point for a page in the upcoming wiki. We can divide it
into the different phases of compiling and uploading.

We can also start a wiki page documenting how to use git for this project in particular; how to
clone, branch, pull requests and merge. I'm still not sure how merge works with conflicting
parts of the same files (say, the .xcodeproject file) and not overwriting other important changes.
I know diving into many smaller files are key, as always, but with Xcode projects some files are
unavvoidably monolothic.

Also, how does the serial monitor work with our setup? I see you use 'screen ...' - is this the
usual screen command I use when I start shell scripts and irssi on remote servers so I
can reconnect to them later?

Maybe it's an idea to hack a quick Cocoa app or script that handles/starts the serial monitor automatically
for the user?

I've also ordered the WiFly wifi shield from Sparkfun.com so my arduino can speak tcp/ip
with the world. Do you guys have any experience with this, or have any other wifi shield
to reccommend?
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: HaakonStorm on Jan 25, 2012, 02:29 pm
Regarding versions: as Olivier use a different and more powerful Arduino board that
isn't fully compatible/running to Arduino 1.0 libraries yet, we'll have two parallell
projects running (or more). For myself I'm primarily interested in Arduino 1.0 + Xcode 4.2
as I'm just recently come aboard and might as well start with the most recent iteration of both.

Tim: How does A*.app 1.0 seem to have changed from 022?
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: timKnapen on Jan 25, 2012, 02:33 pm

Could you please detail how you reach the result? I've already noticed the HEADER_SEARCH_PATHS parameter, but are there other?


Hey Olivier, my guess is that this should work fine on mpide too, as  long as you have Arduino.app installed. Unless Mpide has a lot of functions that are not in Arduino? Anyway it is only for syntax coloring and code completion, it will not affect your build.
IF mpide is not following the arduino conventions, it should be another project anyway, we can't make one XCode project for every flavour of Arduino-style AVR programming, right? Better make a specific project that bases its concepts on the Arduino project.

How does it work? "Serial" is defined in HardwareSerial.h, but only when certain macros have been defined. Those are defined in io.h.
Those macros get defined depending on a macro that defines the arduino board you're using.
So when you pick your board inside the Arduino.app before compiling, it adds a macro that defines your board. For example: __AVR_ATmega168__ . When this is defined, io.h can then load the correct io header for that specific board and the serial communication can get put together correctly.

I have just set __AVR_ATmega8__  in the build settings for the fake target, because for our purposes it doesn't really matter what board the fake target thinks it is building for. (not really sure about this)

While looking through all this, I noticed that a lot of stuff in the Arduino .cpp and .h files depends on inttypes.h, stdlib.h, stdio.h etc..
Just to be sure, I included the ones that avr-g++ uses in the header search paths.

I thought about moving the Arduino group to the header search paths too, but I think you sometimes want to check them for reference...

best,
tim
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: timKnapen on Jan 25, 2012, 02:39 pm

Tim: How does A*.app 1.0 seem to have changed from 022?


Those are documented in http://arduino.cc/en/Main/ReleaseNotes

Quote
- * The WProgram.h file, which provides declarations for the Arduino API,
  has been renamed to Arduino.h. To create a library that will work in
  both Arduino 0022 and Arduino 1.0, you can use an #ifdef that checks
  for the ARDUINO constant, which was 22 and is now 100.  For example:

  #if defined(ARDUINO) && ARDUINO >= 100
  #include "Arduino.h"
  #else
  #include "WProgram.h"
  #endif

- The avrdude included with the Mac and Windows versions of the Arduino
  software has been upgraded to avrdude 5.11 (from an Arduino-specific
  version of avrdude 5.4). The software now uses the "arduino" programmer
  type in place of "stk500v1" for uploading to most Arduino boards.


etc..

good luck with that!

best,
tim.
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: avenue33 on Jan 25, 2012, 02:42 pm
Haakon (is that your first name?),

Please consider the Reference.txt file at https://github.com/rei-vilo/mpideOnXCode42 (https://github.com/rei-vilo/mpideOnXCode42). I tried and listed all the documents I've read so far.

Some of the technical details are in the issues in the timknapen / Arduino-With-XCode repository: please refer to  https://github.com/timknapen/Arduino-With-XCode/issues (https://github.com/timknapen/Arduino-With-XCode/issues)

I strongly recommend having a look at Christopher Peplin's repository arduino.mk at https://github.com/peplin/arduino.mk (https://github.com/peplin/arduino.mk). The makefile embrace both Arduino and chipKIT.

The Arduino part works fine and features a dedicated folder for OBJ files. I'm currently testing the chipKIT part and face two issues I've already reported.

Downloading MPIDE and playing with it are just one click away: https://github.com/chipKIT32/chipKIT32-MAX/downloads (https://github.com/chipKIT32/chipKIT32-MAX/downloads)

Another section to add to the website is the list of features required, with a points-based system of vote, pretty much like the http://getsatisfaction.com implementation. Each registered user has —let' say— 6 points and can allow up to 3 points per feature. Once the feature is delivered, the user recover his/hers points.

It would be nice to link the number of points one user can handle with his/hers active participation on the project.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Jan 25, 2012, 02:56 pm
@All,

I've just changed the thread name from



to



in order to make everything clearer for everyone :).
Title: Re: Arduino on Xcode Project — Official Thread
Post by: timKnapen on Jan 25, 2012, 03:05 pm


  • Arduino on Xcode Project -- Official Thread




haha aw yeah!
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: timKnapen on Jan 25, 2012, 03:28 pm

If it isn't too much hassle, I know that myself and many with me would appreciate a lot if
you could do a write-up of what you have learned so far about how this Xcode+Arduino.app setup
works. I'm thinking about a sequential description of how you understand everything runs from
the point to click Build&Upload, what happens with the makefile, documentation about the makefile
and other important knowledge like customizing code completion, syntax coloring et al.

Absolutely agree with that, when I get some time, I will try to do a nice write-up.
Maybe after we finnish integrating Arduino.app 1.0 ?

Quote
Maybe it's an idea to hack a quick Cocoa app or script that handles/starts the serial monitor automatically
for the user?

I have that app lying around here on my computer.. but I'm not sure I am convinced this should be part of the XCode project...
This is just my personal opinion, but I think this should be as general as possible and the least bloated possible. More stuffss == more places where things can break. People can always fork from the project to add extra special personal preferences to it..
I'm not sure I am right on this one... is serial communication essential in this project? Should it be from XCode? I feel not. What do you guys think?

Quote
I've also ordered the WiFly wifi shield from Sparkfun.com so my arduino can speak tcp/ip
with the world. Do you guys have any experience with this, or have any other wifi shield
to reccommend?

There must be some people on this forum that have worked with those things, but that might be another thread...  ;)
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: avenue33 on Jan 25, 2012, 04:33 pm

Quote
Maybe it's an idea to hack a quick Cocoa app or script that handles/starts the serial monitor automatically
for the user?

I have that app lying around here on my computer.. but I'm not sure I am convinced this should be part of the XCode project...
This is just my personal opinion, but I think this should be as general as possible and the least bloated possible. More stuffss == more places where things can break. People can always fork from the project to add extra special personal preferences to it..
I'm not sure I am right on this one... is serial communication essential in this project? Should it be from XCode? I feel not. What do you guys think?

I use the serial connection very often as a mean to debug my applications.

So I would greatly appreciate an easy way to have a serial console with a smart management of the USB port to avoid any conflict between the serial console and the upload of the code.

For normal and interactive use, I prefer CooTerm (free (http:///CoolTerm/3000-2383_4-10915190.html)).

The error message I receive so far is
Quote
screen /dev/tty.usbmodem641 -b19200
Must be connected to a terminal.

It seems to be a rather basic error but I don't know OS X intricacies feel enough to fix it!

I've also ordered the WiFly wifi shield from Sparkfun.com so my arduino can speak tcp/ip
with the world. Do you guys have any experience with this, or have any other wifi shield to reccommend?

I bought the XBee Explorer Regulated board from Sparkfun (WRL-09132 (http://www.sparkfun.com/products/9132)) but it has a major flaw: the diode D1 prevents data going to DIN. I put a 10 k? resistor instead.

First app was to read time from a NTP server a set the internal clock of my chipKIT UNO32 board.

Everything is here (https://github.com/rei-vilo/pic32_RTC)! Enjoy :)
Title: Re: Arduino on Xcode Project — Official Thread
Post by: timKnapen on Jan 25, 2012, 05:25 pm
Hey Olivier,

try this in your makefile for opening a serial terminal from XCode:

Code: [Select]
serial:
@echo " ---- open serial ---- "
osascript -e 'tell application "Terminal" to do script "screen /dev/tty.usbmodem* 9600"'

killserial:
@echo " ---- close serial ---- "
osascript -e 'tell application "Terminal" to do script "screen -X quit"'


You can then add these rules after and before your upload if you want.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Jan 25, 2012, 06:53 pm
Thanks Tim, it works great!
For better interaction, I'll use CoolTerm.

One caveat, however: the \n management
(http://arduino.cc/forum/index.php?action=dlattach;topic=49956.0;attach=12112;image)
How to convert a \n into \r\n?
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Jan 28, 2012, 09:25 pm
Latest timknapen-Arduino-With-XCode-3dec20f commit includes a nice feature:

• on main.cpp, change
Code: [Select]
#include "ArduinoProgram.h" for
Code: [Select]
#include "ArduinoProgram.pde"
• delete ArduinoProgram.h
• rename ArduinoProgram.cpp to ArduinoProgram.pde

On Xcode 4.2 right-most pane Utility, under Identity and Type, select File Type to C++ source instead of Default Plain Text.

Everything runs fine, including code sense :)

The \n bug remains: I guess it is just a parameter to set for the console.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: HaakonStorm on Jan 30, 2012, 02:11 am
Work has started on Xcodeuino.com - will keep you posted. Took longer than excepted.
Title: Re: UPDATE - Linker Problem — Arduino Uno and Xcode (cont'd)
Post by: Phooto on Jan 31, 2012, 01:29 pm

I've also ordered the WiFly wifi shield from Sparkfun.com so my arduino can speak tcp/ip
with the world. Do you guys have any experience with this, or have any other wifi shield
to reccommend?


I've been using the RN-171 from Roving Networks and just set it up to post to a PHP server every minute without interaction from the host controller. This way, you can power down everything except the WiFi module, it will read sensor data and post to a web server as the frequency you wish. I posted on the Roving FAQ at http://rovingnetworks.com/FAQs/Standalone_WiFi_modules_sending_data_to_web
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Jan 31, 2012, 02:39 pm
Sorry Phooto, I'm afraid this is not the right thread for RN-171 related issues.

Please join or create the appropriate thread.

Thank you.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: HaakonStorm on Feb 02, 2012, 03:07 am
Okay, the skeleton of http://xcodeuino.com is live.
All interested parties are called to register!
I'm not a web developer by trade, and this is my first Drupal site. Bear with me :-)
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Feb 02, 2012, 10:41 am
Congratulations for the launch.

Is there a specific thread on the forum for suggestions?
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Feb 06, 2012, 12:40 am
Discover what Xcode can do (http://sites.google.com/site/vilorei/arduino/20--arduino-makefile-for-xcode/xcode-glimpse) for Arduino / chipKIT!

(https://lh5.googleusercontent.com/-96zl5fWYLT0/Ty8I3x9KHpI/AAAAAAAAI9M/Xw5_t_coJ6o/s1600/1.png)
Title: Re: Arduino on Xcode Project — Official Thread
Post by: HaakonStorm on Feb 06, 2012, 02:34 am
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.
This brach of the project (with mpide)  seems it has some traction,will be modding with this one some more testing.
Wish I had everything up and running already, to do some actual client/server programming ;)
Have a nice night, I'm going to bed zzz
/Storm
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Feb 06, 2012, 08:18 am
The Index target throws a couple of errors but the most important is the index is built.

(https://lh4.googleusercontent.com/-vb-CE4mnNRg/Ty9-gT0HHcI/AAAAAAAAI_U/ijr3ilNLZYI/s800/ei.png)

As a matter of facts, the errors are known bugs of Xcode.

The Index target is a trick: we declare a specific target for Xcode built-in LLVM 3.0 compiler. That way, we benefit from all the niceties of Xcode. Question: how to get them without this ghost target?

So we badly need some help from an Xcode 4 expert!
Title: Re: Arduino on Xcode Project — Official Thread
Post by: visualmicro on Feb 06, 2012, 09:06 am
not sure if this helps but in visual studio and arduino we copy all libs and code to a temp folder prior to compile. this is important because many user libs #include std libs (ie:../Wire/foo) so they all need to be located in the same directory system. without copy to temp, many arduino the sketches will never fully compile
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Feb 06, 2012, 09:19 am
Thanks for the tip.

Building for Arduino or chipKIT works fine with no library related error. Actually, the error reported earlier is raised when Xcode built-in LLVM compiler is used as a target for all the code-sense.

Best solution would be to have code-sense working but without this ghost target.

Any Xcode specialist around willing to help us?
Title: Re: Arduino on Xcode Project — Official Thread
Post by: timKnapen on Feb 06, 2012, 11:43 am
Hey guys,

Sorry for not responding for a while. I'm very busy at work right now. I will try to catch up in a week or so.

Avenue / olivier:
I'm not entirely sure, but I think XCode 4 won't do Code Sense without the fake target. I think XCode needs to be able to communicate with the compiler to do Code Sense. Because of the makefile, XCode can't really do this with the AVR-G++ compiler.
If there was a way to select AVR-G++ as a compiler in an XCode build process we could get this to work and we wouldn't even need the makefiles...
But if this would be possible, somebody would have discovered a long time ago and nobody would be messing with the makefiles in XCode.

best,
tim.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Feb 06, 2012, 03:39 pm

not sure if this helps but in visual studio and arduino we copy all libs and code to a temp folder prior to compile. this is important because many user libs #include std libs (ie:../Wire/foo) so they all need to be located in the same directory system.

The makefile I use just does that: all .cpp .c .h files are converted into .o files which are stored under the Builds/ folder.

I'm not entirely sure, but I think XCode 4 won't do Code Sense without the fake target. I think XCode needs to be able to communicate with the compiler to do Code Sense. Because of the makefile, XCode can't really do this with the AVR-G++ compiler.

Nice to see you back :)

I've noticed the same behaviour on my MacBook.

If there was a way to select AVR-G++ as a compiler in an XCode build process we could get this to work and we wouldn't even need the makefiles...

We haven't explored yet the templates and frameworks and other advanced strings of Xcode 4. Maybe I'm expecting too much, but the solution may be there.

But if this would be possible, somebody would have discovered a long time ago and nobody would be messing with the makefiles in XCode.

Xcode seems exclusively devoted to OS and iOS app development.

What a pity :(
Title: Re: Arduino on Xcode Project — Official Thread
Post by: visualmicro on Feb 06, 2012, 05:25 pm
Intellisense aside (i am sure you will get it working),

If xcode combines the pde/ino into a single cpp file, pulls in both core and user libs, compiles the lot without error that is very good. If it also returns clickable (goto source) errors for invalid source or lib files then I am very impressed! This had to be manually coded in the visual studio plugin, yes it works very well, seemlessly, but it's a chore to maintain.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Feb 06, 2012, 05:36 pm
Intellisense aside (i am sure you will get it working),

I hope so ;) But help from an Xcode expert would be greatly appreciated!

If xcode combines the pde/ino into a single cpp file, pulls in both core and user libs, compiles the lot without error that is very good.

That's the standard feature from the makefile. It's neat and clean!

If it also returns clickable (goto source) errors for invalid source or lib files then I am very impressed! This had to be manually coded in the visual studio plugin, yes it works very well, seemlessly, but it's a chore to maintain.

The code check-as-you-go monitoring and click-to-error features only work when target = Index is activated, fooling Xcode.
(https://lh6.googleusercontent.com/-WC9Zzb7riFg/Ty8I_GMSqpI/AAAAAAAAI-Y/5M4GeHWq59s/s1600/index.png)

More pictures are available here (http://sites.google.com/site/vilorei/arduino/20--arduino-makefile-for-xcode/xcode-glimpse).
Title: Re: Arduino on Xcode Project — Official Thread
Post by: visualmicro on Feb 06, 2012, 05:59 pm
Xcode is certainly better than I had assumed, that doesn't mean I will use it because I am a windows user and content with the visual studio solution. but for mac users it is a revelation, well done!

Quote
The code check-as-you-go monitoring and click-to-error features only work when target = Index is activated, fooling Xcode.


Yes, it is great to have some "intellisense/check as you go" error reporting. I also find it useful in Visual Studio but it seems that both xcode and vs are not using the gcc compilers for the intellisense. So many real exceptions don't appear until we compile. The errors returned by gcc are not very friendly and that's where the fiddly work began in the Visual Studio plugin development. Translating the gcc compiler outputs back to real file locations isn't much fun. If you find an easier solution than coding this manually then please let me know :)
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Feb 07, 2012, 07:42 pm
New Feb 08, 2012 release f brings
• Code-sense and click-to-error with standard targets
• Code check-as-you-type only with Index as target (continous compiling)

(https://lh5.googleusercontent.com/-mUAM82Cf5fg/Ty8I8o_n4WI/AAAAAAAAI98/gzwhBzfDkrw/s1600/err-l.png)

(https://lh5.googleusercontent.com/-uieLp4ctN1Q/Ty8I9KVJ7nI/AAAAAAAAI-A/q5NQkCvQPJU/s1600/err-m.png)

Please refer here (http://sites.google.com/site/vilorei/arduino/20--arduino-makefile-for-xcode) for documentation and there (https://github.com/rei-vilo/mpideXcode) for code.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: visualmicro on Feb 08, 2012, 03:03 pm
very VERY nice work. One little question.

Does this support multiple .pde/.ino files in a single project? If so, do any errors point back to the correct original source code lines?
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Feb 08, 2012, 03:18 pm

Does this support multiple .pde/.ino files in a single project? If so, do any errors point back to the correct original source code lines?

.pde / .ino files are considered as .cpp files and are natively supported.

However, some extra code is required and should be added:
Quote

// core library
#include "WProgram.h"

// needed here
// separate main.cpp creates conflicts
int main(void)
{
   init();
   setup();
   for ( ; ; ) loop();
   return 0;
}


Defining a separate main.cpp with main function or using the main.cpp provided by Arduino / chipKIT resulted in duplicate declarations and loss of code-sense.

Function main is the compulsory entry to the code to active code-sensing and all other niceties.

I haven't added yet a routine to check there's only one .pde / .ino file.

Xcode is poorly documented but has automatic features supposed to make developer's life easier. Xcode doesn't support plug-ins, so I'm afraid I can't go further... unless a white knight comes to the rescue!

Would you like to consider NetBeans instead? It's cross-platform and has an open architecture for plug-in. Combining your expertise with Visual Studio on Windows and my tests with Xcode on Mac OS X, we could do something really nice.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: visualmicro on Feb 08, 2012, 03:39 pm
Quote
pde / .ino files are considered as .cpp files and are natively supported.


That is probably a problem for many existing arduino sketch projects because the .pde files in arduino are joined into a single cpp file . This allows all of the variables and methods of every .pde to be shared (and is heavily used by many arduino sketches).

.cpp files need .h files and public declrations + #includes to be access by other files where as .pde files are global. Example: if we have void Test() {} in Blink2.pde then it should automatically be accessible from Blink1.pde

The joining of .pde files into a single .cpp is where the complexity arises when mapping error line numbers back to source. This is why I asked about it so often, it's messy!

Infact the problem is even worse, as you say you need the arduino.h or wprogram.h but Arduino also extracts and automatically adds the prototypes for each .pde method.
So when we translate error source line numbers we need to subtract the header lines then any other combined pde file line lengths.

Quote
Would you like to consider NetBeans instead

Normally no, because I am very happy with Visual Studio and would like to get back to building sketches instead of plugins :)
But my nephew wants me to install netbeans to help him make some minecraft mods :)
So maybe netbeans is a solution, escpecially because the arduino ide source is .java files so should be easily portable to netbeans? I would be happy to help you if you do!!
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Feb 08, 2012, 03:55 pm
I was talking about Xcode hidden features but you're right in pointing Arduino ones.

Wait a minute: Are they features or bugs?

IMHO, I think we shouldn't mimic Arduino bad habits --or not so good habits-- when using a real IDE as Visual Studio, Xcode, NetBeans or alike.

We could go back to a more canonical way of programming and get rid of the false automatons that make programers' life more difficult. 

That's the way I've taken, in order to get as much as possible from Xcode.

Quote
But my nephew wants me to install netbeans to help him make some minecraft mods 
Splendid, just suggest him this challenge: building an Arduino plug-in for NetBeans!
Title: Re: Arduino on Xcode Project — Official Thread
Post by: visualmicro on Feb 08, 2012, 04:04 pm
Quote
IMHO, I think we shouldn't mimic Arduino bad habits --or not so good habits-- when using a real IDE as Visual Studio, Xcode, NetBeans or alike


I hear what you say but actually I think the Arduino design is for users who don't want the complexities of .cpp/.h and #includes. The objective with the Visual Studio plugin was to be 100% compatible with Arduino ensuring a 100% identical program output. That said, more advanced users should find your xcode solution to be excellent


Quote
Splendid, just suggest him this challenge: building an Arduino plug-in for NetBeans!


:) Can you believe it. 10 years old, already installed netbeans and has no interest in learning how to make an led light up with an Arduino. Doh!
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Feb 09, 2012, 11:29 am

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)
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Feb 11, 2012, 08:34 pm
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!
Title: Re: Arduino on Xcode Project — Official Thread
Post by: Robhuhn on Feb 12, 2012, 07:51 pm
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!
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Feb 12, 2012, 09:50 pm
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.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: blubyu on Feb 13, 2012, 09:39 pm
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?
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Feb 15, 2012, 09:27 pm
I've just added to release 1 an Installation Guide.

As usual, the repository is rei-vilo/embedXcode (https://github.com/rei-vilo/embedXcode)
Title: Re: Arduino on Xcode Project — Official Thread
Post by: glasspusher on Feb 29, 2012, 07:07 pm
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
Title: Re: Arduino on Xcode Project — Official Thread
Post by: glasspusher on Feb 29, 2012, 07:12 pm
Oh, yeah, I'm using the Arduino 1.0. Is the project template compatible with this?

Dave
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Feb 29, 2012, 07:25 pm
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:


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 (https://github.com/rei-vilo/embedXcode/issues) on the GitHub repository.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: glasspusher on Feb 29, 2012, 07:35 pm
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
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Mar 05, 2012, 10:44 pm
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 (https://github.com/rei-vilo/embedXcode) and documentation there (https://sites.google.com/site/vilorei/arduino/20--arduino-makefile-for-xcode).

Next step is to add Wiring, if I find a Wiring S board to test the upload.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: Elijahg on Mar 12, 2012, 03:39 am
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!
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Mar 12, 2012, 06:56 am
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.

Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Mar 12, 2012, 10:20 am

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!
Title: Re: Arduino on Xcode Project — Official Thread
Post by: Elijahg on Mar 12, 2012, 05:19 pm

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!
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Mar 12, 2012, 05:46 pm
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.


That's strange, AVRDUDE_PORT is defined in Avrdude.mk by:
Code: [Select]
AVRDUDE_PORT      = $(firstword $(wildcard $(BOARD_PORT)))
with BOARD_PORT defined in Arduino UNO.xconfig by
Code: [Select]
BOARD_PORT = /dev/tty.usbmodem*
or in Step1.mk otherwise by
Code: [Select]
ifndef BOARD_PORT
    BOARD_PORT = /dev/tty.usb*
endif
Arduino UNO.xconfig has priority over Step1.mk.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: Elijahg on Mar 12, 2012, 08:35 pm

That's strange, AVRDUDE_PORT is defined in Avrdude.mk by:
Code: [Select]
AVRDUDE_PORT      = $(firstword $(wildcard $(BOARD_PORT)))
with BOARD_PORT defined in Arduino UNO.xconfig by
Code: [Select]
BOARD_PORT = /dev/tty.usbmodem*
or in Step1.mk otherwise by
Code: [Select]
ifndef BOARD_PORT
    BOARD_PORT = /dev/tty.usb*
endif
Arduino UNO.xconfig has priority over Step1.mk.


Board_port is pulled from the config file fine, but "$(firstword $(wildcard $(BOARD_PORT)))" seems to return nothing, making AVRDUDE_PORT blank. Without $(firstword $(wildcard it works fine.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: Elijahg on Mar 15, 2012, 04:33 am
Hi again, I've discovered another problem, but unfortunately my makefile writing skills aren't up to scratch to fix this one.

For some reason the Step2 makefile is losing the USER_LIBS_LIST. USER_LIB_PATH works for me when in Arduino.mk I change 
Quote
USER_LIB_PATH  = $(wildcard $(SKETCHBOOK_DIR)/libraries)

to
Quote
USER_LIB_PATH  = $(SKETCHBOOK_DIR)/libraries


However, for some reason USER_LIBS_LIST is always "0" in the debug info. Any ideas? The only way to get non-core libraries to compile is to enter their full path into the source.pde. Thanks!
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Mar 15, 2012, 07:35 am
Just open makefile
Code: [Select]
# Libraries
# ----------------------------------
# Declare application Arduino/chipKIT/Wiring and users libraries used
# Short-listing libraries speeds-up building
# Typing = 0 takes none
# Otherwise, all will be considered (default)

you can define which Arduino/chipKIT/Wiring libraries you want
Code: [Select]
# List Arduino/chipKIT/Wiring libraries here
#

as well as which users libraries
Code: [Select]
# List users libraries here
#

Those parameters are intended to avoid compiling all the libraries each time and thus, speed-up the process.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: Elijahg on Mar 15, 2012, 10:16 pm
Ah that's great, thanks :)

Perhaps it'd be better to have an environment variable set in Xcode defining whether you want to compile user libraries or not, would be much easier than changing a list in the makefile. You could have the envar as a list of user librares too.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Mar 15, 2012, 10:47 pm
Feel free to skip APP_LIBS_LIST and USER_LIBS_LIST from Makefile and add them to Project > Project > Build Settings > User-Defined.

The real challenge is to obtain documentation about Xcode inner structure and keywords to improve:
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Apr 05, 2012, 10:06 pm
New releases add Wiring and LaunchPad support.

(http://embedXcode.weebly.com/uploads/1/1/6/2/11624344/7675641.png)

embedXcode • Apr 05, 2012 release 7 • Wiring and LaunchPad platforms added
mpideXcode • Apr 05, 2012 release 10 • Wiring and LaunchPad platforms added

Code is here (https://github.com/rei-vilo/embedXcode) and documentation there (http://embedXcode.weebly.com/).

Both build and upload have been successfully tested on Wiring S and LaunchPad msp430g2452 boards.

Energia (https://github.com/energia/Energia) is the Processing-based IDE for the LaunchPad platform.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Apr 14, 2012, 09:43 am
Critical Decision Ahead

Most of the open points (https://github.com/rei-vilo/embedXcode/issues) on embedXcode (http://embedxcode.weebly.com) are about Xcode, especially keywords on the template.

Despite numerous calls for help, they're still unresolved. The Xcode template remains undocumented and there's no sign of openness from Apple. Apple seems to restrict Xcode to OS X and iOS platforms only.

So I'm considering to change for another IDE, with NetBeans as most probable solution. It's open, and documentation is available.

What do you think?
Title: Re: Arduino on Xcode Project — Official Thread
Post by: Elijahg on Apr 15, 2012, 04:03 am
There are people attempting to unravel the template format (why Apple had to change it in Xcode 4 to this weird new system we'll never know) for coding other projects too. You aren't alone in trying to decipher it, but only asking for help via the Arduino on Xcode project means the audience is pretty small. I'm sure someone will figure it out (or it'll get leaked from Apple) sometime.

You're right that Xcode is really designed for OS X and iOS, Apple has little interest in supporting other languages/platforms. Despite its limitations though, I'd personally rather use Xcode. NetBeans is Java, which is usually pretty clunky and un Mac-like. I don't have experience with anything but the Arduino IDE, and Xcode on the Mac however.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Apr 18, 2012, 10:15 pm
Elijahg,

You're right about selecting the right channel for the right audience.

I'm posting on both Xcode-related forums --of which Stack Overflow for very specific questions about the Xcode 4 template-- and embedded computing related forums.

The idea is Arduino users may be interested in using Xcode and Xcode experts may have some tricks to exchange.

Thanks to this strategy, the Wiring and LaunchPad platforms are now supported by embedXcode. I hope adding more platforms may help raising interest on this project.

There are so many things one could dream about: built-in serial console, integrated help, debugging, closer integration of the tool-chains, ...
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Apr 24, 2012, 04:43 pm
Please find the new releases for

embedXcode • Apr 16, 2012 release 9 • Code-sense reference defined by selected board
mpideXcode • Apr 16, 2012 release 12 • Code-sense reference defined by selected board
Installation Guide • Apr 16, 2012 release 6 • General update

All the manual settings are due to unknown template keywords (https://github.com/rei-vilo/embedXcode/issues?labels=Template). Your help is greatly appreciated.

Documentation is here (http://embedXcode.weebly.com) and code is there (http://www.github.com/rei-vilo/embedXcode).
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on May 23, 2012, 11:18 pm
embedXcode now supports Maple!

(http://embedxcode.weebly.com/uploads/1/1/6/2/11624344/9015344.png)

embedXcode • May 23, 2012 release 10 • LeafLabs Maple implementation
mpideXcode • May 23, 2012 release 13 • LeafLabs Maple implementation
Installation Guide • May 23, 2012 release 7 • LeafLabs Maple implementation

The Maple reset script --which sends control signals over the USB-serial connection to restart and enter the bootloader-- is written in Python and requires the PySerial library:
• Read the instructions at http://leaflabs.com/docs/unix-toolchain.html#os-x (http://leaflabs.com/docs/unix-toolchain.html#os-x) and
• Download PySerial library from http://pypi.python.org/pypi/pyserial (http://pypi.python.org/pypi/pyserial).

Full documentation and download are available here (http://embedXcode.weebly.com).

Enjoy  :)
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Jun 03, 2012, 05:07 pm
Please find the new releases of

embedXcode • Jun 03, 2012 release 11
mpideXcode • Jun 03, 2012 release 14
Installation Guide • Jun 03, 2012 release 8

As embedXcode manages multiple platforms, including the right libraries and dealing with syntax specificities are two cumbersome challenges.

Until now, the platform identification was solely based on the MCU, resulting on lengthy #if #elif #else #endif statements.

Now, embedXcode brings a new approach based on the IDE.

The Arduino, Wiring and Maple IDEs set an environment variable for the tool-chain.

For example, Arduino defines ARDUINO=100 and pass -DARDUINO=100 on to gcc, g++ and alike, Wiring sets -DWIRING=100 and Maple -MAPLE_IDE.

So the code is fully compatible between embedXcode and those IDEs. This new approach brings more compact and easier to read code, and doesn't require maintenance at code level when a new MCU appears.

This new IDE-based approach is optional, as not all IDEs include this approach. Let's mention Energia and chipKIT MPIDE, and hope they consider it!

As always, full documentation including features, tutorials, installation guide and code, is available at embedXcode website (http://embedXcode.weebly.com).

Enjoy ;)
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Jun 09, 2012, 11:32 pm
I'm working on the next release of embedXcode. I plan to integrate an automatic documenting feature.

After having reviewed HeaderDoc, doxygen and appledoc, I picked doxygen.

Integration with Xcode is the main challenge. The idea is to select a specific target to build the documentation, obtain a PDF and integrate a codeset Xcode could use.

There's still a lot of work to do.

Stay tuned  ;)
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Jun 12, 2012, 02:11 pm
Please find the new release of embedXcode with the implementation of the self-documentation.

embedXcode • Jun 14, 2012 release 13
Installation Guide • Jun 14, 2012 release 9

Just add to your code and launch the Document target:

(http://embedxcode.weebly.com/uploads/1/1/6/2/11624344/238082_orig.jpg)

A help document is generated and closely integrated in Xcode.

Quick Help provides details on documented functions:

(http://embedxcode.weebly.com/uploads/1/1/6/2/11624344/3244187_orig.jpg)

As always, learn more and download from here (http://embedXcode.weebly.com).
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Jun 25, 2012, 05:33 pm

New version 14 of embedXcode brings a significant improvement on the size of the HEX and BIN files over the

embedXcode • Jun 25, 2012 release 14 • HEX and BIN files size optimisation

Sizes are now close to and even better than those obtained with the corresponding IDEs.

(http://embedxcode.weebly.com/uploads/1/1/6/2/11624344/8704458.jpg?896)

All measures are in bytes.

As always, learn more and download from here (http://embedXcode.weebly.com/).
Title: Re: Arduino on Xcode Project — Official Thread
Post by: dangerdave on Jul 13, 2012, 09:05 pm
Hey everybody,
I believe the arduino on Xcode project is just awesome, and as i have a pretty big arduino-project coming up for myself,
i wanted to switch to Xcode for the programming part, But:

On Lion, the developer-folder changed, it is now located in Xcode/contents/developer

So now I'm not sure where to put the embedxcode template files???

i do believe here like in the photo? am i right? because there are other Xcode/template/file_temp.... in the platform-direction!!

might be a dumb question but thanks anyway!

Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Jul 13, 2012, 09:13 pm
Please refrain from modifying the Xcode directory! This is potentially dangerous!

Instead,

Quote from: Installation Guide and User Manual
1.4. Install the Template
Now, the template can be installed:
Check and create ~/Library/Developer/Xcode.

Copy the folder Templates into ~/Library/Developer/ Xcode


I wrote an Installation Guide and User Manual (http://embedxcode.weebly.com/tutorial.html). I hope it's clear enough.

(http://arduino.cc/forum/index.php?action=dlattach;topic=49956.0;attach=22000;image)

Enjoy ;)
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Aug 24, 2012, 09:59 am
embedXcode on Dangerous Prototypes!

Read at http://dangerousprototypes.com/2012/08/24/embedxcode/ (http://dangerousprototypes.com/2012/08/24/embedxcode/)
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Sep 01, 2012, 08:26 pm
Please find the new release of embedXcode

Sep 01, 2012 • Support for Arduino Leonardo

As the Arduino Leonardo requires a specific reset procedure due to its ATmega32U4, I had to develop a reset script in Python.

Also included in this release, support for Xcode 4.4.1 and for newly released Energia 0101E0008 (https://github.com/energia/Energia/downloads) and a fix for GraphWiz 2.28 crashing on Mountain Lion.

As always, find documentation and download at http://embedXcode.weebly.com
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Sep 11, 2012, 10:17 am
New! Installation Package

embedXcode is now installed with a standard installation package. Installation is faster and easier.

(http://embedxcode.weebly.com/uploads/1/1/6/2/11624344/9677597_orig.png)

The Installation Guide and User Manual has changed for User Manual.

The package includes the templates, the code snippets, and the User Manual.

(http://embedxcode.weebly.com/uploads/1/1/6/2/11624344/1381655_orig.png)

Find it at the download page (http://embedxcode.weebly.com/download.html)!
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Sep 15, 2012, 03:40 pm
As Arduino 1.0 is now stabilised and wide-spread, should embedXcode continue to support Arduino 23?

Answer the poll (http://poll.fm/3w3qa) :)

Please note this is not going to affect other platforms, like chipKIT MPIDE which is still based on Arduino 23 and continues to be supported as it.

Thank you for your input. The poll opens for one week.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: Hasse on Sep 22, 2012, 02:49 pm
Dear avenue33,
I'm a complete newbie on Xcode but since I wanted to have a bit more advance IDE than the Arduino provided one and I'm on a Mac, I went for Xcode and your template embedXcode. I've tried to follow your installation guide but I must say it could be more extensive when it comes to where a certain dropdown menu is instead of just saying "the dropdown menu", like on page 37 when selecting a target. And the pictures could also be of higher resolution so one can actually se what's written in them. But I'm not just wining, I'm giving you hopefully constructive feedback because I really want this to work! :)

Also, when I build the default code in a new project I get the following error message:
Argument list too long: recursive header expansion failed at /Applications/Preview.app/Contents.

And loads of messages of the following type:
Warning: no rule to process file '$(PROJECT_DIR)/TestOfXcode/Arduino/cores/arduino/Arduino.h' of type sourcecode.c.h for architecture i386

Any hints to get in the right direction?
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Sep 22, 2012, 07:37 pm
Dear Hasse,

What is the target selected?

According to the message, it seems the Index target is selected.

The Index target is a dummy target and should not be used. It always throws the error you mention.

Please select the Build target to compile only, and the All target to compile and upload.

About the quality of the images, the full quality PDF is 6 GB. I'm obliged to reduce the size because the host for the website limits the size of the files. Uploading larger files would require a non-free plan.

Please don't consider my user manual is an introduction to Xcode. There are excellent books about Xcode: for example, I recommend Xcode 4 Unleashed by Fritz F. Anderson I've purchased thanks to contributions (http://embedxcode.weebly.com/1/post/2012/06/book-purchased-thanks-to-contributions.html).

(http://embedxcode.weebly.com/uploads/1/1/6/2/11624344/9702031_orig.jpg)

The user manual I wrote only focuses on how to use the template. Xcode, like all other professional IDEs --to name a few: Visual Studio, Eclipse, NetBeans, Qt, ...--, has a steep learning curve. The magic of the Arduino IDE relies in its instant plug-and-play gratification.

As a matter of fact, I'm still using the Arduino IDE when I don't need the power of Xcode.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: Hasse on Sep 22, 2012, 08:49 pm
Thanks for the quick reply! :)
Yeah, once I got the target right it all works like a charm!
Cheers
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Sep 25, 2012, 01:15 pm
New release 16 of embedXcode supports the FraunchPad MSP430FR5739.

embedXcode • Sep 25, 2012 release 16 • Support for FraunchPad

The Document target now builds a PDF file along with HTML and docset files.

Documentation is here (http://embedxcode.weebly.com/tutorial.html) and download there (http://embedxcode.weebly.com/download.html).

Obsolescence Notice
The following features are planned to become obsolete in a future release:

Title: Re: Arduino on Xcode Project — Official Thread
Post by: kajmaya on Oct 01, 2012, 09:43 pm
Has this latest version:
Quote
embedXcode • Sep 25, 2012 release 16 • Support for FraunchPad,
been tested with xCode 4.5?

Thanks
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Oct 04, 2012, 12:01 pm
Yes, it is compatible with Xcode 4.5 and even 4.5.1  :)
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Oct 10, 2012, 05:43 pm
Updated User Manual and Support for Xcode 4.5.1

I updated the user manual based on the feed-back I've received about the following two sections: installation and target selection.

embedXcode now supports Xcode 4.5.1.

The package includes the templates, the code snippets, and the User Manual.

As always, documentation is here (http://embedxcode.weebly.com) and download there (http://embedxcode.weebly.com/download.html)!
Title: Re: Arduino on Xcode Project — Official Thread
Post by: eengie on Oct 13, 2012, 11:57 pm
I've downloaded the latest guide and embedXcode after downloading the Arduino 1.0.1 IDE, but I'm a little lost as to where my Sketchbook\Libraries folder is (mentioned on page 23).  When I launched Arduino, it created a ~\Documents\Arduino directory, but seemingly nothing else.

I see in the guide and this forum that 1.0 is supposed to be supported, and with 1.0.1 being a minor point release, I figured perhaps it would be fine.  Is 1.0.1 not supported?

I loaded 1.0 and then re-ran the embedXcode installer.  I still have no "Library" or "Libraries" folder under that Sketchbook path.

Any ideas where I must have gone off the road?

Thank you all for your dedication and time.

Thomas
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Oct 14, 2012, 11:50 am
embedXcode supports Arduino 1.0.1.

The Sketchbook/Library folder is not created by embedXcode but managed by the Arduino IDE.

Please refer to Installing Additional Arduino Libraries (http://arduino.cc/en/Guide/Libraries) on how to install the Sketchbook/Library folder.

Once the Sketchbook/Library folder exists,

(http://embedxcode.weebly.com/uploads/1/1/6/2/11624344/4210966_orig.png)

Now, launch embedXcode, create a new project and follow the instructions page 22:

(http://embedxcode.weebly.com/uploads/1/1/6/2/11624344/3069677_orig.png)


Xcode is a whole new environment and, as other advanced IDEs, requires some learning.
(http://embedxcode.weebly.com/uploads/1/1/6/2/11624344/9702031_orig.jpg)
I recommend the book Xcode 4 Unleashed by Fritz F. Anderson I've purchased thanks to contributions (http://embedxcode.weebly.com/contact.html).

Enjoy ;)
Title: Re: Arduino on Xcode Project — Official Thread
Post by: eengie on Oct 14, 2012, 06:30 pm
Right - I knew that the Library directory was for the Arduino IDE, but the instructions in the guide regarding it confused me.  It made me think that the Arduino IDE was going to also create and insert its default libraries there.  And then by some quirk of the whole X Code template situation, I might need to add (but not copy) those libraries so that the compiler can find everything.  In digging into the template though, I see that all default Arduino libs are actually included as part of the project. 

Anyhow, my mistake.  It seems this step is only relevant if one actually has additional libraries they want to include at the time of creating their project.

So just to make sure I understood everything so far, should the SKETCHBOOK_DIR be pointed at my ~/Documents/Arduino path (where the IDE identifies the Sketchbook and where Library will soon be) or the X Code project's Sketchbook directory?

Thanks again.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Oct 14, 2012, 08:45 pm
The SKETCHBOOK_DIR should be pointed at your ~/Documents/Arduino path to take into account your personal libraries.

Once again, Xcode is a professional IDE and, as so, requires some learning.

I strongly recommend the book Xcode 4 Unleashed by Fritz F. Anderson I've purchased thanks to contributions.

Please keep in mind the embedXcode User Guide is not an introduction to Xcode. It implies some fluency with Xcode.

Enjoy ;)
Title: Re: Arduino on Xcode Project — Official Thread
Post by: eengie on Oct 14, 2012, 09:08 pm
Thanks.

At this point I can build the Build target, but code sense is still not working on PDE files despite having their type set to C++ Source and re-indexing 3 times now.

None of the other standard C/C++ file types are having this issue. It's as if the if-def header isn't being processed properly in specifically the PDE file despite it otherwise being treated like a C/C++ file.

EDIT - Per your suggestion, I eliminated the larger if-def block in place for just Android.h since that's the only platform I am working with.  After re-indexing, everything seems to be fine.

Thank you so much for setting this whole thing up.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Oct 14, 2012, 09:12 pm
Normally, code-sense should work after the first build even for the pde or ino file.

Try closing the project and opening it again.

Xcode has sometimes strange behaviours.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Oct 21, 2012, 11:47 pm
Please find the new release of embedXcode

Oct 21, 2012 • Selection of pde, ino or cpp extension for the sketch

When creating a new project, select the extension on the drop-down list:
• Choose pde for Arduino 0023, chipKIT MPIDE, Wiring and Leaflabs Maple,
• Choose ino for Arduino 1.0 and Energia,
• Choose cpp optionally for a standard C++ file.

Using a pde or ino extension allows to edit the sketch with the standard IDEs of the boards.

Find documentation at http://embedxcode.weebly.com
and download from http://embedxcode.weebly.com/download.html

Enjoy ;)
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Oct 25, 2012, 09:15 pm
I'm implementing support for Due on embedXcode.

Building and linking work fine.

Unfortunately, I can't proceed with the uploading tests as I don't own an Arduino Due board.

Learn more (http://bit.ly/P5VmgF)  :)
Title: Re: Arduino on Xcode Project — Official Thread
Post by: visualmicro on Oct 25, 2012, 09:22 pm
Same here. The amazing invisible board  :)
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Oct 28, 2012, 02:12 pm
I'm implementing support for Due on Xcode for Mac OS X with the template embedXcode.

Building and linking work fine.

Unfortunately, I can't proceed with the uploading tests as I don't own an Arduino Due board.

Can an Arduino Due owner post the verbose output for upload?

(http://farm9.staticflickr.com/8464/8135817630_4dc8a23fed.jpg)

Thanks!
Title: Re: Arduino on Xcode Project — Official Thread
Post by: matzrh on Nov 04, 2012, 11:49 pm
Dear avenue33 (or anybody else who may help),

I have installed embedXcode but get stuck since a couple of days when trying to execute the build target.
I get errors that suggest that the compiler would not accept overloading functions. (screenshot attached)
Also, the UDPbytewise library seems to request a "Types.h" include that cannot be found. 
What kind of confuses me is also that those are "Shell Script Invocation Errors".
Any idea if this is a compiler flag not set or something of that sort?  I really would like this to work, as I have a project that I need to separate into different libraries and classes to be maintainable, and the Arduino IDE is just not made for that.

Any help would be greatly appreciated.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Nov 05, 2012, 06:52 am
Does the project compile with the standard Arduino IDE?

The "already defined here" message occurs when the same libraries are in two places:


The screenshot doesn't provide enough clues to help you more. What is the board used?
Title: Re: Arduino on Xcode Project — Official Thread
Post by: matzrh on Nov 05, 2012, 06:27 pm
Thank you for your input.

I try to build for Arduino Mega 2560

On the standard IDE, I get the following error:

main.cpp:45:25: error: BlinkTest.ino: No such file or directory

If I remove main.cpp from the project, it compiles (this does not seem strange, as the main.cpp is probably already "hidden" in the Arduino IDE), but I get some warnings:
Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/HardwareSerial.cpp: In function 'void store_char(unsigned char, ring_buffer*)':
/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/HardwareSerial.cpp:82: warning: comparison between signed and unsigned integer expressions
/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/HardwareSerial.cpp: In member function 'virtual size_t HardwareSerial::write(uint8_t)':
/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/HardwareSerial.cpp:390: warning: comparison between signed and unsigned integer expressions
and
/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/Print.cpp: In member function 'size_t Print::print(const __FlashStringHelper*)':
/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/Print.cpp:44: warning: '__progmem__' attribute ignored
/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/Tone.cpp:93: warning: only initialized variables can be placed into program memory area

Attached is the path of the project folder.  The Sketchbook folder is empty, except for the .txt file, the others have all the .h and .cpp files in them.
Does that seem right?

Any clues? 
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Nov 07, 2012, 09:53 am
Well, it seems your project is having some issues even in the Arduino IDE.

How complex is your project?

The sketchbook folder is the place were you place a link to the libraries you've developed.

Please refer to section 3.3. Add User's Libraries on pages 25 et sq. of the User Manual (http://embedxcode.weebly.com/tutorial.html).
Title: Re: Arduino on Xcode Project — Official Thread
Post by: matzrh on Nov 07, 2012, 07:02 pm
it's really just the test project that appears when you create a new embedxcode project. I haven't changed a line of code and just wanted to try if it compiles, at all... :~
maybe I should try a regular c++ project to see what's wrong with the environment?
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Nov 07, 2012, 09:37 pm
Which release of embedXcode are you using?

Which release of the Arduino IDE are you using?

Is the Arduino IDE installed on the folder /Applications?

Current version 17 of embedXcode doesn't invoque any HardwareSerial in the default sketch.

According to the messages, it seems Arduino 23 and 1.0 are mixed. Best solution consists on deleting the Arduino IDEs and proceeding with a clean install.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: matzrh on Nov 07, 2012, 11:29 pm
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
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Nov 08, 2012, 08:40 am
Strange indeed.  This is the first time such error is reported.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: matzrh on Nov 10, 2012, 12:34 pm
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: [Select]
/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: [Select]
#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: [Select]
$(shell env>theEnvironment) and the anonymized result is attached...

Thank you anyone for your help.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Nov 10, 2012, 12:47 pm
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
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Nov 10, 2012, 04:16 pm
Please find the new release of embedXcode



The user manual has been updated too



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 ;)
Title: Re: Arduino on Xcode Project — Official Thread
Post by: matzrh on Nov 11, 2012, 06:28 pm
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  ;) 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 :)
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Nov 11, 2012, 07:14 pm
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 (http://embedxcode.weebly.com/tutorial.html).

(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 (http://embedxcode.weebly.com/tutorial.html).

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.

(http://embedxcode.weebly.com/uploads/1/1/6/2/11624344/9702031_orig.jpg)
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Nov 13, 2012, 03:36 pm
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 ;)
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Nov 17, 2012, 05:33 pm
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.

(http://embedxcode.weebly.com/uploads/1/1/6/2/11624344/9158627_orig.png)

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 (http://embedxcode.weebly.com/1/post/2012/11/new-fast-and-make-optimised-targets.html).

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

Enjoy ;)
Title: Re: Arduino on Xcode Project — Official Thread
Post by: davidhux on Nov 22, 2012, 01:04 pm
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
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Nov 22, 2012, 01:27 pm
What target have you selected?

(http://embedxcode.weebly.com/uploads/1/1/6/2/11624344/9158627_orig.png)
Title: Re: Arduino on Xcode Project — Official Thread
Post by: davidhux on Nov 22, 2012, 02:25 pm
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
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Nov 22, 2012, 02:45 pm

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: [Select]
ls /dev/tty.usb*

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



In such a case, just edit the the Arduino UNO.xcconfig file with the USB port.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: davidhux on Nov 22, 2012, 04:41 pm
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.




Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Nov 22, 2012, 05:14 pm

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.?


Title: Re: Arduino on Xcode Project — Official Thread
Post by: davidhux on Nov 22, 2012, 07:16 pm
oops - I will slow down -

Blink runs in Arduino under OSX

Now I understand the Build Options - I get a clean build but when I try to UPLOAD the Blink app I get:

/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avrdude -D -patmega328p -C/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf -carduino -b115200 -P/dev/tty.usbmodem26421 -Uflash:w:Builds/embeddedcomputing.hex:i

Avrdude: can't open input file Builds/embeddedcomputing.hex: No such file or directory

Looks as though I have not done something!

My thanks and apologies for any confusion.



Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Nov 22, 2012, 07:22 pm
The target UPLOAD requires the file Builds/embeddedcomputing.hex to be ready.

Have you checked that the file Builds/embeddedcomputing.hex is available?

Use instead the target ALL = CLEAN + BUILD the sketch + ULPOAD to the board + SERIAL console.

It might be easier to use the contact form (http://embedxcode.weebly.com/contact.html) to send me the content of the Log Navigator.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Nov 25, 2012, 12:50 pm
The maintenance of the embedXcode template is really difficult due to Apple secrecy around and lack of documentation on Xcode.

So I'm considering switching from Xcode to another IDE.

Here's an open letter to Apple Xcode team. Feel free to send it to members of the Apple Xcode team you know.

Thank you for your help :)


Quote from: Open Letter to Apple Xcode Team
Dear Xcode Team,

Xcode offers superior features and ergonomics compared with other IDEs running on OS X.
Unfortunately, its restricted documentation prevents from using many of its features.

I'm using Xcode as a development tool for embedded computing platforms.
As at today, the embedXcode (http://embedxcode.weebly.com/) template supports Arduino, Diligent chipKIT with MPIDE, Texas Instruments' Launchpad with Energia, Leaflab Maple, Teensy, Wiring, and has received a warm welcome from the embedded computing community.

The issues (http://embedxcode.weebly.com/issues) I'm currently facing are mostly linked to the lack of available documentation.
The books available on Xcode focus on how to use the tool, not on how to customise it. Similarly, Apple doesn't provide any clues about its inner structure.
For example, keywords used by the templates are not documented. Neither is using other tool-chains, albeit the specific Toolchains folder.

Is Xcode solely limited OS X and iOS development?
By just releasing some documentation on Xcode inner organisation and customisation, Apple can easily make Xcode the best choice for developers.

Otherwise, I'd have no option but to switch to another IDE and to abandon OS X.

Looking forward to hearing from you,
Best regards,

--- Rei Vilo
http://embedxcode.weebly.com (http://embedxcode.weebly.com)
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Nov 26, 2012, 11:57 am
Please find the new release of embedXcode

embedXcode • Nov 24, 2012 release 23 • Fixed WiFi issue on Arduino 1.0.2 and 1.5.x   
User Manual • Nov 24, 2012 release 17 • New section Dealing with Issues


embedXcode release 23 includes the additional optional parameter EXCLUDE_LIBS in the main makefile to black-list libraries.

Issues have been reported for the WiFi library on Arduino 1.0.2 and the Firmata library with Teensy 3.0.

Edit the makefile on you project and add the names of the libraries to exclude:

Code: [Select]

# List the libraries to be excluded
# For example, WiFi may crash on Arduino 1.0.2
# For example, Firmata may crash on Teensy 3.0
#
EXCLUDE_LIBS = Firmata WiFi WiFi/utility


The user manual includes a check-list when facing an issue on embedXcode.

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

Enjoy ;)
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Dec 10, 2012, 10:20 pm
Please find the new release of embedXcode

embedXcode • Dec 10, 2012 release 23 • Fixed MAPLE_IDE variable and added Energia 9 support for Stellaris
User Manual • Dec 10, 2012 release 18 • New section Dealing with Issues

The user manual includes check-lists when facing an issue on embedXcode.

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

Enjoy ;)
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Dec 14, 2012, 10:02 pm
Please find the new releases of embedXcode

embedXcode • Dec 14, 2012 release 25 • New target for distribution
User Manual • Dec 14, 2012 release 19 • New target for distribution


The new Distribute target creates a specific folder Distribution which contains:
• all the headers and code files,
• documentation in PDF if available,
• and main sketch --.pde or .ino-- in a folder with the appropriate name.

(http://embedxcode.weebly.com/uploads/1/1/6/2/11624344/7251380_orig.png)

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

Enjoy ;)
Title: Re: Arduino on Xcode Project — Official Thread
Post by: ecopoesis on Jan 06, 2013, 12:07 am
I'm having issues getting my sketch to compile in Xcode for the Uno. It works fine in the Arduino IDE.

When I run a compile, I get the error:

/Applications/Arduino.app/Contents/Resources/Java/libraries/Esplora/Esplora.cpp:54: error: 'A11' was not declared in this scope
make: *** [Builds/libs/Esplora/Esplora.o] Error 1

I've attached the full error log.

I get this same error with a fresh embedxcode project too. Any ideas where I've gone wrong?
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Jan 06, 2013, 12:33 am
This is strange as your target is UNO.

I suggest you to edit the makefile on you project and add the names of the libraries to exclude:

Code: [Select]
# List the libraries to be excluded
# For example, WiFi may crash on Arduino 1.0.2
# For example, Esplora may crash on Arduino 1.0.3
# For example, Firmata may crash on Teensy 3.0
#
EXCLUDE_LIBS = Firmata WiFi WiFi/utility Esplora


It seems the Processing IDE is reaching its limits with the new Arduino products.

Thank you for reporting this issue. Please keep me informed of the result as I'm focused on the 1.5.x release 
Title: Re: Arduino on Xcode Project — Official Thread
Post by: ecopoesis on Jan 08, 2013, 02:49 am
Excluding the Esplora lib worked. Thanks.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Jan 08, 2013, 01:09 pm
Thank you for the feed-back.

Please find the new release

embedXcode • Jan 08, 2013 • Fix for Esplora issue on Arduino 1.0.3

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

Enjoy ;)
Title: Re: Arduino on Xcode Project — Official Thread
Post by: ecopoesis on Jan 11, 2013, 10:57 pm
Running into another problem: I'm trying to build a project on the Due, and I get the following error:

Code: [Select]
---- Compile ----
1.1-CORE: .o < .c arduino_due_x Builds/ WInterrupts.c
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avr-gcc -c -mmcu= -DF_CPU= -I/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/avr/cores/Arduino -I/Applications/Arduino.app/Contents/Resources/Java/libraries/LiquidCrystal -I/Applications/Arduino.app/Contents/Resources/Java/libraries/SD -I/Applications/Arduino.app/Contents/Resources/Java/libraries/SD/utility -I/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/avr/libraries/EEPROM -I/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/avr/libraries/Ethernet -I/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/avr/libraries/Ethernet/utility -I/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/avr/libraries/SPI -I/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/avr/libraries/Servo -I/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/avr/libraries/SoftwareSerial -I/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/avr/libraries/Stepper -I/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/avr/libraries/Wire -I/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/avr/libraries/Wire/utility  -g -Os -w -Wall -ffunction-sections -fdata-sections -I/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/avr/variants/ -DARDUINO=150  /Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/avr/cores/Arduino/WInterrupts.c -o Builds/WInterrupts.o
cc1: error: missing argument to "-mmcu="
make: *** [Builds/WInterrupts.o] Error 1


This is with Arduino 1.5.1 and the latest embedxcode. I can compile and upload form Arduino, but even a brand new project in embedxcode fails to compile. Full log is attached
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Jan 11, 2013, 11:32 pm
Problem is, I don't own an Arduino Due, so I can't proceed with the required tests.

I'll see what I can do.

Attached file displays
Quote
Error 503 Service Unavailable
Service Unavailable
Guru Meditation:
XID: 1076264504
Varnish cache server
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Jan 12, 2013, 10:38 pm
Please find an updated version of embedXcode with successful compilation for Arduino Due.



Please let me know how the upload works so I could improve it.

Thank you!
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Jan 15, 2013, 06:38 pm
Please find a new release of embedXcode

embedXcode • Jan 15, 2013 release 26 • Support for Arduino Due -- Build, link and upload tested

Arduino Due is now fully supported thanks to the help of a user who proceeded with the build, link and upload tests.

Many thanks to Mike!


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

Enjoy ;)
Title: Re: Arduino on Xcode Project — Official Thread
Post by: Nicolas68480 on Jan 18, 2013, 10:05 am
Hi Avenue33,

thanks for this development, I still have problems creating index and by trying to understand found that in the step1.mk file you also exclude OneWire :
Code: [Select]
# List of sub-paths to be excluded
#
EXCLUDE_NAMES  = Example example Examples examples Archive archive Archives archives Documentation documentation Reference reference
EXCLUDE_NAMES += ArduinoTestSuite OneWire
EXCLUDE_NAMES += $(EXCLUDE_LIBS)
EXCLUDE_LIST   = $(addprefix %,$(EXCLUDE_NAMES))


Any special reason for this ?
Thanks !
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Jan 19, 2013, 10:03 pm
Yes, the OneWire library used to be incompatible with the chipKIT MPIDE IDE.

Just remove OneWire from step1.mk file.

New place for excluding libraries is the makefile file:

Code: [Select]
# List the libraries to be excluded
# For example, WiFi may crash on Arduino 1.0.2
# For example, Esplora may crash on Arduino 1.0.3
# For example, Firmata may crash on Teensy 3.0
# For example, OneWire may crash on MPIDE 0023
#
EXCLUDE_LIBS = Firmata WiFi Esplora OneWire


The template has been updated accordingly.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Feb 02, 2013, 04:17 pm
Please find a new release of embedXcode

embedXcode • Feb 02, 2013 release 27 • Support for Teensyduino release 1.12

Teensyduino for Teensy 3.0 is no longer in beta; the plug-in for Arduino has reached release 1.12 (http://forum.pjrc.com/threads/17592-Teensyduino-1-12-Released) and is based on gcc 4.7.2.

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

Enjoy ;)
Title: Re: Arduino on Xcode Project — Official Thread
Post by: eduardorcosta on Feb 04, 2013, 06:35 pm
Hello people, I'm new in this forum and also English isn't my first language so forgive me if I have some mistakes.
I'm having problems with Xcode and user libraries, I follow every process of the manual( obviously I forgot something) but I couldn't make it build all.
It's a small code that only uses the IRremote library just that.
I was able to build all without the library, and then I added the files in the a sketchbook tree node on Xcode also in the index for code sensing(witch is working) but when I build all, Xcode complains aboud not finding the ir methods.
I notice also something strange, in the arduino IDE we have the path library, but in embedxcode you have used Libraries, since Mac OS is caps oriented this has some issue, or I'm wrong?
Thanks in advance
Eduardo
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Feb 04, 2013, 06:54 pm
¡Bienvenido!

Where the IR library is on the hard disk? The tree on the left pane is part link, part real files.



If you new to the Arduino world, I'd recommend to go step-by-step and start with the standard Arduino IDE before switching to Xcode, which is a very rich IDE.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: eduardorcosta on Feb 05, 2013, 01:22 am
Hi thanks for quick response.
1 yes I have worked with the arduino IDE and was able to compile everything and upload all the sketches to the board.
2 yes, the only think I have noticed is that, I'm using IDE 1.0.3, and inside my sketchbook folder (/Users/eduardo/Arduino) has the libraries folder, but low caps.
on the documentation was Libraries

3 the library does not matter, I pickup just for try the NewPing library (a standard library)

4 No I'm not, even with Xcode I'm not a newbie, I just dont know it very well...

The errors are these one:

In file included from main.cpp:51:
NewPing.ino:65: error: 'NewPing' does not name a type
NewPing.ino: In function 'void loop()':
NewPing.ino:73: error: 'sonar' was not declared in this scope
NewPing.ino:75: error: 'US_ROUNDTRIP_CM' was not declared in this scope
make: *** [Builds/main.o] Error 1
Title: Re: Arduino on Xcode Project — Official Thread
Post by: eduardorcosta on Feb 05, 2013, 01:49 am
Hi to all again,

I did a search in all project, with Libraries and change everything to libraries.

Well this is sort a desperate measure, but it worked, I don't know, how do you are able to compile your libs like this, but it worked.


Everything is build and ok...

If anyone has an idea, I like to hear....
Title: Re: Arduino on Xcode Project — Official Thread
Post by: eduardorcosta on Feb 05, 2013, 09:43 pm
Hi,

I think this is a problem, or by my IDE in installation or the embedeXcode. I had mapped all the files that are required to everything build ok. Plus, I made a Duemilanove configuration.

If you guys want the codes, please ask.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Feb 08, 2013, 03:52 pm

Hi to all again,

I did a search in all project, with Libraries and change everything to libraries.

Well this is sort a desperate measure, but it worked, I don't know, how do you are able to compile your libs like this, but it worked.


Everything is build and ok...

If anyone has an idea, I like to hear....


Mac OS X offers two kinds of file format: case-sensitive and not case-sensitive. What's your configuration?

On my MacBook, the folder for the user libraries is called ~/Documents/Projets/Arduino/Libraries , hence the Libraries with capital L.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: eduardorcosta on Feb 08, 2013, 11:06 pm
Mine is case-sensitive,

Interesting in your configuration you have a library directory with a capital L, in mine (the default from arduino IDE) is l.

Is this a configuration on the IDE? Maybe integrate this is a good idea.

Thanks
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Feb 08, 2013, 11:26 pm
What are the advantages of having a case-sensitive file system?
Title: Re: Arduino on Xcode Project — Official Thread
Post by: eduardorcosta on Feb 09, 2013, 04:08 pm
I really don't have an answer for that, but is an option and I think there are some users using this out there...

Thanks
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Feb 28, 2013, 06:10 pm
Please find a new release of embedXcode:

embedXcode • Feb 28, 2013 release 29 • Support for Digispark (build and link tested)

The Digispark by Digistump is an incredibly small --0,69x0,75" or 17,5x19,0mm only-- but fully featured board --with I²C, SPI, ADC or PWM!

(http://www.weebly.com/uploads/1/1/6/2/11624344/593967221.jpg)

More tests are required for the upload as the process is not standard.

(http://www.weebly.com/uploads/1/1/6/2/11624344/140781_orig.png)

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

Enjoy :)
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Mar 05, 2013, 04:40 pm
Please find a new release of embedXcode:

embedXcode • Mar, 05 2013 release 30 • Full support for Digispark
embedXcode • Mar, 05 2013 release 31 • Automatic project configuration

Thanks to the Digispark boards received from  Digistump, I ran the tests for the upload. build, link and upload work fine now.

(http://embedxcode.weebly.com/uploads/1/1/6/2/11624344/477479_orig.jpg) Enjoy the power of a square inch!


The automatic project configuration procedure saves a lot of time. Before, a newly created project used to require many manual procedures, like declaring the .ino or .pde sketch file as C++ code file for colour syntaxing, or defining the directories for click-to-error, ... Now, you need just a click!

(http://embedxcode.weebly.com/uploads/1/1/6/2/11624344/8069618_orig.jpg)

This new automatic project configuration (http://embedxcode.weebly.com/automatic-project-configuration.html) works for all the supported platforms: Arduino, chipKIT, Digispark, LaunchPad MSP430 + FRAM + Stellaris, Maple and Wiring.


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


Enjoy :)
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Mar 10, 2013, 12:09 pm
I'm presently working on extending the automatic project configuration (http://embedxcode.weebly.com/1/post/2013/03/embedxcode-working-on-a-fully-automatic-project-configuration.html) to include all the manual procedures, except for adding the user's libraries.

(http://embedxcode.weebly.com/uploads/1/1/6/2/11624344/5517385_orig.png)

The major challenge is to understand how Xcode stores and structures the configuration of a project.

Stay tuned :)
Title: Re: Arduino on Xcode Project — Official Thread
Post by: kass on Mar 13, 2013, 11:52 pm
Hi,

I've exactly the same problem as eduardorcosta.

I've Arduino IDE 1.5 on Mountain Lion (case-insensitive system). It automatically create a folder "libraries" (with a lower L).

I installed embedxcode exactly like in the documentation. I can build and upload to my Arduino board.
But when I need a local library, it didn't work. When I build I become the following errors:

error: ble.h: No such file or directory
error: 'ble_begin' was not declared in this scope


To add libraries, I follow the guide at § 3.2.3.
If I try to change the Sketchbook libraries folder to "Libraries" (with upper L), the Arduino IDE doesn't compile anymore, and under xcode I become the following errors when compiling:

(all error for the app.cpp file,a file from the BLE library)

/Documents/Arduino/Libraries/BLE/app.cpp:17:22: Services.h: No such file or directory
/Documents/Arduino/Libraries/BLE/app.cpp:18:21: error: lib_aci.h: No such file or directory
/Documents/Arduino/Libraries/BLE/app.cpp:46: error: 'lib_aci_device_wakeup' was not declared in this scope
/Documents/Arduino/Libraries/BLE/app.cpp:56: 'lib_aci_send_setup_msg' was not declared in this scope
and 11 more errors…

It would be really great if somebody knows a solution for this problem.

Thanks a lot!
Kass
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Mar 14, 2013, 12:09 am
You could try with this set of makefiles where all
Code: [Select]
/Libraries have been replaced by
Code: [Select]
/libraries
obviously with libraries in the sketchbook folder.

One question for my understanding: what is the rationale for case-sensitive file system?

I hope this helps :)

Title: Re: Arduino on Xcode Project — Official Thread
Post by: kass on Mar 14, 2013, 12:52 am
Hey Avenue33,

thanx for your very quick answer !

Unfortunately the change of the makefile didn't help me. When I build I get the same error as when I tried to change the sketchbook libraries folder to Libraries (in the finder).  :(

In my first post, I wrote that about the case insentive stuff because you asked eduardorcosta if he uses a case sensitive file format.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Mar 14, 2013, 04:17 pm
Please find a new release of embedXcode:
      
embedXcode • Mar 15, 2013 release 32 • Full automatic project configuration

This new release enhances the automatic project configuration (http://embedxcode.weebly.com/automatic-project-configuration.html) and includes:
• Declare .pde or .ino file as C++ code for code-sense, and
• Define the directory for the targets,
• Add all the cores, variants and libraries from the installed platforms under the group Resources,
• Declare all the files of the project for code-sense.

(http://embedxcode.weebly.com/uploads/1/1/6/2/11624344/6574469_orig.png) (http://embedxcode.weebly.com/uploads/1/1/6/2/11624344/9554119_orig.png)

Major impact: project are much lighter, typically 2 MB instead of 16 MB!

The only remaining manual procedure is adding user's libraries.

The User Manual (http://embedxcode.weebly.com/tutorial) has been updated accordingly.

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

Enjoy :)
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Mar 15, 2013, 05:23 pm
Please find a new release

embedXcode • Mar 15, 2013 release 33 • Patch for libraries Libraries in sketchbook

This release fixes an annoying bug on the the folder name for the user's libraries.

The folder with the user's libraries in the sketchbook can now be spelled with or without a capital L.

Both libraries and Libraries names are valid.

Thanks Kass for reporting the issue!

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

Enjoy :)
Title: Re: Arduino on Xcode Project — Official Thread
Post by: jimaobian on Mar 19, 2013, 07:50 am
I've update the most recent embedXcode ,but when the project is created,the files in Configurations become blank. I've installed manually, but it does't work either.
Can you tell me how to deal with it?
Title: Re: Arduino on Xcode Project — Official Thread
Post by: jimaobian on Mar 19, 2013, 07:58 am
I got it, change the "Config" to "Configurations" in the templates ....
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Mar 19, 2013, 08:06 am
The new release

embedXcode • Mar 18, 2013 release 33.2 • Sub-folders in Libraries

fixes a number of issues, including the one you mention.

Learn more (http://embedxcode.weebly.com/1/post/2013/03/embedxcode-improved-sub-folders-in-libraries.html).
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Mar 26, 2013, 08:56 pm
Please find a new release of embedXcode:

embedXcode • Mar 21, 2013 release 34 • Support for Digispark release 1.04
embedXcode • Mar 26, 2013 release 35 • Support for OS X 10.7 Lion and 10.8 Mountain Lion


embedXcode now supports the new release of the IDE for Digispark, which is bundled with the Arduino 1.0.4 IDE.
(http://embedxcode.weebly.com/uploads/1/1/6/2/11624344/287952.png)
The automatic project configuration tool runs now on both OS X Mountain Lion aka. 10.8 and OS X Lion aka. 10.7.

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

Enjoy :)
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Mar 28, 2013, 09:19 am
Please find a new release of embedXcode

embedXcode • Mar 27, 2013 release 36 • Configurations folder name fixed

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

Enjoy
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Apr 04, 2013, 09:57 am
Please find a new version of mbedXcode

embedXcode • Apr 05, 2013 release 36 • Stability enhancement with revised main()

The revised main() function includes now copies of the main files from each platform and architecture. An issue with arm-none-eabi-ar release 4.7.1 has also been fixed. Teensy 3 and LaunchPad Stellaris were concerned.

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

Enjoy :)
Title: Re: Arduino on Xcode Project — Official Thread
Post by: Scott216 on Apr 04, 2013, 02:10 pm
I'd like to try using XCode to program my Arduinos instead of the Arduino IDE. Here's what I have installed

Mac OSX 10.7.5
Arduini IDE 1.04
Xcode 4.6.1
EmbedXcocd Mar 27 Release 36
Doxygen 1.8.3.1
Graphviz 2.30

Note: My Arduino sketches are not in the default location, they are in /volumes/srgshare/Arduino Sketches/
My libraries are in /volumes/srgshare/Arduino Sketches/libraries/

I followed your installation instructions and then tried to create a new project.  When I get to step 3.1.1 and run the Build procedure it fails with these errors

Shell Script Invocation Error
/volumes/srgshare/Arduino: No such file or directory

Shell Script Invocation Error
Sketches/test1/test1/Makefiles/step1.mk:  No such file or directory


In your user manual, I can't get any of the hyperlinks to work. 

Also, when you come out with new versions, how do I install them? Do I just double click on the package?
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Apr 04, 2013, 02:50 pm
Thank you for your message and questions.


Note: My Arduino sketches are not in the default location, they are in /volumes/srgshare/Arduino Sketches/
My libraries are in /volumes/srgshare/Arduino Sketches/libraries/

I followed your installation instructions and then tried to create a new project. 


Just to be sure, have you run the Arduino IDE just once and declared the sketchbook folder in Arduino > Preferences?


When I get to step 3.1.1 and run the Build procedure it fails with these errors

Shell Script Invocation Error
/volumes/srgshare/Arduino: No such file or directory

Shell Script Invocation Error
Sketches/test1/test1/Makefiles/step1.mk:  No such file or directory


What files are in the folder? The Arduino.app should be in the default applications folder, i.e. /Applications/Arduino.app



In your user manual, I can't get any of the hyperlinks to work. 


Thank you for noticing me. My website host doesn't allow files larger than 5 MB. The PDF is 10 MB so I have to compress it. Unfortunately, the compression removes the links.


Also, when you come out with new versions, how do I install them? Do I just double click on the package?


Yes, each release has a number so OS X can manage the updates.

Please let me know.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: Scott216 on Apr 04, 2013, 03:57 pm

Note: My Arduino sketches are not in the default location, they are in /volumes/srgshare/Arduino Sketches/
My libraries are in /volumes/srgshare/Arduino Sketches/libraries/

I followed your installation instructions and then tried to create a new project. 


Just to be sure, have you run the Arduino IDE just once and declared the sketchbook folder in Arduino > Preferences?


Yes.  Before I installed embedXcode, I installed the latest version of Arduino IDE ran it and changed the default sketch directory in preferences.


When I get to step 3.1.1 and run the Build procedure it fails with these errors

Shell Script Invocation Error
/volumes/srgshare/Arduino: No such file or directory

Shell Script Invocation Error
Sketches/test1/test1/Makefiles/step1.mk:  No such file or directory


What files are in the folder? The Arduino.app should be in the default applications folder, i.e. /Applications/Arduino.app 

I'm not sure which directory your are referring too.  This directory doesn't exist: "/volumes/srgshare/Arduino".  I do have a directory called "/volumes/srgshare/Arduino Sketches".  Could the space between "Arduino" and "Sketches" be causing a problem?

My Arduino.app file is located in my Applications directory, as is xcode.app


In your user manual, I can't get any of the hyperlinks to work. 


Thank you for noticing me. My website host doesn't allow files larger than 5 MB. The PDF is 10 MB so I have to compress it. Unfortunately, the compression removes the links.

Can you make the uncompressed version available somewhere else, like slideshare.net?
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Apr 04, 2013, 04:58 pm

Could the space between "Arduino" and "Sketches" be causing a problem?


Yes, I think so, as the tools used in the makefiles doesn't like spaces in folders and files names.


Can you make the uncompressed version available somewhere else, like slideshare.net?


Thank you for pointing me at slideshare.net. See http://us.slideshare.net/rei_vilo/embed-xcode-usermanual

I'm also considering another solution, publishing an ebook.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: Scott216 on Apr 04, 2013, 05:29 pm

Yes, I think so, as the tools used in the makefiles doesn't like spaces in folders and files names.


I'll rename the directory to Arduino_Sketches to get rid of the space.  After I do this, do I need to change any settings or reinstall embedXcode?
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Apr 04, 2013, 05:34 pm
I don't think so, as the Xcode project is self-contained in its folder.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: Scott216 on Apr 05, 2013, 03:06 am
I'm trying to create my first project (no coding yet).  I followed the example in the instructions.  After I do step 3.1.1 where it builds the project (I guess that's what it's doing).  I get a bunch of error in the included Arduino (1.0.4) libraries.  I'm getting errors in WString.h, Arduino.h and stdlib.h.  See attached screenshot.   I just installed the latest version of embedXcode.  What should I do?
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Apr 05, 2013, 09:40 am
Hi!

Really, I don't understand what's happening. This is the very first time so many issues are reported.

Let's try something: as per §5.2. Manage the Libraries for Compilation, please edit the main makefile and change the line
Code: [Select]
APP_LIBS_LIST =

for
Code: [Select]
APP_LIBS_LIST = 0
Title: Re: Arduino on Xcode Project — Official Thread
Post by: Scott216 on Apr 05, 2013, 02:30 pm

Hi!

Really, I don't understand what's happening. This is the very first time so many issues are reported.

Let's try something: as per §5.2. Manage the Libraries for Compilation, please edit the main makefile and change the line
Code: [Select]
APP_LIBS_LIST =

for
Code: [Select]
APP_LIBS_LIST = 0



I tried that, then I started getting errors in other libraries.  First I got errors in a clock.h library I have.  So I moved it out of the \libraries folder.  Then I rebuilt and started getting error in DS1307RTC library, so I moved that out of the library folder.  Then I got errors in ERxPachube library.  I moved that out of the library folder.  Then I got errors on WString.h, Arduino.h and stdlib.h.   All these libraries work in the Arduino IDE. See screenshots.

Some errors are byte does not name a type
Title: Re: Arduino on Xcode Project — Official Thread
Post by: Scott216 on Apr 05, 2013, 02:43 pm
Just to see if the problem was with the latest Arduino IDE (1.0.4), I deleted Arduino.app and installed 1.0.2.  I rebuilt in xcode and got the same errors.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: Scott216 on Apr 05, 2013, 04:08 pm
So I have a little more info, maybe it will help.  I removed all the libraries from my \library\ folder and tried to rebuild my project xcode and it worked, no errors.  Then I started adding libraries back, and re-built.  Sometimes it build successfully, and sometimes I got errors.  For example, when I added a twitter.h library in, I got errors (see screenshot).  Another library that gave me errors was EthernetDHCP (https://github.com/colagrosso/ciao/tree/master/Arduino/libraries/EthernetDHCP). 
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Apr 05, 2013, 04:31 pm
Thank you for your investigation.

Does the header of the libraries always include the statement
Code: [Select]
#include "Arduino.h

Title: Re: Arduino on Xcode Project — Official Thread
Post by: Scott216 on Apr 05, 2013, 04:35 pm
I looked at 3 libraries that had errors and none of them have arduino.h
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Apr 05, 2013, 04:56 pm
As recommended at Writing a Library for Arduino (http://arduino.cc/en/Hacking/LibraryTutorial),

Quote
You need a couple of other things in the header file. One is an #include statement that gives you access to the standard types and constants of the Arduino language (this is automatically added to normal sketches, but not to libraries). It looks like this (and goes above the class definition given previously):
Code: [Select]
#include "Arduino.h"


Have you followed the procedure detailed in section 7.2. Solution to Most Common Issues

Quote
Q: Does the sketch compiles normally on the standard IDE?
A: If the sketch doesn't compile on the standard IDE, then the error isn't generated by Xcode or embedXcode alone.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: Scott216 on Apr 05, 2013, 09:03 pm
I'll try including Arduino.h to the libraries and see if that helps.  If that's the problem I would think lots of other people would have come across this before me. 

I do check to see if the sketch compiles in the Arduino IDE.  Right now my sketch is empty, I'm just trying to create an empty project.

For your user manual in slideshere.net, the hyperlinks to outside sites work, but the links to other sections in the pdf do not.  Can you enable the save option so users like me can just download the PDF from slideshare.

Thanks for your help with getting this to work for me.  I hope I get it figured out, I look forward to using XCode with my Arduino.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: Scott216 on Apr 06, 2013, 01:01 am
I still haven't figured out all my compile error problems on a new install; maybe #include "Arduino.h" will fix it.  But I can compile okay if I remove all the libraries from my library folder, which I've done for the time being.  But I seem to be having a problem with the Automatic Procedure.  I Created a new project (test4) as described in step 3.1 and select Build as my target then Run. 
I didn't get any build errors, but when I compared my project to step 3.1.2, I see that the identity and type for test4.ino is still plain text.  It didn't change the settings in the External Build Tool Configuration and didn't add the Arduino directories under sketchbook.  It's like the Automatic Procedure isn't running.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Apr 07, 2013, 09:59 pm
Thank you for answering this two questions survey (http://rei-vilo.polldaddy.com/s/using-embedxcode-with).

The answers will help me to focus on the most popular platforms.

Survey: http://rei-vilo.polldaddy.com/s/using-embedxcode-with
Title: Re: Arduino on Xcode Project — Official Thread
Post by: Scott216 on Apr 07, 2013, 11:31 pm

I seem to be having a problem with the Automatic Procedure.  I Created a new project (test4) as described in step 3.1 and select Build as my target then Run. 
I didn't get any build errors, but when I compared my project to step 3.1.2, I see that the identity and type for test4.ino is still plain text.  It didn't change the settings in the External Build Tool Configuration and didn't add the Arduino directories under sketchbook.  It's like the Automatic Procedure isn't running.


Any suggestions for me?  I'd really like to get this working.  It seems like the Automatic Procedure isn't running.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Apr 08, 2013, 10:48 am


I seem to be having a problem with the Automatic Procedure.  I Created a new project (test4) as described in step 3.1 and select Build as my target then Run. 
I didn't get any build errors, but when I compared my project to step 3.1.2, I see that the identity and type for test4.ino is still plain text.  It didn't change the settings in the External Build Tool Configuration and didn't add the Arduino directories under sketchbook.  It's like the Automatic Procedure isn't running.


Any suggestions for me?  I'd really like to get this working.  It seems like the Automatic Procedure isn't running.


Could you please send me a copy of the log navigator when you launch the Build? Feel free to use the contact form at http://embedxcode.weebly.com/contact.html.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: Scott216 on Apr 08, 2013, 01:54 pm
What's the log navigator?
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Apr 08, 2013, 02:05 pm

What's the log navigator?


Please find the screen capture attached.

Sorry, but I can't provide support for Xcode.

I strongly recommend you to refer to the book Xcode 4 Unleashed by Fritz F. Anderson I purchased thanks to contributions (http://embedxcode.weebly.com/contact.html).

(http://embedxcode.weebly.com/uploads/1/1/6/2/11624344/9702031_orig.jpg)
Title: Re: Arduino on Xcode Project — Official Thread
Post by: Scott216 on Apr 08, 2013, 02:59 pm
If I can get this working, I'll definitely get the book and learn xcode.  Arduinos are the only thing I program, so I don't want to invest time in learning xcode if I can't get this working.

Attached is a screenshot of the log and also I cut and pasted it into a text file.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Apr 08, 2013, 04:58 pm
The build log you sent me is successful.

As detailed in §3.1. Automatic Procedure,
Quote
However, as the automatic procedure can only be launched once, they are detailed in the next section.


Please create a new project and send me the build log of the very first build.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: Scott216 on Apr 08, 2013, 05:16 pm

Please create a new project and send me the build log of the very first build.


See attached
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Apr 08, 2013, 05:40 pm
The light is green so compilation is successful.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: Scott216 on Apr 08, 2013, 05:56 pm

The light is green so compilation is successful.


I know, but EmbedXCode didn't do any of the stuff described in step 3.1.2.  The automatic procedure is supposed to prepare the project by adding setting the file type for .ino files to C++, setting click to error ,  adding core libraries etc.  It didn't do any of those things.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Apr 08, 2013, 06:27 pm
Ok. Create a new project and then go inside
Code: [Select]
folder_for_Xcode_projects/embed1/embed1/Utilities
and check if embedXcode_prepare is inside.

Once you have launched the first compilation, embedXcode_prepare is used and then deleted.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: Scott216 on Apr 08, 2013, 06:43 pm

Ok. Create a new project and then go inside
Code: [Select]
folder_for_Xcode_projects/embed1/embed1/Utilities
and check if embedXcode_prepare is inside.

Once you have launched the first compilation, embedXcode_prepare is used and then deleted.


I created Test8 and I do see embedXcode_prepare.  It's also in my previous project (test7), but it's colored red, maybe that means it's deleted.  Attached are screen shots for both.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Apr 08, 2013, 07:55 pm
For test8, could you please launch Build and send me the history log.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: Scott216 on Apr 08, 2013, 08:42 pm

For test8, could you please launch Build and send me the history log.


see attached
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Apr 08, 2013, 09:19 pm
At last, after 5 days of research and endless posts, the key element is

Code: [Select]
/bin/sh: line 1: 38998 Segmentation fault: 11  Utilities/embedXcode_prepare /Users/Scott/Documents/Arduino_OLD/Test8/Test8.xcodeproj

I guess this was caused by embedXcode_prepare running on OS X 10.7.

Now, I've compiled embedXcode_prepare specifically for OS X 10.7 and released a new version of embedXcode

embedXcode • Apr 08, 2013 release 38 • embedXcode_prepare for OS X 10.7

I tested it successfully on my OS X 10.8 Mac.

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

Enjoy :)
Title: Re: Arduino on Xcode Project — Official Thread
Post by: Scott216 on Apr 09, 2013, 12:16 am

At last, after 5 days of research and endless posts, the key element is

Code: [Select]
/bin/sh: line 1: 38998 Segmentation fault: 11  Utilities/embedXcode_prepare /Users/Scott/Documents/Arduino_OLD/Test8/Test8.xcodeproj

I guess this was caused by embedXcode_prepare running on OS X 10.7.

Now, I've compiled embedXcode_prepare specifically for OS X 10.7 and released a new version of embedXcode

embedXcode • Apr 08, 2013 release 38 • embedXcode_prepare for OS X 10.7

I tested it successfully on my OS X 10.8 Mac.



It's working now, thanks for the update!!  Now I can get back to my original problem where the build is failing when I have user libraries installed.  I'm hoping #include "Arduino.h" fixes that issue.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: Scott216 on Apr 09, 2013, 04:50 am
Now that Xcode compiles without errors I've started adding my user libraries back to my \library folder.  Most of the libraries compile fine, but not all.  The first one I'm trying to tackle is DallasTemperature.h.  Arduino.h is already included, so that shouldn't be the problem.  The library works fine in Arduino IDE 1.0.4, I compiled a couple of the example sketches without errors in the Arduino IDE.

Attached are some of the errors and the library file. 
Title: Re: Arduino on Xcode Project — Official Thread
Post by: Scott216 on Apr 10, 2013, 01:35 am

Now that Xcode compiles without errors I've started adding my user libraries back to my \library folder.  Most of the libraries compile fine, but not all.  The first one I'm trying to tackle is DallasTemperature.h.  Arduino.h is already included, so that shouldn't be the problem.  The library works fine in Arduino IDE 1.0.4, I compiled a couple of the example sketches without errors in the Arduino IDE.


Until I can figure out why the DallasTemperature library won't compile on xcode I'm trying to exclude it, I added it the the makefile:
EXCLUDE_LIBS = Firmata WiFi Esplora OneWire DallasTemperature

But that didn't help, xcode still gives me the same errors when I run Build.   
Title: Re: Arduino on Xcode Project — Official Thread
Post by: Scott216 on Apr 10, 2013, 03:22 am
I'm trying to follow step 3.2.2 (Declare Sources for Code Sense) in the manual, but the screenshots are really blurry and I can't figure out what to do.  I attached a screen shot of what I think is the target index and build phases pane.  But I don't see an add items button  There is an add Target, but that doesn't seem to be the same.  I Googled around for help, but didn't find anything.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: Scott216 on Apr 10, 2013, 04:40 pm

I strongly recommend you to refer to the book Xcode 4 Unleashed by Fritz F. Anderson

(http://embedxcode.weebly.com/uploads/1/1/6/2/11624344/9702031_orig.jpg)


I just got the Kindle version.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: Scott216 on Apr 11, 2013, 02:30 pm

Now that Xcode compiles without errors I've started adding my user libraries back to my \library folder.  Most of the libraries compile fine, but not all.  The first one I'm trying to tackle is DallasTemperature.h.  Arduino.h is already included, so that shouldn't be the problem.  The library works fine in Arduino IDE 1.0.4, I compiled a couple of the example sketches without errors in the Arduino IDE.


I figured out how to solve this compile problem.  In Makefile I changed
Code: [Select]
EXCLUDE_LIBS = Firmata WiFi Esplora OneWire
to
Code: [Select]
EXCLUDE_LIBS = Firmata WiFi Esplora
Title: Re: Arduino on Xcode Project — Official Thread
Post by: Scott216 on Apr 11, 2013, 02:54 pm

I'm trying to follow step 3.2.2 (Declare Sources for Code Sense) in the manual, but the screenshots are really blurry and I can't figure out what to do.  I attached a screen shot of what I think is the target index and build phases pane.  But I don't see an add items button  There is an add Target, but that doesn't seem to be the same.  I Googled around for help, but didn't find anything.


I figured it out.  I don't know why I didn't see the + at the bottom of the list the first time.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: Scott216 on Apr 12, 2013, 01:06 am
Code-Sense isn't working for basic Arduino keywords like pinMode() and delay() .  I re-indexed as described in step 4.6, but still no luck.

I'm using version the latest version of embedXcode.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Apr 17, 2013, 08:21 am
Each release of Xcode changes the way code-sense works.

I suggest to get rid of the whole core library for code-sense block and keep only

Code: [Select]
#include "Arduino.h"

Also, launch one compilation.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: Scott216 on Apr 17, 2013, 02:36 pm

Each release of Xcode changes the way code-sense works.

I suggest to get rid of the whole core library for code-sense block and keep only

Code: [Select]
#include "Arduino.h"

Also, launch one compilation.



No luck, here's what I did.


Attached is a screenshot of what the code looks like after doing this.

Edit: The auto-complete does seem to work, it's just the colors don't match what I see in your manual. 
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Apr 17, 2013, 04:28 pm
The procedure you've followed is basically this described on section 4.6 Re-Index the Keywords for Code-Sense.

Strange enough, code-sense, auto-completion and arguments list are displayed usually without problem in my laptop. Now, it isn't a 100% hit and Xcode dedicated forums recommend the procedure you've followed and I've mentioned in the user manual.

Unfortunately, as code-sense implementation changes with every Xcode release and as Apple is more than secretive about the customisation of Xcode, I'm sorry I can't be of much help.

Title: Re: Arduino on Xcode Project — Official Thread
Post by: Scott216 on Apr 17, 2013, 04:31 pm

The procedure you've followed is basically this described on section 4.6 Re-Index the Keywords for Code-Sense.

Strange enough, code-sense, auto-completion and arguments list are displayed usually without problem in my laptop. Now, it isn't a 100% hit and Xcode dedicated forums recommend the procedure you've followed and I've
mentioned in the user manual.

Unfortunately, as code-sense implementation changes with every Xcode release and as Apple is more than secretive about the customisation of Xcode, I'm sorry I can't be of much help.


I think code-sense is working but the colors are different from your manual.  Or maybe it's partially working.
Can you give me links to the xcode forums you like to go to?

Title: Re: Arduino on Xcode Project — Official Thread
Post by: Scott216 on Apr 17, 2013, 04:38 pm
I have another smaller issue, not a show stopper.  When I create a new project, xcode does no do a reindex on it's own.  But when I go do my first build and where embedxcode does it's thing, the Build is cancelled because the index starts.  I did notice the the embedxcode changes all seem to be there, so that's good.  Once the indexing is done, if I start another Build, it finishes okay.  Is there a way for me to make xcode do the index so it doesn't just start it on it's own and cancel my first Build.  I guess I could follow the code-sense same re-indexing procedure, but I'm wondering if there is something more direct.  I tried Run > Index, but that didn't work, I guess that's for something else.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Apr 17, 2013, 05:14 pm
I think code-sense is working but the colors are different from your manual.  Or maybe it's partially working.


Yes, the colours may vary, due to different available configurations --see attached screen-shot-- and due to different interpretation of the functions as Project Class Names or Other Class Names, Project Function and Method Names or Other Function and Method Names.


Can you give me links to the xcode forums you like to go to?


Sure, http://stackoverflow.com/questions/tagged/xcode and http://apple.stackexchange.com


I have another smaller issue, not a show stopper.  When I create a new project, xcode does no do a reindex on it's own.  But when I go do my first build and where embedxcode does it's thing, the Build is cancelled because the index starts.  I did notice the the embedxcode changes all seem to be there, so that's good.  Once the indexing is done, if I start another Build, it finishes okay.  Is there a way for me to make xcode do the index so it doesn't just start it on it's own and cancel my first Build.  I guess I could follow the code-sense same re-indexing procedure, but I'm wondering if there is something more direct.


On embedXcode releases up to 40, the preparation of the project is done the first time compilation is asked for, but actually before the compilation really starts. As Xcode tries to do two thinks at the same time, it realises the project has been changed by the preparation and thus stops the compilation.

On embedXcode releases 41 and on, the preparation of the project is still done the first time compilation is asked for, but this time after compilation is completed, avoiding conflicts of multi-tasking. 

The preparation provides Xcode with all the references required for building the index, so code-sense, auto-completion and argument list can work.


I tried Run > Index, but that didn't work, I guess that's for something else.


As explained in section 5. Build and Upload the Project -- 5.1. Select a Target,

Quote
Index is a proxy target solely used for code-sense. Do not launch it.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: Scott216 on Apr 17, 2013, 05:32 pm

On embedXcode releases up to 40, the preparation of the project is done the first time compilation is asked for, but actually before the compilation really starts. As Xcode tries to do two thinks at the same time, it realises the project has been changed by the preparation and thus stops the compilation.

On embedXcode releases 41 and on, the preparation of the project is still done the first time compilation is asked for, but this time after compilation is completed, avoiding conflicts of multi-tasking. 


Isn't release 38 (April 8) the latest release?
Ref: http://arduino.cc/forum/index.php/topic,49956.msg1192390.html#msg1192390


Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Apr 17, 2013, 06:15 pm
Please find a new release of embedXcode

embedXcode • Apr 12, 2013 release 39 • Arduino architecture new variables
embedXcode • Apr 13, 2013 release 40 • Arduino Duemilanove configuration file
embedXcode • Apr 16, 2013 release 41 • Estimated RAM usage


Arduino 1.5 new compilation variables are now included.
Estimated RAM usage and total RAM are displayed after compilation.

Code: [Select]
---- Size ----
Binary sketch size:  654 bytes (of a 16384 byte maximum)
Estimated SRAM used: 8 bytes (of a 512 byte maximum)
==== Make done ====


(http://embedxcode.weebly.com/uploads/1/1/6/2/11624344/2461115_orig.png)
Based on the results of the survey (http://embedxcode.weebly.com/1/post/2013/04/embedxcode-surveyusing-embedxcode-with1.html), support for chipKIT, Maple and Wiring is put on hold until new boards or new versions of the IDEs are released.

As always,
• Website: http://embedxcode.weebly.com
• Download: http://embedxcode.weebly.com/download
• User guide: http://embedxcode.weebly.com/tutorial
Title: Re: Arduino on Xcode Project — Official Thread
Post by: Scott216 on Apr 17, 2013, 09:15 pm
I just installed release 41.  I created a new project, but the embedxcode script isn't doing anything: core libraries are not added, file type is not changed etc.  The build says it's successful, but I get these errors:

Code: [Select]
==== Build done ====
/bin/sh: Utilities/embedXcode_prepare: Permission denied
Showing first 200 notices only
Command /Applications/Xcode.app/Contents/Developer/usr/bin/make emitted errors but did not return a nonzero exit code to indicate failure


I have Xcode 4.6.1 on Mac 10.7.5

I attached the log.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Apr 17, 2013, 09:52 pm
Strange, I haven't modified the embedXcode_prepare utility, built as 10.7 compatible.

Please try with release 42 just uploaded.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: Scott216 on Apr 18, 2013, 02:57 am

Strange, I haven't modified the embedXcode_prepare utility, built as 10.7 compatible.

Please try with release 42 just uploaded.



I installed r42 and still have the problem, but only when the new project is on a network drive (connected as WebDAV.  When I create a project on the local drive it's fine.  My computer has full rights to the network drive. Any suggestions?
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Apr 18, 2013, 07:00 am
Hi!

Have you tried Repair permissions with the disk utility?
Title: Re: Arduino on Xcode Project — Official Thread
Post by: Scott216 on Apr 18, 2013, 12:57 pm

Have you tried Repair permissions with the disk utility?


Disk Utility only lists my local disks, not network drives.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: Scott216 on Apr 18, 2013, 01:05 pm
Can you give me some information as to what embedxcode is doing regarding this error?
Code: [Select]
==== Build done ====
/bin/sh: Utilities/embedXcode_prepare: Permission denied
Showing first 200 notices only
Command /Applications/Xcode.app/Contents/Developer/usr/bin/make emitted errors but did not return a nonzero exit code to indicate failure

Maybe that can help me figure out why it won't run when creating a new project on my network drive.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Apr 18, 2013, 01:28 pm
embedXcode only displays the error message provided by the system.

It seems the network connection prevents the utility from running successfully.

You can try to run embedxcode_prepare from the terminal window.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: Scott216 on Apr 18, 2013, 01:29 pm

You can try to run embedxcode_prepare from the terminal window.


How do I do that?
Title: Re: Arduino on Xcode Project — Official Thread
Post by: avenue33 on Apr 18, 2013, 05:50 pm


You can try to run embedxcode_prepare from the terminal window.


How do I do that?


Code: [Select]
/Users/home/Documents/Xcode/embed1/embed1/Utilities/embedXcode_prepare

Code: [Select]
/Users/home/Documents/Xcode/embed1/embed1.xcodeproj

Code: [Select]
/Users/home/Documents/Xcode/embed1/embed1/Utilities/embedXcode_prepare /Users/home/Documents/Xcode/embed1/embed1.xcodeproj

home is the folder with your name.
Title: Re: Arduino on Xcode Project — Official Thread
Post by: Scott216 on Apr 19, 2013, 06:12 am



You can try to run embedxcode_prepare from the terminal window.


How do I do that?



  • Create a new embedXcode project with Xcode, e.g. embed1

  • Close Xcode

  • Launch Terminal

  • Look for the full path of embedXcode_prepare at

Code: [Select]
/Users/home/Documents/Xcode/embed1/embed1/Utilities/embedXcode_prepare
  • Look for the full path of embed1.xcproject at

Code: [Select]
/Users/home/Documents/Xcode/embed1/embed1.xcodeproj
  • Type in Terminal the command

Code: [Select]
/Users/home/Documents/Xcode/embed1/embed1/Utilities/embedXcode_prepare /Users/home/Documents/Xcode/embed1/embed1.xcodeproj


    home is the folder with your name.


    I get permission denied:

    Code: [Select]
    mac_eth1:Utilities Scott$ /Volumes/srgshare/Arduino_Sketches/Test_webdav/Test_webdav/Utilities/embedXcode_prepare /Volumes/srgshare/Arduino_Sketches/Test_webdav/Test_webdav.xcodeproj
    -bash: /Volumes/srgshare/Arduino_Sketches/Test_webdav/Test_webdav/Utilities/embedXcode_prepare: Permission denied
    mac_eth1:Utilities Scott$
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Apr 19, 2013, 07:43 am
    Unfortunately, I'm afraid I won't be of much help on this OS X-related issue. File permissions are always tricky,me specially in shared volumes.

    You could try
    Code: [Select]
    sudo chmod -R 777 /Volumes/srgshare/Arduino_Sketches/Test_webdav
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on Apr 19, 2013, 08:04 am

    Unfortunately, I'm afraid I won't be of much help on this OS X-related issue. File permissions are always tricky,me specially in shared volumes.

    You could try
    Code: [Select]
    sudo chmod -R 777 /Volumes/srgshare/Arduino_Sketches/Test_webdav


    That didn't work.  I'm using jungledisk software to create the network drive.  I'll see if their tech support can help.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Apr 19, 2013, 08:20 am
    Can you try on your Mac hard disk instead?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on Apr 19, 2013, 01:33 pm

    Can you try on your Mac hard disk instead?

    Running embedxcode from terminal works if the project is on my local hard drive.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on Apr 19, 2013, 01:52 pm
    I'm getting a couple errors after my first Build on a new project.  The build is successful, so I don't know if these errors are important are not.  They are:

    /bin/sh: /usr/local/bin/wget: No such file or directory

    Command /Applications/Xcode.app/Contents/Developer/usr/bin/make emitted errors but did not return a nonzero exit code to indicate failure

    See attached screenshots and log
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Apr 19, 2013, 02:12 pm

    I'm getting a couple errors after my first Build on a new project.  The build is successful, so I don't know if these errors are important are not.  They are:

    /bin/sh: /usr/local/bin/wget: No such file or directory

    Command /Applications/Xcode.app/Contents/Developer/usr/bin/make emitted errors but did not return a nonzero exit code to indicate failure


    No, it isn't a problem. embedXcode is just checking the release number.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on Apr 19, 2013, 02:19 pm


    I'm getting a couple errors after my first Build on a new project.  The build is successful, so I don't know if these errors are important are not.  They are:

    /bin/sh: /usr/local/bin/wget: No such file or directory

    Command /Applications/Xcode.app/Contents/Developer/usr/bin/make emitted errors but did not return a nonzero exit code to indicate failure


    No, it isn't a problem. embedXcode is just checking the release number.


    What's strange is I just ran Build on a project I created a couple days ago, I think it was with embedXcode Release 39, and I don't get those errors.  Any idea why?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Apr 19, 2013, 02:22 pm
    The new release of the template only applies for the new projects.

    You need to copy-paste the makefiles, About and Utilities folder from the template into your existing project.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Apr 20, 2013, 12:31 pm
    Please find a new release of embedXcode

    embedXcode • Apr 19, 2013 release 42 •  Release number check

    During the first compilation of the project, a dialog box may prompt if a new release of embedXcode is available.

    (http://embedxcode.weebly.com/uploads/1/1/6/2/11624344/5386828_orig.png)

    The dialog box closes automatically after 5 seconds. Click on Go to Download to download the new release or OK to ignore it.


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

    Enjoy :)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on Apr 22, 2013, 01:20 am
    Isn't this release 43, not 42.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on Apr 22, 2013, 01:34 am
    I just downloaded the latest release, which I'm pretty sure is r45.  I created a new project on my local hard drive.  When I run Build, it says it's successful, but I get an error that says" Workspace Integrity.  Couldn't load project" and the project is not loaded.  See screenshots.

    Also, can I get previous embedxcode.pkg files on github (https://github.com/rei-vilo/embedXcode)?  If so, where?

    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Apr 22, 2013, 05:47 am
    This error arises when another process is running when you launch the first compilation with the preparation of the code.

    Quote
    3.1.1. Launch the Procedure
    To proceed with the automatic configuration procedure,
    • Select any target, as Build or Make.
    Check no other process is running on Xcode, like indexing.
    • Click on Run to launch it.


    GitHub has the history of all the versions. However, the download section only has the latest release.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on Apr 22, 2013, 06:59 am

    This error arises when another process is running when you launch the first compilation with the preparation of the code.

    Quote
    3.1.1. Launch the Procedure
    To proceed with the automatic configuration procedure,
    • Select any target, as Build or Make.
    Check no other process is running on Xcode, like indexing.
    • Click on Run to launch it.



    I just tried it again and I have the same problem. No other processes were running.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Apr 22, 2013, 07:19 am
    Is it the same error you were experiencing before due to a volume on a network?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on Apr 22, 2013, 01:37 pm

    Is it the same error you were experiencing before due to a volume on a network?


    No.  Plus I'm doing this on my local disk
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Apr 22, 2013, 03:55 pm
    This error arises when another process is running, as indexing in Xcode, when you launch the first compilation with the preparation of the code.

    The project preparation is now done after the end of the first compilation, to avoid such a conflict.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on Apr 22, 2013, 06:35 pm

    This error arises when another process is running, as indexing in Xcode, when you launch the first compilation with the preparation of the code.

    The project preparation is now done after the end of the first compilation, to avoid such a conflict.


    But there isn't another process running when I start my build (according to the little window at the top-center of my xcode screen).  Here's what I'm doing, tell me if I'm doing something wrong.

    And I have the problem I mentioned where the project isn't loaded and won't load when I try to re-open.

    I've even tried waiting a few minutes before doing my build just to make sure, even though xcode isn't showing anything processing.

    When I do the exact same thing with release 42, it works fine.  I've even reinstalled release 42, made sure it worked then installed release 45 again and I get this problem.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Apr 22, 2013, 07:10 pm
    The procedure you're following is the right one.

    I don't understand what's happening as I'm unable to replicate the problem on my MacBook.

    Other users with chipKIT boards run the first Build successfully.

    The issue you describe is related to the corruption of the project.pbxproj file. The project.pbxproj file becomes corrupt when two processes are dealing with it.

    As it is not another process from Xcode so it should be an external process. Do you have an anti-virus installed (I do) and some SSD caching (I don't)?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on Apr 22, 2013, 07:12 pm

    Do you have an anti-virus installed (I do) and some SSD caching (I don't)?


    No antivirus.  I don't have an SSD drive.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on Apr 22, 2013, 07:18 pm
    Can you tell me exactly where on github you have release 43 & 44 .pkg files.  I looked and couldn't find them.  Maybe it would help if we knew which release was the first on to give me this problem.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Apr 22, 2013, 07:22 pm
    The differences between releases 42 and 45 are:


    Should I be able to replicate the same issue, I would understand what's going on and work on a fix.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Apr 22, 2013, 07:24 pm

    Can you tell me exactly where on github you have release 43 & 44 .pkg files.  I looked and couldn't find them.  Maybe it would help if we knew which release was the first on to give me this problem.


    The log with all changes is available at http://github.com/rei-vilo/embedXcode/commits/master
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on Apr 22, 2013, 07:29 pm


    Can you tell me exactly where on github you have release 43 & 44 .pkg files.  I looked and couldn't find them.  Maybe it would help if we knew which release was the first on to give me this problem.


    The log with all changes is available at http://github.com/rei-vilo/embedXcode/commits/master


    Thanks.  I'll go by the dates because I see there are two files for r39 and nothing for  r42 and r44.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on Apr 23, 2013, 05:12 am


    Can you tell me exactly where on github you have release 43 & 44 .pkg files.  I looked and couldn't find them.  Maybe it would help if we knew which release was the first on to give me this problem.


    The log with all changes is available at http://github.com/rei-vilo/embedXcode/commits/master


    How do I find the .pkg file on github?  I want to download r43, but all I see is your source files, not a .pkg file.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Apr 23, 2013, 05:29 am
    GitHub only hosts the source code, not the installer package.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on Apr 23, 2013, 05:56 am

    I just downloaded the latest release, which I'm pretty sure is r45.  I created a new project on my local hard drive.  When I run Build, it says it's successful, but I get an error that says" Workspace Integrity.  Couldn't load project" and the project is not loaded.  See screenshots.


    I don't know why, but this problem is gone.  New projects are building normally now.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Apr 23, 2013, 09:29 am

    I don't know why, but this problem is gone.  New projects are building normally now.


    I'm glad it works now. Enjoy embedXcode :)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: jimaobian on Apr 26, 2013, 09:20 am
    Hi,
    I found I can't build "Marlin" in embedXcode, while in Arduino IDE, it works well. The error code is here

    Code: [Select]

    7.2-LINK: .elf < . mega2560 Builds/ .
    /Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avr-gcc -mmcu=atmega2560 -lm -Wl,--gc-sections -Os  -o Builds/embeddedcomputing.elf Builds/LocalLibrary.o Builds/main.o Builds/embeddedcomputing.a -lc
    Builds/embeddedcomputing.a(MarlinSerial.o): In function `__vector_25':
    /Users/my/Documents/Arduino/libraries/Marlin/MarlinSerial.cpp:54: multiple definition of `__vector_25'
    Builds/embeddedcomputing.a(HardwareSerial.o):/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/Arduino/HardwareSerial.cpp:118: first defined here
    Builds/embeddedcomputing.a(MarlinSerial.o):(.bss.rx_buffer+0x0): multiple definition of `rx_buffer'
    Builds/embeddedcomputing.a(HardwareSerial.o):/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/Arduino/HardwareSerial.cpp:113: first defined here
    /Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/bin/ld: Warning: size of symbol `rx_buffer' changed from 68 in Builds/embeddedcomputing.a(HardwareSerial.o) to 132 in Builds/embeddedcomputing.a(MarlinSerial.o)
    make: *** [Builds/embeddedcomputing.elf] Error 1


    Marlin rewrites the serial library, which is conflict to HardwareSerial. It's really odd why Arduino can compile it...
    How can I deal with it?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Apr 26, 2013, 09:35 am
    If Marlin rewrites HardwareSerial, edit the main makefile
    Code: [Select]
    EXCLUDE_LIBS = HardwareSerial
    as described in section 5.2.2 Exclude Librairies.

    Now, if two libraries define the same constants or variables, conflict is unavoidable.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: jimaobian on Apr 26, 2013, 10:10 am
    I have tested it, but it didn't work either. the HardwareSerial.cpp is the core of arduino instead of the library.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Apr 26, 2013, 01:48 pm
    It seems MarlinSerial also raises problems here (http://arduino.cc/forum/index.php/topic,124736.0.html), there (http://www.visualmicro.com/forums/YaBB.pl?num=1356976682) and even at GitHub (https://github.com/ErikZalm/Marlin/issues/243).

    As far as I understand, your project with the MarlinSerial library does compile with the Arduino IDE. Which release of the Arduino IDE are you using? Which Arduino board are you using?

    As a matter of facts, Arduino does a lot of things under the hood. In normal C++, if a library declares a public variable, another library can't declare the same public variable.

    Now, as I don't have the code for the MarlinSerial library, I can't be of much help.

    Try new release

    embedXcode • Apr 26, 2013 release 46 • Excluded libraries from core, application and user

    where excluded libraries include all libraries, core, application and user.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on Apr 28, 2013, 12:34 am
    I created a project in Xcode and everything works fine.  I wanted to open it in the Arduino IDE and compile it, but the problem is since main.cpp is in the same directory as my .ino file, Arduino IDE opens up main.cpp as as tab.  When I try to compile I get an error because main.cpp isn't needed by the Arduino IDE.  Any suggestion as to getting around this?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on Apr 28, 2013, 01:36 am
    I have a library called panstamp.h that won't compile in xcode.  The problem is PRR isn't defined.  It compiles fine in the Arduino IDE.   PRR is defined in Arduino's library iom328p.h
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Apr 28, 2013, 06:40 am

    I created a project in Xcode and everything works fine.  I wanted to open it in the Arduino IDE and compile it, but the problem is since main.cpp is in the same directory as my .ino file, Arduino IDE opens up main.cpp as as tab.  When I try to compile I get an error because main.cpp isn't needed by the Arduino IDE.  Any suggestion as to getting around this?


    Remember, with Xcode, you're working with true C++. The main.cpp is a standard for C++ but Arduino IDE hides it.

    The only solution is to create another folder with the name of the sketch (eg. embed1) and copy the main sketch .ino and all the .h .cpp except main.cpp.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Apr 28, 2013, 08:49 am

    I have a library called panstamp.h that won't compile in xcode.  The problem is PRR isn't defined.  It compiles fine in the Arduino IDE.   PRR is defined in Arduino's library iom328p.h


    The iom328p.h file is not an Arduino library. Instead, the iom328p.h file is part of the AVR toolchain. It is located deep under the toolchain folder.

    Code: [Select]
    /Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/avr/include/avr/iom328p.h

    embedXcode is provided with the path to the tool-chain and no specific operation is carried out concerning one specific file. It is really strange as other files are used.

    I need the code of the project to investigate and see what's happening.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on Apr 28, 2013, 02:53 pm


    embedXcode is provided with the path to the tool-chain and no specific operation is carried out concerning one specific file. It is really strange as other files are used.

    I need the code of the project to investigate and see what's happening.


    It happens when creating a new project. Just put the panstamp library in your libraries folder and create a new project and you should get the same error.  Panstamp library is located here:
    http://code.google.com/p/panstamp/downloads/detail?name=panstamp_arduino_1.0.zip&can=2&q=

    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on Apr 28, 2013, 03:08 pm

    The only solution is to create another folder with the name of the sketch (eg. embed1) and copy the main sketch .ino and all the .h .cpp except main.cpp.


    I noticed if in make.cpp, if I comment out:
    Code: [Select]
    //Sketch
    #include "MyNewProject.ino"


    it will compile in Arduino IDE. 

    This isn't a big deal to do when I need too, but I'm wondering if I can conditionally include this line with #ifdef or #ifndef.  Do you know of a defined constant that would be defined when xcode tries to compile this line, but would not be defined if the Arduino IDE compiled it?  Then I could do something like this

    Code: [Select]
    #ifdef XCODE_IS_COMPILING
    #include "MyNewProject.ino"
    #endif
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Apr 28, 2013, 03:23 pm



    embedXcode is provided with the path to the tool-chain and no specific operation is carried out concerning one specific file. It is really strange as other files are used.

    I need the code of the project to investigate and see what's happening.


    It happens when creating a new project. Just put the panstamp library in your libraries folder and create a new project and you should get the same error.  Panstamp library is located here:
    http://code.google.com/p/panstamp/downloads/detail?name=panstamp_arduino_1.0.zip&can=2&q=


    panStamp is a whole new platform and is not currently supported by Arduino.

    I'd need a couple of these boards so I can investigate and add support to them.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Apr 28, 2013, 06:04 pm
    Please find a new release of embedXcode.

    embedXcode • Apr 28, 2013 release 47 • Pre-processing variable EMBEDXCODE

    A project using embedXcode declares a pre-processing variable, EMBEDXCODE, with the release number as value.

    Code: [Select]
    EMBEDXCODE = 47

    The variable and the value are passed on to the compiler as a -D variable:

    Code: [Select]
    -DEMBEDXCODE=47

    This allows you to manage conditional #define and #include based on the IDE you use, either Xcode or one of the large Processing-based family.

    The EMBEDXCODE variable is already used in the main.cpp code file so it is only considered when compiled by Xcode, and ignored by the Processing-based IDEs.


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

    Enjoy :)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on Apr 29, 2013, 12:54 am


    panStamp is a whole new platform and is not currently supported by Arduino.

    I'd need a couple of these boards so I can investigate and add support to them.


    From the IDE perspective, it's the same as Arduino Pro or Pro Mini (3.3V, 8Mhz) w/ATmega 328.  This is the board I select in Arduino IDE when uploading to panstamp
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on Apr 29, 2013, 01:04 am

    Please find a new release of embedXcode.

    embedXcode • Apr 28, 2013 release 47 • Pre-processing variable EMBEDXCODE

    A project using embedXcode declares a pre-processing variable, EMBEDXCODE, with the release number as value.


    For projects I created with an earlier release of embedxcode, will this pre-processing variable still be set?  If not, how do I implement this feature on projects I've already created?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on Apr 29, 2013, 03:12 am
    In LocalLibrary.h I have a #include <> for a library in my sketchbook libraries folder, but I get an error that xcode can't find it.  If I remove the include from LocalLibrary.h and put it in the .ino file, it works fine.  I've spent two hours trying to figure out what I'm doing wrong - reading XCode 4 Unleashed, Google searches, but I can't figure it out.  I'll but it's something really simple.  Please help.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Apr 29, 2013, 11:27 am

    In LocalLibrary.h I have a #include <> for a library in my sketchbook libraries folder, but I get an error that xcode can't find it.  If I remove the include from LocalLibrary.h and put it in the .ino file, it works fine.  I've spent two hours trying to figure out what I'm doing wrong - reading XCode 4 Unleashed, Google searches, but I can't figure it out.  I'll but it's something really simple.  Please help.


    It is very hard to help you on a specific project and it is not the purpose of the thread.

    Just mention #include <> in both the main sketch and in the library.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Apr 29, 2013, 11:28 am


    Please find a new release of embedXcode.

    embedXcode • Apr 28, 2013 release 47 • Pre-processing variable EMBEDXCODE

    A project using embedXcode declares a pre-processing variable, EMBEDXCODE, with the release number as value.


    For projects I created with an earlier release of embedxcode, will this pre-processing variable still be set?  If not, how do I implement this feature on projects I've already created?


    embedXcode is a template, not a framework.

    So, yes, you need to update all the makefile and the main.cpp files with the new release.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Apr 29, 2013, 11:39 am



    panStamp is a whole new platform and is not currently supported by Arduino.

    I'd need a couple of these boards so I can investigate and add support to them.


    From the IDE perspective, it's the same as Arduino Pro or Pro Mini (3.3V, 8Mhz) w/ATmega 328.  This is the board I select in Arduino IDE when uploading to panstamp



    As I've said before, even if the panStamp is considered as a Arduino Pro or Pro Mini (3.3V, 8Mhz) w/ATmega 328 by the Arduino IDE, because it uses some obscure AVR library, it is a new platform for embedXcode.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Apr 29, 2013, 11:55 am
    Sorry, but I can't provide general support for Arduino.

    I strongly recommend the book Arduino Cookbook -- Recipes to Begin, Expand, and Enhance Your Projects by Michael Margolis I purchased thanks to contributions (http://embedxcode.weebly.com/contact.html).

    It reviews all the basics of Arduino, both hardware and software, and provide very interesting technical tips.

    (http://akamaicovers.oreilly.com/images/9780596802486/cat.gif)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on Apr 29, 2013, 05:34 pm

    It is very hard to help you on a specific project and it is not the purpose of the thread.

    Just mention #include <> in both the main sketch and in the library.


    I understand.  I didn't know if the LocalLibrary files embedxcode created had some special setting or something that would cause my problem.  I posted on stack overflow, so hopefully I can get it figured out.  I tried your suggestion about about putting #include in the main sketch and library, but that didn't work.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: zulkarnine on May 10, 2013, 06:17 pm
    Hi everyone, I've been recently using embedXcode for some Arduino related projects. as you all know that code sense is not an option u can get in the arduino IDE. thats why i was trying to use embedXcode as it gives you the freedom to get the code sense of Xcode along with the other functionalities in Arduino IDE.

    Now the problem I'm having is even though the standard C++ codes are recognised by Xcode, it can't yet recognise the Arduino specific codes for example in void loop(){} void is highlighted but not loop. in the same way while typing pinMo.. it's not showing any suggestions. As it was mentioned in the embedXcode tutorial, after running the automatic project configuration the code sense should work. But I couldn't figure out any solution. Am I doing something wrong or is there any little tweak i'm missing.

    Please help me solve the issue
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on May 10, 2013, 06:28 pm
    zulkarnine

    Have you tried closing and opening the project again and the procedure described on section 4.6 Re-Index the Keywords for Code-Sense?

    Strange enough, code-sense, auto-completion and arguments list are displayed usually without problem in my laptop. Now, it isn't a 100% hit because code-sense implementation changes with every Xcode release and as Apple is more than secretive about the customisation of Xcode.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on May 10, 2013, 07:29 pm
    You're having something like:

    void loop()



    Let's define then call test

    void test() {}

    void loop() {
       test();
    }




    So everything's normal  :)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: zulkarnine on May 10, 2013, 08:42 pm
    Thank you for your response, I tried re-indexing the way it was mentioned in 4.6 even ater that they don't show any color or auto-complete. pinMode or OUTPUT or Serial.print() doesn't show any sigh of auto completion. :(

    in the 2nd post the example what you mentioned is the part of standard C++ code sense, isn't it.
    like

    int  functionName(int an_example,int b_example){
           return a_example+b_example;

    }

    void main(){
          int a=10;
          int b=20;
          cout<<functionName(a,b);
    }

    in the above mentioned example we are declaring a function functionName and calling it again in the main function. so it works fine since it is standard C++ implementation. But when I try to write:

      pinMode(pinNum,HIGH);
      Serial.begin(960);
      analogWrite(13,HIGH);

    they don't show colors and I dont even get code completion suggestions. But they should be actually like this:

      pinMode(pinNum,HIGH);
      Serial.begin(960);
      analogWrite(13,HIGH);

    aren't they? Since they are declared in Arduino.h

    what i mean is the functions declared in Arduino.h are not being recognised by Xcode while i'm editing in the .ino file. It might have something to do with the Xcode version. I'm using Xcode 4.6.2. Is there anything I'm missing maybe :~
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on May 10, 2013, 08:55 pm
    Try commenting the whole Core library for code-sense section except #include "Arduino.h".

    Code: [Select]
    // Core library for code-sense
    //#if defined(WIRING) // Wiring specific
    //#include "Wiring.h"
    //#elif defined(MAPLE_IDE) // Maple specific
    //#include "WProgram.h"   
    //#elif defined(MPIDE) // chipKIT specific
    //#include "WProgram.h"
    //#elif defined(DIGISPARK) // Digispark specific
    #include "Arduino.h"
    //#elif defined(ENERGIA) // LaunchPad, FraunchPad and StellarPad specific
    //#include "Energia.h"
    //#elif defined(CORE_TEENSY) // Teensy specific
    //#include "WProgram.h"
    //#elif defined(ARDUINO) && (ARDUINO >= 100) // Arduino 1.0 and 1.5 specific
    //#include "Arduino.h"
    //#elif defined(ARDUINO) && (ARDUINO < 100) // Arduino 23 specific
    //#include "WProgram.h"
    //#else // error
    //#error Platform not defined
    //#endif
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: zulkarnine on May 10, 2013, 08:57 pm
    Thanks a lot.

    After commenting out the whole section except #include "Arduino.h"  as you mentioned it solved my problem. everything is perfect now. The code sense  has started working.

    Keep up the good work. :) :) :)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on May 10, 2013, 09:18 pm
    You're welcome!

    I'm glad it works now. It seems Xcode goes lost with many files to sort.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: DarkFlagster on May 11, 2013, 05:17 am
    I have almost the same problem as Zulkarnine, and the previous solutions didn't work for me =S

    The difference is that i have color and auto-complete code with:
      pinMode(myLED, OUTPUT);
    but i don't have with this:
      Serial.begin(960);

    =S anyway, Is there any theme to get the color equal to the arduino ide?


    in the above mentioned example we are declaring a function functionName and calling it again in the main function. so it works fine since it is standard C++ implementation. But when I try to write:

      pinMode(pinNum,HIGH);
      Serial.begin(960);
      analogWrite(13,HIGH);

    they don't show colors and I dont even get code completion suggestions. But they should be actually like this:

      pinMode(pinNum,HIGH);
      Serial.begin(960);
      analogWrite(13,HIGH);

    aren't they? Since they are declared in Arduino.h

    what i mean is the functions declared in Arduino.h are not being recognised by Xcode while i'm editing in the .ino file. It might have something to do with the Xcode version. I'm using Xcode 4.6.2. Is there anything I'm missing maybe :~

    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on May 11, 2013, 10:16 am

    I have almost the same problem as Zulkarnine, and the previous solutions didn't work for me =S

    The difference is that i have color and auto-complete code with:
      pinMode(myLED, OUTPUT);
    but i don't have with this:
      Serial.begin(960);



    As I wrote before,

    Quote
    Code-sense, auto-completion and arguments list are displayed usually without problem in my laptop.

    Now, it isn't a 100% hit because code-sense implementation changes with every Xcode release and as Apple is more than secretive about the customisation of Xcode.


    Xcode code-sense doesn't seem to be powerful enough to manage virtual functions within classes (http://www.cplusplus.com/doc/tutorial/polymorphism/). Serial.print() is a virtual function.


    =S anyway, Is there any theme to get the color equal to the arduino ide?



    Sorry, but I can't provide support for Xcode. Please refer to Xcode documentation for interface customisation.

    I strongly recommend you to refer to the book Xcode 4 Unleashed by Fritz F. Anderson I purchased thanks to contributions (http://embedxcode.weebly.com/contact.html).

    (http://embedxcode.weebly.com/uploads/1/1/6/2/11624344/9702031_orig.jpg)

    Good luck!
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on May 11, 2013, 11:20 am
    Please find a new release of embedXcode:

    embedXcode • May 04, 2013 release 48 • Compilation of main.cpp for embedxcode only
    embedXcode • May 10, 2013 release 49 • Improved code-sense for core libraries


    main.cpp has a conditional statement for compilation based on EMBEDXCODE.

    The name of the IDE is included in the pre-processing variable use for code-sense.

    (http://embedxcode.weebly.com/uploads/1/1/6/2/11624344/3407177.png?275)

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

    Enjoy :)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: wedontplay on May 11, 2013, 01:53 pm
    Hi, I'm trying to get the project configuration working but I have an error on line 16 of easyTransfer.cpp:

    _serial->print(0x06, BYTE);

    It says: "BYTE was not declared in this scope"
    What do you think it could be?

    Tx
    Gabriele
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on May 11, 2013, 03:46 pm
    I don't know. I guess BYTE isn't declared. Try using the Arduino IDE.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on May 21, 2013, 11:16 am
    Please find a new release of embedXcode

    embedXcode • May 21, 2013 release 50 • Arduino and Digispark 1.0.4 compatibility

    For the Teensy boards, embedXcode takes into account the Teensyduino installed either as a plug-in for Arduino 1.0.3, or as a stand-alone application /Applications/Teensyduino.app.

    (http://embedxcode.weebly.com/uploads/1/1/6/2/11624344/6472463_orig.png)

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

    Enjoy :)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on May 23, 2013, 05:42 pm
    Please find a new release of embedXcode.

    embedXcode • May 23, 2013 release 51 • Project configuration with user's libraries

    The automatic preparation procedure now includes the user's libraries for code-sense.

    For example, if you select Arduino Uno as board when you create a new project, all the libraries under the sketchbook/libraries folder define in the Arduino preferences are going to be included to the project.

    (http://embedxcode.weebly.com/uploads/1/1/6/2/11624344/7676676_orig.png) (http://www.weebly.com/uploads/1/1/6/2/11624344/870719_orig.png)

    When I started the embedXcode project back in January 2012, I didn't expect to reach the 51st release!

    Thank you for your support, feed-back and help you've provided me during all the development!

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

    Enjoy :)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on May 23, 2013, 06:19 pm
    Thanks for all your hard work.  Does release 51 mean we don't need to do step 3.2.1 (add user's libraries) in the manual
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on May 23, 2013, 09:09 pm

    Thanks for all your hard work. 


    You're welcome! Now the next big challenge is to update my old Mac :~. Xcode is too demanding :(.


    Does release 51 mean we don't need to do step 3.2.1 (add user's libraries) in the manual


    That's correct. No more manual procedure is required.

    However, I keep providing the manual procedures on the User Manual as they might be useful if you make important changes to a project, for example changing the platform.
    Title: Serial baud rate
    Post by: ivers on May 24, 2013, 06:55 pm
    Got this thing working. Great work!
    My only problem is how to set the baud rate of the terminal serial monitor?
    Title: Re: Serial baud rate
    Post by: avenue33 on May 24, 2013, 07:26 pm

    Got this thing working. Great work!
    My only problem is how to set the baud rate of the terminal serial monitor?



    By default, 9600.

    For another speed, see the screen documentation by typing on the Terminal
    Code: [Select]
    man screen
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on May 30, 2013, 11:45 am
    Please find a new release of embedXcode:

    embedXcode • May 28, 2013 release 52 • Project configuration stability enhancement

    It appeared the tool in charge of configuring the project generated zombies (http://embedxcode.weebly.com/1/post/2013/05/embedxcode-ghost-buster-and-zombie-chaser.html), resulting in a cryptic Segmentation fault: 11 error message. The cause has been fixed and zombies are over now.

    (http://embedxcode.weebly.com/uploads/1/1/6/2/11624344/5983901_orig.png)

    More important, I'm going to resume playing with boards, sensors and displays. As my current Mac no longer provides enough power (http://embedxcode.weebly.com/1/post/2013/05/embedxcode-back-to-boards-sensors-and-displays.html) to run Xcode smoothly,

    I plan to update my old Mac for a new one, as this year's target for contributions (http://embedxcode.weebly.com/contact.html). Obviously, I continue to maintain and support embedXcode.

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

    Enjoy :)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Jun 01, 2013, 10:16 pm
    Zulkarnine has posted a nice video about Setting-up embedXcode for Arduino, development in Mac using Xcode IDE on YouTube.

    Watch it at http://www.youtube.com/watch?v=b4lnz6ixvgU

    Thank you Zulkarnine :)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: zulkarnine on Jun 05, 2013, 08:12 am
    You are welcome  :) :) :)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Ferio on Jun 05, 2013, 10:01 am
    Xcode code-sense doesn't seem to be powerful enough to manage virtual functions within classes (http://www.cplusplus.com/doc/tutorial/polymorphism/). Serial.print() is a virtual function.
    Yes. One should not forget that Apples does not care too much about C++ in Xcode. Xcode is mainly made for C and ObjC. Although they try to make a decent C++ compiler, proper C++ code sense is clearly not their top priority.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Jun 05, 2013, 12:12 pm

    Xcode code-sense doesn't seem to be powerful enough to manage virtual functions within classes (http://www.cplusplus.com/doc/tutorial/polymorphism/). Serial.print() is a virtual function.
    Yes. One should not forget that Apples does not care too much about C++ in Xcode. Xcode is mainly made for C and ObjC. Although they try to make a decent C++ compiler, proper C++ code sense is clearly not their top priority.


    I more than agree with you! Xcode is aimed at OS X and iOS.

    Now, I'm not tied to Xcode and can consider another IDE. The tests of the makefiles were successful with NetBeans.

    I only need some help from someone knowing NetBeans well.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: matti157 on Jun 18, 2013, 10:34 pm
    thanks for this project!!  :) :)

    the site is currently in maintenance, when he comes back online?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Jun 19, 2013, 10:15 am

    thanks for this project!!  :) :)

    the site is currently in maintenance, when he comes back online?


    The maintenance only concerns the download section.

    Weebly limits the size of the file to 5 MB, and both the documentation and the installation package are larger than that.

    I'm currently assessing alternatives to Weebly.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: matti157 on Jun 22, 2013, 02:06 pm


    thanks for this project!!  :) :)

    the site is currently in maintenance, when he comes back online?


    The maintenance only concerns the download section.

    Weebly limits the size of the file to 5 MB, and both the documentation and the installation package are larger than that.

    I'm currently assessing alternatives to Weebly.


    I'm sorry, I need the latest version
    you can load it on google drive, skydrive, mega, etc. ....?
    thank you!
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: matti157 on Jun 22, 2013, 05:19 pm
    the software works perfectly, but I commented several rows in arduino robot that blocked compilation. Is this normal?

    thank you very much!
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Jun 22, 2013, 06:20 pm

    the software works perfectly, but I commented several rows in arduino robot that blocked compilation. Is this normal?

    thank you very much!


    Yes, it is.

    Actually, it depends on which lines you have commented. For example, commenting an [font=Courrier]#include "library_name.h"[/font] may raise an error if the library is required.

    Best method is trials and errors!
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Jun 27, 2013, 08:19 pm
    The next release of the User Manual is going to be an iBook available on the iBookStore.

    (http://embedxcode.weebly.com/uploads/1/1/6/2/11624344/7271155.jpg?222)

    Discover the preview (http://embedxcode.weebly.com/1/post/2013/06/embedxcode-new-user-manual-ibook-preview.html)!

    The iBook has been submitted and is currently under review and awaiting validation.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Jun 30, 2013, 12:17 pm
    Please find a new release of embedXcode

    embedXcode • Jun 30, 2013 release 55 • User Manual as E-Book

    The User Manual is now a free e-book to be available on the iBookStore, allowing a much lighter installation package. The iBook is awaiting validation.

    (http://embedxcode.weebly.com/uploads/1/1/6/2/11624344/2718278_orig.png)

    Dealing with iBooks Author has been especially painful and slow, due to my old Mac.

    As always,
    • Website: http://embedxcode.weebly.com
    • Download: http://embedxcode.weebly.com/download
    • Tutorial: http://embedxcode.weebly.com/tutorial
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: riccardobianchi on Jul 01, 2013, 08:16 pm
    Today I've downloaded and installed the release 55 of your package for Xcode (release 4.6.3) on a MBP with Mountain Lion installed (rev. 10.8.4). I'm using Arduino IDE 1.0.5 without any problems.

    I've followed instructions in Zulkarnine video's, but when I try to compile the default project, I got a lot of errors. It seems like Xcode doesn't find Arduino libraries or some project files.

    The first error is on line 38 of LocalLibrary.h:

    #include "WProgram.h"

    'WProgram.h' file not found

    but Xcode does not report any error on lines 24, 30 and 32 with the same code.

    Then, trying building the project, I got a lot of errors on file ArduinoRobot.cpp, where Xcode reports a lot of "XXXX was not declared in this scope" on line 6, 8, 18, 19, 22 and 25, as you can see in attached image

    If I comment those lines, Xcode reports the same errors in Sensors.cpp

    Any ideas or suggestions for me?
    Thanks for your time and your work.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Jul 01, 2013, 08:20 pm
    Which release of Arduino are you using: 1.0.x or 1.5.x?

    Edit the main makefile and change the line

    Code: [Select]
    EXCLUDE_LIBS = Firmata WiFi Esplora OneWire

    into

    Code: [Select]
    EXCLUDE_LIBS = Firmata WiFi Esplora OneWire Robot_Control Robot_Control/utility Robot_Motor

    Those folders include the libraries for the Arduino Robot.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Jul 01, 2013, 08:25 pm

    Today I've downloaded and installed the release 55 of your package for Xcode (release 4.6.3) on a MBP with Mountain Lion installed (rev. 10.8.4). I'm using Arduino IDE 1.0.5 without any problems.


    Thank you for the details. I'm using the same software configuration.


    I've followed instructions in Zulkarnine video's, but when I try to compile the default project, I got a lot of errors. It seems like Xcode doesn't find Arduino libraries or some project files.

    The first error is on line 38 of LocalLibrary.h:

    #include "WProgram.h"

    'WProgram.h' file not found

    but Xcode does not report any error on lines 24, 30 and 32 with the same code.



    Lines 38 et sq. are only called if the Arduino release is prior to 1.0, i.e. 23:

    Code: [Select]
    #elif defined(ARDUINO) && (ARDUINO < 100)  // Arduino 23 specific
    #include "WProgram.h"


    I don't experience any error with the pre-processing statements with the same software configuration.


    Then, trying building the project, I got a lot of errors on file ArduinoRobot.cpp, where Xcode reports a lot of "XXXX was not declared in this scope" on line 6, 8, 18, 19, 22 and 25, as you can see in attached image

    If I comment those lines, Xcode reports the same errors in Sensors.cpp

    Any ideas or suggestions for me?
    Thanks for your time and your work.


    Please refer to my previous post for the solution.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: riccardobianchi on Jul 01, 2013, 08:41 pm
    Thank you very much for your answer!

    The error in LocalLibrary.h is still present, but is not a problem.

    Now all things works fine.
    Is it possible to modify makefile for all future new projects?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Jul 01, 2013, 08:44 pm
    Sure, I plan to release a new version with the fix.

    I'm still waiting for the e-book to be validated...
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Jul 01, 2013, 11:07 pm
    Please find a new release of embedXcode

    embedXcode • Jul 02, 2013 release 56 • Stability enhancement for Arduino Robot

    The following line in the main makefile excludes the libraries of the Arduino Robot.

    Code: [Select]
    EXCLUDE_LIBS = Firmata WiFi Esplora OneWire Robot_Control Robot_Control/utility Robot_Motor

    The User Manual as an e-book is still under review for « quality assurance ».

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

    Enjoy :)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: jimaobian on Jul 10, 2013, 08:11 am
    Hi avenue33,
    There is something wrong when preparing the project with ver.57. The "External Build Tool Configuration" seems to be unchanged after the first preparation.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Jul 10, 2013, 09:09 am
    Please find a new release of embedXcode.

    • embedXcode • Jul 06, 2013 release 57 • Elapsed time for build and link
    • embedXcode • Jul 08, 2013 release 58 • Management of file names with space
    • embedXcode • Jul 10, 2013 release 59 • Stability enhancement for Doxygen

    Interim release 57 includes a measure for the elapsed time of building and linking.

    Release 58 features modifications to manage projects even if they include a space in their name or in their paths.

    However, it is strongly recommended not to use space in project and folder names.

    Release 59 improves stability for Doxygen by avoiding unrecognised characters. For example, © is changed to (c). Doxygen is the tool used for writing [urlhttp://embedxcode.weebly.com/self-document-the-project.html]documentation[/url], directly from the code into PDF, HTML and native Xcode help file formats.

    jimaobian, thank you for noticing me. Could you please check this new release solves the issue you reported?

    I want to thanks all contributors and stress the importance of your help to continue this project, as Xcode 5 and OS X Mavericks are to require updating my old Mac.

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

    Enjoy
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: rderimay on Jul 10, 2013, 05:29 pm
    I am having difficulties to use User Library files with EmbedXCode.
    I set the path in Arduino preferences (Arduino 1.5b2 finds the libs I add, letting me thing I've done this correctly)
    Bascialy, when I include a file with #include <SdFat.h> for example, it does not find it.
    Also and it may be related to my problem, when I add .cpp and .h files in a subfolder in my project, they do not get compiled either.

    Anyone a clue ?



    EDIT : Found the problem to be a space in the arduino sketchbook folder...
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Jul 10, 2013, 05:51 pm

    EDIT : Found the problem to be a space in the arduino sketchbook folder...


    Thank you for reporting the issue and for sharing the cause...

    Space in project, library, sketchbook folder names aren't recommended, as for the Arduino IDE. I've been working very hard on last releases the manage a volume name with a space...

    Anyway, avoid names with space as much as possible!
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: rderimay on Jul 10, 2013, 06:09 pm
    Now I am facing another problem when compiling.
    I want to use the SdFat Library (http://code.google.com/p/beta-lib/downloads/list)
    They define a const (uint8_t const  SD_CHIP_SELECT_PIN) at 2 different places (once in SdSpi.h and once in Sd2Card.h)
    Their examples compile without problems in Arduino IDE but not in EmbedXCode.

    Any clue ???

    Thanks !
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Jul 10, 2013, 06:42 pm
    Strange!

    If the same constant is defined twice, it should normally raise an error.

    I haven't found the SD_CHIP_SELECT_PIN definition in Sd2Card.h, only in SdSpi.h.

    Now, be cautious with the Arduino 1.5 libraries.

    Arduino 1.5 is still in beta and the libraries use a very new structure.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: rderimay on Jul 10, 2013, 07:15 pm

    Strange!

    If the same constant is defined twice, it should normally raise an error.

    I haven't found the SD_CHIP_SELECT_PIN definition in Sd2Card.h, only in SdSpi.h.

    Now, be cautious with the Arduino 1.5 libraries.

    Arduino 1.5 is still in beta and the libraries use a very new structure.


    Yes, but I have to use a DUE and so, I have to use 1.5, which is sometimes a pita...
    Line 65, you will find

    uint8_t const  SD_CHIP_SELECT_PIN = SS_PIN;
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Jul 10, 2013, 08:21 pm
    SdSpi.h line 65 = uint8_t const SD_CHIP_SELECT_PIN = SOFT_SPI_CS_PIN;

    But on Sd2Card?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Jul 10, 2013, 08:22 pm
    The User Manual for embedXcode as a free e-book is now available.

    (http://embedxcode.weebly.com/uploads/1/1/6/2/11624344/8641362_orig.jpg)

    (http://www.weebly.com/uploads/1/1/6/2/11624344/3074443_orig.png) (link) (http://itunes.apple.com/book/embedxcode/id667501748)

    Enjoy :)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: rderimay on Jul 10, 2013, 09:06 pm

    SdSpi.h line 65 = uint8_t const SD_CHIP_SELECT_PIN = SOFT_SPI_CS_PIN;

    But on Sd2Card?



    You are right. There is an old Sd2Card.h from 2009 included in the Arduino "Genuine" Libs, and this is the one file which collide with the one from the SdFat Lib from now which I am trying to use...
    Is there a way to give the user libs precedence over the arduino ones in EmbedXCode ??
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Jul 10, 2013, 09:16 pm


    Is there a way to give the user libs precedence over the arduino ones in EmbedXCode ??


    Sure, RTFM = Read the Fabulous User Manual, on chapter 4 section 2, now as an e-book.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: rderimay on Jul 10, 2013, 10:25 pm



    Is there a way to give the user libs precedence over the arduino ones in EmbedXCode ??


    Sure, RTFM = Read the Fabulous User Manual, on chapter 4 section 2, now as an e-book.


    Hi there, ok ok. It was not so easy :-) First the manual was not available until today and second you need an iPad...
    I did find one and read TFM now. Sorry for that.

    Put SD and SD/utility in EXCLUDE_LIBS and now, it works.
    Crazy isnt'it ?

    Many thanks for your help and generally for this Xcode Template !
    Once I finish my project, I will contribute you can count on me.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: jimaobian on Jul 11, 2013, 10:24 am
    Problem solved with the latest version~~

    Thank you!
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Jul 11, 2013, 10:37 am

    Put SD and SD/utility in EXCLUDE_LIBS and now, it works.
    Crazy isnt'it ?


    Yes :)


    Many thanks for your help and generally for this Xcode Template !
    Once I finish my project, I will contribute you can count on me.


    You're welcome!
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on Jul 16, 2013, 02:36 am

    The User Manual for embedXcode as a free e-book is now available.


    I downloaded the iBook in iTunes, but it says I need an ipad to read it.  I don't own an ipad.  Is there another way to read it?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Jul 16, 2013, 08:14 am


    The User Manual for embedXcode as a free e-book is now available.


    I downloaded the iBook in iTunes, but it says I need an ipad to read it.  I don't own an ipad.  Is there another way to read it?


    The next iteration of the Mac OS X due this fall is planned to feature an reader for the electronic books using Apple iBook format.

    In the meantime, I'm PM you a link to the printed manual as a PDF file.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on Jul 17, 2013, 04:32 am
    I just installed the latest version (rev 59 I think) of EmbedXcode and I'm having a couple issues.  I created a new project.  I did not add any code yet. I noticed my .ino file was still listed as txt, not C.  I ran build and I got an error on my Dallas library.  So I set USER_LIBS_LIST = 0 and tried again.  It said the build succeeded, but then it said it could not load my project because of workspace integrity.  I closed xcode and tried again to open the project, but it didn't work.  I deleted the bad project and tried it again creating a new project and I had the same result. 

    My OS is 10.7.5, My Arduino IDE ver is 1.0.5.  When I created the project I told it to use source control and my board was the Mega 2560.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Jul 17, 2013, 08:58 am

    I just installed the latest version (rev 59 I think) of EmbedXcode and I'm having a couple issues.  I created a new project.  I did not add any code yet. I noticed my .ino file was still listed as txt, not C.


    That's normal. See Chapter 2 Section 2 on the User Manual.


     I ran build and I got an error on my Dallas library.  So I set USER_LIBS_LIST = 0 and tried again.  It said the build succeeded, but then it said it could not load my project because of workspace integrity.  I closed xcode and tried again to open the project, but it didn't work.  I deleted the bad project and tried it again creating a new project and I had the same result.  

    My OS is 10.7.5, My Arduino IDE ver is 1.0.5.  When I created the project I told it to use source control and my board was the Mega 2560.


    I wasn't able to replicate the [font=Courrier]workspace integrity[/font] error on my MacBook. Are there other time-consuming processes running? as Mac OS X is a multitasking OS, processes may conflict.

    What is your Mac? Try with only Xcode launched.

    You could also try the procedure we've already discussed at http://forum.arduino.cc/index.php?topic=49956.msg1206628#msg1206628
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on Jul 17, 2013, 02:41 pm

    I wasn't able to replicate the [font=Courrier]workspace integrity[/font] error on my MacBook. Are there other time-consuming processes running? as Mac OS X is a multitasking OS, processes may conflict.

    What is your Mac? Try with only Xcode launched.

    You could also try the procedure we've already discussed at http://forum.arduino.cc/index.php?topic=49956.msg1206628#msg1206628



    I logged out of my mac and back in again to make sure nothing else was running.  I created a new project and got the same workspace integrity error. 

    I looked at the post you referenced, but I don't have an Xcode folder in my Documents folder.  So I couldn't do the terminal commands.

    I tried installing xcode rev 50 (still had it in my download folder) and created a new project and this worked fine, no errors.

    My computer is a Mac Pro with Quad-core Intel Xeon, 8GB RAM.

    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Jul 17, 2013, 02:49 pm
    I've PM-ed you to send me the log so I can investigate.

    Thank you.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on Jul 17, 2013, 02:53 pm

    I've PM-ed you to send me the log so I can investigate.

    Thank you.


    Okay.  One thing I noticed is rev 59 installer says it will use 1.9MB on my disk.  I think Rev 50 installer said it was over 6MB on disk. Seems like a big difference.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Jul 17, 2013, 03:25 pm


    I've PM-ed you to send me the log so I can investigate.

    Thank you.


    Okay.  One thing I noticed is rev 59 installer says it will use 1.9MB on my disk.  I think Rev 50 installer said it was over 6MB on disk. Seems like a big difference.


    The difference comes form the User Manual no longer included in the distribution but available separately. The Release Notes is a much more compact PDF, hence the difference of size.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Jul 18, 2013, 08:39 pm
    After two days of intensive search, the cause of the error reported by ScottG has been identified: non standard file names.

    Volume, folder or file names with space --e.g. [font=Courier]My first project.ino[/font]-- , number as first character --e.g. [font=Courier]3D_library.h[/font]--, special letters as . + ~ --e.g. [font=Courier]Wtv020sd16p.cpp~[/font]--, among other cases, raise an error with GCC and make.

    This is not specific to embedXcode.

    I've updated embedXcode to deal with those cases and plan to release it soon, but I strongly recommend to avoid the cases mentioned above.

    Needless to say I can't provide support for issues which are not related with embedXcode, as two major challenges are ahead: OS X Mavericks with Xcode 5 and Arduino 1.5 framework.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: jimaobian on Jul 29, 2013, 08:01 am
    Hi,
    Does the "Fast" Scheme disappear?
    My macbook is not powerful enough. Thus where can I find it?
    Thank you~~
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Jul 29, 2013, 09:40 am

    Hi,
    Does the "Fast" Scheme disappear?
    My macbook is not powerful enough. Thus where can I find it?
    Thank you~~


    The template has grown in complexity, making it difficult to maintain. So I've started a simplification process, removing some extras to focus on the main features.

    You can easily speed compilation by as described in chapter 4 Build and Upload the Project section 2 Manage the Libraries for Compilation on the User Manual.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: flurin on Jul 29, 2013, 11:32 am
    Hi,

    Which is the latest embedXcode release 59 or 101?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Jul 29, 2013, 11:50 am
    Latest version is 101. A new one numbered 102 is to be released later today.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: flurin on Jul 29, 2013, 12:59 pm
    Thanks avenue33 for the quick reply.
    It would be great if you could add links for the old releases.
    I wanted to install release 059 again, but I wasn't able to find it.

    Thank you for your effort, I like embedXcode.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Jul 31, 2013, 10:10 am
    Please find a new release of embedXcode.

    embedXcode • Jul 27, 2013 release 101 • Stability enhancements
    embedXcode • Jul 29, 2013 release 102 • Improved utilities


    Interim release 101 initiates the simplification process, as the template has grown in complexity, making it difficult to maintain. The idea is to focus on the main features.

    Release 102 improves the utilities for checking the availability of new releases and preparing the project with all the references.

    The User Manual is also being reviewed and is under approval.

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

    Enjoy :)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: flurin on Jul 31, 2013, 11:24 am

    Please find a new release of embedXcode.
    ....
    Enjoy :)


    I've installed Release 102 and did a quick test (Build and Upload to Arduino Mega2560 r3). So far Okay. Thanks for the new Release.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on Aug 03, 2013, 01:46 am
    Can I have two or more Arduinos plugged into my Mac and then try to upload to one of them with Xcode?  If so, how to I pick the port?  I just tried a little test:  I plugged my Mega into my Mac and nothing else.  I uploaded my sketch successfully to it.  Then I plugged in a Leonardo and tried to upload my sketch again.  The first time I tried the upload build failed. The second the upload build just hung and did nothing until I cancelled it after a few minutes.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Aug 03, 2013, 10:27 am
    embedXcode uses the first serial port found.

    You need to unplug and plug the boards it you want to upload to a specific board.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on Aug 03, 2013, 02:42 pm

    embedXcode uses the first serial port found.

    You need to unplug and plug the boards it you want to upload to a specific board.


    Thanks.  Do you have any plans to add some user control to picking USB ports? 
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Aug 03, 2013, 04:18 pm
    Thank you for your feed-back. I'll consider adding this feature.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: yagoa on Aug 03, 2013, 06:50 pm
    I am getting errors with the OneWire Library in the OneWire.h and OneWire.cpp it says oneWire was not defined. If you have any progress please let me know yagoax at gmail dot com.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Aug 03, 2013, 07:09 pm
    By default, OneWire is excluded as it raises issues with different boards.

    To include it again, edit the makefile and the line

    Code: [Select]
    EXCLUDE_LIBS = Firmata WiFi Esplora OneWire Robot_Control Robot_Control/utility Robot_Motor


    For more information, please refer to Chapter 4 Build and Upload the Project, Section 2 Manage the Libraries for Compilation, Sub-section Exclude Libraries of the User Manual.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: sbfreddie on Aug 10, 2013, 10:10 pm
    Hi:
    I followed the instructions on the You-Tube video and created a new project (Quite Nice Actually).  Then per the instructions I ran the build and the build failed with the following error:
    Error, No Application Found Stop


    What did I do wrong?

    Thanks,
    freddie
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Aug 10, 2013, 10:16 pm
    Is Arduino installed in the /Applications folder?

    See chapter 1 Install the Template section 2 Install the IDEs of the boards of the User Manual.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: sbfreddie on Aug 10, 2013, 10:32 pm
    Hi:
    I Cannot read the Users Manual because I do not possess an iPad or any other iXxx device, and iTunes will not download to my Mac.  And Yes Arduino is installed (In the usual place: Applications folder)and I have been using the Arduino IDE for about 6 months with no problems.
    Unfortunately the Arduino IDE is not very useful for larger projects.

    Thanks,
    Freddie
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Aug 10, 2013, 10:51 pm
    Please open a Terminal window and launch

    Code: [Select]
    ls /Applications/Arduino.app

    The main sections of the User Manual are available at http://embedxcode.weebly.com/tutorial
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: sbfreddie on Aug 10, 2013, 11:19 pm
    My Arduino.app was not installed in the Applications Folder, it was inside another folder that is why Xcode could not find it.
    So I just moved it to the Application Folder and its working alright for now, its time to try to make it do something now.

    I did not find the tutorial on your Website to be very useful at all, it is confusing because it does not just come out and tell you the steps you need to take to get it working.
    Perhaps putting in FAQ (Frequently Asked Questions) section would be helpful.

    Thanks,
    Freddie
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: sbfreddie on Aug 10, 2013, 11:59 pm
    Hi Again:
    Now I have started to build a Project I get 42 errors related to the following file inclusions:

    #include <OneWire.h> //These are the libs for the One-Wire interface
    #include <UTFT.h>  // We are going to use the Display instead of the monitor
    #include <SD.h>  // We also need the SD card libraries for storing the data on the disk.
    #include <Wire.h>
    #include <SPI.h>  // not used here, but needed to prevent a RTClib compile error
    #include <RTClib.h>

    Xcode does not seem to have a problem finding these files, however whenever I try to use any of the features of these files I get an error.  These work fine in the Arduino IDE with no errors.
    What is wrong now?
    Thanks,
    Freddie
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on Aug 11, 2013, 02:04 am

    Hi Again:
    Now I have started to build a Project I get 42 errors related to the following file inclusions:

    #include <OneWire.h> //These are the libs for the One-Wire interface
    #include <UTFT.h>  // We are going to use the Display instead of the monitor
    #include <SD.h>  // We also need the SD card libraries for storing the data on the disk.
    #include <Wire.h>
    #include <SPI.h>  // not used here, but needed to prevent a RTClib compile error
    #include <RTClib.h>

    Xcode does not seem to have a problem finding these files, however whenever I try to use any of the features of these files I get an error.  These work fine in the Arduino IDE with no errors.
    What is wrong now?
    Thanks,
    Freddie


    Go up a few posts (http://forum.arduino.cc/index.php?topic=49956.msg1340982#msg1340982) and it tells you how to take care of the onewire issue.  Not sure about the rest.  One issue I discovered for the user libraries (not app libraries) was that the directory name had to be the same as the library name; Arduino IDE didn't care but xcode does.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Aug 13, 2013, 04:13 pm
    Please find a new release of embedXcode

    embedXcode • Aug 10, 2013 release 103 • First release of embedXcode+

    I'm introducing a second and more elaborate version of embedXcode, embedXcode+, available soon.

    (http://embedxcode.weebly.com/uploads/1/1/6/2/11624344/9345388_orig.png)

    A new release of the User Manual as e-book is also available.

    I take this opportunity to announce that embedXcode is joining forces with Visual Micro (http://embedxcode.weebly.com/1/post/2013/08/introducing-embedxcode.html), to share experience and release exciting new features.

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

    Enjoy :)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Sep 03, 2013, 06:43 pm
    Please find a new release of embedXcode.

    embedXcode  • Sep 01, 2013 release 104 • Improved utilities
    embedXcode+ • Sep 01, 2013 release 104 • Improved utilities and select among two connected boards


    Release 104 inaugurates the new embedXcode+ edition with extended features.

    In case two similar boards are connected, for example two Arduino boards, a windows lists the connections and ask to select one:
    (http://embedxcode.weebly.com/uploads/1/1/6/2/11624344/6051142_orig.png)

    • To select the first port, press Enter, click on the button 1 or wait 10 seconds.
    • To select the second port, click on the button 2.

    This feature works with the Arduino boards and similar boards using a serial through USB connection.

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

    Enjoy :)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: rodrigozanatta on Sep 06, 2013, 10:35 pm
    Hi. Is just me that is having this problem? I just install the last Xcode and embedXcode. Than start one simple project, don't make ANY change, config to Build and press run. Than I have this error:

    In poliserial.cpp
    void pollserial::write(uint8_t c) {
    pollserial.cpp:131: Prototype for 'void pollserial::write(uint8_t)' does not match any in class 'pollserial'

    In Print.h
    virtual size_t write(uint8_t) = 0;
    Print.h:48: Candidates are: virtual size_t Print::write(uint8_t)

    size_t write(const char *str) {
    Print.h:49:  size_t Print::write(const char*)

    virtual size_t write(const uint8_t *buffer, size_t size);
    Print.h:53: virtual size_t Print::write(const uint8_t*, size_t)

    Is this a bug? All the problem is with this write function. This is just a compilation problem but I am very weak in C++ to solve it :(

    Can someone help this?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Sep 06, 2013, 10:40 pm
    In order to help, I need more information.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: rodrigozanatta on Sep 06, 2013, 10:59 pm
    Hi. Thanks for the fast answer.

    I am using the last of everything:


    I don't make ANY change from original script from your embedXcode. I just start a project and try to compile it. So I really think this is a small bug and it is not in sketch, but in "core" program.

    Where can I download an old version to see if this is the problem? This look like a problem with virtual function... I tried a lot of things and none work until now...
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Sep 06, 2013, 11:27 pm
    I did a quick search on the Arduino forum to find solutions related to this PollSerial library.

    It seems it raises problems.

    See for example Arduino to Stand-alone ATMEGA328 Communication Problem (http://forum.arduino.cc/index.php?topic=146344), among the many threads about this very library.

    I guess you have installed this library in your sketchbook.

    You need to exclude it. Please proceed as follow:



    Code: [Select]
    EXCLUDE_LIBS = pollserial OneWire Firmata WiFi Esplora OneWire Robot_Control Robot_Control/utility Robot_Motor


    For more information, please refer to Chapter 4 Build and Upload the Project, Section 2 Manage the Libraries for Compilation, Sub-section Exclude Libraries of the User Manual.



    Have you downloaded the User Manual?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: rodrigozanatta on Sep 06, 2013, 11:38 pm
    Hum... This is not library from your project? My bad... Because I am starting with Arduino and in my first try with your program I get this error, I thought this problem come from your program...

    I will try it now and see if it work :)

    And yes, I tried to read your (good) user manual. I only have to understand that this is a library from arduino :)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: rodrigozanatta on Sep 07, 2013, 12:11 am
    Sh*t... This poliserial is a sub-library from a library that I installed other day.. Because this I have no idea from were this come from (now I discovery the build log from Xcode  :smiley-red: and see the it compile every library I have, even if I not call then)..

    Only one day to discovery this small problem... =(

    If I not did this mistake, It will be "plug and play"!!

    One advice, in Solutions to Most Common Issues

    Symptom: Compilation fails.
    Solution: Create an empty library folder and try again. Than put the libraries you want and test what cause problem.

    Symptom: Compilation fails.
    Solution: Read the f*cking compilation log! It will show that the problem come from one of your library!
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Sep 07, 2013, 01:29 am
    Already in the Solutions to Most Common Issues

    Quote
    Symptom   Compilation fails.
    Solution   What are the messages in the Log navigator?
    Reference   See Error Messages
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Sep 13, 2013, 10:29 pm
    Old and new icons for embedXcode!

    (http://embedxcode.weebly.com/uploads/1/1/6/2/11624344/363011385.png)(http://embedxcode.weebly.com/uploads/1/1/6/2/11624344/9370800_orig.png)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: rodrigozanatta on Sep 14, 2013, 03:44 am
    Hi again!  the embedXcode is working very well. But, I am having problem with git and XCode. I can use a external program and it work well.

    But with Xcode, I can't do anything. It commit with out problem, but it don't make any difference and I can't see the history in the Xcode. No matter how many times I do the commit, the "A" status never change.

    This only happens with embedXCode project, if I create a "normal" project I don't see any of this problems.

    Did you know the problem or what I can do to solve it?

    This is the image:
    (http://i42.tinypic.com/fxurmw.jpg)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Sep 14, 2013, 07:12 am

    Hi again!  the embedXcode is working very well. But, I am having problem with git and XCode. I can use a external program and it work well.

    Did you know the problem or what I can do to solve it?


    I haven't been able to replicate the issue.

    Now, Xcode is performing many things under the hood, especially indexing all the libraries.

    This may have an impact on the commit process.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: rodrigozanatta on Sep 14, 2013, 08:49 pm


    I haven't been able to replicate the issue.

    Now, Xcode is performing many things under the hood, especially indexing all the libraries.

    This may have an impact on the commit process.


    Do you know how can your program affect the git? The git itself is working perfectly outside, but something between Xcode and Git are not working. I was the first to report this?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Sep 14, 2013, 09:03 pm
    The template doesn't affect the Git, except Xcode has a lot of work to perform just after the project is prepared, as references to all the libraries are added to the project.

    Yes, you're the first to report this. Congratulations!
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: rodrigozanatta on Sep 17, 2013, 05:27 am
    Something very strange is happing with my Xcode... I will try to reinstall it.

    Anyway, one last thing that I can't do is send a message to serial for debug. How can I print a single "Hello World"?

    This classic way don't work:

    Code: [Select]
    Serial.begin(9600);
    Serial.println("Hello world!"); 


    Neither the

    Code: [Select]
    printf("Hello World");

    Is this the way to do it? Or I can't send this message with your program? I try to read all your docs, but didn't find this answer. Is this one (more) problem of my Xcode, or am I missing a library?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Sep 17, 2013, 09:50 am
    The serial console appears on a separate Terminal window.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: rodrigozanatta on Sep 17, 2013, 04:27 pm

    The serial console appears on a separate Terminal window.


    Yes, I know this. So by your answer it have to work like normal... Why I have all this problem??   =(

    The console is just equal the Arduino IDE console? So I have one more problem in my Xcode...
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Sep 17, 2013, 04:36 pm
    Connect your Arduino board and open Terminal.

    Then type in
    Code: [Select]
    ls /dev/tty.usb*
    and press return.

    Result lists the available USB ports.

    Copy and post the answer.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: rodrigozanatta on Sep 17, 2013, 05:12 pm
    OK, when I connect my arduino uno and type this command I get:

    Code: [Select]
    /dev/tty.usbmodem1d11

    When I run a program, the console show

    Code: [Select]
    Last login: Tue Sep 17 12:02:04 on ttys001
    [~] screen /dev/tty.usbmodem1d11 9600


    There are a lot of new line, I don't know if it is important.

    And the last line that "Build All" console in XCode show is:

    Code: [Select]
    osascript -e 'tell application "Terminal" to do script "screen /dev/tty.usbmodem1d11 9600"'
    tab 1 of window id 210


    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Sep 17, 2013, 05:18 pm
    Code: [Select]
    screen /dev/tty.usbmodem1d11 9600

    This is the standard command to open a serial console with the device attached to port /dev/tty.usbmodem1d11 at speed 9600 bps.

    For me, everything is normal as this is the standard procedure.

    I'm sorry I can't be of much help as I don't know the specifics of your configuration.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on Sep 18, 2013, 12:13 am
    I want to update my older Xcode projects that were created with earlier versions of embedxcode so they use the latest version of embedXcode.  Do I just need to update makefile and main.cpp files with the latest embedxcode versions? 
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Sep 18, 2013, 09:21 am

    I want to update my older Xcode projects that were created with earlier versions of embedxcode so they use the latest version of embedXcode.  Do I just need to update makefile and main.cpp files with the latest embedxcode versions? 


    That's not an easy procedure as you need to copy the whole [font=Courrier]Configurations[/font] and [font=Courrier]Makefiles[/font] folders into your existing project.

    Some of the utilities and the way the project is prepared may have also changed.

    For that reason I haven't implemented the update of the existing projects.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on Sep 18, 2013, 01:53 pm
    Sounds like it would be easier to make a new project and just copy my code into it then delete the old project.  Some sort of upgrade utility would be a nice feature to add to embedxcode; especially since you make frequent updates - which is a good thing.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Elijahg on Sep 19, 2013, 01:31 am
    For anyone who is using the new Xcode 5 released today, embedXcode does a check to verify the version of Xcode that's running and fails since it's not 4.x. Since there are few internal changes in Xcode's build process, you can skip the check by adding a # infront of lines 548 and 549 in Makefiles/Step2.mk.

    Code: [Select]
    # @if [ -f $(CURDIR)/About/About.txt ]; then $(CAT) $(CURDIR)/About/About.txt; fi;
    # @if [ -f $(UTILITIES_PATH)/embedXcode_check ]; then $(UTILITIES_PATH)/embedXcode_check; fi


    Also it's probably best to keep these compiled binaries disabled since the source code is unknown, and embedXcode_check gets your serial number then chats to a PHP script. Why do you need people's serial numbers Avenue33, without their permission? That is rather unscrupulous, and there's no reason I can see that you need a binary since everything can be done within the makefile, including version checking.

    Code: [Select]
    imac:~ Elijah$ strings /Users/Elijah/Dropbox/test/Heating3.1/Utilities/embedXcode_check
    @NSt3__113basic_fstreamIcNS_11char_traitsIcEEEE
    NSt3__113basic_filebufIcNS_11char_traitsIcEEEE
    /Makefiles/Step1.mk
    grep -e '.*USER_FLAG.*:=' "
    true
    grep -e '.*TEMPLATE.*:=' "
    /Makefiles/Step2.mk
    grep -e '.*RELEASE_NOW.*:=' "
    PROJECT_FILE_PATH
    PROJECT_NAME
    ioreg -l | awk '/IOPlatformSerialNumber/ { print $4;}'
    open "
    /Utilities/serial.txt
    ports available
    ====
    ====
    : select one.
    /Utilities/TemplateIcon.icns
    port selected ====
    embedXcode_check
    ERROR
    Xcode project not found
    PRODUCT_NAME
    XCODE_VERSION_ACTUAL
    Xcode
    required,
    installed
    BOARD_TAG
    http://embedxcode.free.fr
    /Utilities/embedXcode_prepare
    message
    /release.php?tag=
    &goal=
    &ver=
    embedXcode+
    release
    Installed release is
    .php
    DOCTYPE html PUBLIC
    ==== New release
    available ====
    A new release of embedXcode is available.
    Ignore
    Go to Download
    http://www.embedXcode.weebly.com/download
    Have you contributed? Thanks!
    ==== Release
    installed ====
    ==== Message ====
    ==== End of message ====
    embedXcode is donationware.
    Contribute
    http://www.embedXcode.weebly.com/contact
    zPLR
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Sep 19, 2013, 11:21 am
    Forum server has been down for a while, hence my late answer.


    About Xcode 5

    This new version 5 of Xcode has just been released and sure, you want to play with it!

    On the first tests I conducted, all crashed, so please give me some time to update the template.

    I'm afraid you don't realise how much work the development of embedXcode requires.


    About embedXcode_check utility

    This utility checks the availability of a new release of embedXcode and that the configuration suits the embedXcode requirements, especially for the preparation of the project --adding all the references and libraries.

    To do so, it needs to read some variables from the system.


    About read and used variables

    I took a standard function that reads many variables. Actually, only a few of them are used.

    Unfortunately, I haven't erased those unused variables from the program and I understand your concern about some specific variables. They're going to be removed from the next release.

    I'm sorry if this has raised false alarm.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: flurin on Sep 19, 2013, 11:44 am
    I've just downloaded the last release supposing to get Release 105 as announced in your blog but I got Release 104.

    Is there a reason why you don't specify the release on your download page?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Sep 19, 2013, 12:44 pm
    This specific page hadn't been updated.

    It had the old icon and the link pointed to release 104.

    The page has just been updated to release 105 with the new icon.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: flurin on Sep 19, 2013, 02:37 pm
    Okay, thanks.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Sep 19, 2013, 03:22 pm
    Xcode 5 was officially released to the public and I rushed to test it.

    Existing projects created with embedXcode on Xcode 4 open with no problem, although the utilities aren't compatible with Xcode 5.

    However, creating a new project based on the embedXcode templates fails: Xcode quits unexpectedly.

    (http://embedxcode.weebly.com/uploads/1/1/6/2/11624344/697375_orig.png)

    Is it a bug due to the embedXcode templates, a bug due to this new Xcode release, or a new --and undocumented-- standard for the templates?

    I know and understand how impatient you are to play with this new release of Xcode.

    I have also to cope with the extra power this new release of Xcode requires and makes my old MacBook really slow.

    In the meantime, stick with Xcode 4 and please, give me time to investigate and work on the next release that works.

    Thank you!
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: rodrigozanatta on Sep 20, 2013, 04:34 am

    Code: [Select]
    screen /dev/tty.usbmodem1d11 9600

    This is the standard command to open a serial console with the device attached to port /dev/tty.usbmodem1d11 at speed 9600 bps.

    For me, everything is normal as this is the standard procedure.

    I'm sorry I can't be of much help as I don't know the specifics of your configuration.


    HI! Just to answer, now the serial is working! Why? I deleted every library that I don't need in makefile (in other words, I delete all library from the minimum project). Maybe some library cause the problem, maybe not. I also deleted all files that I don't need, maybe it helps.

    And now I discovery the git problem is not exclusively from your project, every project has this problem. Thanks for all the support.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Sep 20, 2013, 07:18 pm
    Please find a new release of embedXcode.

    • embedXcode • Sep 20, 2013 release 107 • Support for Xcode 5 on OS X 10.8
    • embedXcode+ • Sep 20, 2013 release 107 • Support for Xcode 5 on OS X 10.8



    (http://embedxcode.weebly.com/uploads/1/1/6/2/11624344/1379697824.jpg) (http://embedxcode.weebly.com/uploads/1/1/6/2/11624344/6593998_orig.png)

    embedXcode now supports the new Xcode 5 on OS X 10.8. Support for OS X 10.7 is deprecated

    For more details, please refer to the Release Notes.

    Thank you to the users who helped me with the implementation of Xcode 5!

    Next challenge: update my old Mac!

    Download (http://embedxcode.weebly.com/download)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Sep 20, 2013, 07:26 pm

    HI! Just to answer, now the serial is working! Why? I deleted every library that I don't need in makefile (in other words, I delete all library from the minimum project). Maybe some library cause the problem, maybe not. I also deleted all files that I don't need, maybe it helps.

    And now I discovery the git problem is not exclusively from your project, every project has this problem. Thanks for all the support.


    Thank you for the update. I'm glad it works now.

    My guess is there was a library among those you deleted that redefined the Serial port.

    I confirm the erratic behaviour of Git on Xcode, whatever the project.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: albal on Sep 30, 2013, 12:13 pm
    Hi,

    I just installed embedXcode onto a fresh Mavericks machine with Xcode 5 but I find that the syntax checking and autocomplete is not working for .ino files.  What do I need to do to have these treated as C++ files?

    Thanks,
    Al
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Sep 30, 2013, 12:40 pm
    Mavericks isn't released yet so I can't test it, sorry.

    Have you checked the related section on the User Manual?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: albal on Sep 30, 2013, 12:59 pm
    Hello,

    Thanks for the fast reply.  I'm a Mac newbie so following the guide helped.  I was missing to set "Identity and Type" to C++ Source.  Working now.

    Thanks,
    Al
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: kieferm on Oct 02, 2013, 03:23 am
    Hey,

    I am just starting out with embedXcode so I do not have any previous installations or working projects.  I installed XCode 5.0 and embedXcode 107.  When I create a new project and build, it is successful but then comes up with the "Workspace Integrity" error.  I tried the recommendation from before in this thread (and elsewhere online) to close all other projects but that did not help.  I have quit XCode completely, rebooted the computer, opened a fresh instance of XCode and a new project but I still get the error.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Oct 02, 2013, 08:40 am
    @kieferm

    This case has been already discussed. Please refer to these posts:

    http://forum.arduino.cc/index.php?topic=49956.msg1318987#msg1318987

    Quote
    I wasn't able to replicate the workspace integrity error on my MacBook. Are there other time-consuming processes running? as Mac OS X is a multitasking OS, processes may conflict.

    What is your Mac? Try with only Xcode launched.

    You could also try the procedure we've already discussed at http://forum.arduino.cc/index.php?topic=49956.msg1206628#msg1206628


    http://forum.arduino.cc/index.php?topic=49956.msg1321296#msg1321296

    Quote
    After two days of intensive search, the cause of the error reported by ScottG has been identified: non standard file names.

    Volume, folder or file names with space --e.g. My first project.ino-- , number as first character --e.g. 3D_library.h--, special letters as . + ~ --e.g. Wtv020sd16p.cpp~--, among other cases, raise an error with GCC and make.

    This is not specific to embedXcode.

    I've updated embedXcode to deal with those cases and plan to release it soon, but I strongly recommend to avoid the cases mentioned above.

    Needless to say I can't provide support for issues which are not related with embedXcode, as two major challenges are ahead: OS X Mavericks with Xcode 5 and Arduino 1.5 framework.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: jimaobian on Oct 11, 2013, 05:59 am
    Hi~~

    Have you upgrade to Mavericks? I use Mavericks GM and Xcode 5, but  code hinting seems not working.
    If I change the #include"Arduino.h" to
    #include"/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/avr/cores/arduino/Arduino.h"
    The code hinting works for the function. However Registers like "UBRRH" seem not defined so variables like "Serial" doesn't have code hinting either.

    Do you have this problem? Thank you ~~
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Oct 11, 2013, 07:44 am
    OS X Mavericks isn't released yet and I don't have a developer account so I can't test it.

    Support for Mavericks is in the roadmap and I'm waiting for the official release.

    Since you seem to have Mavericks installed on your Mac and if you aren't limited by a NDA, does the standard Arduino IDE work fine?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: jimaobian on Oct 11, 2013, 09:36 am
    Arduino IDE works fine in Mavericks, as it is based on Java~~
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Oct 11, 2013, 11:07 am

    Arduino IDE works fine in Mavericks, as it is based on Java~~


    I don't understand the point very well: Java is for the Arduino IDE only, not for compilation.

    Compilation, including building and linking, is done by the GNU GCC tool-chain, which is also used by embedXcode.

    Since you have Mavericks GM, I guess you're a registered Apple developer, so you have access to the full technical support. Could you please investigate on what has changed between OS X 10.8 and 10.9 that raises the issue you've reported?

    Thank you for your help!

    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: jimaobian on Oct 14, 2013, 07:36 am
    Hi~~

    I've tried my best to find the solution. However there aren't any issues about it. 
    I also ask my colleague with 3 years IOS development about this problem, but he is not familiar with external environment configuration.

    I'm Sorry...
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Oct 14, 2013, 08:02 am
    Thank you for investigating.

    When OS X Mavericks is officially released, I'll give a look at that issue.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Oct 17, 2013, 12:44 pm
    Please find a new release of embedXcode.

    • embedXcode  • Oct 12, 2013 release 108 • Support for Arduino Uno USBtinyISP
    • embedXcode+ • Oct 12, 2013 release 108 • Support for Arduino Uno USBtinyISP and improved update management


    (http://embedxcode.weebly.com/uploads/1/1/6/2/11624344/875633_orig.png)

    The embedXcode+ edition brings an improved update management for future release. The improved update management allows to update the projects when a new release of the template is available. This applies for project initially created with release 108, for example with next release 109 of the template.

    Download (http://embedxcode.weebly.com/download.html)

    Happy coding :)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on Oct 17, 2013, 02:09 pm
    Just so I'm clear on updating projects to the latest embedxcode version - if my project is rev 108 or higher, then when new versions of embedxcode come out, I can update that project to the latest embedxcode version.  But projects 107 or lower are not updatable, is that correct?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Oct 17, 2013, 03:06 pm

    Just so I'm clear on updating projects to the latest embedxcode version - if my project is rev 108 or higher, then when new versions of embedxcode come out, I can update that project to the latest embedxcode version.  But projects 107 or lower are not updatable, is that correct?


    That's correct.

    Starting release 108, the template includes a utility to manage and update the projects created with it.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on Oct 17, 2013, 03:25 pm
    Any chance you'll come out with a way to upgrade projects that are on rev 106?  My Mac is too old to install Mountain Lion, so I can't use any version of embedxcode after 106.  But someday I'll get a new computer and it would be nice if there was an update option available to me.  Or could you come out with a version of 108 that will work on OSX 10.7 with Xcode 4?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Oct 17, 2013, 03:53 pm
    I understand your concern.

    The real problem is managing different editions x versions x platforms:


    My idea was to focus on Xcode 5 on 10.8 Mountain Lion and 10.9 Mavericks. I'll see what I can do for an updated version of  embedXcode+ Legacy for Xcode 4 on Mac OS X 10.7 Lion and 10.8 Mountain Lion.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on Oct 17, 2013, 04:17 pm
    That would be great.  I wouldn't expect you to keep coming out with 2 flavors every time, one for xcode 4 and another for xcode 5.  I would just like there to be an update path for those of us stuck on older hardware and software.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on Oct 20, 2013, 10:13 pm
    How do I download embedXcode+Legacy?  It's not available under the no donation option.  BTW - I donated to this project last April.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on Oct 22, 2013, 12:48 am
    I just installed EmbedXcode+Legacy.  My project successfully compiled when I ran "Build", but I am getting this error:

    Code: [Select]

    embedXcode+ • Oct 20, 2013 release 106 • Legacy for Xcode 4 on Mac OS X 10.7 or 10.8

    grep: /Users/Scott/Library/Developer/Xcode/Templates/Project Template/embedXcode+/embedXcode+
    Sketch.xctemplate/Makefiles/Step2.mk: No such file or directory


    I checked and this directory (/Users/Scott/Library/Developer/Xcode/Templates/Project Template/embedXcode+/embedXcode+)
    does not exist.  This seems like a directory embedxode should create.  What should I do?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Oct 22, 2013, 09:54 am
    I've sent you an updated version of embedXcode Legacy.

    Quote
    When Mac OS X 10.9 Mavericks is available, the roadmap will focus on porting embedXcode and embedXcode+ to OS X 10.9. embedXcode+Legacy will be no longer maintained.


    Please understand I can't develop a specific version of embedXcode to meet one single user's needs.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Oct 24, 2013, 08:03 pm
    Please find a new release of embedXcode.



    (http://embedxcode.weebly.com/uploads/1/1/6/2/11624344/1162429_orig.png)

    Mac OS X 10.9 Mavericks allows to read User Manual as an e-book a Mac.

    Please note previous versions for Xcode 4 on Mac OS X 10.7 Lion and Mac OS X 10.8 Mountain Lion are deprecated and no longer maintained.

    embedXcode+ includes new options for the Adafruit USBtinyISP programmer (http://www.adafruit.com/products/46), including a free parameter and fuses settings.

    Happy coding :)

    Download (http://embedxcode.weebly.com/download)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: jimaobian on Oct 25, 2013, 08:27 am
    Hi,

    Does the code sense work well on your Mavericks ? Upgrading to Ver.110 did no help for me...

    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Oct 25, 2013, 09:29 am
    Strange, as code sense works fine on my Mavericks.

    Some forums are reporting issues with code sense on Xcode 5.

    I guess we'll need to wait for Xcode 5.0.1 on Mavericks 10.9.1!
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: jimaobian on Oct 25, 2013, 11:54 am
    I've updated to 5.0.1. However it doesn't work either. I even create a new account, but no help...
    Tonight I'll install a new mavericks to test whether the problem exists again~~
    I'll give you the feedback tomorrow~~

    Thank you~~
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: jimaobian on Oct 26, 2013, 01:27 pm
    Hi~~
    A good news that after re-installing the mavericks everything goes well. However I don't know the reason why?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Oct 26, 2013, 02:07 pm
    Glad to know. Thank you for your feed-back.

    I guess a clean install wipes out old files that may be conflicting.

    As usual, Apple provides no explanation and no documentation :(
    Title: No serial port with FTDI cable
    Post by: Scott216 on Nov 03, 2013, 02:26 pm
    I'm trying to upload my sketch to an Arduino Pro-Mini via the FTDI cable.  Embedxcode says it can't find the serial port.  What should I do to get it to recognize the serial port?  I'm using v106 on Mac 10.7.5
    Title: Re: No serial port with FTDI cable
    Post by: avenue33 on Nov 03, 2013, 02:37 pm

    I'm trying to upload my sketch to an Arduino Pro-Mini via the FTDI cable.  Embedxcode says it can't find the serial port.  What should I do to get it to recognize the serial port?  I'm using v106 on Mac 10.7.5


    Support for external programmers has been introduced in release 108.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on Nov 03, 2013, 04:06 pm
    Thanks.  I wish I had a new Mac now so I could use your latest version.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: colinbes on Nov 05, 2013, 09:29 pm
    I was wondering if anyone has embedXCode 111 working with Arduino IDE 1.5 on OSX Mavericks for Arduino Due, Xcode version 5.01.

    After following the install tutorial and creating a new embedxcode project (embedXcode sketch option) and selecting 'BUILD MyMac 64-bit' option. When I click the run button to build the newly created project I get an error being flagged in Audio.h regarding missing DAC.h file and build fails

    Any suggestions, anyone get this to work?

    ~Colin
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Nov 05, 2013, 10:08 pm
    Arduino 1.5.x is still in beta, hence some issues with the libraries.

    By default, embedXcode compiles all the libraries. It seems the latest release of Arduino includes libraries with issues.

    Proceed as follow:

    Code: [Select]
    APP_LIBS_LIST = 0
    USER_LIBS_LIST = 0



    Please refer to chapter 4 Build and Upload the Project section 2 Manage the Libraries for Compilation for more details.

    As I don't own an Arduino Due, I can't conduct the tests myself but the issue has been reported on other boards.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: colinbes on Nov 06, 2013, 04:13 pm
    Thanks that helped.

    I still had to manually setup the project after creating a new project, making changes to makefile and first build as the automatic updates didn't happen.

    Otherwise it's compiling and executing on target.

    I am still battling with differences between options of 'ALL' and 'BUILD' as both seem to compile, download to target and execute code - will play around a bit more.

    ~Colin


    Arduino 1.5.x is still in beta, hence some issues with the libraries.

    By default, embedXcode compiles all the libraries. It seems the latest release of Arduino includes libraries with issues.

    Proceed as follow:
    • Create a new embedXcode project.

    • Edit the makefile with

    Code: [Select]
    APP_LIBS_LIST = 0
    USER_LIBS_LIST = 0

    • Launch Build


    Please refer to chapter 4 Build and Upload the Project section 2 Manage the Libraries for Compilation for more details.

    As I don't own an Arduino Due, I can't conduct the tests myself but the issue has been reported on other boards.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Nov 06, 2013, 05:55 pm
    Strange you have to battle with manual changes on the makefiles...

    It should work fine right away out-of-the-box.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: colinbes on Nov 06, 2013, 09:05 pm
    Yes, it is a bit strange. I even tried creating a new project seeing as the automated procedure is a once only affair.

    I created a new project, manually edited lib lines in make file and then click the run icon to build.

    Build was successful, but .ino file was still associated as a plain text file, plus I had to set up other items as outlined in manual procedure.

    Colin
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: colinbes on Nov 07, 2013, 06:47 pm
    I was wondering if my embedXcode/xcode setup is correct. I am running Arduino 1.5x, Xcode 5.01 and embedXcode 1.11 on OSX Mavericks as it is building/downloading very slowly (can take a minute to compile for small code base).

    When viewing navigator I notice that under "Utilities" and "Product" I have embedXcode_prepare and "Index" showing in red - is this correct/okay?

    As reported in my earlier post that I had to manually setup Xcode as the automated procedure doesn't work so am concerned I have not configured my setup correctly.

    Please see attached showing the navigator.

    ~Colin
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Nov 08, 2013, 09:33 pm

    When viewing navigator I notice that under "Utilities" and "Product" I have embedXcode_prepare and "Index" showing in red - is this correct/okay?


    The embedXcode_prepare program prepares the project and runs only once, during the first compilation. It is deleted after.

    The Index target is a proxy target used solely for code-sense.

    Please find excerpts (http://flic.kr/s/aHsjM8L3cg) from the User Manual.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Nov 08, 2013, 09:48 pm
    Please find a new release of embedXcode.



    Mac OS X 10.9 Mavericks allows to read the User Manual as an e-book on a Mac.

    embedXcode+ supports new boards and programmers: Adafruit Atmega32u4 Breakout (http://www.adafruit.com/products/296) and Protostack 28-pin AVR boards, Adafruit USBtinyISP (http://www.adafruit.com/products/46) and Protostack USBASP programmers.

    Happy coding :)

    Download (http://embedxcode.weebly.com/download)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: jimaobian on Nov 13, 2013, 04:25 am
    Hi,
    I've just updated to embedXcode+113 in Mavericks. However when I try to create a new project ,set the USER_LIBS_LIST = 0, and build it. After successfully compile the project, all the files in the left project navigator disappear except the project file. If I click this project file ,an error diagram pops up "The file couldn't be opened".
    If I remove all the user library away, this problem will no longer exist. However if there is any library in the library folder, this problem remains.
    I turn back to the ver.110. There is no such problem in it.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Nov 13, 2013, 05:05 am

    Hi,
    I've just updated to embedXcode+113 in Mavericks. However when I try to create a new project ,set the USER_LIBS_LIST = 0, and build it. After successfully compile the project, all the files in the left project navigator disappear except the project file. If I click this project file ,an error diagram pops up "The file couldn't be opened".
    If I remove all the user library away, this problem will no longer exist. However if there is any library in the library folder, this problem remains.
    I turn back to the ver.110. There is no such problem in it.


    The utility in charge of preparing the project hasn't changed between release 110 and 113. The issue you're reporting is due to non-standard names for the folders and files of the user library --like spaces, +, ...
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: jimaobian on Nov 13, 2013, 10:30 am
    I've dealt with this problem by moving the incompatible user library before. However at this time, whatever user library I put into the library folder, the project will be lost.
    Since there is no such problem in ver.110 ,I can maintain use this version. But can you figure out the reason why?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Nov 13, 2013, 10:39 am

    I've dealt with this problem by moving the incompatible user library before. However at this time, whatever user library I put into the library folder, the project will be lost.
    Since there is no such problem in ver.110 ,I can maintain use this version. But can you figure out the reason why?


    With so few elements, it is just impossible.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: jimaobian on Nov 13, 2013, 10:49 am
    I resolved it by uninstalling it using the app under the document.

    PS:
    Perhaps you lost an 's' in the "document" folder. A new folder named "Document" is in my home folder after installation.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Nov 15, 2013, 05:31 pm
    Thanks for noticing me about the typo. Fixed :)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Namaan on Nov 20, 2013, 02:27 pm
    Hi,

    I haven't read all the thread, and the search function turns up nothing. I hope this question hasn't been asked already.

    I have to small issues using embedXcode:

    - I develop an RS-485 communication for my board (duemilanove). So naturally, I have an RS-485/USB converter plugged into my MAC. Unfortunately, wen the converter is plugged, I can't upload code to my board. embedXcode thinks the converter is my board. So I have to unplug, compile, upload, re-plug the RS-485 converter. That, in turn breaks the connection with my MAC application that I use to communicate with the board… and so on.
    Question: how do I tell embedXcode which port to use to communicate with the board?

    - I would like to test several boards (uno with ATMEGA, due with ARM processor and chip kit with PIC32). How do I add targets such as "ALL for uno", "ALL for due", and "ALL for chipkit"?

    Thank you for reading me.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Nov 20, 2013, 02:54 pm

    I have to small issues using embedXcode:

    - I develop an RS-485 communication for my board (duemilanove). So naturally, I have an RS-485/USB converter plugged into my MAC. Unfortunately, wen the converter is plugged, I can't upload code to my board. embedXcode thinks the converter is my board. So I have to unplug, compile, upload, re-plug the RS-485 converter. That, in turn breaks the connection with my MAC application that I use to communicate with the board… and so on.
    Question: how do I tell embedXcode which port to use to communicate with the board?


    On the main makefile, uncomment the line with [font=Courier]BOARD_PORT[/font] and set the exact USB port, as [font=Courier]/dev/tty.usbmodem1421[/font] in the example

    Code: [Select]
    # BOARD_PORT is optional
    # If not defined, BOARD_PORT = /dev/tty.usb* (default)
    #
    BOARD_PORT = /dev/tty.usbmodem1421


    - I would like to test several boards (uno with ATMEGA, due with ARM processor and chip kit with PIC32). How do I add targets such as "ALL for uno", "ALL for due", and "ALL for chipkit"?

    Thank you for reading me.


    Just select the board according to chapter 3 Use the Project section 3 Manage the Code for Multiple Plaforms sub-section 1 Change the Board of the User Manual (http://embedxcode.weebly.com/uploads/1/1/6/2/11624344/_7922139_orig.png).
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Namaan on Nov 20, 2013, 03:17 pm
    Thank you for your help. And thank you for the link towards the manual :)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Namaan on Dec 01, 2013, 08:33 pm
    Hi,

    I have created a new workspace, with a new project for Chipkit Uno 32. After the project was created, I launched the build phase to set everything up, just as indicated in the documentation, and I get tons of errors.

    Many are in the form:

    Quote
    relocation truncated to fit: R_MIPS_GPREL16 against `myLED'


    I am using Mpide.app version 0023.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Dec 01, 2013, 08:49 pm
    This is an Arduino forum.

    Please post at MPIDE on Xcode 4.2 (http://www.chipkit.org/forum/viewtopic.php?f=6&t=796)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Namaan on Dec 01, 2013, 09:53 pm
    Thank you for your reply.
    Sorry for the post. I was seeking help on Xcode embed project. Their official website redirects here.
    I will post my question where you told me to.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: desmondttm123 on Dec 08, 2013, 11:50 am
    hi avenue33

    i just started using embedxcode for Arduino and everything seems to work fine! but i have few questions,

    1.When including header files from Arduino, should i use Arduino.h or arduino.h ? and should it be <> or "" ?


    2.How do i use the serial monitor in Xcode? instead of using terminal, can i use the console inside Xcode?
    3.Finally, is it possible to preset the .ino file whenever it startup? cuz i don't need to include all the other header and would be nice to start with a clean layout =)

    cheers!!
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Dec 08, 2013, 03:13 pm

    1.When including header files from Arduino, should i use Arduino.h or arduino.h ? and should it be <> or "" ?


    See tutorial at http://arduino.cc/en/Hacking/LibraryTutorial


    2.How do i use the serial monitor in Xcode? instead of using terminal, can i use the console inside Xcode?


    Please refer to « Display the Serial Console on a Terminal Window » in the User Manual (https://itun.es/fr/0suYN.l).


    3.Finally, is it possible to preset the .ino file whenever it startup? cuz i don't need to include all the other header and would be nice to start with a clean layout =)


    Please refer to « Manage the Libraries for Compilation » in the User Manual (https://itun.es/fr/0suYN.l).
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: desmondttm123 on Dec 08, 2013, 04:07 pm
    alright! thanks for that =) i got my answers!
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: desmondttm123 on Dec 09, 2013, 12:22 am
    hi again, why doesn't embedxcode show an error directly? for example if i forgot to put a ' ; ' , the compiler won't notify me unless i build. is this feature available for embedxcode?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: JGuthridge on Dec 09, 2013, 02:08 am
    My builds are failing with two errors in Main.CPP

    In the #elif (ARDUINO < 150) section:

    line 304 fails: "A function-declaration is not allowed here before '{' token."
    line 319 fails: "Expected `}' at end of input."

    Any ideas?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Dec 09, 2013, 04:00 am

    hi again, why doesn't embedxcode show an error directly? for example if i forgot to put a ' ; ' , the compiler won't notify me unless i build. is this feature available for embedxcode?

    No, but once the project is compiled, clicking on an error shows the corresponding line of code.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Dec 09, 2013, 09:51 am

    My builds are failing with two errors in Main.CPP

    In the #elif (ARDUINO < 150) section:

    line 304 fails: "A function-declaration is not allowed here before '{' token."
    line 319 fails: "Expected `}' at end of input."

    Any ideas?


    Sorry, I haven't been able to replicate the issue.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: JGuthridge on Dec 10, 2013, 10:06 pm
    Looks like it has to do with the default code.  I started a new project, selected the following and commented it out, then added my current sketch.  This causes the Main.CPP to fail as previously indicated.

    As blinking the LED on pin 13 is not what I'm trying to accomplish, how much of the default code should I be leaving alone and where?

    Code: [Select]

    // Include application, user and local libraries


    // Define variables and constants
    //
    // Brief Name of the LED
    // Details Each board has a LED but connected to a different pin
    //
    uint8_t myLED;


    //
    // Brief Setup
    // Details Define the pin the LED is connected to
    //
    // Add setup code
    void setup() {
      // myLED pin number
    #if defined(__AVR_ATmega328P__) || defined(__AVR_ATmega2560__) || defined(__AVR_ATmega32U4__) || defined(__SAM3X8E__) // Arduino specific
      myLED = 13;
    #elif defined(__PIC32MX__) // chipKIT specific
      myLED = 13;
    #elif defined(__AVR_ATtinyX5__) // Digispark specific
        myLED = 1; // assuming model A
    #elif defined(__AVR_ATmega644P__) // Wiring specific
      myLED = 15;
    #elif defined(__MSP430G2452__) || defined(__MSP430G2553__) || defined(__MSP430G2231__) || defined(__MSP430F5529__)  || defined(__MSP430FR5739__) // LaunchPad MSP430 and Experimeter Board FR5739 specific
        myLED = RED_LED;
    #elif defined(__LM4F120H5QR__) || defined(__TM4C1230C3PM__) // LaunchPad Stellaris and Tiva specific
      myLED = RED_LED;
    #elif defined(MCU_STM32F103RB) || defined(MCU_STM32F103ZE) || defined(MCU_STM32F103CB) || defined(MCU_STM32F103RE) // Maple specific
      myLED = BOARD_LED_PIN;
    #elif defined(__MK20DX128__) // Teensy 3.0 specific
        myLED = 13;
    #endif

      pinMode(myLED, OUTPUT);
    }


    // Brief Loop
    // Details Blink the LED
    //
    // Add loop code
    void loop() {
      digitalWrite(myLED, HIGH);
      delay(500);
      digitalWrite(myLED, LOW);
      delay(500);
    }




    My builds are failing with two errors in Main.CPP

    In the #elif (ARDUINO < 150) section:

    line 304 fails: "A function-declaration is not allowed here before '{' token."
    line 319 fails: "Expected `}' at end of input."

    Any ideas?


    Sorry, I haven't been able to replicate the issue.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Dec 10, 2013, 10:23 pm
    What happens when you compile the templates directly without modifying them, embedXcode Local Library Project and embedXcode Sketch?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: JGuthridge on Dec 12, 2013, 08:05 pm

    What happens when you compile the templates directly without modifying them, embedXcode Local Library Project and embedXcode Sketch?


    Xcode reports good builds.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Dec 12, 2013, 08:15 pm
    Ok, great news: so your configuration is fine.

    The issue you've reported earlier comes from your sketch.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Dec 12, 2013, 09:03 pm
    Please find a new release of the User Manual, with reference for debugging and improved presentation.

    (http://embedxcode.weebly.com/uploads/1/1/6/2/11624344/_7922139_orig.png) (link) (https://itunes.apple.com/book/embedxcode/id667501748)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: JGuthridge on Dec 13, 2013, 01:28 am

    Ok, great news: so your configuration is fine.

    The issue you've reported earlier comes from your sketch.


    You evaded my question on what parts of the demo code aren't demo.

    Please consider stripping all demo code out of your next release, perhaps as a separate project type.  Trying to strip out demo code for EVERY new project is adding a level of complexity and potential building errors that might not be easy to find.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Dec 13, 2013, 08:38 am

    You evaded my question on what parts of the demo code aren't demo.

    Please consider stripping all demo code out of your next release, perhaps as a separate project type.  Trying to strip out demo code for EVERY new project is adding a level of complexity and potential building errors that might not be easy to find.


    I haven't evaded your question as it doesn't concern embedXcode but rather Arduino.

    Code: [Select]
    #include "Arduino.h"
    void setup() {
    }

    void loop() {
    }


    Please keep in mind that Xcode is a professional IDE, and thus requires a steep learning curve. I'd recommend starting first with the standard Arduino IDE and, when the framework is mastered, turn to Xcode with embedXcode. Should more advanced options be required, please consider embedXcode+.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: ForgotToGrowUp on Dec 16, 2013, 09:53 pm
    I apologise if this basic question is already andswered but I could not find it via search or through google...

    I just started using EmbedXCode (and Xcode for that matter).  I have been able to create projects and download them to my Arduino Mega, all works very nicely.  The IDE is so much nicer than the standard one.

    However, I have not figured out how to create a new project from existing code that was created in another tool.  The only way I have been able to accomplish this is to create a new project with the same name as my original sketch (.ino) and then copy/paste the code from the original script into the one created by Xcode when the project was created.

    Is it possible to point Xcode at an existing code when creating a new project?

    One reason I want to do this is I am also playing with the QM modelling tool (which is also it's own IDE), whcih generates code and I would like to be able to work with that code in Xcode.

    Thanks in advance.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Dec 16, 2013, 10:05 pm

    Is it possible to point Xcode at an existing code when creating a new project?


    This question hasn't been raised before, you're the first!

    The answer is no, as embedXcode doesn't feature an import utility.

    However, could you configure QM to output the code to a given folder?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: ForgotToGrowUp on Dec 17, 2013, 01:56 am
    I'm not sure, but I don't see how that would solve my dilemma.  QM wants to create the ino files from scratch and so does Xcode.  Plus I have a bunch of existing sketches already written in the standard IDE I would like to be able to use in Xcode.  It's frustrating needing to juggle 3 different IDEs.  If I could I would prefer to use Xcode as much as possible.

    Thanks for the quick response.

    edit:
    Also, has anyone else had issues with not being able to upload to a Mega in the standard IDE after doing an upload via Xcode?  This is happening it me.  I can upload in Xcode now but in the normal IDE I can't even upload the blink example.  I've tired quitting everything and even rebooted a few times.  Nothing seems to work.  The IDE says the device is in use


    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Dec 17, 2013, 02:50 am
    Once embedXcode has uploaded the sketch, it opens a Terminal window for the serial console.

    For the next upload, embedXcode automatically close the serial console. The Arduino IDE doesn't, hence the issue you're facing.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: ForgotToGrowUp on Dec 17, 2013, 03:07 am
    thanks again I really appreciate the help!.  but I quit the terminal program and it does not solve anything.  Is there any work around?  Is there a process I can kill or some other action?  As long as I need to juggle the IDEs this is going  to come up

    edit:  hit or miss but it seems if I quit everything and then disconnect the usb cord, restart the Arduino IDE and then reconnect the USB I can get them to talk again  Doesn't always work though.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Dec 17, 2013, 05:07 am
    Please refer to the User Manual Build at the section Upload the Project • Build and Upload • Display the Serial Console on a Terminal Window page  105.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: ForgotToGrowUp on Dec 21, 2013, 12:59 am
    I am using the QP framework libraries in my code.  The are in the arduino/libraries folder.  I can build the code in both the arduino IDE and in Xcode.  However even after the successful build in Xcode, the include statement to one of the .h files in the library has a red exclamation point next to it that says "file not found"  Because of this Xcode can not find the definition of anything defined in that file, or the ones it includes.  This seems weird because the code builds.

    Any ideas?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Dec 21, 2013, 11:33 am
    Sorry, but I'm not sure to understand your question correctly.

    Code-sense is managed by a proxy target, Index. This target may display red dots while all the other targets for production run fine.

    What's important is your sketch compiles and uploads.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: ForgotToGrowUp on Dec 23, 2013, 03:17 pm
    I understand, my confusion is probably more with Xcocde than embedXcode.  I am having lots of problems with the way Xcode deals with files in the Arduino libraries folders.  Most 3rd party libraries contain examples as well as the regular library files.  Most of my build issues are related to the build target trying to compile everything in the example directories inside the library directories.  I had one library that contained code that would not build and caused build failures in my project.  Now I am having trouble because I want to put a file in my project that has the same name as a file in one of the example directories.  MY build fails because lots of things have multiple definitions. 

    Any idea what I am doing wrong or how to tell Xcode/embedXcode not to build those examples?

    Thanks
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Dec 23, 2013, 04:06 pm
    embedXcode only compiles the main sketch in the project, here [font=Courrier]embed1.ino[/font].

    embedXcoed doesn't compile other [font=Courrier]ino[/font] files from other folders.

    I'm testing embedXcode on a regular basis with many different boards and libraries and haven't faced so far the issue you're describing.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: ForgotToGrowUp on Dec 23, 2013, 04:35 pm
    thanks, no idea what I am doing incorrectly.

    If I look in the builds directory under my project I can see that it created .d and .o for every file in the libraries directory, including all the example code.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: ForgotToGrowUp on Dec 23, 2013, 08:41 pm
    please ignore these last few posts.... I think I figured out what was going on and it was a code issue.  if it comes back I'll try to  ask again with more info

    Thanks for trying to help me.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: KasparN on Dec 30, 2013, 02:56 pm
    Hello,

    I have a big Problem with X-Code and Arduino Uno:
    if i try to send Datas to the serialport "/dev/tty*" it does NOT work, if i use the Serialport "/dev/cu*" it works...
    More Details i wrote here :

    http://forum.arduino.cc/index.php?topic=207287

    Please can anyone here help me? im freaking out :-(

    Thank you!

    Kaspar
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Dec 30, 2013, 03:25 pm
    To be sure: are you using embedXcode?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: KasparN on Dec 30, 2013, 03:44 pm
    No i am using Apple Xcode 5.0.1
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Dec 30, 2013, 04:52 pm

    No i am using Apple Xcode 5.0.1


    So I can't help you, sorry.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Fratink on Dec 31, 2013, 04:18 am
    Hello,

    I'm trying to use embedXcode for developing a project, but I can't seem to get anything to work.  I've tried using Arduino 1.5.5, 1.0.5 and I have two computers, one runing xcode 4 and another with xcode 5.  I've installed the correct versions of embedXcode, but I always end up with script errors such as these:

    ~/Documents/Arduino/libraries/VirtualWire/VirtualWire.cpp:14:22: WProgram.h: No such file or directory
    ~/Documents/Arduino/libraries/VirtualWire/VirtualWire.h:59: Variable or field 'vw_set_tx_pin' declared void

    I'd really like to use embedXcode, but I just can't get it to work.  Is there something simple that I'm missing?

    My systems are:
    Macbook Pro 15-inch, Mid 2009, 2.8 GHz Intel Core 2 Duo running 10.9.1
    Mac Pro, 2006, 2.6GHz Xeon, Running 10.7.5

    Thanks for the help!
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Dec 31, 2013, 04:28 am
    Code: [Select]
    #include "WProgram.h" is no longer valid: it was the old Arduino 0023 IDE.

    If you're using the Arduino 1.0 or 1.5 IDE, you need to specify
    Code: [Select]
    #include "Arduino.h"

    Please delete that old library and take a more recent one.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Fratink on Dec 31, 2013, 04:53 am
    avenue33,

    Thanks for the quick reply.  I'm running the default sketch you get when you create e new project.  I believe it has those includes within the #ifdef statements.  Just to be sure I added #include "Arduino.h", but there was no change.

    I've also attempted to compile for the Mega and the Uno  (by making new projects) but no change

    Also, when the dialog box saying that embedxcode is donationware, it get a bunch of what looks like html code within the box.  This happens on both computers.

    Cheers,
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Dec 31, 2013, 05:33 am
    Please refer to this post: http://forum.arduino.cc/index.php?topic=49956.msg1456956#msg1456956
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Fratink on Dec 31, 2013, 05:48 am
    avenue33, that worked perfectly!  Thank you!
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Fratink on Jan 03, 2014, 06:51 am
    Hello Again,

    I'm having a strange problem.  I'm attempting to test the SD card writing compatibility of embedXcode.  So far if i compile the sketch and upload it It will only log 5 numbers.  If I compile the same sketch in the Arduino IDE it will work fine.  I'm not certain if it's a problem with my code, my installation, or embedXcode.

    Code: [Select]

    /*
    SD card datalogger

    This example shows how to log data from three analog sensors
    to an SD card using the SD library.

    The circuit:
    * analog sensors on analog ins 0, 1, and 2
    * SD card attached to SPI bus as follows:
    ** MOSI - pin 11
    ** MISO - pin 12
    ** CLK - pin 13
    ** CS - pin 4

    created  24 Nov 2010
    modified 9 Apr 2012
    by Tom Igoe

    This example code is in the public domain.

    */
    #include <Arduino.h>
    #include <SD.h>

    // On the Ethernet Shield, CS is pin 4. Note that even if it's not
    // used as the CS pin, the hardware CS pin (10 on most Arduino boards,
    // 53 on the Mega) must be left as an output or the SD library
    // functions will not work.
    const int chipSelect = 4;

    void setup()
    {
        // make sure that the default chip select pin is set to
        // output, even if you don't use it:
        pinMode(10, OUTPUT);
    pinMode(53, OUTPUT);
       
        // see if the card is present and can be initialized:
        SD.begin(chipSelect);
    }

    void loop()
    {
    digitalWrite(13, LOW);
        // make a string for assembling the data to log:
        String dataString = "";
       
        // read three sensors and append to the string:
        for (int analogPin = 0; analogPin < 3; analogPin++) {
            int sensor = analogRead(analogPin);
            dataString += String(sensor);
            if (analogPin < 2) {
                dataString += ",";
            }
        }
       
        // open the file. note that only one file can be open at a time,
        // so you have to close this one before opening another.
        File dataFile = SD.open("datalog_xcode.txt", FILE_WRITE);
       
        // if the file is available, write to it:
        if (dataFile) {
            dataFile.println(dataString);
            dataFile.close();
            // print to the serial port too:
        }
    digitalWrite(13, HIGH);

    }


    Note:  I removed the serial terminal output to see if that was causing the problems (and because I don't need it).  It didn't change anything.

    Thanks!
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Jan 03, 2014, 07:28 am
    I don't know what could happen.

    Does the [font=Courier]SD.h[/font] include a [font=Courier]#include "Arduino.h"[/font] statement?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Fratink on Jan 04, 2014, 05:25 am
    Hello avenue33,

    I thought it a long shot, this is a rather tough problem to try and troubleshoot without seeing the actual installation and devices.  Seeing as how the code compiles I'm wondering if it's a build issue with the compiler.  I'll try it on a couple different boards I've got lying around and see if I can come up with anything more specific.  I'll post if I figure out anything.

    EDIT:
    Turns out it doesn't necessarily have anything to do with embedXcode.  If you make the string variable used in the data logging example a global variable (as opposed to local) the sketch runs, although not exactly the same.  Not sure of the cause here, might have to do with compiler settings?

    Please See: http://forum.arduino.cc/index.php?topic=105631.0 (http://forum.arduino.cc/index.php?topic=105631.0)
    End EDIT

    Thanks again,

    Fratink
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Jan 04, 2014, 10:04 am
    Thank you for the update! Glad to know it works now.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Jan 04, 2014, 01:58 pm
    Please find a new release of embedXcode.


    This cumulated release includes support for two new boards, DFRobot BLuno (http://embeddedcomputing.weebly.com/2/post/2014/01/dfrobot-bluno-ble-arduino-uno.html) and Microduino (http://embeddedcomputing.weebly.com/2/post/2014/01/microduino-10-x-11-arduino.html); updated support for the new release 11 of Energia, and improvements for the Stellaris now Tiva C Series LaunchPad.

    Happy coding :)

    Download (http://embedxcode.weebly.com/download)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Jan 16, 2014, 03:09 pm
    Want to provide feed-back and vote for the next features on embedXcode?

    Try the new feed-back page at embedxcode.idea.informer.com (http://embedxcode.idea.informer.com/).

    My plan is to proceed with an initial test for a couple of months before full implementation.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on Jan 21, 2014, 09:52 pm
    I just got a new iMac and installed EmbedXcode+ v126 and Xcode 5.   All my projects have EmbedXcode legacy.  How do I upgrade my projects to work with the new EmbedXcode+
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Jan 21, 2014, 10:13 pm

    I just got a new iMac and installed EmbedXcode+ v126 and Xcode 5.   All my projects have EmbedXcode legacy.  How do I upgrade my projects to work with the new EmbedXcode+


    Congratulations for your new Mac and welcome to embedXcode+.

    How many projects do you have?

    The automatic update of the existing projects works created starting release 108 of embedXcode+.

    I suggest the following procedure:

    After, open each project and check the libraries used are mentioned on the main makefile:
    Code: [Select]
    APP_LIBS_LIST =
    USER_LIBS_LIST =

    I'm using this procedure myself and it's fast and reliable.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on Jan 22, 2014, 10:17 pm
    When I create a new project, I see both EmbedXcode and EmbedXcode+ templates.  Is there a way to get rid of EmbedXcode.  I don't think I need it now that I have plus.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Jan 22, 2014, 10:45 pm
    Sure!

    Please refer to the manual procedure at chapter Install the Template section Install embedXcode sub-section Uninstall the Template of the User Manual.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Jan 28, 2014, 12:07 am
    I'm evaluating the Arduino Yún and its different upload and console options.

    First tests with standard USB and over-the-air upload, including Ethernet and WiFi, are successful :)

    Another major improvement is the way libraries are managed. Based on the feed-back I've received, I plan to implement a simpler way of dealing with them.

    By default, no library is included in the compilation process. Adding a library is done by

    Stay tuned!

    Learn more (http://embedxcode.weebly.com/1/post/2014/01/embedxcode-arduino-yn-with-over-the-air-upload-and-console.html) • Download (http://embedxcode.weebly.com/download.html)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Jan 29, 2014, 10:04 am
    Please find a new release of embedXcode+.

    Release 128 of embedXcode supports the Arduino Yún connected to a USB port.

    In addition, release 128 of embedXcode+ features upload and console over-the-air, through WiFi or Ethernet. The password is asked for during the process.

    (http://embedxcode.weebly.com/uploads/1/1/6/2/11624344/3514145_orig.png)

    Download (http://embedxcode.weebly.com/download)

    Happy coding :)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: ArnaudNe on Feb 01, 2014, 06:59 pm
    Hi to all of you,

    I downloaded embedXcode 129, installed it following your guide step by step, uploading is working seamlessly but I cannot get code-sense to work... The only weak workaround I found was to put Arduino.h in the Xcode "Sketchbook" group, then build the whole project.
    This solution is certainly not the best, that's why I am asking your help... I am using Xcode 5.02 or 5.1.4 (I have both, same problem) with Arduino UNO (Arduino 1.5.5 IDE) on Mavericks 10.9.1 .

    I tried :
    - Off-course I build the projects once to launch the "automatic procedure" you describe in your very detailed Guide
    - Reindex the whole project (Via project organizer as stated in your guide)
    - Only include "Arduino.h" at the top of the .ino file
    - Verify that all the projects files are present in "Project Properties" -> Targets -> Index -> "Build Phases" ->"Compile Sources"
    - Create a Library project
    - Create a Sketch project
    - Uninstalling/Reinstalling embedXcode
    - Create projects in different places on my iMac
    - Move my Arduino Sketchbook folder (It was initially in my google drive folder, I tried to put it back at its original path (~/Documents/Arduino), still didn't work)
    - Try on my second Mac (MacBook Pro on Mavericks 10.9.1, Xcode 5.0.2, Arduino 1.5.5)

    Have a look at my attachment if it can be useful.

    Thanks in advance, and thanks a lot for making this amazing tool.

    I hope you will forgive me for my english, I am french.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Feb 01, 2014, 07:11 pm
    Bonjour!

    The same question was raised at the support portal (https://app.onedesk.com/html/feedback/?cid=embedxcode#) and the solution was to include
    Code: [Select]
    #include "Arduino.h" in the main sketch.

    Maybe Xcode doesn't like conditional includes for code-sense.

    Please refer to chapter 7 Find Solutions to Issues • section 1 Compatibility on the User Manual.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: ArnaudNe on Feb 01, 2014, 07:23 pm
    Merci pour la réponse rapide!

    I already tried that, as you can see on my first attached picture, there is only "Arduino.h" included, and it still doesn't work...
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Feb 01, 2014, 07:33 pm
    Very strange, as it works fine on my MacBook...

    (https://app.onedesk.com/cware/view/21918489)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: ArnaudNe on Feb 01, 2014, 07:37 pm
    Very strange indeed... What Arduino version do you use ?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Feb 01, 2014, 07:43 pm
    Arduino 1.0.5

    Is there an anti-virus installed? Are there other power-hungry processes running?

    Indexing for code-sense on Xcode requires a lot of resources and thus can give mixed results.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: ArnaudNe on Feb 01, 2014, 09:20 pm
    There is no antivirus nor any power-hungry process...
    But what I find weird is that if I put "Arduino.h" in the Sketchbook group in Xcode it works (at least with the Arduino.h prototypes)

    I will try with 1.0.5 and get back to you !
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Feb 01, 2014, 09:24 pm
    If which folder Arduino.app is installed?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: ArnaudNe on Feb 01, 2014, 10:36 pm
    It is installed in /Applications/

    I just tried with 1.0.5, same problem :(
    On both of my computers.

    I'm lost!
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Feb 01, 2014, 10:41 pm
    So am I :(
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: ArnaudNe on Feb 02, 2014, 10:31 am
    What libraries have you put in "Sketchbook/Libraries"? Only user libraries and no core libraries?

    Update :
    I got it working on the Guest account of the MacBook!
    Something must be broken with my Xcode, on both of my Macs. I will try a clean install of Xcode.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Feb 02, 2014, 03:51 pm
    Glad to know it worked for you and the cause was external to embedXcode :)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: ArnaudNe on Feb 02, 2014, 08:51 pm
    Yep but it still does not work on my main account !! Still investigating (Clean Xcode install did not change anything), I am now trying a full and clean Mavericks reinstall... (Yes I am - very - determined to make embedXcode work perfectly on my computers, it looks so great!!)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Feb 02, 2014, 08:56 pm
    I recommend installing the Arduino 1.0.5 release as the 1.5.5 is still in beta.

    Don't forget to launch the Arduino IDE once and define the sketchbook folder.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: ArnaudNe on Feb 02, 2014, 09:12 pm
    Good news!
    After a clean install of  OSX Mavericks 10.9.2, without installing any other application than Xcode 5.0.2, Arduino 1.0.5 and embedXcode 129, all is working like a charm.

    I still do not know what caused the problem to happen on both of my Macs, could it be related to a sketchbook folder placed in a DropBox or Google Drive folder ? Or could it be related to the coexistence of both Xcode 5.0.2 and 5.1?4 ?

    I am now reinstalling Dropbox and drive client applications, I keep my finger crossed...
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Feb 02, 2014, 10:04 pm
    Maybe Xcode 5.1. As it isn't yet available, I haven't tested embedXcode on it.

    I don't know how shared folders like DropBox and Google Drive manage files authorisations.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: ArnaudNe on Feb 03, 2014, 12:52 am
    Ok, I found a really interesting bug...
    I will try to be as clear as possible.

    I have on my iMac all the Adobe CS6 Master Collection installed, that makes a lot of applications beginning by the letter "A" in my Applications folder.

    I launch Xcode and create a new embedXcode sketch project, build it once (Build Succeeded), delete all includes but "Arduino.h". (Code-sense doesn't work at this point).
    I then select "Index" in the scheme menu and "Run" (I know that Index is not meant to be used, but it permitted me to find from where the error was coming from) of course it does not compile but when I look at the errors I can see that the first in the list explains that "Arduino.h" could not be found.

    When I follow the exact same procedure on my MacBook (where I got code-sense working), it does find "Arduino.h".

    Now I look at the second error in the list and on my iMac it is :
    Code: [Select]
    Argument list too long: recursive header expansion failed at /Applications/Adobe Dreamweaver CS6/Configuration/Snippets/~Deprecated/Form_Elements/DropDownMenus.

    On my MacBook (where code sense is working) it is
    Code: [Select]
    Argument list too long: recursive header expansion failed at /Applications/iMovie.app/Contents/PlugIns/MediaProviders/MotionEffect.fxp/Contents/Resources.

    Comparing those two errors leaded me to the hypothesis that "Arduino.h" on my iMac could not be found because the "Recursive header expansion" failed before analyzing "Arduino.app" since it failed in "Adobe Dreamweaver CS6", and so it could not find any core library as Arduino.h.
    So, to test if I was right, I moved all of CS6 applications to a folded named "Z".
    I followed the exact same procedure as before, and when I looked again at the errors the one saying that "Arduino.h could not be found" did disappeared.
    The second error had also changed, and the "Recursive header expansion" failed during analyzing an app which is alphabetically after Arduino.h.
    I then tried using the conventional "Build" scheme, and code-sense was working like a charm in the .ino file!

    So to recap, I think that when embedXcode searches for Arduino.h and other core libraries in large Applications folders, it can fail if the Arduino.app is too far from the beginning of the list.

    I hope I was clear enough for you to maybe resolve the bug in a later release, or I can explain in French if you prefer...

    Thanks for all of your answers, and for having built a such amazing tool, It is so useful and powerful. I am looking into getting the embedXcode+ version really soon ! ;)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Feb 03, 2014, 04:46 am
    Thus is not a bug: Index in the target menu is a proxy target.

    Quote
    The additional target Index is a proxy target solely used for code-sense. Do not launch it.


    Please refer to the user manual, chapter 4 Build and Upload the Project section 1 Select a Target.

    Have you read the User Manual? Avez-vous lu le Mode d'Emploi ?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: ArnaudNe on Feb 03, 2014, 07:02 am
    Of course I read it, and I know Index isn't meant to be used as a scheme or anything, it is only useful for code-sense to work.

    I just tried to analyze the errors when using "Index" as a scheme and it appeared that it permitted me to fix the bug.
    Please read my full answer, I tried to be as clear as possible in describing the procedure I followed to find the bug. I can explain it in French if my English is not understandable enough, (I am sorry about that).
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Feb 03, 2014, 08:56 am
    Glad to know it works now and thank you for investigating.

    Actually, Index can't compile because the MCUs used by Arduino are unknown to the Mac platform.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: ArnaudNe on Feb 03, 2014, 07:18 pm
    I'm glad I could find where the problem was coming from, and hope you can find a fix for future versions.
    I did saw several peoples having the exact same issue on the internet...

    Thanks again for the great work you provided with embedXcode.
    Just one more question, are you planning to include a "sort of debugger" as the one included in "Visual Micro" for boards like Arduino or Chipkit? I know that a true debugger is impossible to implement with those boards because they have not any hardware debugger but maybe one like the "Visual Micro" one ?

    Thanks.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Feb 03, 2014, 07:48 pm

    I'm glad I could find where the problem was coming from, and hope you can find a fix for future versions.
    I did saw several peoples having the exact same issue on the internet...


    The right place to go is the new OneDesk page (http://embedxcode.weebly.com/onedesk.html). This code-sense case was raised and solved.


    Just one more question, are you planning to include a "sort of debugger" as the one included in "Visual Micro" for boards like Arduino or Chipkit? I know that a true debugger is impossible to implement with those boards because they have not any hardware debugger but maybe one like the "Visual Micro" one ?


    Visual Micro is using a technique called code injection for providing some sort of debugging. This monopolises the serial interface and is basically the same as [font=Courier]Serial.print()[/font].

    Arduino doesn't provide any debugging facility except the [font=Courier]Serial.print()[/font]. chipKIT programmer costs USD27 and doesn't support GDB.

    To perform real debugging, a hardware debugger is required.

    As at today, the only boards featuring such built-in debugger are the LaunchPad boards from Texas Instrument:

    They are supported by Energia, a fork of Arduino, and of course by embedXcode (http://embedxcode.weebly.com) with external debugging (http://embedxcode.weebly.com/debugging.html). They share the same language and the same framework.

    Give the LaunchPad a try: they are cheaper and more powerful!
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: ArnaudNe on Feb 03, 2014, 09:30 pm
    Quote
    The right place to go is the new OneDesk page. This code-sense case was raised and solved.


    I did saw this case but the solution didn't completely resolved the problem, I can post my problem and the workaround on OneDesk page if you want me to!

    Quote
    As at today, the only boards featuring such built-in debugger are the LaunchPad boards from Texas Instrument:
    ...

    • and Stellaris LaunchPad now Tiva C LaunchPad with ARM 32-bit 256 KB flash, 32 KB RAM, 80 MHz MCU including FPU, at USD13, best value ever



    Thanks a lot for your explanations, you convinced me to look into the ARM based Tiva C Launchpad, and I bought it ! Can't wait to try it with Xcode !
    I will now look into embedXcode+, since it is required to use the debugging functions.

    Thanks again, and keep up the good work on embedXcode !
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Feb 07, 2014, 10:36 pm
    Please find a new release of embedXcode.



    Release 130 improves support for Arduino Mega2560 with Arduino 1.5.5 IDE. Release 1.5.5 of the Arduino IDE is still in beta.

    (http://embedxcode.weebly.com/uploads/1/1/6/2/11624344/4673392_orig.png)

    Release 131 improves reference indexing for code-sense.

    Happy coding :)

    Download (http://embedxcode.weebly.com/download)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Feb 19, 2014, 10:04 pm
    Please find an update of embedXcode.

    Release 1.5.5 of the Arduino IDE is still in beta and unstable. As a matter of facts, each new release of the Arduino 1.5.x IDE includes many changes, some of them undocumented.

    My advice:


    Download (http://embedxcode.weebly.com/download.html)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: jimaobian on Feb 20, 2014, 04:51 am
    Hi,
    I'm using the embedXcode+ • Feb 10, 2014 release 132 with the "embedXcode+ Example" template
    Xcode 5.0.2
    Mac OSX 10.9.1

    If the user library is updated in Xcode, the "Fast" Scheme seems not compile the changed library?

    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Feb 20, 2014, 08:14 am
    The Make and Fast targets don't compile the user libraries, only the main sketch and the local libraries.

    Please refer to the chapter Build and Upload the Project section Select a Target sub-section Faster Targets of the User Manual:

    Quote
    The second time the Make and Fast targets are launched, they only compile the main sketch and the local libraries, and link them reusing the foundation archive built previously. The Fast target also uploads and opens a serial window in Terminal.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: jimaobian on Feb 20, 2014, 01:20 pm
    I've found it in the user manual. It's greatly improved.
    I'll review it before posting next time~~
    Thank you all the same~~
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Feb 20, 2014, 01:26 pm
    You're welcome!

    If you want to work on a library, the best way is to have it on the same folder where the main sketch is located.

    This way, libraries under the user sketchbook are protected against unwanted editing.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Mar 04, 2014, 12:44 pm
    Please find a new release of embedXcode.


    Release 136 of embedXcode and embedXcode+ includes stability improvement.

    Cumulated release 136 of embedXcode+ introduces folders for local libraries (release 133) and a dedicated variable (release 134) to select among them local for compilation.

    Cumulated release 136 of embedXcode+ also improves feed-back from compilation with optional warning messages (release 135). Turned off by default, they provide useful information about possible causes of errors, for example unused variables.

    (http://www.weebly.com/uploads/1/1/6/2/11624344/4543564_orig.jpg)

    Please refer to the release notes for more details.

    Happy coding :)

    Download (http://embedxcode.weebly.com/download)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on Mar 05, 2014, 03:55 am
    I'm having problems getting the warnings feature to work.  I just installed ver 136 (I have plus).  I opened an existing project and told embedxcode to upgrade when asked.  I went into the Makefile and noticed the upgrade process did not add WARNING_OPTIONS.  So I added:
    Code: [Select]
    WARNING_OPTIONS = unused-variable unused-function unused-label unused-value
    I put it right after the #SERIAL_BAUDRATE = 19200 line.
    I created some variables that are not used and ran Build, but I didn't get any warnings.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Mar 05, 2014, 07:55 am

    I'm having problems getting the warnings feature to work.  I just installed ver 136 (I have plus).  I opened an existing project and told embedxcode to upgrade when asked.  I went into the Makefile and noticed the upgrade process did not add WARNING_OPTIONS.  So I added:
    Code: [Select]
    WARNING_OPTIONS = unused-variable unused-function unused-label unused-value


    You're right: the main makefile isn't updated because it contains specific settings to be kept, as the list of the libraries.

    I took the option not to update the makefile to save the settings.


    I put it right after the #SERIAL_BAUDRATE = 19200 line.
    I created some variables that are not used and ran Build, but I didn't get any warnings.


    Were the variables you created global or local?

    Keep in mind compilation has optimisation options to remove unused portions of the code. Those optimisation options may interfere with the warning messages. Please refer to the Using the GNU Compiler Collection Manual.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on Mar 05, 2014, 02:10 pm

    Were the variables you created global or local?


    They were local
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Mar 05, 2014, 03:12 pm
    Fixed with embedXcode+ release 137. Thank you for noticing me.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on Mar 05, 2014, 03:28 pm

    Fixed with embedXcode+ release 137. Thank you for noticing me.


    Works now, thanks!
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Mar 05, 2014, 03:31 pm


    Fixed with embedXcode+ release 137. Thank you for noticing me.


    Works now, thanks!


    Great :)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: kizzie33 on Mar 06, 2014, 01:59 am
    I've just downloaded the latest version of embedXCode, i have the latest version of Xcode and have tried version 1 and 1.5 of the Arduino library and yet everytime i try to build i end up with:

    /Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/lib/avr5/crtm328p.o:(.init9+0x0): undefined reference to `main'

    The bit that confuses me as and i'm not adding or removing anything. Im starting a new project. Hitting build as the tutorial says so it can setup and it always comes up with this? Im trying to build this for an Arduino Duo. Can anyone even point me in the right direction ? I'm assuming no one else gets this.

    Full log: http://cl.ly/text/2K0t3e3q1R32
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on Mar 06, 2014, 02:46 am

    I've just downloaded the latest version of embedXCode, i have the latest version of Xcode and have tried version 1 and 1.5 of the Arduino library and yet everytime i try to build i end up with:

    /Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/lib/avr5/crtm328p.o:(.init9+0x0): undefined reference to `main'


    Every time I create a new project using EmbedXcode, I change main.cpp to main2.cpp
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: kizzie33 on Mar 06, 2014, 03:12 am


    Every time I create a new project using EmbedXcode, I change main.cpp to main2.cpp



    Hey that worked! Thank you. Why is the main.cpp file even put there if its not meant to be there ? Bug ? Issue with updated Xcode ?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on Mar 06, 2014, 03:22 am
    Using the new feature to turn on warning messages I'm mgetting an error for this code:
    Code: [Select]
    Serial.println(F("Hello World"));
    The error is:  Only initialized variables can be placed into program memory area

    It seems the warning might be a  GCC bug (http://forum.arduino.cc/index.php?topic=107141.0) and shouldn't display at all. Regardless, is there a way to suppress this warning message?  My makefile settings are:
    Code: [Select]
    WARNING_OPTIONS = unused-variable unused-function unused-label unused-value

    I looked around on GCC Warnings Page (http://gcc.gnu.org/onlinedocs/gcc-4.6.2/gcc/Warning-Options.html#Warning-Options), but I wasn't able to figure it out.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Mar 07, 2014, 11:23 pm
    Remember, warnings are warnings, not errors.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on Mar 08, 2014, 01:16 am

    Remember, warnings are warnings, not errors.


    True, but there are a lot of these warnings in some of my sketches and it really clutters things up, making it harder to spot the other warnings.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Mar 08, 2014, 01:50 am
    From the Releases Notes

    Quote
    The [font=Courier]all[/font] option usually generates a very long list of warning messages, making the analysis difficult if not impossible. Moreover, only the 200 first messages are displayed.
    The solution consists on selecting a scope and targeting specific warnings.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on Mar 08, 2014, 02:02 pm

    The solution consists on selecting a scope and targeting specific warnings.


    I'd like to do this, but I'm not sure where to start in order to learn more about selecting a scope and targeting specific warnings.  I did some searching online but didn't find much.  Can you point me to a good resource for this?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Mar 08, 2014, 02:17 pm
    I provide two sets of examples on the Release Notes.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on Mar 10, 2014, 03:57 am
    I'm trying to upload to a Leonardo, but xcode doesn't see it.  I get this error:
    Code: [Select]

    ---- Size ----
    Binary sketch size:  21028 bytes (of a 28672 byte maximum)
    Estimated SRAM used: 1385 bytes (of a 2560 byte maximum)
    Elapsed time: 0.8 s

    ---- Reset ----
    screen -X kill
    No screen session found.

    make: [reset] Error 1 (ignored)
    sleep 1
    9.2-RESET:  <  leonardo ./ ./
    stty -f /dev/tty.usbmodem14644111 1200
    sleep 2

    ---- Upload ----
    9.3-UPLOAD:  <  leonardo ./
    /Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avrdude -D -patmega32u4 -C/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf -cavr109 -b57600 -P/dev/tty.usbmodem14644111 -Uflash:w:Builds/embeddedcomputing.hex:i

    Connecting to programmer: .avrdude: butterfly_recv(): programmer is not responding
    make: *** [raw_upload] Error 1
    Command /Applications/Xcode.app/Contents/Developer/usr/bin/make failed with exi


    I don't have any other Arduinos plugged into the serial ports.  I'm using EmbedXcode+ 137.  I have not problem uploading to the Leonardo with the Arduino IDE (v1.05)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Mar 10, 2014, 08:25 am

    I don't have any other Arduinos plugged into the serial ports.  I'm using EmbedXcode+ 137.  I have not problem uploading to the Leonardo with the Arduino IDE (v1.05)


    I was unable to replicate the issue with the exact same configuration --Arduino Leonardo, embedXcode 137, Arduino 1.0.5.

    Have you tried and pressed the RESET button?

    Please send me by mail the full Log Navigator output.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Mar 10, 2014, 01:48 pm
    Please find a new release of embedXcode.

    Download (http://embedxcode.weebly.com/download.html)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on Mar 11, 2014, 02:26 am

    I'm trying to upload to a Leonardo, but xcode doesn't see it. 


    I got xcode working with the Leonardo.  I press and release the reset button on the Leonardo.  As soon as I release the button I upload the sketch from Xcode.   My next problem is I can't get the serial monitor working in Terminal with the Leonardo.  I'll choose the Fast scheme and it opens the terminal windows, but not output from the Leonardo appears.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Mar 11, 2014, 06:12 am
    Serial ports in the Leonardo are tricky.

    See Guide to the Arduino Leonardo and Micro (http://arduino.cc/en/Guide/ArduinoLeonardoMicro?from=Guide.ArduinoLeonardo#toc3) for more details.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on Mar 11, 2014, 01:33 pm

    Serial ports in the Leonardo are tricky.
    See Guide to the Arduino Leonardo and Micro (http://arduino.cc/en/Guide/ArduinoLeonardoMicro?from=Guide.ArduinoLeonardo#toc3) for more details.


    Even with the Arduino IDE, I've seen the Leonardo over serial port behave a bit finicky.  The only real advice in the link above was to hold down the reset button then upload - which works pretty well.  This is close to what I'm doing with Xcode, but it seems that Xcode will fail right away if it doesn't see a serial port while the Arduino IDE keeps looking for a bit.  So with the Arduino IDE you can start the upload, then release the reset button.  With Xcode you have to release the reset button then upload.  Unfortunately, this doesn't seem to help with the Serial Monitor in the Terminal window issue when using Xcode.  Do you have any tips for getting this to work?  Is there anything you can change in EmbedXcode that would help?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Mar 11, 2014, 02:40 pm
    The problem with the Leonardo board is the way Serial ports are managed through USB. The latency you describe is caused by the operating system that needs to re-enumerate the USB devices. What version of Mac OS X do you have?

    I'm investigating. In the meantime, just select the target Serial to open the serial console, or even better, use the great CoolTerm terminal (http://freeware.the-meiers.org).

    (http://freeware.the-meiers.org/CoolTerm_Screenshot_Mac.png)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on Mar 11, 2014, 03:09 pm

    The problem with the Leonardo board is the way Serial ports are managed through USB. The latency you describe is caused by the operating system that needs to re-enumerate the USB devices. What version of Mac OS X do you have?


    I've got Mavericks running on a new iMac I got a month ago.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Mar 11, 2014, 03:17 pm
    Mavericks should explain the slow USB enumeration.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Mar 12, 2014, 07:46 am
    Please find a maintenance release of embedXcode.


    Thanks ScootG!

    Also, embedXcode runs fine on Xcode 5.1.

    Download (http://embedxcode.weebly.com/download.html)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on Mar 13, 2014, 01:36 pm
    I was using EmbedXCode (v1.39) with my Arduino Pro-Mini 3.3v and it was having trouble finding the serial port.  Uploading would fail right away.  So I ran "ls /dev/tty.usb*' in terminal and in the mini 3volt xcconfig file I changed

    Code: [Select]
    BOARD_PORT = /dev/tty.usbmodem*
    to
    Code: [Select]
    BOARD_PORT = /dev/tty.usbserial-AH01PAW8

    This solved the problem.  Is there a way to make EmbedXcode work better with usbmodem*?  I gather the whole serial port thing is a bit tricky.

    Also, I noticed that a few times I uploaded the sketch and Xcode said it was successful but the changes I made didn't take, so the program really didn't upload - strange.   I did see the Tx and Rx LEDs blink rapidly.  This happened when the Target was "Upload", but sometimes it worked properly on Upload.  I changed the target to "Fast" and the program was actually uploaded, but it may have been a coincidence that it worked with the Fast target. 

    I'm running on iMac with Mavericks and using Adafruit FTDI Friend (http://www.adafruit.com/products/284).   This morning I installed EmbedXcode v1.41 and had the same issue with the serial port. 
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Mar 13, 2014, 02:08 pm
    Actually, you're using an external programmer which is not supported by embedXcode+. embedXcode+ already supports the following programmers:

    Each programmer --either included in the board like in the Arduino Uno or external as the Adafruit USBtinyISP or the one you use-- has its specific address --e.g. [font=Courier]/dev/tty.usbmodem1411[/font] or [font=Courier]/dev/tty.usbserial-AH01PAW8[/font], respectively. The address is defined in the board configuration file.

    The way to handle this is to change the default [font=Courier]BOARD_PORT[/font] on the board configuration file as you did or to uncomment and specify a port after [font=Courier]BOARD_PORT[/font] on the main makefile.

    Code: [Select]
    # BOARD_PORT is optional
    # If not defined, BOARD_PORT = /dev/tty.usb* (default)
    #
    BOARD_PORT = /dev/tty.usbserial-AH01PAW8


    For more information, please refer to

    The Fast target uses the very same procedure for uploading as the All and Upload targets you may have used.

    There are too many devices --Mac, programmer, board-- and too many parameters involved --Xcode, embedXcode template, Arduino tool-chain, uploader, boot loader-- as possible causes to identify one for sure.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Mar 13, 2014, 04:11 pm
    Please find a release of embedXcode.



    This release fixes small glitches reported by the users. Thanks!

    Download (http://embedxcode.weebly.com/download.html)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on Mar 13, 2014, 07:52 pm

    The way to handle this is to change the default [font=Courier]BOARD_PORT[/font] on the board configuration file as you did or to uncomment and specify a port after [font=Courier]BOARD_PORT[/font] on the main makefile.


    Thanks.
    Are the board config files over-written when you upgrade an existing project to the latest version of EmbedXcode?


    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Mar 13, 2014, 08:10 pm

    Thanks.
    Are the board config files over-written when you upgrade an existing project to the latest version of EmbedXcode?


    You're welcome! 

    Yes, the board configuration files are going to be over-written by the upgrade.

    Hence the solution of modifying the main makefile, which is preserved from being updated.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on Mar 13, 2014, 08:32 pm

    Hence the solution of modifying the main makefile, which is preserved from being updated.


    Modifying the makefile seems like the best approach.  It would be really nice if EmbedXcode supported multiple BOARD_PORT definitions.  Embedxcode would try the first, if that failed, it would try the next, and so on.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Mar 14, 2014, 12:16 am
    embedXcode already manages multiple ports when 2 boards are connected.

    A dialog box pop-ups and asks to select which one of the 2 boards to upload the sketch to.

    (http://forum.arduino.cc/index.php?action=dlattach;topic=49956.0;attach=72974;image)

    Adding selection among multiple ports for one board would conflict with this feature.

    Hardcoding or restricting the path of the port on the main makefile is an acceptable solution.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Mar 26, 2014, 10:29 pm
    Please find a new release of embedXcode.


    Release 143 of embedXcode and embedXcode+ includes improved code-sense for libraries.

    Please refer to the release notes for more details.

    Happy coding :)

    Download (http://embedxcode.weebly.com/download)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on Mar 27, 2014, 04:09 am
    I'd like to see the Iteaduino Lite board supported by EmbedXcode
    See: http://imall.iteadstudio.com/iteaduino-lite.html

    I got a bunch of these recently and they seem pretty nice.  You can operate at 3.3v or 5v and they have lots of pads so you can solder leads right to the board.  They only cost $8. 
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Mar 27, 2014, 09:14 am
    I'm not sure adding this specific board makes sense.

    You can try the procedure Add a Configuration File for a New Board described in the User Manual.
    I recommend using the support page at http://embedxcode.weebly.com/onedesk.html
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Apr 03, 2014, 08:40 am
    I've been interviewed by Michael James of the Open Source Hardware Group.



    (http://embedxcode.weebly.com/uploads/1/1/6/2/11624344/4562357_orig.png)

    Go and listen the podcast (http://opensourcehardwaregroup.com/oshgroup-040-use-embedxcode-to-program-multiple-development-boards-with-arduino-code/)!
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Apr 06, 2014, 11:39 am
    Andy, a user of embedXcode, posted in his blog a review of the template for Xcode.


    Go and read it at Stuff Andy Makes - DIY, make, tinker, play (http://stuffandymakes.com/2014/04/05/embedxcode-a-better-way-to-develop-for-arduino-on-the-mac-using-xcode/)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: kowalski on Apr 07, 2014, 02:03 pm
    @avenue33

    With the latest Cosa update I understand that you have got the Xcode code-sense work. Does this mean that the Cosa documentation is now available as pop-up boxes? As all member functions are fully documented with the doxygen-style this would give a major advantage when learning to use the Cosa classes. Most of the Arduino/Wiring code base is not documented in this style.

    Are there any code-sense specific tags that can be used to improve documentation?

    Also does the code-sense also handle auto-completion?

    Cheers!
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Apr 07, 2014, 02:35 pm
    @kowalski

    Yes, code-sense, auto-completion and tool-tip-texts are now nicely managed by embedXcode.

    Here are two examples, taken from my review of Cosa (http://embeddedcomputing.weebly.com/cosa-an-alternative-framework-for-avr-boards.html):

    (http://embeddedcomputing.weebly.com/uploads/1/1/6/2/11624344/2026690.png?452)

    (http://embeddedcomputing.weebly.com/uploads/1/1/6/2/11624344/3514560_orig.png)

    I need to play more with Cosa before answering the other question.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: kowalski on Apr 07, 2014, 02:57 pm
    @avenue33

    This looks great and very much what I was hoping for with the Xcode platform.

    The hours of pushing an industry strength programming style, object-orientation and rich documentation is now starting to pay off. This is a quantum leap compared to the Arduino/Wiring core code base.

    Getting documentation direct and the list of member functions when typing helps a lot when learning a large object-oriented platform as Cosa.

    Nice work!

    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Apr 07, 2014, 03:14 pm

    Nice work!


    You're welcome!

    Have you considered other platforms?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: kowalski on Apr 08, 2014, 08:31 pm

    Have you considered other platforms?

    Please see my answers here (http://forum.arduino.cc/index.php?topic=150299.msg1671398#msg1671398) :)

    Cheers!
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Jabbish on Apr 18, 2014, 03:07 am
    Hello, I just started using embedxcode+ and encountered a strange situation.
    I used "Blink" sketch for trial. Build succeeded and the log didn't report any errors but the board doesn't change the behaviour (i.e. interval of the blink).
    I wondered if embedxcode didn't upload the sketch properly.
    The board is Uno and OS X 10.9.2. & Xcode 5.1.1. Arduino1.0.5 IDE can upload to the same board without a problem.
    I uploaded the "blink" from Arduino IDE first then tried to overwrite with embedxcode to see if upload is OK or not.
    But the board didn't change the interval of the blink at all.

    What could be the cause of the problem?
    I tried full path for "BOARD_PORT" in MakeFile but no change.

    The log says "avrdude: writing flash (2312 bytes):" but the size of the "embeddedcomputing.hex" file is 7kb in Finder instead.
    Does this mean it was not writing all the codes to the board?

    Any help will be appreciated. The part of the log is at the bottom.
    Jabbish.

    Code: [Select]

    ExternalBuildToolExecution All

    embedXcode
    embedXcode+
    ----------------------------------
    Embedded Computing on Xcode


    © Rei VILO, 2010-2014
    All rights reserved
    http://embedXcode.weebly.com/


    embedXcode  • Apr 16, 2014 release 148 • Fix for project name and path
    embedXcode+ • Apr 17, 2014 release 149 • Stability enhancements

    ---- Port ----
    Uploader avrdude
    AVRdude     /dev/tty.usbmodemfa131
    Programmer arduino
    Serial     /dev/tty.usbmodemfa131
    ---- Libraries ----
    . Core libraries from /Applications/Arduino
    Arduino Client HardwareSerial IPAddress Platform Print Printable Server Stream USBAPI USBCore USBDesc Udp WCharacter WString binary new wiring_private
    . Application libraries from /Applications/Arduino
    0
    . User libraries from /Users/................/Documents/Develop/Embeded/Arduino/Sketches
    0
    . Local libraries from .

    ==== Info done ====
    ==== All ====
    ---- Clean ----
    ---- Compile ----
    ---- Size ----
    Binary sketch size:  2312 bytes (of a 32256 byte maximum)

    Estimated SRAM used: 207 bytes (of a 2048 byte maximum)

    Elapsed time: 1.7 s
    ---- Reset ----
    screen -X kill
    sleep 1
    ---- Upload ----
    9.3-UPLOAD:  <   uno ./
    /Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avrdude -D -patmega328p -C/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf -carduino -b115200 -P/dev/tty.usbmodemfa131 -Uflash:w:Builds/embeddedcomputing.hex:i

    avrdude: AVR device initialized and ready to accept instructions

    Reading | ################################################## | 100% 0.00s

    avrdude: Device signature = 0x1e950f
    avrdude: reading input file "Builds/embeddedcomputing.hex"
    avrdude: writing flash (2312 bytes):

    Writing | ################################################## | 100% 0.38s

    avrdude: 2312 bytes of flash written
    avrdude: verifying flash memory against Builds/embeddedcomputing.hex:
    avrdude: load data flash data from input file Builds/embeddedcomputing.hex:
    avrdude: input file Builds/embeddedcomputing.hex contains 2312 bytes
    avrdude: reading on-chip flash data:

    Reading | ################################################## | 100% 0.30s

    avrdude: verifying ...
    avrdude: 2312 bytes of flash verified

    avrdude done.  Thank you.

    ---- Serial ----
    osascript -e 'tell application "Terminal" to do script "screen /dev/tty.usbmodemfa131 9600"'
    tab 1 of window id 223
    ==== All

    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on Apr 18, 2014, 04:48 am
    I just installed EmbedXcode+ ver 149, but when I opened a project, I was not prompted to upgrade.  I ran the Build scheme and looked at the log and it said embedxcode ver 141.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Apr 18, 2014, 07:21 am

    The board is Uno and OS X 10.9.2. & Xcode 5.1.1. Arduino1.0.5 IDE can upload to the same board without a problem.
    I uploaded the "blink" from Arduino IDE first then tried to overwrite with embedxcode to see if upload is OK or not.
    But the board didn't change the interval of the blink at all.


    That's really strange. Everything works fine on my MacBook with the very same configuration.

    Result is:

    Code: [Select]
    ---- Size ----
    Binary sketch size:  1184 bytes (of a 32256 byte maximum)
    Estimated SRAM used: 10 bytes (of a 2048 byte maximum)


    For technical issues, please use the OneDesk portal (http://embedxcode.weebly.com/onedesk.html).
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Apr 18, 2014, 07:27 am

    I just installed EmbedXcode+ ver 149, but when I opened a project, I was not prompted to upgrade.  I ran the Build scheme and looked at the log and it said embedxcode ver 141.


    It seems there's been a typo on the name of the folder for the project templates, erroneous [font=Courier]Project Template[/font] in singular instead of the correct [font=Courier]Project Templates[/font] in plural.

    To fix this,


    For technical issues, please use the OneDesk portal (http://embedxcode.weebly.com/onedesk.html).
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Jabbish on Apr 18, 2014, 11:24 pm
    avenue33

    After updated to release 150 and created a new project with the release 150, the problem has gone away.
    Thanks and regards,
    Jabbish
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on Apr 24, 2014, 04:26 am
    I just installed release 151.  I opened a project on release 148 or 149 and embedxcode+ upgraded my project.  But in the log it said it updated it to ver 150.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Apr 24, 2014, 10:12 am
    Sorry, I can't replicate the issue.

    Was the project created with embedXcode instead of embedXcode+? embedXcode release is still at 150.

    For technical issues, please use the new help portal (http://embedxcode.weebly.com/onedesk.html).
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Apr 24, 2014, 12:08 pm
    Please find a new release of embedXcode+.



    How to proceed:


    (http://embedxcode.weebly.com/uploads/1/1/6/2/11624344/6127903_orig.png)

    Please refer to the release notes for more details.

    Based on the feed-back I've received for the last couple of months, I've reconsidered the provider for the help desk (http://embedxcode.weebly.com/help-desk.html) and selected FreshDesk, with a fast, light and modern interface.

    (http://embedxcode.weebly.com/uploads/1/1/6/2/11624344/2444360.png)

    Happy coding :)

    Download (http://embedxcode.weebly.com/download)
    Title: Survey • Boards USB Ports Names
    Post by: avenue33 on Apr 27, 2014, 08:02 pm
    Each board displays a name on the USB ports for uploading the sketch and visualising the serial console.

    However, some boards take the name of the hardware USB port while other provides a specific name whatever the port there're connected too.

    Thank you very much for helping me finding the names of the USB ports.

    Take the survey for Arduino boards (http://rei-vilo.polldaddy.com/s/usb-ports-names).
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Apr 28, 2014, 10:11 am
    Please find a new release of embedXcode.



    Happy coding :)

    Download (http://embedxcode.weebly.com/download)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on May 01, 2014, 06:42 pm
    Please find a new release of embedXcode+.

    During the first compilation, embedXcode looks for the Arduino Yún board and checks the password.

    If the Arduino board isn't found on the network, a window asks for the IP address.
    (http://embedxcode.weebly.com/uploads/1/1/6/2/11624344/975051_orig.png)

    A message box asks for the password.
    (http://embedxcode.weebly.com/uploads/1/1/6/2/11624344/8621550_orig.png)

    Download (http://embedxcode.weebly.com/download.html)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on May 13, 2014, 02:28 pm
    Please find a new release of embedXcode.



    The cumulated embedXcode+ release also includes improved boards USB ports names, USB type and keyboard layout selection for Teensy, customised path for IDE applications, and optional serial console for Fast target.

    Happy coding :)

    Download (http://embedxcode.weebly.com/download)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on May 15, 2014, 10:07 am
    Please find a new release of embedXcode.

    As the Arduino IDE 1.5.6r2 is still in beta, support for this IDE remains experimental.

    Happy coding :)

    Download (http://embedxcode.weebly.com/download)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Jun 21, 2014, 10:38 am
    Please find a new release of embedXcode.



    The LightBlue Bean board is an Arduino with Bluetooth, more specifically an ATmega328P with a CC2540-based Bluetooth Low Energy or BLE radio.

    Additional Arduino boards include Arduino Pro, Mini, Nano.
    (http://forum.arduino.cc/index.php?action=dlattach;topic=49956.0;attach=85894;image)
    Happy coding :)

    Download (http://embedxcode.weebly.com/download)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: bilica on Jun 23, 2014, 07:37 pm
    Hi,

    I have managed to compile, build and upload an sketch to an Arduino Due successfully :) Yay!

    However, when if I remove it from the serial port, I am not able to compile the code anymore.

    Is this a limitation/restriction ? Do I have to have an Arduino connected to the USB in order to just compile/build the hex ?

    Thanks!
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: bilica on Jun 23, 2014, 07:41 pm
    Nevermind :)

    RTFM on page 114/115: change "Build All" to just "Build".

    Thanks!


    Hi,

    I have managed to compile, build and upload an sketch to an Arduino Due successfully :) Yay!

    However, when if I remove it from the serial port, I am not able to compile the code anymore.

    Is this a limitation/restriction ? Do I have to have an Arduino connected to the USB in order to just compile/build the hex ?

    Thanks!
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Jun 23, 2014, 08:12 pm
    :)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: bilica on Jun 23, 2014, 10:02 pm
    Hi, it is me again:

    I have followed the manual to add libraries to my sketchfolder.

    However, I still get a "no such file or directory" when including any of the libs.

    I believe the steps are:

    + add the libraries directories according to page 69;
    + define the SKETCHBOOK_DIR variable;
    + add the library name to the Makefile variable USER_LIBS_LIST;

    Is there something else I am missing ?

    Thanks for any pointers!
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Jun 23, 2014, 10:47 pm
    Does the main sketch mention #include "library_name"?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: bilica on Jun 24, 2014, 04:25 am

    Yes, I am including the library in the main sketch file (ino).

    However, calling Build (Cmd-B on a Mac) for individual targets (Build, Upload, Serial) works. 

    Calling Build for the target "All" gives a "Shell Script Invocation Error". Libname.h: no such file or directory.

    Thanks again,
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Jun 24, 2014, 12:00 pm
    That's really strange, as the target All calls Clean, Build, Upload and then Serial.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: bilica on Jun 24, 2014, 06:55 pm
    Thanks, I have just deleted everything and started from scratch and it works :)

    Another question:

    + I want to keep the code and classes organised inside subfolders on the main project directory; can I just drag and drop these folders containing classes inside the project (and tick the "index" target) ? These classes reference each other so would it be possible to configure USER_HEADER_SEARCH_PATH to include these folders for compilation ?

    Thanks again!
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Jun 24, 2014, 07:17 pm
    By default, Xcode indexes all the .h and .cpp in the folder of the main project directory. Just be sure to check the Index target when creating new ones.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: bilica on Jun 24, 2014, 09:13 pm
    Thanks avenue33,

    I believe I did not express myself properly. To better exemplify I did two tests:

    1. Drop a class (cpp and h files) inside the root directory of the xcode project (where main.ccp, Makefile and everything is). Compilation works fine.

    2. Drop a directory which contains my class files inside the root directory. Compilation does not work.

    I believe it is a problem with the search paths for the included files. Or maybe this is not supported and I need to place all cpp and h files in the root directory.

    Thanks again,


    By default, Xcode indexes all the .h and .cpp in the folder of the main project directory. Just be sure to check the Index target when creating new ones.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Jun 24, 2014, 09:24 pm
    Directories with libraries is supported in embedXcode+ but not in embedXcode.

    May I suggest you to use the help desk (http://embedxcode.weebly.com)? Attaching files and screen-shots are much easier.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: bilica on Jun 24, 2014, 09:29 pm
    Thanks avenue33, I did not notice it was limited to the + version.

    These are not Libraries but some Classes I wrote. Well, the definition of Classes and Libraries can be interchanged in this context :) So I guess it apply to Classes inside directories as well ?

    Do you plan to support Xcode 6 when it comes out ?

    Thanks again,
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Jun 24, 2014, 09:41 pm
    The template for classes is very close to the template for library except that it comes pre-populated with a class.

    Sure, I plan to investigate and add support to Mac OS X 10.10 Yosemite or Xcode 6 (http://embedxcode.weebly.com/blog/embedxcode-o-mac-os-x-1010-yosemite-and-xcode-6) when they're available.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Jul 09, 2014, 09:52 pm
    Please find a new release of embedXcode.

    Release 166 supports the Arduino IDE 1.5.7 beta for both Java 6 and Java 7, the previous Arduino IDE 1.5.6 beta and the mainstream Arduino IDE 1.0.5.

    Download (http://embedxcode.weebly.com)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: giovak on Jul 17, 2014, 03:26 am
    Hello, I want to know if can I debug from XCODE using embedxcode. Please say yes because I bought personal license.
    best regards
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Jul 17, 2014, 06:15 am
    As per chapter • section Debug the Project • Check the Configuration of the User Manual, the Debug page (http://embedxcode.weebly.com/debugging.html) on the website and the Debugger Compatible Boards (http://embedxcode.freshdesk.com/support/solutions/articles/1000046740) solution on the support desk,

    Quote
    Debugging requires boards with a built-in hardware debugger. Debugging has been tested successfully on the following boards:
    • LaunchPad MSP430G2,
    • LaunchPad MSP430F5529,
    • LaunchPad MSP430FR5969,
    • Experimenter Board MSP430FR5739,
    • LaunchPad Stellaris LM4F120 now Tiva C Series TM4C123,
    • Connected LaunchPad with Tiva C Series TM4C129,
    • chipKIT Uno32 with the external chipKIT PGM programmer- debugger.


    For more information on how to install the tools, please refer to chapter Debug the Project of the User Manual.
    Title: Re: Arduino on Xcode Project — Official Thread --multiple libraries in makefile
    Post by: shrek on Jul 17, 2014, 07:54 pm
    I was reading how there are several alternatives in terms of referencing the user-contributed libraries in makefile for embedXcode for arduino. namely these options are 0 blank or name_of_library
    example makefile
    Code: [Select]

    APP_LIBS_LIST = 0
    USER_LIBS_LIST = 0

    no libraries are compiled therefore this option is the fastest
    Code: [Select]

    APP_LIBS_LIST =
    USER_LIBS_LIST =

    all libraries are compiled therefore this option is the slowest
    Code: [Select]

    APP_LIBS_LIST = [insert library name]
    USER_LIBS_LIST = [insert library name]

    only the referenced libraries are compiled therefore should the sketch should function on a per project basis therfore slower than 0 but faster than all
    my question is how do I refernce multiple libraries in the line
    Quote

    USER_LIBS_LIST

    for example is it a comma or tab seperated list, is it one library per line, is it a semi-colon or colon seperated list, do the entries have to be seperated by quotes (single ' or double "), or do they have to be seperated by parenthesis (), square bracketts [], or curly bracketts {}?
    Title: Re: Arduino on Xcode Project — Official Thread --multiple libraries in makefile
    Post by: avenue33 on Jul 18, 2014, 03:06 pm

    my question is how do I refernce multiple libraries in the line
    Quote

    USER_LIBS_LIST

    for example is it a comma or tab seperated list, is it one library per line, is it a semi-colon or colon seperated list, do the entries have to be seperated by quotes (single ' or double "), or do they have to be seperated by parenthesis (), square bracketts [], or curly bracketts {}?


    Just mention the names of the libraries separated with spaces.

    Code: [Select]
    LOCAL_LIBS_LIST = LocalLibrary AnotherLocalLibrary

    Please note this requires the libraries to be inside folders.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Jul 18, 2014, 03:09 pm
    Please find a new release of embedXcode.

    This new release adds support for the Arduino Micro board.

    The new embedXcode+ release improves the Document and Distribute targets, based on the Doxygen standard.

    Happy coding :)

    Download (http://embedxcode.weebly.com/download)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Jul 31, 2014, 09:15 am
    Please find a new release of embedXcode.

    Remember to always power the board before connecting the USB cable!

    Download (http://www.weebly.com/download.html)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: apple877 on Aug 08, 2014, 12:53 am
    Hi,

    I have a question. I want to use a display with I2C backpack. In the Arduino IDE this code with the libraries work great:
    http://www.instructables.com/id/I2C-LCD-Controller-the-easy-way/step5/The-code-Part-II/ (http://www.instructables.com/id/I2C-LCD-Controller-the-easy-way/step5/The-code-Part-II/).
    I also tried this in embedXcode because I like Xcode for the Autocompletion and Syntax-highlighting.(embedXcode is great project and you do a good job!)
    But for the first time I don't understand what I do wrong.
    I've imported the libraries but Xcode show a lot of errors.
    Here the code with the errors:
    https://www.dropbox.com/s/qvwu0mk603xo2la/Screenshot%202014-08-07%2019.52.02.png (https://www.dropbox.com/s/qvwu0mk603xo2la/Screenshot%202014-08-07%2019.52.02.png)
    Here the makefile:
    https://www.dropbox.com/s/0dyh2sxzmv6r0xq/Screenshot%202014-08-07%2019.52.54.png (https://www.dropbox.com/s/0dyh2sxzmv6r0xq/Screenshot%202014-08-07%2019.52.54.png)
    and here only the errors:
    https://www.dropbox.com/s/5o804c4cnktvci6/Screenshot%202014-08-08%2000.51.35.png (https://www.dropbox.com/s/5o804c4cnktvci6/Screenshot%202014-08-08%2000.51.35.png)

    The IRRemote Library works fine I don't know what I did wrong.
    Can you please help me?

    Best regards

    Noah

    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Aug 08, 2014, 06:56 am
    I've tested the code provided at http://www.instructables.com/id/I2C-LCD-Controller-the-easy-way/step5/The-code-Part-II/ and everything compiled fine.

    Thank you for the pictures. Unfortunately, they are too small to be easily readable.

    To send/received files, please use the Help Desk (http://embedxcode.weebly.com/help-desk.html) page.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: apple877 on Aug 08, 2014, 10:38 am
    Hi,
    thanks for your answer.
    Yes I wrote to you on helpdesk as well.
    I updatet the ticket on helpdesk with a zip of the projectfolder.
    My ticketnumber is #77.

    Noah
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Aug 08, 2014, 11:28 am
    Actually, the name of the folder where the LiquidCrystal_I²C  is located is LiquidCrystal, not LiquidCrystal_I²C.

    Just specify in the main makefile

    Code: [Select]
    USER_LIBS_LIST = LiquidCrystal

    Delete the headers in the main directory as they are already available in the LiquidCrystal folder.

    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: tht1 on Sep 02, 2014, 06:45 pm
    I've just discovered embedXcode (bought it a few days ago  XD) and now I'm trying to get some programs to work using the Cosa framework. Let's start with: "Great work!". I love what you have done and Xcode is such an improvement over the Arduino IDE. Using it for a few days I already got some improvement requests:

    1. When starting a new project in Xcode the Drop-Down list for "Board" is missing all ATtiny variants Cosa is available for. (See question below…)

    2. Running a "Clean" fails with "serial port not available" if programmer is not connected. I don't assume it also cleans the attached ICs so this should not be a requirement :-).

    3. When running a "Clean" with programmer attached I get a "*** BOARD_TAG not defined". It actually is defined in the .xcconfig and normal builds work just fine. Only "Clean" fails.

    4. Looks like adding "SERIAL_BAUDRATE = 57600" to the Makefile is the easiest way to change the baud rate. It may help to add this to the comments in the default Makefile.

    Sorry for all these "issues". Just look at the points as possible improvements. It's also quite possible that I'm doing something wrong here…

    One question: How can I build (and upload) for ATtiny devices (ATtiny85) using Cosa and an ISP programmer? What do I have to select while creating the project and what changes are needed to the Makefile to make it work? I can't figure it out myself :(

    Thanks!
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Sep 02, 2014, 11:02 pm
    Thank you for the accolade and the useful comments.

    I'll investigate them and add some features to the next revision.

    Supporting all the boards isn't easy as I don't have them all and thus can't proceed with the required tests.

    Have you investigated using the My Board board configuration file as described in chapter • section Use the Project • Add a Board Configuration File in the User Manual?

    For a better follow-up of your points, could you please fill a ticket at the help desk portal (http://embedxcode.weebly.com/help-desk.html)? Thank you :)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: tht1 on Sep 02, 2014, 11:54 pm

    For a better follow-up of your points, could you please fill a ticket at the help desk portal (http://embedxcode.weebly.com/help-desk.html)? Thank you :)


    I've already tried to add a board configuration as described in the book. But this actually makes things worse :(. I think it's now looking in the wrong boards.txt (arduino core instead of Cosa) but have no idea how to fix this. I've opened a ticket a few minutes ago. Thanks for looking into it.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Sep 03, 2014, 10:12 am
    Here are some answers:

    1. Please try Cosa Digispark Tiny Core.xcconfig

    2.-3. I've been unable to replicate the issue.

    4. The [font=Courier]SERIAL_BAUDRATE[/font] value is taken from the board configuration file and then overridden from the main makefile.  The [font=Courier]SERIAL_BAUDRATE[/font] is commented by default in the main makefile. Just uncomment it to set the desired speed.

    Code: [Select]
    # Parameters
    # ----------------------------------
    # ...
    # SERIAL_BAUDRATE for the serial console, 9600 by default
    # Uncomment and specify another speed
    #
    SERIAL_BAUDRATE = 19200
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: antaljani on Sep 19, 2014, 08:33 am
    Dear Masters,

    I'm pretty new on this Embedded Xcode, but I already developed a beginner code for my Arduino Uno, it was built, uploaded, everything was working fine.

    Last night Xcode upgraded to 6.0.0 and now, there is no Embedded code compiled at all!
    Nothing compiled!

    The error message is : "ERROR   Xcode 4.6.3 required, 6.0.0 installed"
    Which is interesting, on my computer there was never ever Xcode 4.6.3, but Xcode 5.something...

    What to do now? Is there any workaround?

    Thanks in advance!

    Regards,
    Janos
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Sep 19, 2014, 09:16 am
    From the help desk portal at Xcode 6 and Mac OS X 10.10 Yosemite (http://embedxcode.freshdesk.com/support/solutions/articles/1000124546)

    Quote
    Update September 18, 2014

    I've just downloaded Xcode 6 and ran the first tests successfully. Now, Xcode 6 is just one part of the picture; the other big part is Mac OS X 10.10 Yosemite.

    The makefiles shouldn't raise any concern as GCC hasn't changed. However, the utilities may require some adaptation.

    I'm waiting for the release of Mac OS X 10.10 and plan to proceed with extensive tests before releasing an official version compatible with Mac OS X 10.10 and Xcode 6.


    Stay tuned!
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Sep 21, 2014, 08:56 pm
    Please find a new release of embedXcode.



    This new release combines release 177 of embedXcode+ with support for the Robotis OpenCM9.04 board and release 176 with a cleaner build process.

    As embedXcode celebrates its first birthday, release 201 is the first release of the 2nd year!

    Happy coding :)

    Download (http://embedxcode.weebly.com/download)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on Sep 22, 2014, 12:40 am

    Last night Xcode upgraded to 6.0.0 and now, there is no Embedded code compiled at all!
    Nothing compiled!

    The error message is : "ERROR   Xcode 4.6.3 required, 6.0.0 installed"
    Which is interesting, on my computer there was never ever Xcode 4.6.3, but Xcode 5.something...

    I'm getting the same error.  I have Mavericks 10.9.5 with xcode 6.0.1 and embedxcode+ v201. 
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Sep 22, 2014, 01:52 am
    Please refer to the solution Update Project (http://embedxcode.freshdesk.com/support/solutions/articles/1000129114) on the help portal.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on Sep 22, 2014, 02:36 am

    Please refer to the solution Update Project (http://embedxcode.freshdesk.com/support/solutions/articles/1000129114) on the help portal.

    That worked.  Thanks.  I'm not looking forward to doing the manual update to all my projects :(
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Sep 22, 2014, 07:56 am
    Just use Xcode 5 to update your projects.

    Quote
    Note for updating to Xcode 6 -- If the project to be updated has been created with embedXcode+ release 175 or previous, open the project to update in Xcode 5 as the utility in charge of the automatic update of the project doesn't work with Xcode 6.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: ZorroGbg on Oct 03, 2014, 03:02 pm
    Hi Coders,

    I have updated Xcode and embedXcode+ to latest versions and now I cant upload any code to my board. So now I'm back on the example code with same problem. Blink from Arduino IDE works fine but the embedXcode+ Example wont upload with standard error that programmer is not responding.

    Im using several different Arduino Nano from China, but dont think the error is there if it works from Arduino IDE.

    Have tried several different parameters:
    BOARD_TAG  = nano and pro,
    BOARD_PORT = /dev/tty.usbserial*
    SERIAL_BAUDRATE = 9600 - 57600

    Im no expert on Arduino and Xcode, but not novice either.

    Grateful for any feedback.

    Zorro
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Oct 03, 2014, 03:43 pm
    Have you tried to upload with the standard Arduino IDE? In that case, what is the board you select?

    There are 6 boards available for Arduino nano, mini and Pro on embedXcode


    When you connect the board, what is the serial port? Open a Terminal window and type ls /dev/tty.usb*

    For more information, please refer to the User Manual (https://itunes.apple.com/book/embedxcode/id667501748) or the Customise Upload Serial Port (http://embedxcode.freshdesk.com/support/solutions/articles/1000082057).

    If uploading from the Arduino IDE doesn't work, it can't work from embedXcode either.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: ZorroGbg on Oct 03, 2014, 04:33 pm
    Yes, I tried Blink example from Arduino IDE and uploaded it fine with IDE 1.0.5.  The board is a Nano v3 and it has worked before with all the settings I posted. In the log  it seems fine, I think:


    embedXcode  • Sep 20, 2014 release 201 • Support for Xcode 6.0.1 on Mac OS X 10.9.5
    embedXcode+ • Sep 30, 2014 release 204 • Support for RFduino
       
       
    ==== Check Test ====
    ==== Test checked ====
    ==== Info ====
    ---- Project ----
    Target      all
    Name      Test
    Tag         pro5v328
    Extension      ino
    User         /Users/zorro/
    ---- Platform ----
    IDE         Arduino
    Version      1.0.5
    Variant      standard
    ---- Board ----
    Name      Arduino Pro or Pro Mini (5V, 16 MHz) w/ ATmega328
    Frequency      16000000L
    MCU         atmega328p
    Flash memory   30720 bytes
    SRAM memory   2048 bytes
    ---- Port ----
    Uploader      avrdude
    AVRdude       /dev/tty.usbserial-AH01A95U
    Programmer   arduino
    Serial           /dev/tty.usbserial-AH01A95U
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: ZorroGbg on Oct 03, 2014, 04:49 pm
    Here are the settings that work in Arduino IDE:


    avrdude: Version 5.11, compiled on Sep  2 2011 at 18:52:52
             Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
             Copyright (c) 2007-2009 Joerg Wunsch

             System wide configuration file is "/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf"
             User configuration file is "/Users/zorro/.avrduderc"
             User configuration file does not exist or is not a regular file, skipping

             Using Port                    : /dev/tty.usbserial-AH01A95U
             Using Programmer              : arduino
             Overriding Baud Rate          : 57600
    avrdude: Send: 0 [30]   [20]
    avrdude: Send: 0 [30]   [20]
    avrdude: Send: 0 [30]   [20]
    avrdude: Recv: . [14]
    avrdude: Recv: . [10]
             AVR Part                      : ATMEGA328P
             Chip Erase delay              : 9000 us
             PAGEL                         : PD7
             BS2                           : PC2
             RESET disposition             : dedicated
             RETRY pulse                   : SCK
             serial program mode           : yes
             parallel program mode         : yes
             Timeout                       : 200
             StabDelay                     : 100
             CmdexeDelay                   : 25
             SyncLoops                     : 32
             ByteDelay                     : 0
             PollIndex                     : 3
             PollValue                     : 0x53
             Memory Detail                 :
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Oct 05, 2014, 10:56 pm
    Which board are you selecting on the Tool > Board menu of the Arduino IDE?

    Have you tried with Arduino 1.5.8 installed instead of 1.0.5?

    Please use the dedicated Help Desk (http://embedxcode.weebly.com/help-desk.html) as it provides an easy way to attach files.

    The boards definitions are different between 1.0.5 --now 1.0.6-- and 1.5.8 :(
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: ZorroGbg on Oct 06, 2014, 11:56 pm
    Yes, I can use Helpdesk if thats easier for you, but thought that more people had same problem with Xcode 6 and embedXcode since it don't work with example code.

    An yes, I can instal newer Arduino IDE, but I don't have problem with that IDE, so was hoping to not need that anymore when having embedXcode.

    Regarding selected board in Arduino IDE, it works with many different boards, like  nano, pro and mini. It seems that the only thing that matters is the MCU,  and as you can se above its atmega328p.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: AlexGodbehere on Oct 09, 2014, 11:09 pm
    Hi guys. Sorry if this question has been asked thousands of times, but I can't seem to find a search thread function. I've added the libraries folder to Xcode, added the words MPU6050 (the library is MPU6050.h) to the USER_LIBS_LIST part of the Makefile and added #include MPU6050.h to the main sketch, however I still get 'No such file or directory'. I'm developing for an Arduino Uno. Any ideas?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Oct 11, 2014, 06:38 pm

    Regarding selected board in Arduino IDE, it works with many different boards, like  nano, pro and mini. It seems that the only thing that matters is the MCU,  and as you can se above its atmega328p.


    I'm unable to replicate the issue with


    Upload works on both Arduino and embedXcode. The command lines are the same.

    The official Arduino 1.0.6 IDE gives
    Code: [Select]
    /Applications/Arduino-106.app/Contents/Resources/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino-106.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega328p -carduino -P/dev/tty.usbmodem1411 -b115200 -D -Uflash:w:Build/Blink.cpp.hex:i 
    while embedXcode uses
    Code: [Select]
    /Applications/Arduino-106.app/Contents/Resources/Java/hardware/tools/avr/bin/avrdude -D -patmega328p -C/Applications/Arduino-106.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf -carduino -b115200 -P/dev/tty.usbmodem1411 -Uflash:w:Builds/embeddedcomputing.hex:i   

    Could you please copy the log navigator and send it to me?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Oct 11, 2014, 06:43 pm
    Hi guys. Sorry if this question has been asked thousands of times, but I can't seem to find a search thread function. I've added the libraries folder to Xcode, added the words MPU6050 (the library is MPU6050.h) to the USER_LIBS_LIST part of the Makefile and added #include MPU6050.h to the main sketch, however I still get 'No such file or directory'. I'm developing for an Arduino Uno. Any ideas?

    In that case, set USER_LIBS_LIST=MPU6050 as you've already done  -- please refer to Build and Upload the Project • Manage the Libraries for Compilation • Select the Libraries for Compilation on the User Manual.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: AlexGodbehere on Oct 13, 2014, 01:53 pm
    1. I have defined the arduino sketchbook folder in the Arduino IDE.

    2. I have added the MPU6050 (as well as Kalman and I2CDev) folder(s) to 'libraries' under the sketchbook folder.

    The makefile line looks like:

    USER_LIBS_LIST = MPU6050 Kalman I2CDev

    However now, It's trying to compile the MPU6050.h file, but can't find the I2CDev libraries. Do I drag my 'libraries' folder into the Sketchbook folder of Xcode? (which is empty).

    Sorry, I don't know how to make the image any smaller.

    EDIT:

    I've added all the files to the same directory, and the only errors I'm experiencing are compilation errors in I2CDev.cpp:

    (http://i.imgur.com/Os3E3ZV.png) (http://imgur.com/Os3E3ZV)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Oct 13, 2014, 02:01 pm
    Thank you for the hard-copy of the screen: it provides the solution to the tricky misspelling.

    My guess is you have activated the case-sensitive file system on your Mac.

    So you need to list I2Cdev instead of I2CDev to obtain this:

    Code: [Select]
    USER_LIBS_LIST = MPU6050 Kalman I2Cdev


    consistent with that:
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: AlexGodbehere on Oct 13, 2014, 02:10 pm
    Okay, I'm editing this post because I've made some progress (kind of). There are only a few files I want to include in the project, so I've added them to the project folder (not using libraries) by dragging them into Xcode and selecting Copy files to folder, create groups and add to Index. Upon compiling, I'm getting the following error (attachment 1). Attachment 2 shows my sketch folder.

    I get the same error in the Arduino IDE when I don't include <Wire.h>, even though Wire.h is included in the Xcode version.

    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Oct 14, 2014, 10:42 pm
    I get the same error in the Arduino IDE when I don't include <Wire.h>, even though Wire.h is included in the Xcode version.
    If the issue arises with the standard Arduino IDE, it is not related to embedXcode.

    Does [font= Courrier]i2Cdev.h[/font]header include an [font=Courier]#include "Wire.h"[/font] statement?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: AlexGodbehere on Oct 15, 2014, 02:00 pm
    I started a new project, and things seem to have fixed themselves, however I'm having trouble adding libraries to the project. When I build the project to prepare it, I've noticed that my libraries folder is not being included in the sketchbook folder in Xcode. Where would be the first place to look to try and sort out this issue?

    My sketchbook location is defined in the Arduino.app IDE (located in the applications folder).
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Namaan on Oct 18, 2014, 01:38 pm
    Dear All,

    I have installed Xcode 6, Arduino.app and mbedXcode on a MAC OS 10.9. This is not my first install of mbedXcode. Previously I was using it with Xcode 5. I did ran Arduino.app to chef the project path.

    Now, when I want to load "old" project, there is an unknown "make" issue occurring when building them. I can live with it and reconstruct new projects.

    Unfortunately, when I create a new project, and add the following two lines in the main file (.ino)

    Code: [Select]

    #include <SoftwareSerial.h>
    SoftwareSerial mySerial(10, 11);


    I get the following error

    Quote
    "'Software' serial does not name a type"


    Same happens with the wire library.

    I have noticed that both of them aren't included  in

    Quote
    /Resources/Arduino/arduino/libraries/


    of the project, despite being present on the disk.
    I tried adding them, but it does not change anything.

    I also have the issue with the liquid crystals library, which is included in the "/Resources/Arduino/arduino/libraries/" folder by default.

    However, I do not have the error with stream.

    Any ideas on how to solve this. Can anyone use any of those two libraries with Xcode 6 and the latest version of mbedXcode ?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Namaan on Oct 18, 2014, 01:57 pm
    I partially solved the issue by a hack :

    move the SoftwareSerial.h and .cpp from

    /Application/Arduino.App/Resources/Java/libraries/SoftwareSerial

    to

    /Application/Arduino.App/Resources/Java/hardware/arduino/cores/arduino

    It seems that anything inside the libraries folder is visible for Xcode but isn't included when compiling.

    How can I fix this without a hack ?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Oct 18, 2014, 02:06 pm
    Which version of the Arduino IDE are you using?

    The last batch of tests I ran was with:

    As usual with each new release, the Arduino team loves to include incremental changes that are incompatible with previous iterations.

    The name of the template is embedXcode, not mbedXcode. mbed is a SDK for ARM MCUs.

    embedXcode+ supports the mbed SDK but keeps its name unchanged  ;)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Namaan on Oct 18, 2014, 02:43 pm
    Thank you for your reply. I am sorry about the mistake on the name embedXcode.

    I am using 1.0.6, downloaded today. With the latest version of embedXcode, downloaded today, and the latest version of Xcode, downloaded today.

    Should I decrease the version of Arduino.app ? Note: I had the issue with an old version of Arduino.app from 2013. I switched versions today.

    I have also noticed that executing Build on a brand new project just kills the project (files disappear from Xcode) and xcode complains about the format of the project file). But if I execute "all" first, then it works.

    The issue only happens if the project is located in the path defined in Arduino.app.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Oct 18, 2014, 04:00 pm

    I am using 1.0.6, downloaded today. With the latest version of embedXcode, downloaded today, and the latest version of Xcode, downloaded today.


    I went through the test with Arduino 1.0.6 and everything went fine.

    Have you declared the the libraries you want to use in the main makefile
    Code: [Select]

    APP_LIBS_LIST = SoftwareSerial Wire

    Please refer to Build and Upload the Project • Manage the Libraries for Compilation in the User Manual.


    I have also noticed that executing Build on a brand new project just kills the project (files disappear from Xcode) and xcode complains about the format of the project file). But if I execute "all" first, then it works.

    The issue only happens if the project is located in the path defined in Arduino.app.


    I wasn't able to replicate the issue, even with a project located in the path defined by Arduino.

    Have you checked Xcode runs no other process, like indexing? In that case, two processes are working on the same index, and thus collide.

    Please refer to Create a New Project • Prepare the Project! in the User Manual.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Namaan on Oct 18, 2014, 04:36 pm
    Thanks for your help. No I haven't declared the libraries used in the main makefile. Last time I used embedXcode, it was 2013. I didn't remember it necessary. I will read the manual again, try everything and post back.

    Temporarily, I made it work by copying all source files for the libraries (software serial, eeprom, wire) in the core path.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Oct 18, 2014, 04:45 pm
    All the libraries in the core path are included.

    Application libraries in the libraries path --like SoftwareSerial and Wire-- are optional, and they require to be specified.

    Same for the user's libraries from the sketchbook/libraries folder.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Oct 18, 2014, 07:57 pm
    embedXcode now runs on Mac OS X.10 Yosemite.

    (http://embedxcode.weebly.com/uploads/1/1/6/2/11624344/5673825_orig.png)

    Download (http://embedxcode.weebly.com/download)
    Title: Upgrade Arduino IDE to 1.06
    Post by: Scott216 on Oct 18, 2014, 11:53 pm
    I'd like to upgrade my Arduino IDE from 1.0.5 to 1.0.6.  Anything special I need to do with embedxcode so it works properly?
    Title: Re: Upgrade Arduino IDE to 1.06
    Post by: avenue33 on Oct 18, 2014, 11:57 pm

    I'd like to upgrade my Arduino IDE from 1.0.5 to 1.0.6.  Anything special I need to do with embedxcode so it works properly?


    No, nothing special. embedXcode will consider the new [font=Courier]Arduino.app[/font].
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Namaan on Oct 19, 2014, 12:07 am
    Avenue33, thank you so much for your help. Everything works perfectly now.
    I will test on an arduino board on monday.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: apple877 on Oct 26, 2014, 11:29 pm
    Hi I tried do update embedXcode to use it with Yosemite and Xcode 6 but compiling just doesn't work.
    I've downloaded the installer from your website and installed it.
    Now I opened a project which I created with embedXcode under Xcode 5.1 and I tried du Build it. The Build fails with exit code 2.
    Here is a picture:click (https://www.dropbox.com/s/udcnll6wlyh4js4/Bildschirmfoto%202014-10-26%20um%2023.25.17.png?dl=0)
    Please help :). It didn't update since 171 how can I fully uninstall embedXcode and reinstall it ?

    apple877
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Oct 30, 2014, 12:24 am
    @apple877

    Sorry for the late answer. Release 171 is a very old version and there has been Xcode 5 in between.

    Here's the procedure:
    Quote
    • Create a new project with the same name, ProjectA.
    • Copy-paste the corresponding files from the old project to the new project: the main sketch ProjectA.ino and the local libraries.
    • Edit the main makefile of the new project to add the libraries you plan to use, for example the application and user's libraries.
    • Optionally, edit the main makefile of the new project to customise the options, for example the warning options.
    Should you need more details, please open a ticket at the Help Desk (http://embedxcode.weebly.com/help-desk.html)?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: apple877 on Nov 02, 2014, 03:53 pm
    thanks :) now it works :)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Nov 15, 2014, 10:45 pm
    New release 2.3 of embedXcode support the Little Robot Friends (http://embeddedcomputing.weebly.com/little-robot-friends.html) board and includes many stability improvements for Arduino boards.

    (http://embeddedcomputing.weebly.com/uploads/1/1/6/2/11624344/360790_orig.jpg)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: cdalvaro on Nov 26, 2014, 07:33 pm
    This is the first time I write in this forum so hello everybody, and thank you for your help!

    You can see my problem in the attachment.


    I'm using an Arduino Uno board, with Xcode 6.1, OS X 10.10.1, and the IDE for Arduino with version 1.06.


    I don't really know what to do with the error, so any help will be welcome.

    Anyway thank you for your time!
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Dec 06, 2014, 03:56 pm
    Hi!

    Sorry for the late answer.

    I can't manage to replicate the issue with current version 2.3.2 of embedXcode.


    Feel free to use the Help Portal (http://embedxcode.weebly.com/help-desk.html).
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: fletort on Dec 13, 2014, 10:54 am
    Hello,
    great job, i am new in mac world (come from windows) and very happy with your solution.

    Some problems and questions anyway :

    I am trying to make a library directly with some different sketch in subfolder example.
    It seems not possible to do that with your solution ?

    If i try to put my sketch (ino file) in a subfolder this one is no more detected (i updated the include of the main.cpp). The sketch need to be at the base folder of the project ? This is quite unusual in a library.

    After, i think that all source code are always compilated, buikld target selection seems not used, isn't it ?
    So even if i success to have multiple ino file in some different subfolder (different example for my library), it seems impossible to select which on is used to be compilated ?

    If i understand well, with this solution, i need to make one project for the library , then one project for each example ? Is this the solution ?

    ANyway, great job ! thanks for that.

    Fabien
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Dec 19, 2014, 01:58 pm
    great job, i am new in mac world (come from windows) and very happy with your solution.
    You're welcome!

    I'm not sure to understand all your questions. I'll try my best.

    I am trying to make a library directly with some different sketch in subfolder example.
    It seems not possible to do that with your solution ?
    A project has one unique .ino sketch and as many .h + .cpp libraries.
    Depending on the edition you're using, libraries can be placed in sub-folders and selected or ignored.

    If i try to put my sketch (ino file) in a subfolder this one is no more detected (i updated the include of the main.cpp). The sketch need to be at the base folder of the project ? This is quite unusual in a library.
    For the embed1 project, the unique embed1.ino sketch should be under embed1/embed1/embed1.ino.

    After, i think that all source code are always compilated, buikld target selection seems not used, isn't it ?
    So even if i success to have multiple ino file in some different subfolder (different example for my library), it seems impossible to select which on is used to be compilated ?
    Which target selection are you referring to?
    Again, a project has one unique .ino sketch and as many .h + .cpp libraries.

    If i understand well, with this solution, i need to make one project for the library , then one project for each example ? Is this the solution ?
    Yes.
    A project is not a workspace.

    Feel free to use the Help Portal (http://embedxcode.weebly.com/help-desk.html).
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: inventorlabs on Feb 08, 2015, 10:34 pm
    I have installed the new (260) embedXcode on two different computers and followed the video (two years and a couple of Xcode versions out of date) and every installation instruction I can find, but it just isn't working.  The installation instructions are not very clear.  Other than "install it and hit Command-B to build", there is little to go on.  The Schemes in the video are vanished in Xcode 6.1.

    I see things like Boards in the configuration, but the only choice is "My Mac" and it just doesn't build.  Is there a more up-to-date tutorial somewhere?  Is there a thread on a forum for Xcode 6.1 somewhere?  I can't find it.  Is anybody using embedXcode?

    Thanks!
    Glenn Reid
    Silicon Valley
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Feb 12, 2015, 12:00 pm
    Hi!

    The installation video was shot by an enthusiast user.

    Have you read the User Manual (http://embedxcode.weebly.com/download.html)?

    (http://embedxcode.weebly.com/uploads/1/1/6/2/11624344/5400527.png)

    The User Manual provides step-by-step instructions as is available as both an iBook and a PDF document. I update for each new release of embedXcode.

    Please download it from this page (http://embedxcode.weebly.com/download.html) at the embedXcode website. You just need to scroll down a little. The User Manual is also mentioned at the Tutorial (http://embedxcode.weebly.com/tutorial.html) section with a link to download it.

    Please note embedXcode has a dedicated page at the Arduino Playground (http://playground.arduino.cc/Main/EmbedXcode) with all the relevant links.

    Read The Fabulous Manual :)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Feb 21, 2015, 09:36 am
    Please find a new release of embedXcode.


    Arduino version 1.6.0 is a welcomed release as it replaces both Arduino 1.0.6 and Arduino 1.5.8. embedXcode will focus on Arduino 1.6.0.

    Download (http://embedxcode.weebly.com/download.html)
    Title: Multiple versions of Arduino IDE
    Post by: Scott216 on Feb 25, 2015, 01:42 pm
    I've got a few versions of Arduino on my Mac, including 1.6.0.  Do I have to set anything in Xcode so it uses a particular one?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Feb 28, 2015, 05:15 pm
    No, embedXcode goes for the Arduino.app and adapts itself automatically to the version, 1.0.6, 1.5.8 or 1.6.0.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Scott216 on Feb 28, 2015, 06:52 pm
    On my Mac IDE ver 1.6.0 is named Arduino_160.app.  I still have an older version (1.0.5) that's named Arduino.app. 
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Mar 02, 2015, 05:11 pm
    Please find a new release of embedXcode.


    Release 2.6.3 improves stability for Arduino 1.6.0.

    Not all the plug-ins are compatible with Arduino 1.6.0, so please refrain from updating them. Section Install the Template • Install the IDEs of the Boards • Check the IDE and Plug-In Options lists the recommended versions of the Arduino IDE for each plug-in.

    (http://embedxcode.weebly.com/uploads/1/1/6/2/11624344/6716440_orig.png)

    Download (http://embedxcode.weebly.com/download.html)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: kervyn on Mar 05, 2015, 03:19 am
    Avenue 33,

    I think I'm a bit confused as to where I define functions within the program. Im getting the error " 'Fancontrol' was not declared in this scope" when the function being called on is after the loop function at the bottom of the sketch.

    Ive attached a screen shot of the code and error.

    Should the 'fancontrol' function code be relocated to one of the local library files? if so where exactly?


    Thanks for your help!

     
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: tgsuperspec on Mar 05, 2015, 06:27 pm
    If youe using Emberded X then you have to declare using C/C++ including .h files otherwise Xcode will throw this sort of error.

    The Artdunio IDE fiddles many aspects of the correct way to program in C++ so to use Xcode you need to understand the correct way of doing things..

    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Mar 12, 2015, 09:56 pm
    @kervyn

    Please refer to Find Solutions to Issues • Check Compatibility • Declare Prototypes on Main Sketch on the User Manual.

    Quote
    Projects developed by embedXcode are highly compatible with the standard IDEs, like Arduino and alike.
    However, unlike the standard IDEs, code with embedXcode is true C++.

    The main consequence of true C++ is the need for declaring prototypes of the functions in the main sketch.
    In the example provided below, the prototype for fancontrol() is required, as fancontrol() is called by loop() but defined after.

    Without prototyping fancontrol(), compilation would raise an error. The standard IDEs add the prototypes on the main sketch.

    Prototypes aren't required for libraries as they are already included in the header file.

    Prototypes are fully compatible with the standard IDEs.
    As usual, reading the user manual is highly recommended.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Mar 22, 2015, 05:58 pm
    Please find a new release of embedXcode.

    embedXcode 2.7 adds two new platforms.

    embedXcode 2.7 also updates the IDEs.

    Please check the release of the official IDEs as previous versions are no longer supported. With the release of Arduino IDE 1.6.1, previous versions 1.0.6 and 1.5.8 are no longer supported except for plug-ins.

    Download (http://embedxcode.weebly.com/download.html)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Apr 01, 2015, 06:08 pm
    The last release of the Arduino IDE 1.6.2 inaugurates a radical new internal structure and is not compatible with previous versions.

    The standard ASCII files for boards, platforms and programmes are gone! They are no longer under the folder /Applications /Arduino.app /Contents /Java /hardware /arduino /avr /boards.txt but they have moved to the hidden folder /Users /ReiVilo /Library /Arduino15 /packages /arduino /hardware /avr /1.6.2 /boards.txt.

    Moreover, the support for the Arduino Due doesn't come as standard. An additional download is required. Call the menu Tools > Boards > Boards Manager and then click on Download for the Arduino SAM Boards.

    Worse, none of the plug-ins developed by other providers of boards works with this next release 1.6.2.

    For all those reasons, embedXcode doesn't support release 1.6.2.
     
    Please install and use Arduino release 1.6.1, which is supported by embedXcode.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: elkafirmanda on Apr 07, 2015, 01:24 pm
    The last release of the Arduino IDE 1.6.2 inaugurates a radical new internal structure and is not compatible with previous versions.

    The standard ASCII files for boards, platforms and programmes are gone! They are no longer under the folder /Applications /Arduino.app /Contents /Java /hardware /arduino /avr /boards.txt but they have moved to the hidden folder /Users /ReiVilo /Library /Arduino15 /packages /arduino /hardware /avr /1.6.2 /boards.txt.

    Moreover, the support for the Arduino Due doesn't come as standard. An additional download is required. Call the menu Tools > Boards > Boards Manager and then click on Download for the Arduino SAM Boards.

    Worse, none of the plug-ins developed by other providers of boards works with this next release 1.6.2.

    For all those reasons, embedXcode doesn't support release 1.6.2.
     
    Please install and use Arduino release 1.6.1, which is supported by embedXcode.
    how about the newest version of Arduino IDE 1.6.3 ?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Apr 24, 2015, 11:34 am
    how about the newest version of Arduino IDE 1.6.3 ?
    Same answer, as Arduino 1.6.3 shares the same structure as 1.6.2, incompatible with previous releases 1.0.6 and 1.5.8.

    My advice is to stick with 1.6.1.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Zorro_X on May 02, 2015, 07:39 pm
    Hi, i've being trying to install embededXcode but after installation is done, there is no XCode templates neither any folder with embededXCode in my library ?
    I've proceeded as explained in the tutorials : 1) install Arduino environment ; 2) install embededXCode ; 3) create new project...
    I'm using MacOSX 10.10.3, and XCode 6.3.1.
    It seems like no files are even installed into the computer (?!)

    Any ideas ?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on May 02, 2015, 09:44 pm
    Check

    on the Help Portal (http://embedxcode.freshdesk.com/support/home).
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Zorro_X on May 03, 2015, 08:28 am
    Thank you for the links, it is better now, I've also discovered I was using the wrong version of arduino environment.
    Thank you very much !
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on May 03, 2015, 09:05 am
    @Zorro_X

    You're welcome. Enjoy embedXcode!
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on May 25, 2015, 05:21 pm
    Please find a new release of embedXcode.


    Release 2.8.9 adds support for the Teensy LC board. The Teensy 3.0 and 3.1 are very popular among the embedXcode users and the Teensy LC is a welcomed addition.

    Release 2.8.9 also updates support for the plug-ins running on Arduino 1.6.1 or 1.7.x, including Adafruit, Cosa, LightBlue, panStamp, RedBearLab, RFduino, Teensy.

    Finally, release 2.8.9 brings support for Particule, the new name of Spark. I'm still waiting for the Photon so I can add support for it.

    Download (http://embedxcode.weebly.com/download.html)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: StuffAndyMakes on May 29, 2015, 05:33 pm
    Should the 'fancontrol' function code be relocated to one of the local library files? if so where exactly?
    Hey kervyn, I don't know if this is too late or not, but for clarity...

    In C/C++ you must declare things before you use them. The Arduino environment doesn't change the rules of C/C++, it just hides away some of the normal things you'd see in a C or C++ main file, like the program's starting point, the main() function. It's there, it's just behind the scenes.

    Therefore, because the definition of the fancontrol() function is AFTER loop() where it is first called, it doesn't exist at the point the compiler gets to loop(). Move the entire function above loop() or setup() in your sketch file OR write a prototype for it above loop() or setup() to give the compiler a hint that it does exist later on in the file.

    A prototype is just the function declaration without the block after it (the function block is the curly braces and the stuff in between them following the "void function()" bit). Like this:

    Code: [Select]

    void fancontrol(); // prototype or declaration

    void setup() {
      ...
    }

    void loop() {
      ...
    }

    // actual function definition
    void fancontrol() {
      ...
    }
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: StuffAndyMakes on May 29, 2015, 05:38 pm
    Has anyone seen Xcode suddenly start throwing an error after building a project like this?

    Code: [Select]

    .../Makefiles/Step1.mk:572: *** mega2560 board is unknown.  Stop.


    I'm on Yosemite 10.10.3, Xcode 6.1, embedXcode+ 289, Arduino 1.6.0. This project is running on an Arduino Mega 2560 (if you couldn't tell from the error).

    It had been building perfectly fine (no errors at all) until this morning. Nothing had been changed since a week ago. This error isn't stopping avrdude from flashing the chip, but it's just weird.

    The BOARD_TAG User-Defined variable is defined in the project Build Bettings, which is why it's weird.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on May 29, 2015, 05:43 pm
    @kervyn

    Please report to section Find Solutions to Issues • Manage Compatibility with Standard IDEs on the User Manual.

    Quote
    Declare Prototypes on Main Sketch
    The main consequence of true C++ is the need for declaring prototypes of the functions in the main sketch.
    In the example provided below, the prototype for functionB() is required, as functionB() is called by functionA() but defined after.
     
    // Prototypes
    void functionA();
    void functionB();

    // Functions
    void functionA() {
      Serial.println("functionA"); functionB();
    }
    void functionB() {
      Serial.println("functionB");
    }


    Without prototyping functionB(), compilation would raise an error. The standard IDEs add the prototypes on the main sketch.

    Prototypes aren't required for libraries as they are already included in the header file.

    Prototypes are fully compatible with the standard IDEs.
    I've dedicated a lot of time in writing and maintaining this User Manual. Why isn't read?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on May 29, 2015, 05:50 pm
    @StuffAndyMakes

    Does the sketch include the sequence !!! ?

    There are two releases of the Arduino IDE 1.6.0: one for Java 6 and another for Java 7. Both are not compatible as they have a different internal structure.

    Have you tried to install the Arduino IDE release 1.6.1? Arduino IDE release 1.6.1 is officially supported by embedXcode.

    Feel free to use the help desk (http://embedxcode.freshdesk.com)!

    Thank you!
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Jul 11, 2015, 03:29 pm
    Please find a new release of embedXcode.

    This cumulated release includes:

    Download (http://embedxcode.weebly.com/download.html)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: AloyseTech on Aug 19, 2015, 10:25 am
    Hi!
    Well done on this project!
    Do you plan to add Arduino Zero (Native USB programming if possible) to embedXcode?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Aug 19, 2015, 10:30 am
    embedXcode already supports the Arduino Zero Pro (http://labs.arduino.org/tiki-view_forum_thread.php?comments_parentId=320&topics_offset=3) from Arduino.ORG, now rebranded as Arduino M0 Pro.

    Both boards are said to be compatible. Have you tried with the Arduino Zero M0 board?

    I'd love to add support for the Arduino Zero Pro from Arduino.CC, but I don't have any available for testing. Any sponsor?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Sep 27, 2015, 12:52 pm
    New release 3.0 of embedXcode supports and runs on Xcode 7 with Mac OS X 10.10.

    Release 3.0.1 improves the stability of the installation process. Release 3.0.2 fixes two bugs for Arduino Due and LaunchPad CC3200. Release 3.0.3 fixes a bug for mbed.

    Please note embedXcode requires Arduino.CC 1.6.1 for Java 7 or Arduino.ORG 1.7.7.

    Download (http://embedxcode.weebly.com/download.html)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: undeniable on Oct 25, 2015, 11:47 pm
    Hey!

    I've just updated Xcode to 7.1 version and found out that embedXcode isn't compatible with it :(

    Do I have to downgrade or there is some other way?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Oct 26, 2015, 01:45 am
    Please check release 3.0.5.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: ulyssefender on Oct 29, 2015, 12:45 pm
    Hello
    I am a student in engineering school . I am trying to implement a project : I want to create a sole that can accurately calculate the number of steps you are doing :
    The problem is that I want to spend my Arduino code that works, on Xcode and then to have it, on my iPhone.
    I installed embledXcode as advised but when I 'Run' after being ' built ' I have this error message " uno board is unknown . Stop . "

    How do I do to not get this message and continue to provide coding?

    In advance thank you friends


    Ulysse
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Oct 29, 2015, 03:35 pm
    Unfortunately, I can hardly help you with the information you provide

    Please open a ticket on the Help Desk (http://embedxcode.weebly.com/help-desk.html) and provide the information listed at What Information to Provide When Asking for Help (http://embedxcode.freshdesk.com/support/solutions/articles/1000046741-what-information-to-provide-when-asking-for-help).
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Nov 02, 2015, 09:07 pm
    New release 4.0 of embedXcode brings support for the Arduino.CC 1.6.5 and for Energia 0101E017.

    The Arduino.CC 1.6.5 IDE features the Boards Manager, which provides an easy way to download and install boards.

    The following boards have been tested successfully: Adafruit 1.3.3, Cosa 1.1.0, Digistump 1.6.5, ESP8266 1.6.5-947-g39819f0, Intel 1.6.2+1.0, MediaTek 1.1.17, Little Robot Friends 1.6.0, panStamp AVR 1.5.1 and MSP430 1.0.4, RedBearLab 1.0.0, RFduino.

    Download (http://embedxcode.weebly.com/download.html)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: sixqub on Nov 04, 2015, 02:40 pm
    I have this error 'ArduinoAVR_165.mk : No such file or directory' some where in my step1.mk file under makefile.

    I am not too savvy with this, and the manual and/or video was not too explicit on solving this or i just do not understand the process...
    I have xcode 7 installed on my macboook pro running on El Capitan, i have embedXcode installed, i have the arduino 1.6.5 installed and have been using it but now want to work with my board from xcode.

    Does anyone have time to help me with this , well walk me through kind of.
    Thanks in advance.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Nov 04, 2015, 02:48 pm
    @sixqub

    Please open a ticket on the Help Desk (http://embedxcode.weebly.com/help-desk.html) and provide the information listed at What Information to Provide When Asking for Help (http://embedxcode.freshdesk.com/support/solutions/articles/1000046741-what-information-to-provide-when-asking-for-help), especially which template you've used for your project.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: sixqub on Nov 04, 2015, 05:15 pm


    @sixqub

    Please open a ticket on the Help Desk (http://embedxcode.weebly.com/help-desk.html) and provide the information listed at What Information to Provide When Asking for Help (http://embedxcode.freshdesk.com/support/solutions/articles/1000046741-what-information-to-provide-when-asking-for-help), especially which template you've used for your project.
    [/quote]



    Thanks, I had the embedxcode 4.0.0 build and i updated to build 4.0.1 and it solved the issue in question.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Nov 04, 2015, 05:18 pm
    Glad to know. Enjoy embedXcode!
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: undeniable on Nov 07, 2015, 01:07 am
    Hey!

    I've created project for Arduino Uno and now I want to move it to Arduino Mega. Do I have to change any files/settings before building and uploading to the new board?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Nov 07, 2015, 07:03 am
    Please refer to the User Manual.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Mjxkill on Nov 24, 2015, 08:12 am
    Hello,

    I have created a ESP8266 project on xCode but the Libraries of ESP8266 are not found (like EEPROM.h).
    This libraries are still present in /Users/michael/Library/Arduino15/packages/esp8266/hardware/esp8266/1.6.5-947-g39819f0/libraries.

    On Arduino IDE, this libraries are present.

    I tried :
    #include "EEPROM.h"
    #include "EEPROM/EEPROM.h"
    #include <EEPROM.h>
    #include <EEPROM/EEPROM.h>

    but i have the same error... EEPROM.h not found...

    Thanks for your help.

    Arduino 1.6.5 / embedXcode+ 4.0.3
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Nov 24, 2015, 08:52 am
    Please refer to the User Manual for how to use the libraries, especially



    The esp8266.com forum may be more appropriate for ESP8266-related topics.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Mjxkill on Nov 24, 2015, 08:33 pm
    OK thank you, it's OK :-)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Dec 13, 2015, 03:44 pm
    Please find a new release of embedXcode.

    embedXcode release 4.1 updates support for IDEs and boards.


    Download (http://embedxcode.weebly.com/download.html)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Andreas_Gaunitz on Dec 23, 2015, 03:14 pm
    Hi avenue33! Thank you for all the hard work, simplifying my work.

    I have one persistent problem though. In trying use avr-objdump to view disassembly, I can't get it to "Intermix source code with disassembly". I do get the disassembly but no source code.

    I've tried everything here: http://forum.arduino.cc/index.php?topic=152005.0 and googled a lot. I also tried adding and changing some avr-objdump arguments (-Sz, -I/path/to/sketch.ino) and some ASFLAGS in EmbedXcode's step2.mk makefile to no avail (--dwarf-2, -ggdb etc)

    Any suggestions?

    Using an Arduino Nano project
    Xcode 7.1.1
    EmbedXcode 4.0.3
    Arduino IDE 1.6.6

    Merry Christmas
    / Andreas
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Dec 23, 2015, 03:30 pm
    Thank you for the kind words. I'm glad you like embedXcode.

    You need to tweak the -O parameter to prevent the compiler and linker from removing the symbols for disassembly.

    Does the standard Arduino.CC IDE provide those symbols?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Andreas_Gaunitz on Dec 23, 2015, 03:50 pm
    Thank you for the fast reply!

    However, there must be something more amiss, neither -O, -Os or -O3 shows source code intermixed with disassembly. They do produce different file sizes, so I'm sure I'm changing in the right place

    I am using avr-objdump -h -S
    and ASFLAGS = -$(MCU_FLAG_NAME)=$(MCU) -x assembler-with-cpp

    I just tried with the Arduino IDE 1.6.6 and I do get intermixed source code.
    Command: avr-objdump -h -S /private/var/folders/lots/of/random/stuff/Blink.ino.elf
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Dec 23, 2015, 04:10 pm
    I compiled and linked the same basic blinky sketch with ArduinoCC 1.6.7 and embedXcode.

    I launched avr-objdump with no parameters, then with the -d option and finally with the -S option.

    I'm getting the disassembly output for the 6 cases, and they are very close.

    Again, have you tried with the standard Arduino.CC IDE and obtained those symbols?

    Please open a ticket on the help desk (http://embedxcode.weebly.com/help-desk.html) to add files.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Andreas_Gaunitz on Dec 23, 2015, 04:20 pm
    I made a fresh EmbedXcode project and pasted the blink code in it. Compiled and opened the .elf with avr-objdump -h -S, and then -d. Still no intermixed C code. Strange.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Dec 23, 2015, 04:24 pm
    Again, do you obtain the result you're looking for with the standard Arduino.CC IDE?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Andreas_Gaunitz on Dec 23, 2015, 04:40 pm
    I do get the source code information with the Arduino IDE and the same avr-objdump command

    (Sorry, I added that information to the previous message but since I'm not allowed to post again within 5 minutes it took a while to show up.)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Dec 23, 2015, 04:49 pm
    Some hints:
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Andreas_Gaunitz on Dec 23, 2015, 06:03 pm
    I put a cpp file named "embeddedcomputing.cpp", and another "main.cpp" and another "MyProjectName.cpp" with the contents of MyProjectName.ino in both the Build folder and the project folder.

    Tried avr-objdump -I and gave it 1) project directory, 2) build directory, 3) cpp file name, and 4) ino file name

    Still no C code :(
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Dec 23, 2015, 06:13 pm
    I don't know.

    I guess the solution consists on comparing the trace of the building and linking process with Arduino.CC 1.6.5 and embedXcode line per line.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: westfw on Dec 23, 2015, 11:51 pm
    For quite a while, in order to get line numbers from errors "correct", the arduino pre-processing was adding lines that looked like:
    #line 1 blink.ino
    to the .cpp file that it created in the build directory during pre-processing.  This of course is what gets propagated to the .elf files, and is used by objdump.   Since the build directory didn't actually have a copy of the .ino file, this broke the source inter-mingling of disassembly.  It was fixed relatively recently.

    https://github.com/arduino/Arduino/issues/1337 (https://github.com/arduino/Arduino/issues/1337)

    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Dec 24, 2015, 12:07 am
    Because embedXcode relies on standard C++ and makefile implementation, it doesn't need the #line 1 blink.ino trick.

    The compiler starts with the void main() function, located on the main.cpp. The main.cpp includes the statement #include "blink.ino".

    Should an error be reported, clicking on it goes right to the line of code.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Andreas_Gaunitz on Dec 24, 2015, 12:43 am
    This was fixed already in Arduino 1.6.6, which is the version I am using. There's something else going on on my end...
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Andreas_Gaunitz on Dec 24, 2015, 03:38 pm
    After a lot of testing, I realized that the problem was a missing gcc directive in the included makefile.

    If you are having the same problems (no intermixed C++ source code when using avr-objdump -S) please make sure that the makefiles ArduinoAVR_165.mk and ArduinoAVR_177.mk contain the -g flag

    I added it in both files like this:
    Quote
    CPPFLAGS     = -g $(OPTIMISATION) $(WARNING_FLAGS)
    CPPFLAGS    += -$(MCU_FLAG_NAME)=$(MCU) -DF_CPU=$(F_CPU)
    CPPFLAGS    += -ffunction-sections -fdata-sections
    CPPFLAGS    += $(addprefix -D, printf=iprintf $(PLATFORM_TAG))
    CPPFLAGS    += $(addprefix -I, $(INCLUDE_PATH))
    Was previously (EmbedXcode version 4.0.3):
    Quote
    CPPFLAGS     = $(OPTIMISATION) $(WARNING_FLAGS)
    CPPFLAGS    += -$(MCU_FLAG_NAME)=$(MCU) -DF_CPU=$(F_CPU)
    CPPFLAGS    += -ffunction-sections -fdata-sections
    CPPFLAGS    += $(addprefix -D, printf=iprintf $(PLATFORM_TAG))
    CPPFLAGS    += $(addprefix -I, $(INCLUDE_PATH))
    I also noted another anomaly: in the Configurations/Arduino Nano ATmega328.xcconfig
    Quote
    MAX_RAM_SIZE = 1024
    should be
    Quote
    MAX_RAM_SIZE = 2048
    Merry Christmas!!!
    / Andreas
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Dec 24, 2015, 03:57 pm
    @Andreas_Gaunitz

    Thank you for investigating and congratulations for finding the solution!

    The -g is activated for the Debug target on the platforms that support debugging, e.g. Zero, M0 Pro, LaunchPads, mbed-enabled boards on embedXcode+.

    I'll include it in a next few release.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: DeafSoul on Dec 30, 2015, 01:11 pm
    Hi Guys,
    I've been using embedXcode for some time now and i love it.
    I migrated my arduino project recently to a breadboard, where i use an arduino as an ISP to program the Atmega328p. This works perfectly from the Arduino IDE (shift + upload)...

    The question is: how do I change the makefiles of embedXcode such that the "Upload" scheme would use the arduino as ISP ??

    I appreciate your ideas.
    DeafSoul
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Jan 30, 2016, 02:04 pm
    Please find a new release of embedXcode.

    Release 4.1.9 adds support for Arduino.CC Zero. Please use the Programming Port to upload the sketch.

    Release 4.1.8 updates the Intel Galileo and Edison upload procedure.

    Download (http://embedxcode.weebly.com/download.html)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Jan 30, 2016, 02:05 pm
    Hi Guys,
    I've been using embedXcode for some time now and i love it.
    I migrated my arduino project recently to a breadboard, where i use an arduino as an ISP to program the Atmega328p. This works perfectly from the Arduino IDE (shift + upload)...

    The question is: how do I change the makefiles of embedXcode such that the "Upload" scheme would use the arduino as ISP ??

    I appreciate your ideas.
    DeafSoul
    Please have a look at chapter 3 section 5 of the User Manual.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Mar 12, 2016, 09:34 pm
    embedXcode release 4.3.9 improves support for Arduino Due and updates boards for Arduino CC IDE.

    Download (http://embedxcode.weebly.com/download.html)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: rafiki270 on Apr 03, 2016, 11:32 pm
    Is there any chance you will support RedBear DUO anytime soon? definitely getting couple of commercial licenses for my team if you do :) ... Thanks, Ondrej
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Apr 03, 2016, 11:41 pm
    Actually, the RedBear Duo is supported since embedXcode+ 4.2.3 released Feb 06, 2016. I've also posted a review of the board. (http://embeddedcomputing.weebly.com/redbear-duo.html)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Garydeason on Jun 21, 2016, 04:34 pm
    In addressing such problems can advise you here this website https://jitbit.com. There's a cool team. They operate 24/7 and will help you at any time. I also have software is ordered and use it for work. I advise everyone to this site.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: CatsLoveJazz on Aug 13, 2016, 08:17 pm
    I can see in the Makefiles that embedXcode @echos a number of things during building?

    How can I view this output?

    For instance I am interested in the memory specifically. Currently I am having to switch to using the Arduino IDE to check  this.

    Code: [Select]

    @echo '---- Size ----'
     @echo 'Estimated Flash: ' $(shell $(FLASH_SIZE)) $(MAX_FLASH_BYTES); echo;
     @echo 'Estimated SRAM:  ' $(shell $(RAM_SIZE)) $(MAX_RAM_BYTES); echo;
     @echo 'Elapsed time:    ' $(STOPCHRONO)

    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Aug 13, 2016, 09:08 pm
    Just select the Report Navigator.

    For more information, please refer to the official Xcode documentation or to section Build and Upload the Project • Manage General Messages on the User Manual.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: TMD0 on Aug 14, 2016, 09:08 pm
    Hi avenue33.

    I'm new to embedXcode but already hooked up :-)

    I have one issue with the arduino due in Xcode:

    When I use the 'SD card test' example from arduino.org (File/Examples/SD/CardInfo) the sketch works without change in Arduino.org 1.7.7 (and in Arduino.cc 1.6.10).
    In Xcode I added the SD & SPI Library to the Makefile and it works with the Arduino uno and Mega 2560 but not with the due. I changed boards in the TestFile itself an also made separate new projects for the uno and the due.
    With the due I always get 5 issues with "undefined reference":


    Any idea what I'm doing wrong?

    Thanks for your work and help!
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Aug 14, 2016, 09:45 pm
    @TMD0

    I confirm the issue. Could you please open a ticket at the Help Desk (http://embedxcode.weebly.com/support.html)?

    Thank you.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: _jok3r89 on Aug 25, 2016, 09:31 pm
    Hello,
    is it possible to use my programmer with embedXcode ?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Aug 25, 2016, 09:56 pm
    Hello,
    is it possible to use my programmer with embedXcode ?
    Which programmer and which board please?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: _jok3r89 on Aug 29, 2016, 09:58 pm
    Programmer : Diamex ISP programmer

    Controller: Atmel 328
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Aug 29, 2016, 10:17 pm
    Programmer : Diamex ISP programmer

    Controller: Atmel 328
    Have you managed to use this programmer with the Arduino IDE?

    For AVR MCUs, embedXcode+ already supports the Adafruit USBtinyISP (https://www.adafruit.com/product/46) and the USBASP AVR Programmer (http://www.protostack.com/accessories/usbasp-avr-programmer) programmers. A coming version will add support for the Segger J-Link (https://www.segger.com/jlink_base.html) for ARM Cortex-M.

    Could you please open a ticket at the Help Desk (http://embedxcode.weebly.com/support.html)?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: _jok3r89 on Aug 31, 2016, 10:21 pm
    No it doesn work with Arduino but it works great with Avrdudess 2.4 (Atmel STK500)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: _jok3r89 on Aug 31, 2016, 10:33 pm
    i found this ->
    http://forum.diamex.de/showthread.php?866-Diamex-AVR-USB-ISP-Programmer-mit-Arduino-IDE-nutzen

    i doesn t find the file "programmer.txt" in xcode. i want to chang "avrispmkii.communication=usb" to"avrispmkii.communication=serial" , i hope that is it.

    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Aug 31, 2016, 10:36 pm
    Please open a ticket at the Help Desk (http://embedxcode.weebly.com/support.html).
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: davidhux on Sep 06, 2016, 04:28 pm
    I have a project written for the UNO which I wish to transfer a mega2560, id there any way (apart from creating a new mega2560 project and transferring the source code files in to it) to edit the project so that is converted from a Uno to a mega?

    Thank-you

    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Sep 06, 2016, 04:36 pm
    Please refer to chapter Use the Project section Change the Board on the User Manual.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Sep 14, 2016, 04:24 pm
    Just an update on embedXcode+.


    Download (http://embedxcode.weebly.com/download.html)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: nataliarias on Oct 19, 2016, 08:10 am

    I need help I've been trying to handle the Arduino Uno from xcode 8.0 and i yet  download embed and the manual and  i too download arduino.cc and i opened the new project then choose embed and then went to proyecto.ino and put compile build but does not compile because it says there is an error, HELP
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Oct 19, 2016, 09:02 am
    Please open a ticket at the Help Desk (http://embedxcode.weebly.com/support.html) and provide What Information to Provide When Asking for Help (https://embedxcode.freshdesk.com/support/solutions/articles/1000046741-what-information-to-provide-when-asking-for-help).
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Jan 06, 2017, 03:43 pm
    New release embedXcode 6.0.2 updates support for unified Arduino 1.8.0 IDE.

    Download (http://embedxcode.weebly.com/download.html)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Jan 15, 2017, 08:17 pm
    New release embedXcode 6.0.6 updates support for unified Arduino 1.8.1 IDE.

    Download (http://embedxcode.weebly.com/download.html)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: mingletron on Feb 16, 2017, 03:25 pm
    Is anyone else seeing an issue where the sketchbook libraries are not populated?

    using Sierra 10.12.3
    And embedXcode 6.1.2

    I have the sketchbook directory specified in arduino.
    I can see the entry in the properties file but the sketchbook in Xcode only contains the readme.txt

    The other libraries are found fine.

    Code compiles if I use the "standard" libraries but I cannot use any libraries that should be in the sketchbook.

    Cheers in advance.

    I have RTFM
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Feb 16, 2017, 04:24 pm
    Please open a ticket at the Help Desk (http://embedxcode.weebly.com/help-desk.html) and provide the details listed at What Information to Provide When Asking for Help (https://embedxcode.freshdesk.com/solution/articles/1000046741-what-information-to-provide-when-asking-for-help).
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Namaan on Apr 03, 2017, 03:47 pm
    Hi,

    On a new install of MAC OS X Sierra 10.12.4, using the latest version of xcode (8.3) and embedxcode,
    when I create a new project (arduino, default options) and hit build, I get


    Quote
    Segmentation fault: 11
    make: *** [info] Error 1
    Command /Applications/Xcode.app/Contents/Developer/usr/bin/make failed with exit code 2
    I have Arduino IDE 1.8.2.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Apr 03, 2017, 04:45 pm
    Please update to release 6.2.0 as per "Segmentation Fault" Error (https://embedxcode.freshdesk.com/support/solutions/articles/11000024204--segmentation-fault-error).
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: stevie72 on Apr 08, 2017, 01:35 am
    Hello Guys,

    I have xcode Version 8.3.1 (8E1000a) and ESP8266 Version 2.3.0-rc2 on a Mac installed.
    Arduino is installad in the Version 1.8.2
    Same Problems as described before from other users ...

    Code: [Select]

    /Makefiles/Step1.mk:437: *** generic board is unknown.  Stop.



    Code: [Select]

         $(error $(BOARD_TAG) board is unknown)




    Any Ideas?

    Cheers, Stefan

    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Apr 08, 2017, 11:17 am
    @stevie72

    As for other users, please open a ticket at the Help Desk (http://embedxcode.weebly.com/help-desk.html) and provide the details listed at What Information to Provide When Asking for Help (https://embedxcode.freshdesk.com/solution/articles/1000046741-what-information-to-provide-when-asking-for-help).

    embedXcode currently supports

    Code: [Select]
    ESP8266_RELEASE                 = 2.3.0

    Now, you can update the board package or edit the About.mk file following the procedure Update the Releases for the Board Packages (https://embedxcode.freshdesk.com/support/solutions/articles/11000019602-update-the-releases-for-the-board-packages-).
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: stevie72 on Apr 08, 2017, 10:59 pm

    I got it working !

    Version 2.3.0 is stable

    Cheers Stefan

    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Respe on Apr 23, 2017, 09:54 pm
    make: /Users/respect/Library/Arduino15/packages/arduino/tools/bossac/1.7.0/bossac: No such file or directory
    make: *** [raw_upload] Error 1

    xcode Version 8.3.2 (8E2002)
    arduino 1.8.2
    arduino due
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Apr 24, 2017, 07:55 am
    Install Arduino SAMD Boards (32-bits ARM Cortex-M0+).
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Respe on Apr 24, 2017, 09:45 pm
    Thanks, helped.


    embedXcode+ - What additional functions does it include?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: tychop on Apr 27, 2017, 03:48 pm
    I am getting the noob error..... :-(

    "Error: sketchbook path not found"

    My setting in Arduino IDE is: "/Users/klm47954/Library/Mobile Documents/com~apple~CloudDocs/Arduino"
    I also tried location "/Users/klm47954/Documents/Arduino"

    But I get the same error....

    P.s. My projects in the Arduino IDE work just fine with these locations set...

    MacBookPro13,3 (15" TouchBar)
    macOS 10.12.4 (16E195)
    XCode Version 8.3.2 (8E2002)
    Arduino IDE 1.8.2
    embedXcode (not the + version because trying out)
    Arduino Uno rev. 3

    Error details:
    /Users/klm47954/Library/Mobile Documents/com~apple~CloudDocs/Arduino/xcodeprojects/DSG-GearMonitor/DSG-GearMonitor/Makefiles/ArduinoAVR_180.mk:65: *** Error: sketchbook path not found.  Stop.

    ~/Library/Arduino15/preferences.txt:
    board=uno
    boardsmanager.additional.urls=
    build.verbose=false
    build.warn_data_percentage=75
    compiler.cache_core=true
    compiler.warning_level=none
    console=true
    console.auto_clear=true
    console.error.file=stderr.txt
    console.length=500
    console.lines=4
    console.output.file=stdout.txt
    editor.antialias=true
    editor.caret.blink=true
    editor.code_folding=false
    editor.divider.size=0
    editor.external=false
    editor.font=Monaco,plain,12
    editor.indent=true
    editor.invalid=false
    editor.keys.alternative_cut_copy_paste=false
    editor.keys.home_and_end_beginning_end_of_doc=false
    editor.keys.shift_backspace_is_delete=true
    editor.languages.current=
    editor.linenumbers=false
    editor.save_on_verify=true
    editor.tabs.expand=true
    editor.tabs.size=2
    editor.update_extension=true
    editor.window.height.default=600
    editor.window.height.min=290
    editor.window.width.default=500
    editor.window.width.min=400
    export.applet.separate_jar_files=false
    export.application.fullscreen=false
    export.application.platform=true
    export.application.stop=true
    export.delete_target_folder=true
    gui.scale=auto
    last.ide.1.8.2.daterun=1493300363
    last.ide.1.8.2.hardwarepath=/Applications/Arduino.app/Contents/Java/hardware
    last.screen.height=900
    last.screen.width=1440
    last.sketch.count=1
    last.sketch.default.location=35,22,1405,878,712,6
    last.sketch.default.path=/Users/klm47954/Library/Mobile Documents/com~apple~CloudDocs/Arduino/projects/DSG-GearMonitor/DSG-GearMonitor.ino
    last.sketch0.location=35,22,1405,878,712,6
    last.sketch0.path=/Users/klm47954/Library/Mobile Documents/com~apple~CloudDocs/Arduino/projects/DSG-GearMonitor/DSG-GearMonitor.ino
    platform.auto_file_type_associations=true
    preproc.color_datatype=true
    preproc.enhanced_casting=true
    preproc.imports.list=java.applet.*,java.awt.Dimension,java.awt.Frame,java.awt.event.MouseEvent,java.awt.event.KeyEvent,java.awt.event.FocusEvent,java.awt.Image,java.io.*,java.net.*,java.text.*,java.util.*,java.util.zip.*,java.util.regex.*
    preproc.output_parse_tree=false
    preproc.save_build_files=false
    preproc.substitute_floats=true
    preproc.substitute_unicode=true
    preproc.web_colors=true
    programmer=arduino:avrispmkii
    proxy.manual.hostname=
    proxy.manual.password=
    proxy.manual.port=
    proxy.manual.type=HTTP
    proxy.manual.username=
    proxy.pac.url=
    proxy.type=auto
    recent.sketches=/Users/klm47954/Library/Mobile Documents/com~apple~CloudDocs/Arduino/projects/DSG-GearMonitor/DSG-GearMonitor.ino,/Users/klm47954/Library/Mobile Documents/com~apple~CloudDocs/Arduino/projects/bicolor8x8/bicolor8x8.ino,/Applications/Arduino.app/Contents/Java/examples/01.Basics/Blink/Blink.ino,/Applications/Arduino.app/Contents/Java/examples/01.Basics/BareMinimum/BareMinimum.ino
    run.display=1
    run.options=
    run.options.memory=false
    run.options.memory.initial=64
    run.options.memory.maximum=256
    run.present.bgcolor=#666666
    run.present.exclusive=true
    run.present.stop.color=#cccccc
    serial.databits=8
    serial.debug_rate=9600
    serial.parity=N
    serial.port=/dev/cu.usbmodem1441
    serial.port.file=cu.usbmodem1441
    serial.port.iserial=75630313536351A0C0B2
    serial.stopbits=1
    sketchbook.path=/Users/klm47954/Library/Mobile Documents/com~apple~CloudDocs/Arduino
    software=ARDUINO
    target_package=arduino
    target_platform=avr
    update.check=true
    update.id=9093398885407155017
    upload.using=bootloader
    upload.verbose=false
    upload.verify=true
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Sudetak on May 07, 2017, 07:52 am
    I am trying to bring my project from VisualMicro for Windows to embedXcode/Arduino. I managed to fix most of issues (there were not that many), but one still persists: I am not able to get SdFat library working. I use the Data logger sketch that comes with the library as a sort of test bed. It compiles fine under visual micro as well as the normal Arduino IDE.

    When I try to compile it in embedXcode, I get some „undefined reference to" errors from linker

    /Users/xxx/Library/Developer/Xcode/DerivedData/w1k-hceiuzqjyfurxefrcitlorgxfrjb/Build/Products/Debug/SDCard.cpp.o: In function `PrintFile::write(unsigned char const*, unsigned int)':

    The library is listed in makefile, gets compiled (at least partially) - I can see three .o files in the build folder (SdFat.cpp.o, SdFatUtil.cpp.o and MinumSerial.cpp.o). SDCard.cpp is an implementation of my class that uses the library, but I get the same error for built-in examples).

    I have opened a support ticket, got some good advice, but apparently not enough to fix the problem. Any more hints as where to look next?
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on May 07, 2017, 12:03 pm
    @tychop @Sudetak

    Best solution is to open a ticket at the Help Desk and provide a minimal example so I can replicate and investigate the issue.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on May 07, 2017, 12:10 pm
    I am trying to bring my project from VisualMicro for Windows to embedXcode/Arduino. I managed to fix most of issues (there were not that many), but one still persists: I am not able to get SdFat library working.

    [...]

    I have opened a support ticket, got some good advice, but apparently not enough to fix the problem. Any more hints as where to look next?
    I took the Datalogger.ino example and compiled it successfully on embedXcode.

    Please ensure the main makefile lists

    Code: [Select]
    APP_LIBS_LIST = SPI SD
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: ILIA_KISIL on Jun 30, 2017, 03:56 pm
    I am getting the noob error..... :-(

    "Error: sketchbook path not found"

    My setting in Arduino IDE is: "/Users/klm47954/Library/Mobile Documents/com~apple~CloudDocs/Arduino"
    I also tried location "/Users/klm47954/Documents/Arduino"

    But I get the same error....

    P.s. My projects in the Arduino IDE work just fine with these locations set...

    MacBookPro13,3 (15" TouchBar)
    macOS 10.12.4 (16E195)
    XCode Version 8.3.2 (8E2002)
    Arduino IDE 1.8.2
    embedXcode (not the + version because trying out)
    Arduino Uno rev. 3

    Error details:
    /Users/klm47954/Library/Mobile Documents/com~apple~CloudDocs/Arduino/xcodeprojects/DSG-GearMonitor/DSG-GearMonitor/Makefiles/ArduinoAVR_180.mk:65: *** Error: sketchbook path not found.  Stop.

    ~/Library/Arduino15/preferences.txt:
    board=uno
    boardsmanager.additional.urls=
    build.verbose=false
    build.warn_data_percentage=75
    compiler.cache_core=true
    compiler.warning_level=none
    console=true
    console.auto_clear=true
    console.error.file=stderr.txt
    console.length=500
    console.lines=4
    console.output.file=stdout.txt
    editor.antialias=true
    editor.caret.blink=true
    editor.code_folding=false
    editor.divider.size=0
    editor.external=false
    editor.font=Monaco,plain,12
    editor.indent=true
    editor.invalid=false
    editor.keys.alternative_cut_copy_paste=false
    editor.keys.home_and_end_beginning_end_of_doc=false
    editor.keys.shift_backspace_is_delete=true
    editor.languages.current=
    editor.linenumbers=false
    editor.save_on_verify=true
    editor.tabs.expand=true
    editor.tabs.size=2
    editor.update_extension=true
    editor.window.height.default=600
    editor.window.height.min=290
    editor.window.width.default=500
    editor.window.width.min=400
    export.applet.separate_jar_files=false
    export.application.fullscreen=false
    export.application.platform=true
    export.application.stop=true
    export.delete_target_folder=true
    gui.scale=auto
    last.ide.1.8.2.daterun=1493300363
    last.ide.1.8.2.hardwarepath=/Applications/Arduino.app/Contents/Java/hardware
    last.screen.height=900
    last.screen.width=1440
    last.sketch.count=1
    last.sketch.default.location=35,22,1405,878,712,6
    last.sketch.default.path=/Users/klm47954/Library/Mobile Documents/com~apple~CloudDocs/Arduino/projects/DSG-GearMonitor/DSG-GearMonitor.ino
    last.sketch0.location=35,22,1405,878,712,6
    last.sketch0.path=/Users/klm47954/Library/Mobile Documents/com~apple~CloudDocs/Arduino/projects/DSG-GearMonitor/DSG-GearMonitor.ino
    platform.auto_file_type_associations=true
    preproc.color_datatype=true
    preproc.enhanced_casting=true
    preproc.imports.list=java.applet.*,java.awt.Dimension,java.awt.Frame,java.awt.event.MouseEvent,java.awt.event.KeyEvent,java.awt.event.FocusEvent,java.awt.Image,java.io.*,java.net.*,java.text.*,java.util.*,java.util.zip.*,java.util.regex.*
    preproc.output_parse_tree=false
    preproc.save_build_files=false
    preproc.substitute_floats=true
    preproc.substitute_unicode=true
    preproc.web_colors=true
    programmer=arduino:avrispmkii
    proxy.manual.hostname=
    proxy.manual.password=
    proxy.manual.port=
    proxy.manual.type=HTTP
    proxy.manual.username=
    proxy.pac.url=
    proxy.type=auto
    recent.sketches=/Users/klm47954/Library/Mobile Documents/com~apple~CloudDocs/Arduino/projects/DSG-GearMonitor/DSG-GearMonitor.ino,/Users/klm47954/Library/Mobile Documents/com~apple~CloudDocs/Arduino/projects/bicolor8x8/bicolor8x8.ino,/Applications/Arduino.app/Contents/Java/examples/01.Basics/Blink/Blink.ino,/Applications/Arduino.app/Contents/Java/examples/01.Basics/BareMinimum/BareMinimum.ino
    run.display=1
    run.options=
    run.options.memory=false
    run.options.memory.initial=64
    run.options.memory.maximum=256
    run.present.bgcolor=#666666
    run.present.exclusive=true
    run.present.stop.color=#cccccc
    serial.databits=8
    serial.debug_rate=9600
    serial.parity=N
    serial.port=/dev/cu.usbmodem1441
    serial.port.file=cu.usbmodem1441
    serial.port.iserial=75630313536351A0C0B2
    serial.stopbits=1
    sketchbook.path=/Users/klm47954/Library/Mobile Documents/com~apple~CloudDocs/Arduino
    software=ARDUINO
    target_package=arduino
    target_platform=avr
    update.check=true
    update.id=9093398885407155017
    upload.using=bootloader
    upload.verbose=false
    upload.verify=true

    I think, I had similar issues but with Teensy board and therefore different makefile. Basically, the system couldn't find preferences.txt file in order to extract sketchbook path. This file is located in ~/Library/Arduino15/preferences.txt

    In my case, the following line would through Error: sketchbook path not found because of the following part:

    Code: [Select]
    ifeq ($(wildcard $(SKETCHBOOK_DIR)),)
       SKETCHBOOK_DIR = $(shell grep sketchbook.path $(ARDUINO_180_LIBRARY_PATH)/preferences.txt | cut -d = -f 2)
    endif


    Namely with variable ARDUINO_180_LIBRARY_PATH. So I defined it just before this if statement:

    Code: [Select]
    ARDUINO_180_LIBRARY_PATH=~/Library/Arduino15

    This worked for me.)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Jun 30, 2017, 04:31 pm
    Code: [Select]
    sketchbook.path=/Users/klm47954/Library/Mobile Documents/com~apple~CloudDocs/Arduino

    The problem is, the path to the sketchbook contains special characters, which are not very friendly with GCC. ~ is considered as /Users/klm47954.

    Please refer to Avoid spaces and special characters in the name and path of the projects (https://embedxcode.freshdesk.com/solution/articles/1000120953-avoid-spaces-and-special-characters-in-the-name-and-path-of-the-projects).
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: dadamou1997 on Aug 31, 2017, 05:29 am
    I am getting the error "/Users/Danny/Documents/Xcode/Arduino/Arduino/Makefiles/Step1.mk:279: *** uno board is unknown.  Stop.
    "
    and it shows this :

    (https://image.noelshack.com/fichiers/2017/35/4/1504150146-capture-d-ecran-2017-08-31-a-04-27-37.png)

    What should i do ?  :(  :(  :(
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Aug 31, 2017, 09:41 am
    I am getting the error "/Users/Danny/Documents/Xcode/Arduino/Arduino/Makefiles/Step1.mk:279: *** uno board is unknown.  Stop.
    "
    and it shows this :
    [...]

    What should i do ?  :(  :(  :(
    Help yourself!
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Oct 17, 2017, 09:27 pm
    The embedXcode User Manual is now available as a dedicated website.

    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: rcwhiteley on Dec 18, 2017, 12:50 am
    Help yourself!
    • See Check platforms and MCUs page 326 sq. of the User Manual (https://itunes.apple.com/book/embedxcode/id667501748)
    • Read Check platforms and MCUs on the Help Desk portal (https://embedxcode.freshdesk.com/support/solutions/articles/11000032859--check-platforms-and-mcus)
    • If neither solutions work, open a ticket on the Help Desk (http://embedxcode.weebly.com/help-desk.html).


    @avenue33. Just to let you know the User Manual is not available in the UK. I have the same error as above and am trying to solve it:
    *** uno board is unknown.  Stop.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Dec 27, 2017, 05:29 am
    @rcwhiteley

    The User Manual as an iBook has been discontinued since September 29, 2017 (https://embedxcode.weebly.com/blog/embedxcode-user-manual-as-a-website).

    The User Manual is now available as a website (https://embedxcode.com).

    (https://embedxcode.weebly.com/uploads/1/1/6/2/11624344/capture-2017-10-04-17-37-53_orig.png)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Diodac on Aug 14, 2018, 02:00 pm
    Hi everyone!
    I have a question. Where I can get embedXcode for El Capitan 10.11.6, Xcode 7 working with Teensy 3.2?
    Thank you!!!
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Aug 14, 2018, 02:31 pm
    Please check the download page of the embedXcode website (https://embedxcode.weebly.com).

    Quote
    For legacy systems with Xcode 8 on Mac OS X 10.11 El Capitan or macOS 10.12 Sierra, please select the embedXcode Legacy 8 installation package. It corresponds to embedXcode release 7.6.8.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: Diodac on Aug 15, 2018, 08:14 pm
    Hi avenue33,
    Yeah I checked website and all available eX not working for me. Version recommended for OS X 10.11 I tried to install but during installation I get problems, eX asking for OS X 10.12.
    I have pretty old MacBook Pro late 2009 with El Capitan 10.11.6 , Xcode 7.
    I can't upgrade my Mac to Sierra because too old, the higher OS what I can use is 10.11.6 at the moment.

    I need eX older version than is available on your website. But I didn't see around any option to download.
    Thank you.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Aug 15, 2018, 11:33 pm
    Unfortunately, prior releases of embedXcode are no longer available.

    Even if there were available, they would require very old releases of the IDEs, tools and libraries that are no longer available.

    Sorry.
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: 3Dogs on Aug 28, 2018, 03:58 am
    I am a new EmbedXcode user (and a novice Arduino user, to boot). I am trying to develop on the ESP-32 TTGO LORA-OLED board. I got some test code working under the Arduino IDE, but when I try to get it to compile under Xcode, it can't find some header files that are referenced from other header files.

    I am using BLE, and I have included the BLE library here in the make file:
    #
    APP_LIBS_LIST = Wire BLE

    But, some of the headers in BLE refer to files in a different location. For example, bleaddress.h references esp_gap_ble_api.h, which is located here:
    ~/Documents/Arduino/hardware/espressif/esp32/tools/sdk/include/bluedroid/api/esp_gap_ble_api.h

    bluedroid is not a "library", so adding it to the makefile doesn't help. Also, explicitly adding the full path to the file doesn't work, either.

    How do I tell Xcode (via EmbedXcode) to search this path:
    ~/Documents/Arduino/hardware/espressif/esp32/tools/sdk/include/bluedroid/api

    ??

    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Aug 28, 2018, 09:21 am
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: 3Dogs on Sep 01, 2018, 12:55 am
    I created a ticket, and support responded with an updated make file that fixes the issue.

    Now I am having a different problem. When I try to compile the code, I get the following error:

    throw new BLEUuidNotFoundException;      error: exception handling disabled, use -fexceptions to enable

    I searched for this error and found a thread that says to change -fno-exceptions to -fexceptions in platform.txt, but doing this had no effect (do I need to start from scratch on a new project?).

    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Sep 01, 2018, 06:48 am
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Sep 28, 2018, 05:06 pm
    Please find a new major release of embedXcode.

    embedXcode now supports Xcode 10 on macOS 10.14 Mojave.

    Download (https://embedxcode.weebly.com/download.html)
    Title: Re: Arduino on Xcode Project — Official Thread
    Post by: avenue33 on Nov 07, 2018, 07:39 pm
    Release 10.2.3 updates support for Xcode 10.1 and macOS 10.14.1.

    Download (https://embedxcode.weebly.com/download.html)