arm: add uart echo app

This commit is contained in:
2022-05-08 20:55:58 -07:00
parent dae76c4e17
commit 43d245bae2
48 changed files with 11971 additions and 8 deletions

View File

@@ -4,17 +4,32 @@ CXX = arm-none-eabi-g++
OBJCOPY = arm-none-eabi-objcopy
linker_script = bootloader.ld
includes =
sources =
CFLAGS = -march=armv6-m -g -ffunction-sections -fdata-sections -O2
CFLAGS = -march=armv6-m -g -ffunction-sections -fdata-sections -O2 -Werror -Wall
CXXFLAGS = $(CFLAGS) -std=c++20 -fno-exceptions
LDFLAGS = -march=armv6-m -g --specs=nano.specs --specs=nosys.specs -Wl,--gc-sections -Wl,-T$(linker_script) -O2
LDFLAGS = -march=armv6-m \
-g --specs=nano.specs --specs=nosys.specs \
-Wl,--gc-sections -Wl,-T$(linker_script) -O2 \
-Wl,--print-memory-usage
all: bootloader.bin
sources += hal/lib/common/xil_assert.c
includes += -Ihal/lib/common
sources += hal/uart/xuartlite.c hal/uart/xuartlite_stats.c
includes += -Ihal/uart
objects = main.o vector_table.o $(sources:.c=.o)
CFLAGS += $(includes)
all: bootloader.elf
%.bin: %.elf
$(OBJCOPY) -O binary $< $@
bootloader.elf: main.o vector_table.o
bootloader.elf: $(objects)
%.elf:
$(LD) $(LDFLAGS) -o $@ $^
@@ -22,4 +37,4 @@ bootloader.elf: main.o vector_table.o
.PHONY: clean
clean:
rm -rf *.elf *.bin *.o
rm -rf *.elf *.bin $(objects)