-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathMakefile_volvo_od2
20 lines (16 loc) · 1.44 KB
/
Makefile_volvo_od2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
VOLVO_OD2_OBJS = volvo_od2/fw/hw_clock.vo \
volvo_od2/fw/hw_can.vo \
volvo_od2/fw/hw_gpio.vo \
volvo_od2/fw/hw_tick.vo \
volvo_od2/fw/hw_usart.vo \
volvo_od2/fw/hw_sleep.vo \
volvo_od2/fw/hw_conf.vo
%.vo : %.c
$(CC) $(F103_CFLAGS) -c $< -o $@
volvo_od2.bin: main.vo canbox.vo ring.vo conf.vo car.vo tick.vo hw.vo sbrk.vo $(VOLVO_OD2_OBJS) $(LIBOPENCM3_OBJS)
$(CC) $^ -L. -Tvolvo_od2/fw/x32f103x8.ld -L$(LIBOPENCM3_DIR)/lib/stm32/f1 $(F103_LDFLAGS) $(F103_INCLUDES) -Wl,-Map=volvo_od2.map -o volvo_od2.elf
$(OBJCOPY) -O binary volvo_od2.elf $@
flash_volvo_od2: volvo_od2.bin
openocd -f volvo_od2/fw/stm32f103x8.cfg -c "init; reset halt" -c "mww 0x40022004 0x45670123" -c "mww 0x40022004 0xCDEF89AB" -c "mww 0x40022008 0x45670123" -c "mww 0x40022008 0xCDEF89AB" -c "mww 0x40022010 0x220" -c "mww 0x40022010 0x260" -c "sleep 100" -c "mww 0x40022010 0x230" -c "mwh 0x1ffff800 0x5AA5" -c "sleep 1000" -c "mww 0x40022010 0x2220" -c "sleep 100" -c "mdw 0x40022010" -c "mdw 0x4002201c" -c "mdw 0x1ffff800" -c targets -c "halt" -c "stm32f1x unlock 0;exit"
openocd -f volvo_od2/fw/stm32f103x8.cfg -c "init; reset halt" -c "mww 0x40022004 0x45670123" -c "mww 0x40022004 0xCDEF89AB" -c "mww 0x40022008 0x45670123" -c "mww 0x40022008 0xCDEF89AB" -c targets -c "halt" -c "stm32f1x unlock 0; exit"
openocd -f volvo_od2/fw/stm32f103x8.cfg -c "init; mdw 0x1ffff7e0; mdw 0x1ffff800; reset halt; stm32f1x unlock 0; sleep 1; program volvo_od2.bin 0x8000000; reset;exit"