xxx wip
This commit is contained in:
@@ -4,13 +4,20 @@ RV_ARCH = rv32imacxw
|
||||
|
||||
CC = riscv-none-elf-gcc
|
||||
OBJDUMP = riscv-none-elf-objdump
|
||||
OBJCOPY = riscv-none-elf-objcopy
|
||||
CFLAGS = -ggdb3 -Os -march=$(RV_ARCH) -ffunction-sections -fdata-sections
|
||||
LDFLAGS = -ggdb3 -march=$(RV_ARCH) -Wl,--gc-sections --specs=nosys.specs
|
||||
|
||||
all: main.elf
|
||||
all: main.uf2
|
||||
|
||||
main.elf: startup.o main.o
|
||||
|
||||
%.uf2: %.bin
|
||||
~/code/uf2/utils/uf2conv.py -f 0xdeadbeef -b 0x08002000 -o $@ $<
|
||||
|
||||
%.bin: %.elf
|
||||
$(OBJCOPY) -O binary $< $@
|
||||
|
||||
%.elf: linker.lds
|
||||
$(CC) -Xlinker -Map=$(@:.elf=.map) -Wl,--script=linker.lds -nostartfiles -o $@ $(filter-out linker.lds,$+)
|
||||
$(OBJDUMP) -xdsS $@ >$(@:.elf=.dump)
|
||||
|
||||
@@ -7,7 +7,7 @@ MEMORY
|
||||
{
|
||||
/* CH32V20x_D6 -> 10 KB SRAM */
|
||||
/* allow full flash (incl. non-zero-wait) */
|
||||
FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 224K
|
||||
FLASH (rx) : ORIGIN = 0x00002000, LENGTH = (224K - 8K)
|
||||
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 10K
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user