NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Microcontroller Programming » Where do these *,h files reside?

January 02, 2012
by jeffspc88mx
jeffspc88mx's Avatar

Where are these files kept? I can't find them anywhere. OS X search capability sucks, so no help there. I tried "unhiding" files, but no luck. Are they on the chip itself?

#include <stdio.h>
#include <math.h>
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/pgmspace.h>
#include <inttypes.h>
January 02, 2012
by pcbolt
pcbolt's Avatar

@jeffspc88mx

I'm not sure this helps but on my machine (Windoze) all the files are in:

C:\WinAVR-20090313\avr\include\avr

or

C:\WinAVR-20090313\avr\include

Happy hunting...

January 03, 2012
by Rick_S
Rick_S's Avatar

On my mac mini, my includes are in /usr/local/CrossPack-AVR-20100115/avr/include

I installed CrossPack AVR instead of the AVRMacPack, but I believe they install in the same place. CrossPack AVR is just the newer release of AVRMacPack - Renamed. I'm real new at Mac, so I won't be of much help. I do have the tool chain working, but haven't tried the prolific drivers yet. So far I have ISP programming with and USBASP programmer, and Arduino drivers working both the newer arduino's as well as the FTDI based ones. I never used the prolific adapter on my PC's so I don't even know where it is??

Anyway, sorry to sidetrack. Hope the location info helps out.

Rick

January 03, 2012
by jeffspc88mx
jeffspc88mx's Avatar

Aha - looking for "include" folders got me somewhere. I have at least two copies of these files

//Firefly/Developer/SDKs/MacOS10.x.sdk/usr/include/... (where x is 5 or 6)

Found a bunch of stdio.h files, actually, within this scope, and others.

No avr/* yet though. Weird.

Everything's worked so far though, so I guess the program's finding it somewhere. It's just my nature to try to figure stuff like this out. I can't stand not knowing why things work (or don't work), so I get a little crazy. :\

January 03, 2012
by treymd
treymd's Avatar

It looks like to me that you've located the files belonging to your native toolchain, perhaps x86 architecture? the avr toolchain has it's own set of files, and does include a separate stdio.h and many of the other standard includes/libraries that you'd see in the native toolchain. The avr set is optimized and cross compiled specifically for the avr processor and the two do not mingle to my knowledge.

January 03, 2012
by treymd
treymd's Avatar

see if running "avr-gcc -v" spits out what it does on my linux system, that being it's compile time options which probably includes the --prefix switch which I bet may lead you to your avr include directory

January 04, 2012
by Ralphxyz
Ralphxyz's Avatar

On my MAC Mini I tried "avr-gcc -v" as suggested by treymd:

Last login: Wed Jan  4 09:03:02 on console
miniMac:~ Me$ avr-gcc -v
Using built-in specs.
Target: avr
Configured with: 
../configure 
--prefix=/usr/local/CrossPack-AVR-20100115 
--disable-dependency-tracking 
--disable-nls 
--disable-werror 
--target=avr 
--enable-languages=c,c++ 
--disable-nls 
--disable-libssp 
--with-dwarf2
Thread model: single
gcc version 4.3.3 (GCC) 
miniMac:~ Me$ cd /usr/local/CrossPack-AVR-20100115
miniMac:CrossPack-AVR-20100115 Me$ ls
avr     avr-4       bin     etc     info        libexec     manual      share       versions.txt
avr-3       bfd     doc     include     lib     man     revision.txt    uninstall
miniMac:CrossPack-AVR-20100115 Me$ cd avr
miniMac:avr Me$ ls
bin include lib
miniMac:avr Me$ cd include
miniMac:include Me$ ls
alloca.h    avr     ctype.h     inttypes.h  setjmp.h    stdio.h     string.h
assert.h    compat      errno.h     math.h      stdint.h    stdlib.h    util
miniMac:include Me$

So for me the files reside within "/usr/local/CrossPack-AVR-20100115 " just as Rick said!

Of course /usr is a "hidden" folder so I had to use the command line, uh Terminal, to track them down.

Hey Rick did you get a mini for Christmas, I hadn't seen you mention having a mac before :-:)

Ralph

January 04, 2012
by Rick_S
Rick_S's Avatar

No, my son had a circa 2006 mini he didn't use much anymore. He offered it to me for $50 and I couldn't pass that up. It was a single core 1.5GHz Intel core solo with 1.25G Ram. I swapped the cpu out for a 1.83GHz Core 2 Duo and upped the memory to 2G. I've often been curious about mac but the price was too much for what you got (in my opinion anyway). So now I have a mini running snow leopard to play with. AVR wise, everything I've used has worked. Like I said though, I haven't installed prolific drivers because frankly I don't even know where my original USB/Serial adapter is. I got my kit before they had this batch of cables.

I doubt I'll ever turn completely to the mac side of things but its fun to play with and runs quite fluidly for as little power as it has.

Rick

January 04, 2012
by jeffspc88mx
jeffspc88mx's Avatar

Ah yes - there they are. Thanks guys!

January 12, 2012
by jeffspc88mx
jeffspc88mx's Avatar

So... a followup question:

How does "make" know to look in the usr/.. directory for those files?

Where else is it looking?

Where doesn't it look?

January 13, 2012
by Rick_S
Rick_S's Avatar

I'm not too sure in the Mac world but in the PC world there is an environmental variable called Path that Windows uses to find things not in the current directory. I'm sure it's similar with Mac/Linux/Unix but I'm not sure what the variable is called.

January 13, 2012
by treymd
treymd's Avatar

make in and of itself doesn't care where the files exist, avr-gcc knows where they are because it was compiled with the aforementioned option. make just calls avr-gcc because it is told to in the Makefile. You could probably add to the searched directories using switches in the Makefile, if you really wanted to.

January 13, 2012
by Rick_S
Rick_S's Avatar

Sorry misread the question. I thought he was asking how the computer knew where make was.

Post a Reply

Please log in to post a reply.

Did you know that interrupts can be used to trigger pieces of code when events happen? Learn more...