GNU GCC Arm and OSX

Get the precompiled toolchain here

Download and extract folder, copy to /usr/local/.
Update link to /usr/local/arm-gcc (ln -s /usr/local/gcc-arm-none-eabi-{version} /usr/local/arm-gcc)

Once only: Add gcc-arm to path:
Edit /etc/paths.d/60-arm-gcc
/usr/local/arm-gcc/bin

Also add man paths
Edit /etc/manpaths.d/60-arm-gcc
/usr/local/arm-gcc/share/doc/gcc-arm-none-eabi/man

A bit of a ‘bug’ in os x is path_helper (run from /etc/profile) doesn’t set MANPATH if it’s not already defined. So A quick hack is to add the following lines in /etc/profile:

MANPATH=
export MANPATH

So the complete file looks like:

# System-wide .profile for sh(1)
MANPATH=
export MANPATH

if [ -x /usr/libexec/path_helper ]; then
eval `/usr/libexec/path_helper -s`
fi

if [ "${BASH-no}" != "no" ]; then
[ -r /etc/bashrc ] && . /etc/bashrc
fi

Then all man paths defined in /etc/manpaths.d will be set

Buliding simavr on OS 10.9 (Mavericks) with CrosspackAVR

A brief howto build simavr using CrosspackAVR avr-gcc toolchain

First download the source to simavr from here

git clone https://github.com/buserror-uk/simavr.git

Using Homebrew install libelf (thanks to post here by Robert Nees):
brew install libelf

