Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
avrdude on osx
#1
Photo 
Hi,

I'm trying to use avrdude to program the watch using OSX. I think I have installed the usb drivers correctly, because when I insert the programmer, I get a new tty.wchusbserial1410 in my /dev/ folder.
I am using this command to program the watch. When I start the command, the white light on the programmer flashes and the watch turns on, so I think it is connected in some way.

bash-3.2$ avrdude -v -v -v -v -b 76800 -p m328p -c arduino -P /dev/tty.wchusbserial1410 -U flash:w:watch_eng.hex -U eeprom:w:watch.eep

avrdude: Version 6.1, compiled on Mar 23 2014 at 04:42:55
Copyright © 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright © 2007-2014 Joerg Wunsch

System wide configuration file is "/usr/local/Cellar/avrdude/6.1/etc/avrdude.conf"
User configuration file is "/Users/chang/.avrduderc"
User configuration file does not exist or is not a regular file, skipping

Using Port : /dev/tty.wchusbserial1410
Using Programmer : arduino
Overriding Baud Rate : 76800
avrdude: serial_baud_lookup(): Using non-standard baud rate: 76800avrdude: Send: 0 [30] [20]
avrdude: Send: 0 [30] [20]
avrdude: Send: 0 [30] [20]
avrdude: ser_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
avrdude: Send: 0 [30] [20]
avrdude: ser_recv(): programmer is not responding

But it doesn't seem to be fully connecting for some reason. I've attached an image of my setup. Programmer is 3v3 and the wires seem to be correctly connected. Normally I hold the pogo programmer down on the watch.
   

I'm wondering if avrdudess does something extra other than calling avrdude. Also, do I need to use the fuse and lock bit commands?

Any suggestions are appreciated. Has anyone gotten the programmer to work on OSX?
Reply
#2
Hey, the latest batch of watches uses 57600 baud instead of 76800.
Code:
-b 57600


Fuse and lock bits don't need to be changed (they can't be changed with the serial programmer anyway, you need an ISP attached to the SPI pads for that).
Reply
#3
Thanks! I thought that I tried that baud rate before, but all of a sudden it seems to work.


avrdude -p m328P -c arduino -P /dev/tty.wchusbserial1410 -U flash:w:watch_eng.hex -U eeprom:w:watch.eep -b 57600

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.03s

avrdude: Device signature = 0x1e950f
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "watch_eng.hex"
avrdude: input file watch_eng.hex auto detected as Intel Hex
avrdude: writing flash (27184 bytes):

Writing | ################################################## | 100% 17.17s

avrdude: 27184 bytes of flash written
avrdude: verifying flash memory against watch_eng.hex:
avrdude: load data flash data from input file watch_eng.hex:
avrdude: input file watch_eng.hex auto detected as Intel Hex
avrdude: input file watch_eng.hex contains 27184 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 15.27s

avrdude: verifying ...
avrdude: 27184 bytes of flash verified
avrdude: reading input file "watch.eep"
avrdude: input file watch.eep auto detected as Intel Hex
avrdude: writing eeprom (128 bytes):

Writing | ################################################## | 100% 1.94s

avrdude: 128 bytes of eeprom written
avrdude: verifying eeprom memory against watch.eep:
avrdude: load data eeprom data from input file watch.eep:
avrdude: input file watch.eep auto detected as Intel Hex
avrdude: input file watch.eep contains 128 bytes
avrdude: reading on-chip eeprom data:

Reading | ################################################## | 100% 1.62s

avrdude: verifying ...
avrdude: 128 bytes of eeprom verified

avrdude: safemode: Fuses OK (E:00, H:00, L:00)

avrdude done. Thank you.
Reply
#4
Hi,

I've created a minimal makefile that works with CrossPack avr environment on osx.
http://www.obdev.at/products/crosspack/index.html
As you can see below, the files seem to compile and link into an elf and hex file when I type "make all".
When I try to install it using "make program", the watch shows nothing.
When I load the original watch_eng.hex using "make programorig", the watch is functional again.

I suspect there is something wrong with my mywatch.hex file, but any suggestions are appreciated.

Thanks.

------------------
# Minimal make file

TARGET=mywatch
CC = avr-gcc
ALL_CFLAGS = -mmcu=atmega328p -DF_CPU=8000000UL -Iincludes -Iincludes/drivers/ -Os -std=c99
OBJDIR = .

$(OBJDIR)/%.o : %.c
@echo
@echo compiling $<
$(CC) -c $(ALL_CFLAGS) $< -o $@

