[Mac OS X] Development Environment Poll

Go To Last Post
9 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Unless you have been living under a rock the last two days, you know that Apple has released it's iPhone SDK into the wild in beta format. What isn't as obvious is that this SDK is actually an update to XCode bringing it up to version 3.1. The update allows XCode to support multiple platforms and SDKs. For example, the iPhone is running an ARM processor with a highly modified version of the Mac OS X kernel. By changing the SDK, the compiler, tools, libraries, and headers are changed. My thought is to use this feature for AVR development.

This only makes sense if two things line up. First, I can get this to work (I have been playing with XCode 3.1 for about an hour now). Second, there are people interested in using XCode as an AVR IDE.

Questions, complaints, comments and discussion are more than welcome. Voting will make it easier to figure out if this is worth the time it will take to decipher.

You can have my mac when you pry my cold dead fingers off of it.

Kevin McEnhill -- mcenhillk@gmail.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

while not completely integrated, AVR Mac Pack already uses (or allows) X Code to be used as a development environment.

Writing code is like having sex.... make one little mistake, and you're supporting it for life.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The AVR Mac Pack is just a project template which most versions of the pre-compiled tool chain. What this new XCode release has done is made it possible to integrate almost all of the tool chain into XCode.

You can have my mac when you pry my cold dead fingers off of it.

Kevin McEnhill -- mcenhillk@gmail.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Any progress on this front?

I have been playing with compiling AVR in XCode (using C++ no less!) in XCode 3.1. I have successfully used MacAVR to write small programs and download them to an STK500 board. But I don't want to use the makefile approach because I want to manage the files and build options in XCode.

My goal is to ultimately be able to select an AVR project from New Projects... and then to add source files, build and end up with an .elf file ready for downloading to the part. I also want to have a "Program" target like MacAVR to download to the part. The ultimate would of course be to debug in XCode using AVaRice or something. But that is for later, if ever!

I have looked at many XCode plugins, but have not found any to be of much help. The MacAVR templates are a little helpful just for seeing how to get a project template into the New Project list.

I've tried cloning the iPhone SDK files at /Developer/Platforms/iPhoneOS.platform. I got a little ways with this, but found the syntax pretty inscrutable.

Then I just tried making a script based build rule, which used the environment variables from XCode as input to the compile. This allowed me to compile all my files using the proper include files from avr libc. I can even use the drop down menu to Compile and get reasonable clickable error messages in the build console. But I could not get the linker to work. It tries to use a linker in some odd place off in the depths of XCode, but I can't find how to control that.

Because of my cloning of the iPhone SDK, I can set the "Base SDK for All Configurations" to "AVR" (because I have an AVR.platform in /Developer/Platforms). But I have never been able to get the system to recognize "avr" as an architecture rather than "armv6", even though I changed from one to the other in many of the spec files in AVR.platform.

I'd be happy to work with anyone who wants to achieve this goal.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It would be nice if someone would add the avr toolset to xcode, but for now I'm quite happy with avr macpack.
I made a small quick "n00b hack" to make avr macpack more bearable so you no longer have to alt-tab out and type in "make flash" in the terminal all the time.

Just double click the target "firmware" and fill in the same things as in the pic which I attached.
This together with a custom makefile template makes it a breeze.

Even though I like the way how I can dev avr's in xcode now, I wouldn't mind helping you cmarrin, although I'm not a xcode guru. Any attempt to make avr programming easier in xcode is a good attempt 8)

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This is the linker setting I used with Xcode 2.4. I could not figure how to change it from using the i386 link list file so I just used that file to gather the list of files to link. It worked. I have not looked at this since December 2006. I have a new project and was looking to see what has changed as far as using Xcode 3.1 vs Xcode 2.4.

ECHO 1
#/opt/local/bin/avr-gcc `cat $LINK_FILE_LIST_normal_i386` -Wl,-Map=$OBJECT_FILE_DIR/testavr.map,--cref -mmcu=$MMCU -lm -o $OBJECT_FILE_DIR/testavr.elf
#ECHO /opt/local/bin/avr-gcc-4.0.2 `cat $LINK_FILE_LIST_normal_i386` -Wl,-Map=$OBJECT_FILE_DIR/testavr.map,--cref -mmcu=$MMCU -lm -o $OBJECT_FILE_DIR/testavr.elf
/opt/local/bin/avr-gcc-4.0.2 `cat $LINK_FILE_LIST_normal_i386` -Wl,-Map=$OBJECT_FILE_DIR/testavr.map,--cref -mmcu=$MMCU -o $OBJECT_FILE_DIR/testavr.elf
ECHO 2
#/opt/local/bin/avr-gcc `cat $OBJECT_FILES` -Wl,-Map=$DERIVED_FILE_DIR/testavr.map,--cref -mmcu=$MMCU -o $DERIVED_FILE_DIR/testavr.elf
#/opt/local/bin/avr-objcopy -O ihex $DERIVED_FILE_DIR/testavr.elf $DERIVED_FILE_DIR/testavr.hex
ECHO /opt/local/bin/avr-objcopy -O ihex $OBJECT_FILE_DIR/testavr.elf $OBJECT_FILE_DIR/testavr.hex
/opt/local/bin/avr-objcopy -O ihex $OBJECT_FILE_DIR/testavr.elf $OBJECT_FILE_DIR/testavr.hex
ECHO 3
ECHO mv $OBJECT_FILE_DIR/testavr.hex /Users/jim/Documents/Parallels/AVR\ Downloads/testavr.hex
mv $OBJECT_FILE_DIR/testavr.hex /Users/jim/Documents/Parallels/AVR\ Downloads/testavr.hex
/opt/local/bin/avr-size $OBJECT_FILE_DIR/testavr.elf

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This would be very nice! :)

Math is cool.
jevinskie.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Update: I don't have anything working and it doesn't look like I will be able to make any progress in the next couple of months. It isn't that I have hit a technical road block but I don't have the time right now. I have been away from home for the last four months courtesy of the Air Force learning a new job. There will be more training once I get back to my home base but I should have some down time to work on this.

Any questions, complaints, and/or comments will be welcomed.

You can have my mac when you pry my cold dead fingers off of it.

Kevin McEnhill -- mcenhillk@gmail.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I wrote a couple of templates for xcode as part of http://osxavr.sf.net.
But avrmacpack is much nicer package as a whole.
I have tweaked them to work for avrmacpack.

http://www.brokentoaster.com/Xco...

Don't do much but a start.
I looked at integrating avr-gdb with xcodes debugger but gave up as I don't have the knowledge of gdb needed to get it working.

I think with the new xcode and iPhone sdk there could be some progress on this front.