I needed to make symbolic links to the libelf header files:
cd /usr/local/include
ln -s libelf/* .

Edit the Makefile.common in the simavr git repo you’ve downloaded and change the following lines:
AVR_ROOT := "/usr/local/CrossPack-AVR/"
AVR_INC := ${AVR_ROOT}/avr/
AVR := ${AVR_ROOT}/bin/avr-
# Thats for MacPorts libelf
ifeq (${shell test -d /usr/local && echo Exists}, Exists)
IPATH += /usr/local/include
LFLAGS = -L/usr/local/lib

Then just make and make install and you are done! Now to figure out how to use it.

For your reference, here’s my make output:
/Library/Developer/CommandLineTools/usr/bin/make -C simavr RELEASE=0
CONF obj-x86_64-apple-darwin13.0.0/cores.deps
WARNING cores/sim_mega324.c did not compile, check your avr-gcc toolchain
/Library/Developer/CommandLineTools/usr/bin/make obj config
make[2]: Nothing to be done for `obj'.
CONF sim_core_decl.h
/Library/Developer/CommandLineTools/usr/bin/make libsimavr run_avr
CC sim/sim_avr.c
CC sim/sim_core.c
CC sim/sim_cycle_timers.c
CC sim/sim_elf.c
CC sim/sim_gdb.c
CC sim/sim_hex.c
CC sim/sim_interrupts.c
CC sim/sim_io.c
CC sim/sim_irq.c
CC sim/sim_vcd_file.c
CC sim/avr_adc.c
CC sim/avr_bitbang.c
CC sim/avr_eeprom.c
CC sim/avr_extint.c
CC sim/avr_flash.c
CC sim/avr_ioport.c
CC sim/avr_lin.c
CC sim/avr_spi.c
CC sim/avr_timer.c
CC sim/avr_twi.c
CC sim/avr_uart.c
CC sim/avr_usb.c
CC sim/avr_watchdog.c
CORE cores/sim_90usb162.c
CORE cores/sim_mega128.c
CORE cores/sim_mega1280.c
CORE cores/sim_mega1281.c
CORE cores/sim_mega1284.c
CORE cores/sim_mega128rfa1.c
CORE cores/sim_mega16.c
CORE cores/sim_mega164.c
CORE cores/sim_mega168.c
CORE cores/sim_mega16m1.c
CORE cores/sim_mega2560.c
CORE cores/sim_mega32.c
CORE cores/sim_mega328.c
CORE cores/sim_mega48.c
CORE cores/sim_mega644.c
CORE cores/sim_mega8.c
CORE cores/sim_mega88.c
CORE cores/sim_megax.c
CORE cores/sim_megax4.c
CORE cores/sim_megax8.c
CORE cores/sim_megaxm1.c
CORE cores/sim_tiny13.c
CORE cores/sim_tiny2313.c
CORE cores/sim_tiny24.c
CORE cores/sim_tiny25.c
CORE cores/sim_tiny44.c
CORE cores/sim_tiny45.c
CORE cores/sim_tiny84.c
CORE cores/sim_tiny85.c
CORE cores/sim_tinyx4.c
CORE cores/sim_tinyx5.c
AR obj-x86_64-apple-darwin13.0.0/libsimavr.a
CC sim/run_avr.c
LD obj-x86_64-apple-darwin13.0.0/run_avr.elf
ln -sf obj-x86_64-apple-darwin13.0.0/run_avr.elf run_avr
/Library/Developer/CommandLineTools/usr/bin/make -C tests RELEASE=0
AVR-CC atmega48_disabled_timer.c
171 0 0 171 ab atmega48_disabled_timer.axf
AVR-CC atmega48_enabled_timer.c
177 0 0 177 b1 atmega48_enabled_timer.axf
AVR-CC atmega48_watchdog_test.c
371 82 6 459 1cb atmega48_watchdog_test.axf
AVR-CC atmega644_adc_test.c
2038 160 22 2220 8ac atmega644_adc_test.axf
AVR-CC atmega88_coroutine.c
703 36 159 898 382 atmega88_coroutine.axf
AVR-CC atmega88_example.c
1746 118 6 1870 74e atmega88_example.axf
AVR-CC atmega88_timer16.c
334 0 2 336 150 atmega88_timer16.axf
AVR-CC atmega88_uart_echo.c
1872 68 88 2028 7ec atmega88_uart_echo.axf
AVR-CC attiny85_crash_gdb.c
97 0 0 97 61 attiny85_crash_gdb.axf
TST obj-x86_64-apple-darwin13.0.0/test_atmega48_disabled_timer.tst
TST obj-x86_64-apple-darwin13.0.0/test_atmega48_enabled_timer.tst
TST obj-x86_64-apple-darwin13.0.0/test_atmega48_watchdog_test.tst
TST obj-x86_64-apple-darwin13.0.0/test_atmega644_adc_test.tst
TST obj-x86_64-apple-darwin13.0.0/test_atmega88_example.tst
TST obj-x86_64-apple-darwin13.0.0/test_atmega88_timer16.tst
TST obj-x86_64-apple-darwin13.0.0/test_atmega88_uart_echo.tst
/Library/Developer/CommandLineTools/usr/bin/make -C examples RELEASE=0
uname: illegal option -- o
usage: uname [-amnprsv]
for bi in board_hd77480 board_i2ctest board_ledramp board_simduino board_timer_64led; do /Library/Developer/CommandLineTools/usr/bin/make -C $bi; done
AVR-CC atmega48_charlcd.c
2073 14 5 2092 82c atmega48_charlcd.axf
CC ../parts/ac_input.c
CC ../parts/hd44780.c
CC ../parts/hd44780_glut.c
charlcd.c:103:5: warning: 'glutSwapBuffers' is deprecated: first deprecated in OS X 10.9 [-Wdeprecated-declarations]
glutSwapBuffers();
^
/System/Library/Frameworks/GLUT.framework/Headers/glut.h:448:22: note: 'glutSwapBuffers' declared here
extern void APIENTRY glutSwapBuffers(void) OPENGL_DEPRECATED(10_0, 10_9);
^
charlcd.c:111:2: warning: 'glutTimerFunc' is deprecated: first deprecated in OS X 10.9 [-Wdeprecated-declarations]
glutTimerFunc(1000/64, timerCB, 0);
^
/System/Library/Frameworks/GLUT.framework/Headers/glut.h:514:22: note: 'glutTimerFunc' declared here
extern void APIENTRY glutTimerFunc(unsigned int millis, void (*func)(int value), int value) OPENGL_DEPRECATED(10...
^
charlcd.c:112:2: warning: 'glutPostRedisplay' is deprecated: first deprecated in OS X 10.9 [-Wdeprecated-declarations]
glutPostRedisplay();
^
/System/Library/Frameworks/GLUT.framework/Headers/glut.h:444:22: note: 'glutPostRedisplay' declared here
extern void APIENTRY glutPostRedisplay(void) OPENGL_DEPRECATED(10_0, 10_9);
^
charlcd.c:125:2: warning: 'glutDisplayFunc' is deprecated: first deprecated in OS X 10.9 [-Wdeprecated-declarations]
glutDisplayFunc(displayCB); /* set window's display callback */
^
/System/Library/Frameworks/GLUT.framework/Headers/glut.h:505:22: note: 'glutDisplayFunc' declared here
extern void APIENTRY glutDisplayFunc(void (*func)(void)) OPENGL_DEPRECATED(10_0, 10_9);
^
charlcd.c:126:2: warning: 'glutKeyboardFunc' is deprecated: first deprecated in OS X 10.9 [-Wdeprecated-declarations]
glutKeyboardFunc(keyCB); /* set window's key callback */
^
/System/Library/Frameworks/GLUT.framework/Headers/glut.h:507:22: note: 'glutKeyboardFunc' declared here
extern void APIENTRY glutKeyboardFunc(void (*func)(unsigned char key, int x, int y)) OPENGL_DEPRECATED(10_0, 10_9);
^
charlcd.c:127:2: warning: 'glutTimerFunc' is deprecated: first deprecated in OS X 10.9 [-Wdeprecated-declarations]
glutTimerFunc(1000 / 24, timerCB, 0);
^
/System/Library/Frameworks/GLUT.framework/Headers/glut.h:514:22: note: 'glutTimerFunc' declared here
extern void APIENTRY glutTimerFunc(unsigned int millis, void (*func)(int value), int value) OPENGL_DEPRECATED(10...
^
charlcd.c:231:2: warning: 'glutInit' is deprecated: first deprecated in OS X 10.9 [-Wdeprecated-declarations]
glutInit(&argc, argv); /* initialize GLUT system */
^
/System/Library/Frameworks/GLUT.framework/Headers/glut.h:431:22: note: 'glutInit' declared here
extern void APIENTRY glutInit(int *argcp, char **argv) OPENGL_DEPRECATED(10_0, 10_9);
^
charlcd.c:237:2: warning: 'glutInitDisplayMode' is deprecated: first deprecated in OS X 10.9 [-Wdeprecated-declarations]
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
^
/System/Library/Frameworks/GLUT.framework/Headers/glut.h:432:22: note: 'glutInitDisplayMode' declared here
extern void APIENTRY glutInitDisplayMode(unsigned int mode) OPENGL_DEPRECATED(10_0, 10_9);
^
charlcd.c:238:2: warning: 'glutInitWindowSize' is deprecated: first deprecated in OS X 10.9 [-Wdeprecated-declarations]
glutInitWindowSize(w * pixsize, h * pixsize); /* width=400pixels height=500pixels */
^
/System/Library/Frameworks/GLUT.framework/Headers/glut.h:437:22: note: 'glutInitWindowSize' declared here
extern void APIENTRY glutInitWindowSize(int width, int height) OPENGL_DEPRECATED(10_0, 10_9);
^
charlcd.c:239:11: warning: 'glutCreateWindow' is deprecated: first deprecated in OS X 10.9 [-Wdeprecated-declarations]
window = glutCreateWindow("Press 'q' to quit"); /* create window */
^
/System/Library/Frameworks/GLUT.framework/Headers/glut.h:441:21: note: 'glutCreateWindow' declared here
extern int APIENTRY glutCreateWindow(const char *title) OPENGL_DEPRECATED(10_0, 10_9);
^
charlcd.c:246:2: warning: 'glutMainLoop' is deprecated: first deprecated in OS X 10.9 [-Wdeprecated-declarations]
glutMainLoop();
^
/System/Library/Frameworks/GLUT.framework/Headers/glut.h:438:22: note: 'glutMainLoop' declared here
extern void APIENTRY glutMainLoop(void) OPENGL_DEPRECATED(10_0, 10_9);
^
11 warnings generated.
CC charlcd.c
LD obj-x86_64-apple-darwin13.0.0/charlcd.elf
charlcd done
AVR-CC atmega1280_i2ctest.c
941 16 12 969 3c9 atmega1280_i2ctest.axf
CC i2ctest.c
CC ../../examples/parts/i2c_eeprom.c
LD obj-x86_64-apple-darwin13.0.0/i2ctest.elf
i2ctest done
AVR-CC atmega48_ledramp.c
1839 32 11 1882 75a atmega48_ledramp.axf
CC ../parts/button.c
ledramp.c:85:5: warning: 'glutSwapBuffers' is deprecated: first deprecated in OS X 10.9 [-Wdeprecated-declarations]
glutSwapBuffers();
^
/System/Library/Frameworks/GLUT.framework/Headers/glut.h:448:22: note: 'glutSwapBuffers' declared here
extern void APIENTRY glutSwapBuffers(void) OPENGL_DEPRECATED(10_0, 10_9);
^
ledramp.c:118:2: warning: 'glutTimerFunc' is deprecated: first deprecated in OS X 10.9 [-Wdeprecated-declarations]
glutTimerFunc(1000/64, timerCB, 0);
^
/System/Library/Frameworks/GLUT.framework/Headers/glut.h:514:22: note: 'glutTimerFunc' declared here
extern void APIENTRY glutTimerFunc(unsigned int millis, void (*func)(int value), int value) OPENGL_DEPRECATED(10...
^
ledramp.c:122:3: warning: 'glutPostRedisplay' is deprecated: first deprecated in OS X 10.9 [-Wdeprecated-declarations]
glutPostRedisplay();
^
/System/Library/Frameworks/GLUT.framework/Headers/glut.h:444:22: note: 'glutPostRedisplay' declared here
extern void APIENTRY glutPostRedisplay(void) OPENGL_DEPRECATED(10_0, 10_9);
^
ledramp.c:214:2: warning: 'glutInit' is deprecated: first deprecated in OS X 10.9 [-Wdeprecated-declarations]
glutInit(&argc, argv); /* initialize GLUT system */
^
/System/Library/Frameworks/GLUT.framework/Headers/glut.h:431:22: note: 'glutInit' declared here
extern void APIENTRY glutInit(int *argcp, char **argv) OPENGL_DEPRECATED(10_0, 10_9);
^
ledramp.c:216:2: warning: 'glutInitDisplayMode' is deprecated: first deprecated in OS X 10.9 [-Wdeprecated-declarations]
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
^
/System/Library/Frameworks/GLUT.framework/Headers/glut.h:432:22: note: 'glutInitDisplayMode' declared here
extern void APIENTRY glutInitDisplayMode(unsigned int mode) OPENGL_DEPRECATED(10_0, 10_9);
^
ledramp.c:217:2: warning: 'glutInitWindowSize' is deprecated: first deprecated in OS X 10.9 [-Wdeprecated-declarations]
glutInitWindowSize(8 * pixsize, 1 * pixsize); /* width=400pixels height=500pixels */
^
/System/Library/Frameworks/GLUT.framework/Headers/glut.h:437:22: note: 'glutInitWindowSize' declared here
extern void APIENTRY glutInitWindowSize(int width, int height) OPENGL_DEPRECATED(10_0, 10_9);
^
ledramp.c:218:11: warning: 'glutCreateWindow' is deprecated: first deprecated in OS X 10.9 [-Wdeprecated-declarations]
window = glutCreateWindow("Glut"); /* create window */
^
/System/Library/Frameworks/GLUT.framework/Headers/glut.h:441:21: note: 'glutCreateWindow' declared here
extern int APIENTRY glutCreateWindow(const char *title) OPENGL_DEPRECATED(10_0, 10_9);
^
ledramp.c:227:2: warning: 'glutDisplayFunc' is deprecated: first deprecated in OS X 10.9 [-Wdeprecated-declarations]
glutDisplayFunc(displayCB); /* set window's display callback */
^
/System/Library/Frameworks/GLUT.framework/Headers/glut.h:505:22: note: 'glutDisplayFunc' declared here
extern void APIENTRY glutDisplayFunc(void (*func)(void)) OPENGL_DEPRECATED(10_0, 10_9);
^
ledramp.c:228:2: warning: 'glutKeyboardFunc' is deprecated: first deprecated in OS X 10.9 [-Wdeprecated-declarations]
glutKeyboardFunc(keyCB); /* set window's key callback */
^
/System/Library/Frameworks/GLUT.framework/Headers/glut.h:507:22: note: 'glutKeyboardFunc' declared here
extern void APIENTRY glutKeyboardFunc(void (*func)(unsigned char key, int x, int y)) OPENGL_DEPRECATED(10_0, 10_9);
^
ledramp.c:229:2: warning: 'glutTimerFunc' is deprecated: first deprecated in OS X 10.9 [-Wdeprecated-declarations]
glutTimerFunc(1000 / 24, timerCB, 0);
^
/System/Library/Frameworks/GLUT.framework/Headers/glut.h:514:22: note: 'glutTimerFunc' declared here
extern void APIENTRY glutTimerFunc(unsigned int millis, void (*func)(int value), int value) OPENGL_DEPRECATED(10...
^
ledramp.c:235:2: warning: 'glutMainLoop' is deprecated: first deprecated in OS X 10.9 [-Wdeprecated-declarations]
glutMainLoop();
^
/System/Library/Frameworks/GLUT.framework/Headers/glut.h:438:22: note: 'glutMainLoop' declared here
extern void APIENTRY glutMainLoop(void) OPENGL_DEPRECATED(10_0, 10_9);
^
11 warnings generated.
CC ledramp.c
LD obj-x86_64-apple-darwin13.0.0/ledramp.elf
ledramp done
AVR-CC atmega328p_dummy_blinky.c
333 66 6 405 195 atmega328p_dummy_blinky.axf
CC ../parts/button.c
CC ../parts/uart_pty.c
simduino.c:94:5: warning: 'glutSwapBuffers' is deprecated: first deprecated in OS X 10.9 [-Wdeprecated-declarations]
glutSwapBuffers();
^
/System/Library/Frameworks/GLUT.framework/Headers/glut.h:448:22: note: 'glutSwapBuffers' declared here
extern void APIENTRY glutSwapBuffers(void) OPENGL_DEPRECATED(10_0, 10_9);
^
simduino.c:127:2: warning: 'glutTimerFunc' is deprecated: first deprecated in OS X 10.9 [-Wdeprecated-declarations]
glutTimerFunc(1000/64, timerCB, 0);
^
/System/Library/Frameworks/GLUT.framework/Headers/glut.h:514:22: note: 'glutTimerFunc' declared here
extern void APIENTRY glutTimerFunc(unsigned int millis, void (*func)(int value), int value) OPENGL_DEPRECATED(10...
^
simduino.c:248:2: warning: 'glutInit' is deprecated: first deprecated in OS X 10.9 [-Wdeprecated-declarations]
glutInit(&argc, argv); /* initialize GLUT system */
^
/System/Library/Frameworks/GLUT.framework/Headers/glut.h:431:22: note: 'glutInit' declared here
extern void APIENTRY glutInit(int *argcp, char **argv) OPENGL_DEPRECATED(10_0, 10_9);
^
simduino.c:250:2: warning: 'glutInitDisplayMode' is deprecated: first deprecated in OS X 10.9
[-Wdeprecated-declarations]
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
^
/System/Library/Frameworks/GLUT.framework/Headers/glut.h:432:22: note: 'glutInitDisplayMode' declared here
extern void APIENTRY glutInitDisplayMode(unsigned int mode) OPENGL_DEPRECATED(10_0, 10_9);
^
simduino.c:251:2: warning: 'glutInitWindowSize' is deprecated: first deprecated in OS X 10.9 [-Wdeprecated-declarations]
glutInitWindowSize(8 * pixsize, 1 * pixsize); /* width=400pixels height=500pixels */
^
/System/Library/Frameworks/GLUT.framework/Headers/glut.h:437:22: note: 'glutInitWindowSize' declared here
extern void APIENTRY glutInitWindowSize(int width, int height) OPENGL_DEPRECATED(10_0, 10_9);
^
simduino.c:252:11: warning: 'glutCreateWindow' is deprecated: first deprecated in OS X 10.9 [-Wdeprecated-declarations]
window = glutCreateWindow("Glut"); /* create window */
^
/System/Library/Frameworks/GLUT.framework/Headers/glut.h:441:21: note: 'glutCreateWindow' declared here
extern int APIENTRY glutCreateWindow(const char *title) OPENGL_DEPRECATED(10_0, 10_9);
^
simduino.c:261:2: warning: 'glutDisplayFunc' is deprecated: first deprecated in OS X 10.9 [-Wdeprecated-declarations]
glutDisplayFunc(displayCB); /* set window's display callback */
^
/System/Library/Frameworks/GLUT.framework/Headers/glut.h:505:22: note: 'glutDisplayFunc' declared here
extern void APIENTRY glutDisplayFunc(void (*func)(void)) OPENGL_DEPRECATED(10_0, 10_9);
^
simduino.c:262:2: warning: 'glutKeyboardFunc' is deprecated: first deprecated in OS X 10.9 [-Wdeprecated-declarations]
glutKeyboardFunc(keyCB); /* set window's key callback */
^
/System/Library/Frameworks/GLUT.framework/Headers/glut.h:507:22: note: 'glutKeyboardFunc' declared here
extern void APIENTRY glutKeyboardFunc(void (*func)(unsigned char key, int x, int y)) OPENGL_DEPRECATED(10_0, 10_9);
^
simduino.c:263:2: warning: 'glutTimerFunc' is deprecated: first deprecated in OS X 10.9 [-Wdeprecated-declarations]
glutTimerFunc(1000 / 24, timerCB, 0);
^
/System/Library/Frameworks/GLUT.framework/Headers/glut.h:514:22: note: 'glutTimerFunc' declared here
extern void APIENTRY glutTimerFunc(unsigned int millis, void (*func)(int value), int value) OPENGL_DEPRECATED(10...
^
simduino.c:269:2: warning: 'glutMainLoop' is deprecated: first deprecated in OS X 10.9 [-Wdeprecated-declarations]
glutMainLoop();
^
/System/Library/Frameworks/GLUT.framework/Headers/glut.h:438:22: note: 'glutMainLoop' declared here
extern void APIENTRY glutMainLoop(void) OPENGL_DEPRECATED(10_0, 10_9);
^
10 warnings generated.
CC simduino.c
LD obj-x86_64-apple-darwin13.0.0/simduino.elf
simduino done
rm atmega328p_dummy_blinky.axf
AVR-CC atmega168_timer_64led.c
1860 20 53 1933 78d atmega168_timer_64led.axf
CC ../parts/button.c
CC ../parts/hc595.c
timer_64led.c:149:5: warning: 'glutSwapBuffers' is deprecated: first deprecated in OS X 10.9 [-Wdeprecated-declarations]
glutSwapBuffers();
^
/System/Library/Frameworks/GLUT.framework/Headers/glut.h:448:22: note: 'glutSwapBuffers' declared here
extern void APIENTRY glutSwapBuffers(void) OPENGL_DEPRECATED(10_0, 10_9);
^
timer_64led.c:183:2: warning: 'glutTimerFunc' is deprecated: first deprecated in OS X 10.9 [-Wdeprecated-declarations]
glutTimerFunc(1000/64, timerCB, 0);
^
/System/Library/Frameworks/GLUT.framework/Headers/glut.h:514:22: note: 'glutTimerFunc' declared here
extern void APIENTRY glutTimerFunc(unsigned int millis, void (*func)(int value), int value) OPENGL_DEPRECATED(10...
^
timer_64led.c:187:3: warning: 'glutPostRedisplay' is deprecated: first deprecated in OS X 10.9
[-Wdeprecated-declarations]
glutPostRedisplay();
^
/System/Library/Frameworks/GLUT.framework/Headers/glut.h:444:22: note: 'glutPostRedisplay' declared here
extern void APIENTRY glutPostRedisplay(void) OPENGL_DEPRECATED(10_0, 10_9);
^
timer_64led.c:335:2: warning: 'glutInit' is deprecated: first deprecated in OS X 10.9 [-Wdeprecated-declarations]
glutInit(&argc, argv); /* initialize GLUT system */
^
/System/Library/Frameworks/GLUT.framework/Headers/glut.h:431:22: note: 'glutInit' declared here
extern void APIENTRY glutInit(int *argcp, char **argv) OPENGL_DEPRECATED(10_0, 10_9);
^
timer_64led.c:340:2: warning: 'glutInitDisplayMode' is deprecated: first deprecated in OS X 10.9
[-Wdeprecated-declarations]
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
^
/System/Library/Frameworks/GLUT.framework/Headers/glut.h:432:22: note: 'glutInitDisplayMode' declared here
extern void APIENTRY glutInitDisplayMode(unsigned int mode) OPENGL_DEPRECATED(10_0, 10_9);
^
timer_64led.c:341:2: warning: 'glutInitWindowSize' is deprecated: first deprecated in OS X 10.9
[-Wdeprecated-declarations]
glutInitWindowSize(w * pixsize, h * pixsize); /* width=400pixels height=500pixels */
^
/System/Library/Frameworks/GLUT.framework/Headers/glut.h:437:22: note: 'glutInitWindowSize' declared here
extern void APIENTRY glutInitWindowSize(int width, int height) OPENGL_DEPRECATED(10_0, 10_9);
^
timer_64led.c:342:11: warning: 'glutCreateWindow' is deprecated: first deprecated in OS X 10.9
[-Wdeprecated-declarations]
window = glutCreateWindow("Press 0, 1, 2 or q"); /* create window */
^
/System/Library/Frameworks/GLUT.framework/Headers/glut.h:441:21: note: 'glutCreateWindow' declared here
extern int APIENTRY glutCreateWindow(const char *title) OPENGL_DEPRECATED(10_0, 10_9);
^
timer_64led.c:351:2: warning: 'glutDisplayFunc' is deprecated: first deprecated in OS X 10.9 [-Wdeprecated-declarations]
glutDisplayFunc(displayCB); /* set window's display callback */
^
/System/Library/Frameworks/GLUT.framework/Headers/glut.h:505:22: note: 'glutDisplayFunc' declared here
extern void APIENTRY glutDisplayFunc(void (*func)(void)) OPENGL_DEPRECATED(10_0, 10_9);
^
timer_64led.c:352:2: warning: 'glutKeyboardFunc' is deprecated: first deprecated in OS X 10.9
[-Wdeprecated-declarations]
glutKeyboardFunc(keyCB); /* set window's key callback */
^
/System/Library/Frameworks/GLUT.framework/Headers/glut.h:507:22: note: 'glutKeyboardFunc' declared here
extern void APIENTRY glutKeyboardFunc(void (*func)(unsigned char key, int x, int y)) OPENGL_DEPRECATED(10_0, 10_9);
^
timer_64led.c:353:2: warning: 'glutTimerFunc' is deprecated: first deprecated in OS X 10.9 [-Wdeprecated-declarations]
glutTimerFunc(1000 / 24, timerCB, 0);
^
/System/Library/Frameworks/GLUT.framework/Headers/glut.h:514:22: note: 'glutTimerFunc' declared here
extern void APIENTRY glutTimerFunc(unsigned int millis, void (*func)(int value), int value) OPENGL_DEPRECATED(10...
^
timer_64led.c:359:2: warning: 'glutMainLoop' is deprecated: first deprecated in OS X 10.9 [-Wdeprecated-declarations]
glutMainLoop();
^
/System/Library/Frameworks/GLUT.framework/Headers/glut.h:438:22: note: 'glutMainLoop' declared here
extern void APIENTRY glutMainLoop(void) OPENGL_DEPRECATED(10_0, 10_9);
^
11 warnings generated.
CC timer_64led.c
LD obj-x86_64-apple-darwin13.0.0/timer_64led.elf
timer_64led done

Avrdude command line

The command line format is:

avrdude -p {partnumber} <options>

To see the list of part numbers, run avrdude -p ?

Options that I will use programming AVRs are:

-c <programmer>            Specify programmer type.

-P <port>                  Specify connection port.

The typical command line will be : avrdude -p attiny2313 -c stk500v2 -P /dev/cu.usbserial-id.
* todo – plug in new usb to serial dongle when it arrives, ls /dev/cu.* and find out what I should replace usbserial-id with above..

LCD across ports

Using CodevisionAVR in the past, it has been great to use the LCD library to interface with an LCD. When this is not so great is if you have a non-standard setup and wish to connect the LCD to the AVR across different ports. I have this issue with my next project – a LCD interface for other microcontrollers. I am going to use the Tiny2313 and it can accept commands via either serial or i2c interface. The interface will be selected by 2 input lines (configured by jumpers). These 2 input lines will also configure the serial communication speed if it is used. The one issue I have come across so far is that the USI pins and serial pins are on separate ports and will need to be available. This does not leave a full port for the LCD interface, requiring the LCD data lines (4 pins) and the control lines (3 pins) will have to span ports. The upshot of this is that I cannot use the built in LCD library in CodevisionAVR. This is what has lead me down the path of programming the AVR on my OS X machine.

The google gods have guided me to this site http://winavr.scienceprog.com/example-avr-projects/avr-4-bit-lcd-interface-library.html which is pretty much exactly what I’m looking for.

Xcode and AVR development

First I have to note that apart from creating the “Hello World” application in Xcode, I have not used Xcode for any application development. Most of my avr code development has been fairly dodgy C code using CodevisionAVR (and assembly code when I was first introduced to microcontroller programming)

So I decided to try and do all my AVR development on my mac. First thing to do was download and install CrossPack from http://www.obdev.at/products/crosspack/index.html. These folks have done a stella job of packaging pretty much all the required software.

The first place I went to to get the OS X avr development tools was http://www.digithink.com/OSX-AVR/ but he pointed users to the CrossPack instead of his package. He did make note however that he was going to contact them and ask them to include the Xcode templates.

I had a look at the Xcode template that is supplied with OSX-AVR (created by Nick Lott) and it looked ok. Installing just the Xcode templates however, put them in the wrong place for my system   (I’m running Xcode 3.1.2 and OS X.5.6). They were installed into /Library/Application Support/Apple/Developer Tools. I moved them to ~/Library/Application Support/Developer/Shared/Xcode/

I created a new project using the Basic AVR C project and Built it. The build failed because it was trying to find avr-gcc and it was not in the Xcode project template path. So I edited the project.pbxproj file in ~/Library/Application Support/Developer/Shared/Xcode/Project Templates/AVR/Basic AVR C Project/AVR.xcodeproj directory and removed PATH = “/sw/bin/:/usr/local/bin/:$PATH”; and replaced it with PATH = “$(PATH):/usr/local/CrossPack-AVR/bin”; I had to replace about three instances of this path. After making these changes I was able to successfully build the sample code provided with the template.