Build standalone SYS
This commit is contained in:
committed by
NIIBE Yutaka
parent
0ef687ea4c
commit
4b5f93624e
1
.gitignore
vendored
1
.gitignore
vendored
@@ -6,6 +6,7 @@ src/.dep
|
|||||||
src/config.mk
|
src/config.mk
|
||||||
src/config.h
|
src/config.h
|
||||||
src/gnuk.ld
|
src/gnuk.ld
|
||||||
|
src/stdaln-sys.ld
|
||||||
src/board.h
|
src/board.h
|
||||||
src/build/*
|
src/build/*
|
||||||
src/*.inc
|
src/*.inc
|
||||||
|
|||||||
16
src/Makefile
16
src/Makefile
@@ -53,6 +53,10 @@ ifeq ($(CHIP),stm32f103)
|
|||||||
CSRC += mcu-stm32f103.c
|
CSRC += mcu-stm32f103.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifneq ($(USE_DFU),)
|
||||||
|
OBJS_ADD += build/stdaln-sys-bin.o
|
||||||
|
endif
|
||||||
|
|
||||||
###################################
|
###################################
|
||||||
CC = $(CROSS)gcc
|
CC = $(CROSS)gcc
|
||||||
LD = $(CROSS)gcc
|
LD = $(CROSS)gcc
|
||||||
@@ -72,8 +76,18 @@ sys.c: board.h
|
|||||||
|
|
||||||
build/bignum.o: OPT = -O3 -g
|
build/bignum.o: OPT = -O3 -g
|
||||||
|
|
||||||
|
build/stdaln-sys.elf: build/sys-$(CHIP).o stdaln-sys.ld
|
||||||
|
@echo
|
||||||
|
$(LD) -v $< $(MCFLAGS) -nostartfiles -Tstdaln-sys.ld -Wl,--no-warn-mismatch,--gc-sections $(LLIBDIR) -o $@
|
||||||
|
|
||||||
|
build/stdaln-sys-bin.o: build/stdaln-sys.elf
|
||||||
|
@echo
|
||||||
|
$(OBJCOPY) -O binary -j .sys $< build/stdaln-sys.bin
|
||||||
|
$(OBJCOPY) -I binary -O default --rename-section .data=.rodata \
|
||||||
|
build/stdaln-sys.bin $@
|
||||||
|
|
||||||
distclean: clean
|
distclean: clean
|
||||||
-rm -f gnuk.ld config.h board.h config.mk \
|
-rm -f gnuk.ld stdaln-sys.ld config.h board.h config.mk \
|
||||||
usb-strings.c.inc usb-vid-pid-ver.c.inc
|
usb-strings.c.inc usb-vid-pid-ver.c.inc
|
||||||
|
|
||||||
ifeq ($(EMULATION),)
|
ifeq ($(EMULATION),)
|
||||||
|
|||||||
2
src/configure
vendored
2
src/configure
vendored
@@ -506,6 +506,8 @@ else
|
|||||||
-e "s/@FLASH_PAGE_SIZE@/$FLASH_PAGE_SIZE/" \
|
-e "s/@FLASH_PAGE_SIZE@/$FLASH_PAGE_SIZE/" \
|
||||||
< gnuk.ld.in > gnuk.ld
|
< gnuk.ld.in > gnuk.ld
|
||||||
fi
|
fi
|
||||||
|
sed -e "s/@ORIGIN_REAL@/$ORIGIN_REAL/" -e "s/@MEMORY_SIZE@/$MEMORY_SIZE/" \
|
||||||
|
< stdaln-sys.ld.in > stdaln-sys.ld
|
||||||
sed -e "s/@DEBUG_DEFINE@/$DEBUG_DEFINE/" \
|
sed -e "s/@DEBUG_DEFINE@/$DEBUG_DEFINE/" \
|
||||||
-e "s/@DFU_DEFINE@/$DFU_DEFINE/" \
|
-e "s/@DFU_DEFINE@/$DFU_DEFINE/" \
|
||||||
-e "s/@ORIGIN_DEFINE@/$ORIGIN_DEFINE/" \
|
-e "s/@ORIGIN_DEFINE@/$ORIGIN_DEFINE/" \
|
||||||
|
|||||||
39
src/stdaln-sys.ld.in
Normal file
39
src/stdaln-sys.ld.in
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
/*
|
||||||
|
* ST32F103 memory setup.
|
||||||
|
*/
|
||||||
|
MEMORY
|
||||||
|
{
|
||||||
|
flash0 : org = @ORIGIN_REAL@, len = 4k
|
||||||
|
ram : org = 0x20000000, len = @MEMORY_SIZE@k
|
||||||
|
}
|
||||||
|
|
||||||
|
__ram_start__ = ORIGIN(ram);
|
||||||
|
__ram_size__ = LENGTH(ram);
|
||||||
|
__ram_end__ = __ram_start__ + __ram_size__;
|
||||||
|
|
||||||
|
SECTIONS
|
||||||
|
{
|
||||||
|
. = 0;
|
||||||
|
|
||||||
|
.sys : ALIGN(4) SUBALIGN(4)
|
||||||
|
{
|
||||||
|
_sys = .;
|
||||||
|
KEEP(*(.vectors))
|
||||||
|
. = ALIGN(16);
|
||||||
|
KEEP(*(.sys.version))
|
||||||
|
KEEP(*(.sys.board_id))
|
||||||
|
KEEP(*(.sys.board_name))
|
||||||
|
build/sys-*.o(.text)
|
||||||
|
build/sys-*.o(.text.*)
|
||||||
|
build/sys-*.o(.rodata)
|
||||||
|
build/sys-*.o(.rodata.*)
|
||||||
|
. = ALIGN(1024);
|
||||||
|
} > flash0
|
||||||
|
|
||||||
|
.aesft : ALIGN(4) SUBALIGN(4)
|
||||||
|
{
|
||||||
|
*(.sys.0)
|
||||||
|
*(.sys.1)
|
||||||
|
*(.sys.2)
|
||||||
|
} > flash0
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user