mirror of https://github.com/rusefi/wideband.git
app linker settings for bl
This commit is contained in:
parent
d7c1e3b350
commit
a318bedcfe
|
@ -20,12 +20,12 @@ endif
|
||||||
|
|
||||||
# Enable this if you want the linker to remove unused code and data.
|
# Enable this if you want the linker to remove unused code and data.
|
||||||
ifeq ($(USE_LINK_GC),)
|
ifeq ($(USE_LINK_GC),)
|
||||||
USE_LINK_GC = yes
|
USE_LINK_GC = no
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Linker extra options here.
|
# Linker extra options here.
|
||||||
ifeq ($(USE_LDOPT),)
|
ifeq ($(USE_LDOPT),)
|
||||||
USE_LDOPT =
|
USE_LDOPT =
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Enable this if you want link time optimizations (LTO).
|
# Enable this if you want link time optimizations (LTO).
|
||||||
|
@ -111,7 +111,7 @@ include $(CHIBIOS)/tools/mk/autobuild.mk
|
||||||
include $(CHIBIOS)/os/hal/lib/streams/streams.mk
|
include $(CHIBIOS)/os/hal/lib/streams/streams.mk
|
||||||
|
|
||||||
# Define linker script file here
|
# Define linker script file here
|
||||||
LDSCRIPT= $(CONFDIR)/STM32F042x6.ld
|
LDSCRIPT= $(CONFDIR)/app.ld
|
||||||
|
|
||||||
# C sources that can be compiled in ARM or THUMB mode depending on the global
|
# C sources that can be compiled in ARM or THUMB mode depending on the global
|
||||||
# setting.
|
# setting.
|
||||||
|
@ -169,7 +169,7 @@ UINCDIR =
|
||||||
ULIBDIR =
|
ULIBDIR =
|
||||||
|
|
||||||
# List all user libraries here
|
# List all user libraries here
|
||||||
ULIBS =
|
ULIBS = bootloader/build/wideband_bootloader.o
|
||||||
|
|
||||||
#
|
#
|
||||||
# End of user section
|
# End of user section
|
||||||
|
|
|
@ -14,13 +14,15 @@
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*INCLUDE wideband_layout.ld*/
|
||||||
* STM32F042x6 memory setup.
|
|
||||||
*/
|
|
||||||
|
blsize = 8k;
|
||||||
|
|
||||||
MEMORY
|
MEMORY
|
||||||
{
|
{
|
||||||
/* bootloader (rx) : org = 0x08000000, len = 8k */
|
blflash (rx) : org = 0x08000000, len = blsize
|
||||||
flash0 (rx) : org = 0x08000000, len = 24k
|
appflash (rx) : org = 0x08000000 + blsize, len = 32k - blsize
|
||||||
flash1 (rx) : org = 0x00000000, len = 0
|
flash1 (rx) : org = 0x00000000, len = 0
|
||||||
flash2 (rx) : org = 0x00000000, len = 0
|
flash2 (rx) : org = 0x00000000, len = 0
|
||||||
flash3 (rx) : org = 0x00000000, len = 0
|
flash3 (rx) : org = 0x00000000, len = 0
|
||||||
|
@ -28,7 +30,8 @@ MEMORY
|
||||||
flash5 (rx) : org = 0x00000000, len = 0
|
flash5 (rx) : org = 0x00000000, len = 0
|
||||||
flash6 (rx) : org = 0x00000000, len = 0
|
flash6 (rx) : org = 0x00000000, len = 0
|
||||||
flash7 (rx) : org = 0x00000000, len = 0
|
flash7 (rx) : org = 0x00000000, len = 0
|
||||||
ram0 (wx) : org = 0x20000000, len = 6k
|
ram_vectors (wx) : org = 0x20000000, len = 256
|
||||||
|
ram0 (wx) : org = 0x20000200, len = 6k - 256
|
||||||
ram1 (wx) : org = 0x00000000, len = 0
|
ram1 (wx) : org = 0x00000000, len = 0
|
||||||
ram2 (wx) : org = 0x00000000, len = 0
|
ram2 (wx) : org = 0x00000000, len = 0
|
||||||
ram3 (wx) : org = 0x00000000, len = 0
|
ram3 (wx) : org = 0x00000000, len = 0
|
||||||
|
@ -38,6 +41,13 @@ MEMORY
|
||||||
ram7 (wx) : org = 0x00000000, len = 0
|
ram7 (wx) : org = 0x00000000, len = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
__appflash_start__ = ORIGIN(appflash);
|
||||||
|
__ram_vectors_start__ = ORIGIN(ram_vectors);
|
||||||
|
__ram_vectors_size__ = LENGTH(ram_vectors);
|
||||||
|
|
||||||
|
|
||||||
|
REGION_ALIAS("flash0", appflash);
|
||||||
|
|
||||||
/* For each data/text section two region are defined, a virtual region
|
/* For each data/text section two region are defined, a virtual region
|
||||||
and a load region (_LMA suffix).*/
|
and a load region (_LMA suffix).*/
|
||||||
|
|
||||||
|
@ -82,5 +92,17 @@ REGION_ALIAS("BSS_RAM", ram0);
|
||||||
/* RAM region to be used for the default heap.*/
|
/* RAM region to be used for the default heap.*/
|
||||||
REGION_ALIAS("HEAP_RAM", ram0);
|
REGION_ALIAS("HEAP_RAM", ram0);
|
||||||
|
|
||||||
|
/* Bootloader section */
|
||||||
|
SECTIONS
|
||||||
|
{
|
||||||
|
.bl : ALIGN(4)
|
||||||
|
{
|
||||||
|
. = ALIGN(4);
|
||||||
|
*(.bl)
|
||||||
|
*(.bl.*)
|
||||||
|
. = ALIGN(4);
|
||||||
|
} > blflash AT > blflash
|
||||||
|
}
|
||||||
|
|
||||||
/* Generic rules inclusion.*/
|
/* Generic rules inclusion.*/
|
||||||
INCLUDE rules.ld
|
INCLUDE rules.ld
|
|
@ -0,0 +1,31 @@
|
||||||
|
/*
|
||||||
|
* STM32F042x6 memory setup.
|
||||||
|
*/
|
||||||
|
|
||||||
|
blsize = 8k;
|
||||||
|
|
||||||
|
MEMORY
|
||||||
|
{
|
||||||
|
blflash (rx) : org = 0x08000000, len = blsize
|
||||||
|
appflash (rx) : org = 0x08000000 + blsize, len = 32k - blsize
|
||||||
|
flash1 (rx) : org = 0x00000000, len = 0
|
||||||
|
flash2 (rx) : org = 0x00000000, len = 0
|
||||||
|
flash3 (rx) : org = 0x00000000, len = 0
|
||||||
|
flash4 (rx) : org = 0x00000000, len = 0
|
||||||
|
flash5 (rx) : org = 0x00000000, len = 0
|
||||||
|
flash6 (rx) : org = 0x00000000, len = 0
|
||||||
|
flash7 (rx) : org = 0x00000000, len = 0
|
||||||
|
ram_vectors (wx) : org = 0x20000000, len = 256
|
||||||
|
ram0 (wx) : org = 0x20000200, len = 6k - 256
|
||||||
|
ram1 (wx) : org = 0x00000000, len = 0
|
||||||
|
ram2 (wx) : org = 0x00000000, len = 0
|
||||||
|
ram3 (wx) : org = 0x00000000, len = 0
|
||||||
|
ram4 (wx) : org = 0x00000000, len = 0
|
||||||
|
ram5 (wx) : org = 0x00000000, len = 0
|
||||||
|
ram6 (wx) : org = 0x00000000, len = 0
|
||||||
|
ram7 (wx) : org = 0x00000000, len = 0
|
||||||
|
}
|
||||||
|
|
||||||
|
__appflash_start__ = ORIGIN(appflash);
|
||||||
|
__ram_vectors_start__ = ORIGIN(ram_vectors);
|
||||||
|
__ram_vectors_size__ = LENGTH(ram_vectors);
|
Loading…
Reference in New Issue