diff options
| author | Keith Packard <keithp@keithp.com> | 2012-03-16 20:21:09 -0700 |
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2012-03-28 21:37:02 -0700 |
| commit | 9279fd42793123784ce83ca151df6f4630487722 (patch) | |
| tree | 4aa915f83ee5aafbeda8d6df5c32044684e0acae /src/stm-bringup/Makefile | |
| parent | e2f13aa43ba79becbff6c9bfc18c665a58d96185 (diff) | |
Add STM platform and stm-bringup demo program
The stm-bringup doesn't run altos, it just initializes the device and
writes stuff over a serial port. Works on the STM32L Discovery board
at least, should do stuff on other boards too.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/stm-bringup/Makefile')
| -rw-r--r-- | src/stm-bringup/Makefile | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/stm-bringup/Makefile b/src/stm-bringup/Makefile new file mode 100644 index 00000000..49966a4f --- /dev/null +++ b/src/stm-bringup/Makefile @@ -0,0 +1,35 @@ +CC=arm-none-eabi-gcc +OBJCOPY=arm-none-eabi-objcopy + +C_LIB=/local/src/pdclib/pdclib.a +C_INC=-I/local/src/pdclib/includes -I/local/src/pdclib/internals + +DEF_CFLAGS=-g -std=gnu99 -O0 -mlittle-endian -mthumb -ffreestanding -nostdlib -I../../src/stm $(C_INC) + +# to run from SRAM +LD_FLAGS_RAM=-Wl,-Taltos-ram.ld +LD_FLAGS=-Wl,-Taltos.ld + +CFLAGS=$(DEF_CFLAGS) -mcpu=cortex-m3 -DCONFIG_STM32L_DISCOVERY + +OBJS=bringup.o + +all: bringup-ram.elf bringup.elf + +%.bin: %.elf + $(OBJCOPY) -O binary $^ $@ + +bringup.elf: $(OBJS) $(C_LIB) altos.ld + $(CC) $(CFLAGS) $(LD_FLAGS) -o $@ $(OBJS) $(C_LIB) -lgcc + +bringup-ram.elf: $(OBJS) $(C_LIB) altos-ram.ld + $(CC) $(CFLAGS) $(LD_FLAGS_RAM) -o $@ $(OBJS) $(C_LIB) -lgcc + +bringup.o: bringup.c + $(CC) -c $(CFLAGS) bringup.c + +clean: + rm -rf *.elf + rm -rf *.bin + +.PHONY: all clean |
