29 lines
740 B
Makefile
29 lines
740 B
Makefile
CC=arm-none-eabi-gcc
|
|
MACH=cortex-m33
|
|
CFLAGS= -c -mcpu=$(MACH) -mthumb -std=gnu11 -Wall -O0
|
|
LFLAGS= -nostdlib -T pico_plus_2.ld -Wl,-Map=final.map
|
|
|
|
assemble: vectors.o hello_world.o min_arm_image_def.o
|
|
|
|
vectors.o: vectors.s
|
|
$(CC) $(CFLAGS) -o $@ $^
|
|
|
|
hello_world.o: hello_world.s
|
|
$(CC) $(CFLAGS) -o $@ $^
|
|
|
|
min_arm_image_def.o: min_arm_image_def.s
|
|
$(CC) $(CFLAGS) -o $@ $^
|
|
|
|
hello_world.elf: vectors.o hello_world.o min_arm_image_def.o
|
|
$(CC) $(LFLAGS) -o $@ $^
|
|
|
|
clean:
|
|
- rm -rf $(wildcard *.o)
|
|
- rm -rf $(wildcard *.elf)
|
|
- rm -rf $(wildcard *.map)
|
|
|
|
link: hello_world.elf
|
|
|
|
PHONY: flash
|
|
flash:
|
|
sudo openocd -s tcl -f interface/cmsis-dap.cfg -f target/rp2350.cfg -c "adapter speed 5000" -c "program hello_world.elf verify reset exit"
|