diff --git a/firmware/loadable/.gitignore b/firmware/loadable/.gitignore index 60ca729..7652361 100644 --- a/firmware/loadable/.gitignore +++ b/firmware/loadable/.gitignore @@ -1,3 +1,4 @@ *.elf *.bin *.h +loadable.ld diff --git a/firmware/loadable/Makefile.sub b/firmware/loadable/Makefile.sub index a4763af..e513bb4 100644 --- a/firmware/loadable/Makefile.sub +++ b/firmware/loadable/Makefile.sub @@ -22,12 +22,20 @@ include $(ROOT_PATH)/Makefile.inc # Compiler settings, parameters and flags ########################################################################## FIRMWARE=$(ROOT_PATH)/$(OUTFILE).elf +LDSRCFILE=$(DIR)/ram.ld LDFILE=$(DIR)/loadable.ld CFLAGS+=-mlong-calls LDFLAGS+= -R $(FIRMWARE) all: $(OBJS) $(ELFS) $(BINS) $(HDRS) +$(LDFILE): + -@echo "MEMORY" > $(LDFILE) + -@echo "{" >> $(LDFILE) + -@echo " sram(rwx): ORIGIN = 0x10002000 - $(RAMCODE), LENGTH = $(RAMCODE)" >> $(LDFILE) + -@echo "}" >> $(LDFILE) + -@echo "INCLUDE $(LDSRCFILE)" >> $(LDFILE) + %.o : %.c $(CC) $(CFLAGS) -o $@ $< @@ -45,3 +53,5 @@ clean: cd $(DIR) && rm -f *.o *.elf *.bin .SUFFIXES: + +.PHONY: $(LDFILE) diff --git a/firmware/loadable/loadable.ld b/firmware/loadable/ram.ld similarity index 93% rename from firmware/loadable/loadable.ld rename to firmware/loadable/ram.ld index 2666465..db3b236 100644 --- a/firmware/loadable/loadable.ld +++ b/firmware/loadable/ram.ld @@ -1,8 +1,3 @@ -MEMORY -{ - sram(rwx): ORIGIN = 0x10001800, LENGTH = 2K -} - sram_top = ORIGIN(sram) + LENGTH(sram); ENTRY(boot_entry)