This commit is contained in:
R
2024-04-13 22:20:40 +01:00
parent 3bbc82bd4d
commit 51b64d291a
4 changed files with 13 additions and 30 deletions
+8 -1
View File
@@ -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)
+1 -1
View File
@@ -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
}