[app][mdebug] makefile.fw and linkscript to regenerate fw

The original tooling is lost to the mists of time and long-discarded
workstations, but this generates identical results and will enable
updating the code on the m0 sub-processor going forward.  Yay.
This commit is contained in:
Brian Swetland
2021-01-30 02:51:41 -08:00
parent 98cf1e5067
commit 16ba667296
2 changed files with 58 additions and 0 deletions

32
app/mdebug/fw-m0sub.ld Normal file
View File

@@ -0,0 +1,32 @@
/* RAM only binary layout */
SECTIONS {
.text : {
. = ALIGN(4);
KEEP (*(.vectors))
*(.text)
*(.text.*)
*(.rodata)
*(.rodata.*)
. = ALIGN(4);
__data_init__ = . ;
} /* >RAM */
.data : {
. = ALIGN(4);
__data_start__ = . ;
*(.data)
*(.data.*)
. = ALIGN(4);
__data_end__ = . ;
} /* >RAM */
.bss : {
. = ALIGN(4);
__bss_start__ = . ;
*(.bss)
*(.bss.*)
*(COMMON)
. = ALIGN(4);
__bss_end__ = . ;
} /*>RAM */
}

26
app/mdebug/makefile.fw Normal file
View File

@@ -0,0 +1,26 @@
TOOLCHAIN := /toolchain/arm-eabi-10.2.0/bin/arm-eabi-
OBJCOPY := $(TOOLCHAIN)objcopy
OBJDUMP := $(TOOLCHAIN)objdump
CC := $(TOOLCHAIN)gcc
CFLAGS := -mcpu=cortex-m0 -mthumb
CFLAGS += -fno-builtin -nostdlib
LFLAGS := -Wl,--script=fw-m0sub.ld -Wl,-Ttext=0x18000000
all: zero.bin zero.lst fw-m0sub.h
zero.elf: fw-m0sub.S
$(CC) $(CFLAGS) $(LFLAGS) -o $@ $<
zero.lst: zero.elf
$(OBJDUMP) -D $< > $@
zero.bin: zero.elf
$(OBJCOPY) -O binary $< $@
fw-m0sub.h: zero.bin
xxd -i $< > $@
clean:
rm -f zero.bin zero.lst zero.elf