SRCS=$(wildcard *.c */*.c)
OBJS=$(SRCS:.c=.o)
# compile objects
obj: $(OBJS)

elf:
$(CC) -g $(ALL_CFLAGS) -o $(TARGET).elf $(OBJS)

hex:
avr-objcopy -j .text -j .data -O ihex $(TARGET).elf $(TARGET).hex

all: obj elf hex

program:
avrdude -p m328P -c arduino -P /dev/tty.wchusbserial1410 -b 57600 -U eeprom:w:watch.eep -U flash:w:$(TARGET).hex

programorig:
avrdude -p m328P -c arduino -P /dev/tty.wchusbserial1410 -b 57600 -U eeprom:w:watch.eep -U flash:w:watch_eng.hex

clean:
rm -f *.o

--------
chang$ make all
franklins-air:watch chang$ make

compiling alarm.c
avr-gcc -c -mmcu=atmega328p -DF_CPU=8000000UL -Iincludes -Iincludes/drivers/ -Os -std=c99 alarm.c -o alarm.o

compiling animation.c
avr-gcc -c -mmcu=atmega328p -DF_CPU=8000000UL -Iincludes -Iincludes/drivers/ -Os -std=c99 animation.c -o animation.o

compiling appconfig.c
avr-gcc -c -mmcu=atmega328p -DF_CPU=8000000UL -Iincludes -Iincludes/drivers/ -Os -std=c99 appconfig.c -o appconfig.o

compiling disco.c
avr-gcc -c -mmcu=atmega328p -DF_CPU=8000000UL -Iincludes -Iincludes/drivers/ -Os -std=c99 disco.c -o disco.o

compiling discos.c
avr-gcc -c -mmcu=atmega328p -DF_CPU=8000000UL -Iincludes -Iincludes/drivers/ -Os -std=c99 discos.c -o discos.o

compiling display.c
avr-gcc -c -mmcu=atmega328p -DF_CPU=8000000UL -Iincludes -Iincludes/drivers/ -Os -std=c99 display.c -o display.o

compiling draw.c
avr-gcc -c -mmcu=atmega328p -DF_CPU=8000000UL -Iincludes -Iincludes/drivers/ -Os -std=c99 draw.c -o draw.o

compiling global.c
avr-gcc -c -mmcu=atmega328p -DF_CPU=8000000UL -Iincludes -Iincludes/drivers/ -Os -std=c99 global.c -o global.o

compiling main.c
avr-gcc -c -mmcu=atmega328p -DF_CPU=8000000UL -Iincludes -Iincludes/drivers/ -Os -std=c99 main.c -o main.o

compiling menu.c
avr-gcc -c -mmcu=atmega328p -DF_CPU=8000000UL -Iincludes -Iincludes/drivers/ -Os -std=c99 menu.c -o menu.o

compiling pwrmgr.c
avr-gcc -c -mmcu=atmega328p -DF_CPU=8000000UL -Iincludes -Iincludes/drivers/ -Os -std=c99 pwrmgr.c -o pwrmgr.o

compiling resources.c
avr-gcc -c -mmcu=atmega328p -DF_CPU=8000000UL -Iincludes -Iincludes/drivers/ -Os -std=c99 resources.c -o resources.o

compiling system.c
avr-gcc -c -mmcu=atmega328p -DF_CPU=8000000UL -Iincludes -Iincludes/drivers/ -Os -std=c99 system.c -o system.o

compiling time.c
avr-gcc -c -mmcu=atmega328p -DF_CPU=8000000UL -Iincludes -Iincludes/drivers/ -Os -std=c99 time.c -o time.o

compiling tune.c
avr-gcc -c -mmcu=atmega328p -DF_CPU=8000000UL -Iincludes -Iincludes/drivers/ -Os -std=c99 tune.c -o tune.o

compiling tunes.c
avr-gcc -c -mmcu=atmega328p -DF_CPU=8000000UL -Iincludes -Iincludes/drivers/ -Os -std=c99 tunes.c -o tunes.o

compiling watch.c
avr-gcc -c -mmcu=atmega328p -DF_CPU=8000000UL -Iincludes -Iincludes/drivers/ -Os -std=c99 watch.c -o watch.o
avr-gcc -g -mmcu=atmega328p -DF_CPU=8000000UL -Iincludes -Iincludes/drivers/ -Os -std=c99 -o mywatch.elf alarm.o animation.o appconfig.o disco.o discos.o display.o draw.o global.o main.o menu.o pwrmgr.o resources.o system.o time.o tune.o tunes.o watch.o apps/btrccar.o apps/calc.o apps/screenshot.o apps/stopwatch.o apps/torch.o apps/tunemaker.o devices/battery.o devices/buttons.o devices/buzzer.o devices/ds1307.o devices/ds3231.o devices/led.o devices/mcp7940x.o devices/oled.o drivers/adc.o drivers/i2c.o drivers/rtc.o drivers/spi.o drivers/uart.o drivers/wdt.o games/game1.o games/game2.o games/game3.o menus/alarms.o menus/diag.o menus/display.o menus/games.o menus/main.o menus/settings.o menus/sleep.o menus/sound.o menus/timedate.o millis/millis.o watchfaces/lowbatt.o watchfaces/normal.o watchfaces/segment.o watchfaces/small.o watchfaces/ui.o
avr-objcopy -j .text -j .data -O ihex mywatch.elf mywatch.hex

----
chang$ make program
avrdude -p m328P -c arduino -P /dev/tty.wchusbserial1410 -b 57600 -U eeprom:w:watch.eep -U flash:w:mywatch.hex

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x1e950f
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "watch.eep"
avrdude: input file watch.eep auto detected as Intel Hex
avrdude: writing eeprom (128 bytes):

Writing | ################################################## | 100% 1.95s

avrdude: 128 bytes of eeprom written
avrdude: verifying eeprom memory against watch.eep:
avrdude: load data eeprom data from input file watch.eep:
avrdude: input file watch.eep auto detected as Intel Hex
avrdude: input file watch.eep contains 128 bytes
avrdude: reading on-chip eeprom data:

Reading | ################################################## | 100% 1.62s

avrdude: verifying ...
avrdude: 128 bytes of eeprom verified
avrdude: reading input file "mywatch.hex"
avrdude: input file mywatch.hex auto detected as Intel Hex
avrdude: writing flash (29306 bytes):

Writing | ################################################## | 100% 18.46s

avrdude: 29306 bytes of flash written
avrdude: verifying flash memory against mywatch.hex:
avrdude: load data flash data from input file mywatch.hex:
avrdude: input file mywatch.hex auto detected as Intel Hex
avrdude: input file mywatch.hex contains 29306 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 16.42s

avrdude: verifying ...
avrdude: 29306 bytes of flash verified

avrdude: safemode: Fuses OK (E:00, H:00, L:00)

avrdude done. Thank you.
Reply
#5
Just noticed that my mywatch.hex file is not the same size as the watch_eng.hex. Can you let me know the size of the watch_eng.elf? At least we can isolate the problem to the hex creation.

-rwxr-xr-x 1 chang staff 57446 14 Dec 06:57 mywatch.elf
-rw-r--r-- 1 chang staff 82441 14 Dec 06:57 mywatch.hex
-rw-r--r-- 1 chang staff 82441 14 Dec 06:57 mywatch.hex
-rwxr-xr-x@ 1 chang staff 74780 14 Dec 06:57 watch_eng.hex

thanks
Reply
#6
My elf size is 227311 bytes.
There seems to be a lot of arguments missing in your makefile, here's the full list:

Compiler:

Code:
-x c -mcall-prologues -funsigned-char -funsigned-bitfields -DF_CPU=8000000UL -DCPU_DIV=clock_div_1  -I"../includes"  -O1 -fno-tree-scev-cprop -ffreestanding -fno-exceptions -maccumulate-args -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -Wstrict-prototypes -Wextra


Linker:

Code:
-Wl,--start-group -Wl,-lm  -Wl,--end-group -Wl,--gc-sections -mrelax -mmcu=atmega328p
 

I'm also using AVR-GCC 4.7.2.
Reply
#7
Thanks for your help with this. I've updated the makefile to match your flags. It seems to compile ok.

I was wondering if you could post the results of "ls -la *.o */*.o" for your watch folder after you compile it on your system. It would help if I could compare the file sizes and the files.

I think another area where I'm having trouble is the assembly files. draw_bitmap.S seems to compile (see below), but not milli_isr.S
Quote:avr-gcc -mcall-prologues -funsigned-char -funsigned-bitfields -DF_CPU=8000000UL -DCPU_DIV=clock_div_1 -Iincludes -mmcu=atmega328p -c millis/millis_isr.S
millis/millis_isr.S: Assembler messages:
millis/millis_isr.S:30: Error: missing ')'
millis/millis_isr.S:30: Error: missing ')'
millis/millis_isr.S:30: Error: missing ')'
millis/millis_isr.S:30: Warning: constant out of 8-bit range: -7999744
millis/millis_isr.S:30: Error: garbage at end of line
I think this is because the program that you are using preprocesses assembly differently. I've tried various things, but if you can think of something, let me know.

Here is the results of the new makefile. When I load it in the watch, still nothing shows up. I guess millis_isr is used for showing time.
Code:
bash-3.2$ make all

compiling alarm.c
avr-gcc -c -x c -mcall-prologues -funsigned-char -funsigned-bitfields -DF_CPU=8000000UL -DCPU_DIV=clock_div_1  -Iincludes  -O1 -fno-tree-scev-cprop -ffreestanding -fno-exceptions -maccumulate-args -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -Wstrict-prototypes -Wextra alarm.c -o alarm.o

compiling animation.c
avr-gcc -c -x c -mcall-prologues -funsigned-char -funsigned-bitfields -DF_CPU=8000000UL -DCPU_DIV=clock_div_1  -Iincludes  -O1 -fno-tree-scev-cprop -ffreestanding -fno-exceptions -maccumulate-args -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -Wstrict-prototypes -Wextra animation.c -o animation.o

compiling appconfig.c
avr-gcc -c -x c -mcall-prologues -funsigned-char -funsigned-bitfields -DF_CPU=8000000UL -DCPU_DIV=clock_div_1  -Iincludes  -O1 -fno-tree-scev-cprop -ffreestanding -fno-exceptions -maccumulate-args -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -Wstrict-prototypes -Wextra appconfig.c -o appconfig.o

compiling disco.c
avr-gcc -c -x c -mcall-prologues -funsigned-char -funsigned-bitfields -DF_CPU=8000000UL -DCPU_DIV=clock_div_1  -Iincludes  -O1 -fno-tree-scev-cprop -ffreestanding -fno-exceptions -maccumulate-args -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -Wstrict-prototypes -Wextra disco.c -o disco.o

compiling discos.c
avr-gcc -c -x c -mcall-prologues -funsigned-char -funsigned-bitfields -DF_CPU=8000000UL -DCPU_DIV=clock_div_1  -Iincludes  -O1 -fno-tree-scev-cprop -ffreestanding -fno-exceptions -maccumulate-args -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -Wstrict-prototypes -Wextra discos.c -o discos.o

compiling display.c
avr-gcc -c -x c -mcall-prologues -funsigned-char -funsigned-bitfields -DF_CPU=8000000UL -DCPU_DIV=clock_div_1  -Iincludes  -O1 -fno-tree-scev-cprop -ffreestanding -fno-exceptions -maccumulate-args -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -Wstrict-prototypes -Wextra display.c -o display.o

compiling draw.c
avr-gcc -c -x c -mcall-prologues -funsigned-char -funsigned-bitfields -DF_CPU=8000000UL -DCPU_DIV=clock_div_1  -Iincludes  -O1 -fno-tree-scev-cprop -ffreestanding -fno-exceptions -maccumulate-args -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -Wstrict-prototypes -Wextra draw.c -o draw.o

compiling global.c
avr-gcc -c -x c -mcall-prologues -funsigned-char -funsigned-bitfields -DF_CPU=8000000UL -DCPU_DIV=clock_div_1  -Iincludes  -O1 -fno-tree-scev-cprop -ffreestanding -fno-exceptions -maccumulate-args -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -Wstrict-prototypes -Wextra global.c -o global.o

compiling main.c
avr-gcc -c -x c -mcall-prologues -funsigned-char -funsigned-bitfields -DF_CPU=8000000UL -DCPU_DIV=clock_div_1  -Iincludes  -O1 -fno-tree-scev-cprop -ffreestanding -fno-exceptions -maccumulate-args -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -Wstrict-prototypes -Wextra main.c -o main.o

compiling menu.c
avr-gcc -c -x c -mcall-prologues -funsigned-char -funsigned-bitfields -DF_CPU=8000000UL -DCPU_DIV=clock_div_1  -Iincludes  -O1 -fno-tree-scev-cprop -ffreestanding -fno-exceptions -maccumulate-args -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -Wstrict-prototypes -Wextra menu.c -o menu.o

compiling pwrmgr.c
avr-gcc -c -x c -mcall-prologues -funsigned-char -funsigned-bitfields -DF_CPU=8000000UL -DCPU_DIV=clock_div_1  -Iincludes  -O1 -fno-tree-scev-cprop -ffreestanding -fno-exceptions -maccumulate-args -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -Wstrict-prototypes -Wextra pwrmgr.c -o pwrmgr.o

compiling resources.c
avr-gcc -c -x c -mcall-prologues -funsigned-char -funsigned-bitfields -DF_CPU=8000000UL -DCPU_DIV=clock_div_1  -Iincludes  -O1 -fno-tree-scev-cprop -ffreestanding -fno-exceptions -maccumulate-args -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -Wstrict-prototypes -Wextra resources.c -o resources.o

compiling system.c
avr-gcc -c -x c -mcall-prologues -funsigned-char -funsigned-bitfields -DF_CPU=8000000UL -DCPU_DIV=clock_div_1  -Iincludes  -O1 -fno-tree-scev-cprop -ffreestanding -fno-exceptions -maccumulate-args -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -Wstrict-prototypes -Wextra system.c -o system.o

compiling time.c
avr-gcc -c -x c -mcall-prologues -funsigned-char -funsigned-bitfields -DF_CPU=8000000UL -DCPU_DIV=clock_div_1  -Iincludes  -O1 -fno-tree-scev-cprop -ffreestanding -fno-exceptions -maccumulate-args -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -Wstrict-prototypes -Wextra time.c -o time.o

compiling tune.c
avr-gcc -c -x c -mcall-prologues -funsigned-char -funsigned-bitfields -DF_CPU=8000000UL -DCPU_DIV=clock_div_1  -Iincludes  -O1 -fno-tree-scev-cprop -ffreestanding -fno-exceptions -maccumulate-args -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -Wstrict-prototypes -Wextra tune.c -o tune.o

compiling tunes.c
avr-gcc -c -x c -mcall-prologues -funsigned-char -funsigned-bitfields -DF_CPU=8000000UL -DCPU_DIV=clock_div_1  -Iincludes  -O1 -fno-tree-scev-cprop -ffreestanding -fno-exceptions -maccumulate-args -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -Wstrict-prototypes -Wextra tunes.c -o tunes.o

compiling watch.c
avr-gcc -c -x c -mcall-prologues -funsigned-char -funsigned-bitfields -DF_CPU=8000000UL -DCPU_DIV=clock_div_1  -Iincludes  -O1 -fno-tree-scev-cprop -ffreestanding -fno-exceptions -maccumulate-args -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -Wstrict-prototypes -Wextra watch.c -o watch.o

compiling apps/btrccar.c
avr-gcc -c -x c -mcall-prologues -funsigned-char -funsigned-bitfields -DF_CPU=8000000UL -DCPU_DIV=clock_div_1  -Iincludes  -O1 -fno-tree-scev-cprop -ffreestanding -fno-exceptions -maccumulate-args -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -Wstrict-prototypes -Wextra apps/btrccar.c -o apps/btrccar.o

compiling apps/calc.c
avr-gcc -c -x c -mcall-prologues -funsigned-char -funsigned-bitfields -DF_CPU=8000000UL -DCPU_DIV=clock_div_1  -Iincludes  -O1 -fno-tree-scev-cprop -ffreestanding -fno-exceptions -maccumulate-args -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -Wstrict-prototypes -Wextra apps/calc.c -o apps/calc.o

compiling apps/screenshot.c
avr-gcc -c -x c -mcall-prologues -funsigned-char -funsigned-bitfields -DF_CPU=8000000UL -DCPU_DIV=clock_div_1  -Iincludes  -O1 -fno-tree-scev-cprop -ffreestanding -fno-exceptions -maccumulate-args -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -Wstrict-prototypes -Wextra apps/screenshot.c -o apps/screenshot.o

compiling apps/stopwatch.c
avr-gcc -c -x c -mcall-prologues -funsigned-char -funsigned-bitfields -DF_CPU=8000000UL -DCPU_DIV=clock_div_1  -Iincludes  -O1 -fno-tree-scev-cprop -ffreestanding -fno-exceptions -maccumulate-args -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -Wstrict-prototypes -Wextra apps/stopwatch.c -o apps/stopwatch.o

compiling apps/torch.c
avr-gcc -c -x c -mcall-prologues -funsigned-char -funsigned-bitfields -DF_CPU=8000000UL -DCPU_DIV=clock_div_1  -Iincludes  -O1 -fno-tree-scev-cprop -ffreestanding -fno-exceptions -maccumulate-args -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -Wstrict-prototypes -Wextra apps/torch.c -o apps/torch.o

compiling apps/tunemaker.c
avr-gcc -c -x c -mcall-prologues -funsigned-char -funsigned-bitfields -DF_CPU=8000000UL -DCPU_DIV=clock_div_1  -Iincludes  -O1 -fno-tree-scev-cprop -ffreestanding -fno-exceptions -maccumulate-args -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -Wstrict-prototypes -Wextra apps/tunemaker.c -o apps/tunemaker.o

compiling devices/battery.c
avr-gcc -c -x c -mcall-prologues -funsigned-char -funsigned-bitfields -DF_CPU=8000000UL -DCPU_DIV=clock_div_1  -Iincludes  -O1 -fno-tree-scev-cprop -ffreestanding -fno-exceptions -maccumulate-args -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -Wstrict-prototypes -Wextra devices/battery.c -o devices/battery.o

compiling devices/buttons.c
avr-gcc -c -x c -mcall-prologues -funsigned-char -funsigned-bitfields -DF_CPU=8000000UL -DCPU_DIV=clock_div_1  -Iincludes  -O1 -fno-tree-scev-cprop -ffreestanding -fno-exceptions -maccumulate-args -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -Wstrict-prototypes -Wextra devices/buttons.c -o devices/buttons.o

compiling devices/buzzer.c
avr-gcc -c -x c -mcall-prologues -funsigned-char -funsigned-bitfields -DF_CPU=8000000UL -DCPU_DIV=clock_div_1  -Iincludes  -O1 -fno-tree-scev-cprop -ffreestanding -fno-exceptions -maccumulate-args -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -Wstrict-prototypes -Wextra devices/buzzer.c -o devices/buzzer.o

compiling devices/ds1307.c
avr-gcc -c -x c -mcall-prologues -funsigned-char -funsigned-bitfields -DF_CPU=8000000UL -DCPU_DIV=clock_div_1  -Iincludes  -O1 -fno-tree-scev-cprop -ffreestanding -fno-exceptions -maccumulate-args -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -Wstrict-prototypes -Wextra devices/ds1307.c -o devices/ds1307.o

compiling devices/ds3231.c
avr-gcc -c -x c -mcall-prologues -funsigned-char -funsigned-bitfields -DF_CPU=8000000UL -DCPU_DIV=clock_div_1  -Iincludes  -O1 -fno-tree-scev-cprop -ffreestanding -fno-exceptions -maccumulate-args -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -Wstrict-prototypes -Wextra devices/ds3231.c -o devices/ds3231.o

compiling devices/led.c
avr-gcc -c -x c -mcall-prologues -funsigned-char -funsigned-bitfields -DF_CPU=8000000UL -DCPU_DIV=clock_div_1  -Iincludes  -O1 -fno-tree-scev-cprop -ffreestanding -fno-exceptions -maccumulate-args -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -Wstrict-prototypes -Wextra devices/led.c -o devices/led.o

compiling devices/mcp7940x.c
avr-gcc -c -x c -mcall-prologues -funsigned-char -funsigned-bitfields -DF_CPU=8000000UL -DCPU_DIV=clock_div_1  -Iincludes  -O1 -fno-tree-scev-cprop -ffreestanding -fno-exceptions -maccumulate-args -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -Wstrict-prototypes -Wextra devices/mcp7940x.c -o devices/mcp7940x.o

compiling devices/oled.c
avr-gcc -c -x c -mcall-prologues -funsigned-char -funsigned-bitfields -DF_CPU=8000000UL -DCPU_DIV=clock_div_1  -Iincludes  -O1 -fno-tree-scev-cprop -ffreestanding -fno-exceptions -maccumulate-args -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -Wstrict-prototypes -Wextra devices/oled.c -o devices/oled.o

compiling drivers/adc.c
avr-gcc -c -x c -mcall-prologues -funsigned-char -funsigned-bitfields -DF_CPU=8000000UL -DCPU_DIV=clock_div_1  -Iincludes  -O1 -fno-tree-scev-cprop -ffreestanding -fno-exceptions -maccumulate-args -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -Wstrict-prototypes -Wextra drivers/adc.c -o drivers/adc.o

compiling drivers/i2c.c
avr-gcc -c -x c -mcall-prologues -funsigned-char -funsigned-bitfields -DF_CPU=8000000UL -DCPU_DIV=clock_div_1  -Iincludes  -O1 -fno-tree-scev-cprop -ffreestanding -fno-exceptions -maccumulate-args -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -Wstrict-prototypes -Wextra drivers/i2c.c -o drivers/i2c.o

compiling drivers/rtc.c
avr-gcc -c -x c -mcall-prologues -funsigned-char -funsigned-bitfields -DF_CPU=8000000UL -DCPU_DIV=clock_div_1  -Iincludes  -O1 -fno-tree-scev-cprop -ffreestanding -fno-exceptions -maccumulate-args -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -Wstrict-prototypes -Wextra drivers/rtc.c -o drivers/rtc.o

compiling drivers/spi.c
avr-gcc -c -x c -mcall-prologues -funsigned-char -funsigned-bitfields -DF_CPU=8000000UL -DCPU_DIV=clock_div_1  -Iincludes  -O1 -fno-tree-scev-cprop -ffreestanding -fno-exceptions -maccumulate-args -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -Wstrict-prototypes -Wextra drivers/spi.c -o drivers/spi.o

compiling drivers/uart.c
avr-gcc -c -x c -mcall-prologues -funsigned-char -funsigned-bitfields -DF_CPU=8000000UL -DCPU_DIV=clock_div_1  -Iincludes  -O1 -fno-tree-scev-cprop -ffreestanding -fno-exceptions -maccumulate-args -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -Wstrict-prototypes -Wextra drivers/uart.c -o drivers/uart.o

compiling drivers/wdt.c
avr-gcc -c -x c -mcall-prologues -funsigned-char -funsigned-bitfields -DF_CPU=8000000UL -DCPU_DIV=clock_div_1  -Iincludes  -O1 -fno-tree-scev-cprop -ffreestanding -fno-exceptions -maccumulate-args -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -Wstrict-prototypes -Wextra drivers/wdt.c -o drivers/wdt.o

compiling games/game1.c
avr-gcc -c -x c -mcall-prologues -funsigned-char -funsigned-bitfields -DF_CPU=8000000UL -DCPU_DIV=clock_div_1  -Iincludes  -O1 -fno-tree-scev-cprop -ffreestanding -fno-exceptions -maccumulate-args -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -Wstrict-prototypes -Wextra games/game1.c -o games/game1.o

compiling games/game2.c
avr-gcc -c -x c -mcall-prologues -funsigned-char -funsigned-bitfields -DF_CPU=8000000UL -DCPU_DIV=clock_div_1  -Iincludes  -O1 -fno-tree-scev-cprop -ffreestanding -fno-exceptions -maccumulate-args -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -Wstrict-prototypes -Wextra games/game2.c -o games/game2.o

compiling games/game3.c
avr-gcc -c -x c -mcall-prologues -funsigned-char -funsigned-bitfields -DF_CPU=8000000UL -DCPU_DIV=clock_div_1  -Iincludes  -O1 -fno-tree-scev-cprop -ffreestanding -fno-exceptions -maccumulate-args -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -Wstrict-prototypes -Wextra games/game3.c -o games/game3.o

compiling menus/alarms.c
avr-gcc -c -x c -mcall-prologues -funsigned-char -funsigned-bitfields -DF_CPU=8000000UL -DCPU_DIV=clock_div_1  -Iincludes  -O1 -fno-tree-scev-cprop -ffreestanding -fno-exceptions -maccumulate-args -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -Wstrict-prototypes -Wextra menus/alarms.c -o menus/alarms.o

compiling menus/diag.c
avr-gcc -c -x c -mcall-prologues -funsigned-char -funsigned-bitfields -DF_CPU=8000000UL -DCPU_DIV=clock_div_1  -Iincludes  -O1 -fno-tree-scev-cprop -ffreestanding -fno-exceptions -maccumulate-args -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -Wstrict-prototypes -Wextra menus/diag.c -o menus/diag.o

compiling menus/display.c
avr-gcc -c -x c -mcall-prologues -funsigned-char -funsigned-bitfields -DF_CPU=8000000UL -DCPU_DIV=clock_div_1  -Iincludes  -O1 -fno-tree-scev-cprop -ffreestanding -fno-exceptions -maccumulate-args -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -Wstrict-prototypes -Wextra menus/display.c -o menus/display.o

compiling menus/games.c
avr-gcc -c -x c -mcall-prologues -funsigned-char -funsigned-bitfields -DF_CPU=8000000UL -DCPU_DIV=clock_div_1  -Iincludes  -O1 -fno-tree-scev-cprop -ffreestanding -fno-exceptions -maccumulate-args -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -Wstrict-prototypes -Wextra menus/games.c -o menus/games.o

compiling menus/main.c
avr-gcc -c -x c -mcall-prologues -funsigned-char -funsigned-bitfields -DF_CPU=8000000UL -DCPU_DIV=clock_div_1  -Iincludes  -O1 -fno-tree-scev-cprop -ffreestanding -fno-exceptions -maccumulate-args -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -Wstrict-prototypes -Wextra menus/main.c -o menus/main.o

compiling menus/settings.c
avr-gcc -c -x c -mcall-prologues -funsigned-char -funsigned-bitfields -DF_CPU=8000000UL -DCPU_DIV=clock_div_1  -Iincludes  -O1 -fno-tree-scev-cprop -ffreestanding -fno-exceptions -maccumulate-args -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -Wstrict-prototypes -Wextra menus/settings.c -o menus/settings.o

compiling menus/sleep.c
avr-gcc -c -x c -mcall-prologues -funsigned-char -funsigned-bitfields -DF_CPU=8000000UL -DCPU_DIV=clock_div_1  -Iincludes  -O1 -fno-tree-scev-cprop -ffreestanding -fno-exceptions -maccumulate-args -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -Wstrict-prototypes -Wextra menus/sleep.c -o menus/sleep.o

compiling menus/sound.c
avr-gcc -c -x c -mcall-prologues -funsigned-char -funsigned-bitfields -DF_CPU=8000000UL -DCPU_DIV=clock_div_1  -Iincludes  -O1 -fno-tree-scev-cprop -ffreestanding -fno-exceptions -maccumulate-args -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -Wstrict-prototypes -Wextra menus/sound.c -o menus/sound.o

compiling menus/timedate.c
avr-gcc -c -x c -mcall-prologues -funsigned-char -funsigned-bitfields -DF_CPU=8000000UL -DCPU_DIV=clock_div_1  -Iincludes  -O1 -fno-tree-scev-cprop -ffreestanding -fno-exceptions -maccumulate-args -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -Wstrict-prototypes -Wextra menus/timedate.c -o menus/timedate.o

compiling millis/millis.c
avr-gcc -c -x c -mcall-prologues -funsigned-char -funsigned-bitfields -DF_CPU=8000000UL -DCPU_DIV=clock_div_1  -Iincludes  -O1 -fno-tree-scev-cprop -ffreestanding -fno-exceptions -maccumulate-args -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -Wstrict-prototypes -Wextra millis/millis.c -o millis/millis.o

compiling watchfaces/lowbatt.c
avr-gcc -c -x c -mcall-prologues -funsigned-char -funsigned-bitfields -DF_CPU=8000000UL -DCPU_DIV=clock_div_1  -Iincludes  -O1 -fno-tree-scev-cprop -ffreestanding -fno-exceptions -maccumulate-args -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -Wstrict-prototypes -Wextra watchfaces/lowbatt.c -o watchfaces/lowbatt.o

compiling watchfaces/normal.c
avr-gcc -c -x c -mcall-prologues -funsigned-char -funsigned-bitfields -DF_CPU=8000000UL -DCPU_DIV=clock_div_1  -Iincludes  -O1 -fno-tree-scev-cprop -ffreestanding -fno-exceptions -maccumulate-args -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -Wstrict-prototypes -Wextra watchfaces/normal.c -o watchfaces/normal.o

compiling watchfaces/segment.c
avr-gcc -c -x c -mcall-prologues -funsigned-char -funsigned-bitfields -DF_CPU=8000000UL -DCPU_DIV=clock_div_1  -Iincludes  -O1 -fno-tree-scev-cprop -ffreestanding -fno-exceptions -maccumulate-args -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -Wstrict-prototypes -Wextra watchfaces/segment.c -o watchfaces/segment.o

compiling watchfaces/small.c
avr-gcc -c -x c -mcall-prologues -funsigned-char -funsigned-bitfields -DF_CPU=8000000UL -DCPU_DIV=clock_div_1  -Iincludes  -O1 -fno-tree-scev-cprop -ffreestanding -fno-exceptions -maccumulate-args -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -Wstrict-prototypes -Wextra watchfaces/small.c -o watchfaces/small.o

compiling watchfaces/ui.c
avr-gcc -c -x c -mcall-prologues -funsigned-char -funsigned-bitfields -DF_CPU=8000000UL -DCPU_DIV=clock_div_1  -Iincludes  -O1 -fno-tree-scev-cprop -ffreestanding -fno-exceptions -maccumulate-args -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -Wstrict-prototypes -Wextra watchfaces/ui.c -o watchfaces/ui.o

compiling draw_bitmap.S
avr-gcc -c -DF_CPU=8000000UL -DCPU_DIV=clock_div_1  -Iincludes -mmcu=atmega328p -std=gnu99 draw_bitmap.S -o draw_bitmap.o

making elf
avr-gcc -Wl,--start-group -Wl,-lm  -Wl,--end-group -Wl,--gc-sections -mrelax -mmcu=atmega328p -o mywatch.elf alarm.o animation.o appconfig.o disco.o discos.o display.o draw.o global.o main.o menu.o pwrmgr.o resources.o system.o time.o tune.o tunes.o watch.o apps/btrccar.o apps/calc.o apps/screenshot.o apps/stopwatch.o apps/torch.o apps/tunemaker.o devices/battery.o devices/buttons.o devices/buzzer.o devices/ds1307.o devices/ds3231.o devices/led.o devices/mcp7940x.o devices/oled.o drivers/adc.o drivers/i2c.o drivers/rtc.o drivers/spi.o drivers/uart.o drivers/wdt.o games/game1.o games/game2.o games/game3.o menus/alarms.o menus/diag.o menus/display.o menus/games.o menus/main.o menus/settings.o menus/sleep.o menus/sound.o menus/timedate.o millis/millis.o watchfaces/lowbatt.o watchfaces/normal.o watchfaces/segment.o watchfaces/small.o watchfaces/ui.o draw_bitmap.o

making hex
avr-objcopy -j .text -j .data -O ihex mywatch.elf mywatch.hex
Reply
#8
Ah forgot about the asm parts, args for ASM AVR-GCC:

Code:
-Wa,-gdwarf2 -x assembler-with-cpp -c -mmcu=atmega328p -DF_CPU=8000000 -I "../includes"  -mrelax -Wa,-g

You need the "-x assembler-with-cpp" part.

File sizes:


Code:
21652 alarm.o
7324 animation.o
6004 appconfig.o
1760 apps/btrccar.o
1752 apps/calc.o
1768 apps/screenshot.o
11876 apps/stopwatch.o
7760 apps/torch.o
753 apps/tunemaker.o
7824 devices/battery.o
12940 devices/buttons.o
10436 devices/buzzer.o
1764 devices/ds1307.o
19884 devices/ds3231.o
10824 devices/led.o
1764 devices/mcp7940x.o
14252 devices/oled.o
5684 disco.o
2244 discos.o
14988 display.o
1212 draw_bitmap.o
16560 draw.o
3440 drivers/adc.o
8396 drivers/i2c.o
1756 drivers/rtc.o
3752 drivers/spi.o
1756 drivers/uart.o
2992 drivers/wdt.o
17552 games/game1.o
19200 games/game2.o
1760 games/game3.o
8360 global.o
7672 main.o
29920 menu.o
20168 menus/alarms.o
11756 menus/diag.o
11444 menus/display.o
6452 menus/games.o
9748 menus/main.o
7440 menus/settings.o
10180 menus/sleep.o
10444 menus/sound.o
23808 menus/timedate.o
1400 millis/millis_isr.o
4112 millis/millis.o
10108 pwrmgr.o
13200 resources.o
3096 system.o
18480 time.o
7176 tune.o
3336 tunes.o
5396 watchfaces/lowbatt.o
19428 watchfaces/normal.o
1768 watchfaces/segment.o
4092 watchfaces/small.o
4872 watchfaces/ui.o

millis_isr.S deals with the millisecond counter interrupt.


Args for making .hex form .elf:

Code:
-O ihex -R .eeprom -R .fuse -R .lock -R .signature -R .user_signatures

Args for making .eep from .elf:

Code:
-j .eeprom --set-section-flags=.eeprom=alloc,load --change-section-lma .eeprom=0 --no-change-warnings -O ihex


Be sure to upload the .eep with the .hex, it contains things like the beep tunes.
Reply
#9
Thanks for all of your help with this. It compiles everything now and loads into the watch! Here is the working Makefile. I'm using CrossPack-AVR-20131216.dmg, which has gcc version 4.8.1 (osx 10.9.5). The object files are bigger than the ones that you posted, but everything works fine.

Code:
# NWatch makefile
# make all      - compile hex and eep files
# make program  - program watch

TARGET=mywatch
CC = avr-gcc
OBJCOPY = avr-objcopy

SRCS=$(wildcard *.c */*.c)
ASRC=$(wildcard *.s */*.s)
OBJS = $(SRCS:%.c=%.o) $(ASRC:%.s=%.o)

CFLAGS = -x c -mcall-prologues -funsigned-char -funsigned-bitfields -DF_CPU=8000000UL -DCPU_DIV=clock_div_1  -Iincludes  -O1 -fno-tree-scev-cprop -ffreestanding -fno-exceptions -maccumulate-args -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -Wstrict-prototypes -Wextra
%.o : %.c
    @echo
    @echo compiling $<
    $(CC) -c $(CFLAGS) $< -o $@

ASMFLAGS = -Wa,-gdwarf2 -x assembler-with-cpp -c -mmcu=atmega328p -DF_CPU=8000000 -Iincludes  -mrelax -Wa,-g
%.o : %.s
    @echo
    @echo compiling $<
    $(CC) $(ASMFLAGS) $< -o $@

obj: $(OBJS)

LDFLAGS = -Wl,--start-group -Wl,-lm  -Wl,--end-group -Wl,--gc-sections -mrelax -mmcu=atmega328p
elf:
    @echo
    @echo making elf $<
    $(CC) $(LDFLAGS) -o $(TARGET).elf $(OBJS)

HEXFLAGS = -O ihex -R .eeprom -R .fuse -R .lock -R .signature -R .user_signatures
hex:
    @echo
    @echo making hex $<
    $(OBJCOPY) $(HEXFLAGS) $(TARGET).elf $(TARGET).hex

EEPFLAGS = -j .eeprom --set-section-flags=.eeprom=alloc,load --change-section-lma .eeprom=0 --no-change-warnings -O ihex
eep:
    @echo
    @echo making eep $<
    $(OBJCOPY) $(EEPFLAGS) $(TARGET).elf $(TARGET).eep

all: obj elf hex eep

program:
    @echo
    @echo program $<
    avrdude -p m328P -c arduino -P /dev/tty.wchusbserial1410 -b 57600 -U eeprom:w:$(TARGET).eep -U flash:w:$(TARGET).hex

programorig:
    @echo
    @echo program original $<
    avrdude -p m328P -c arduino -P /dev/tty.wchusbserial1410 -b 57600 -U eeprom:w:watch.eep -U flash:w:watch_eng.hex

clean:
    rm -f */*.o *.o *.c~ $(TARGET).hex $(TARGET).elf $(TARGET).eep
Reply
#10
Hi Chang, I am not a programmer and none of this makes any sense to me. I am dumb as mud.

Can I ask what are you trying to program for the watch? A game? A additional feature/option? If so will you share it with other N|Watch owners?

I am going to make a thread asking programmers, if they make/program something for the N|Watch post it in thread.
---------------------------
Rob Gentile
Motion Graphics
www.pixelrob.com
[Image: pixel-rob-tag-3.gif]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)