lab2: add working lab1_v1 and lab1_v2 prototype
This commit is contained in:
24
Makefile
24
Makefile
@@ -1,13 +1,29 @@
|
||||
CROSS_COMPILE = arm-none-eabi-
|
||||
GCC_COMPILE_ARGS = -x assembler-with-cpp -c -O0 -g3 -mcpu=cortex-m4 -mthumb -Wall
|
||||
|
||||
build: start.S
|
||||
$(CROSS_COMPILE)gcc -x assembler-with-cpp -c -O0 -g3 -mcpu=cortex-m4 -mthumb -Wall -o start.o start.S
|
||||
$(CROSS_COMPILE)gcc start.o -mcpu=cortex-m4 -mthumb -Wall --specs=nosys.specs -nostdlib -lgcc -T./ldscript.ld -o start.elf
|
||||
build: start.o lab1.o ldscript.ld
|
||||
$(CROSS_COMPILE)gcc start.o lab1.o \
|
||||
-mcpu=cortex-m4 -mthumb -Wall \
|
||||
--specs=nosys.specs -nostdlib -lgcc -T./ldscript.ld \
|
||||
-o start.elf
|
||||
$(CROSS_COMPILE)objcopy -O binary -F elf32-littlearm start.elf start.bin
|
||||
|
||||
start.o: start.S lab1_v2.bin
|
||||
$(CROSS_COMPILE)gcc $(GCC_COMPILE_ARGS) -o start.o start.S
|
||||
|
||||
lab1.o: lab1.S
|
||||
$(CROSS_COMPILE)gcc $(GCC_COMPILE_ARGS) -o lab1.o lab1.S
|
||||
|
||||
lab1_v2.bin: lab1_v2.S lab1_v2.ld
|
||||
$(CROSS_COMPILE)gcc $(GCC_COMPILE_ARGS) -o lab1_v2.o lab1_v2.S
|
||||
$(CROSS_COMPILE)gcc lab1_v2.o -mcpu=cortex-m4 -mthumb -Wall \
|
||||
--specs=nosys.specs -nostdlib -lgcc -T./lab1_v2.ld \
|
||||
-o lab1_v2.elf
|
||||
$(CROSS_COMPILE)objcopy -O binary lab1_v2.elf lab1_v2.bin
|
||||
|
||||
qemu: build
|
||||
qemu-system-gnuarmeclipse --verbose --verbose --board STM32F4-Discovery \
|
||||
--mcu STM32F407VG -d unimp,guest_errors \
|
||||
--mcu STM32F407VG -d unimp,guest_errors --nographic \
|
||||
--semihosting-config enable=on,target=native -s -S \
|
||||
--image start.bin
|
||||
|
||||
|
||||
Reference in New Issue
Block a user