st: Use submodules for system files when possible, use more up to date

files otherwise. Update STM32F4-DISCOVERY demo and board.mk to reflect
changes.
This commit is contained in:
William D. Jones
2019-03-04 10:41:05 -05:00
parent c95ad426c6
commit 49aa6ec251
178 changed files with 34936 additions and 383869 deletions
+15 -13
View File
@@ -35,15 +35,15 @@ ENTRY(Reset_Handler)
/* Highest address of the user mode stack */
_estack = 0x20020000; /* end of RAM */
/* Generate a link error if heap and stack don't fit into RAM */
_Min_Heap_Size = 0x200;; /* required amount of heap */
_Min_Stack_Size = 0x400;; /* required amount of stack */
_Min_Heap_Size = 0x1000; /* required amount of heap */
_Min_Stack_Size = 0x4000; /* required amount of stack */
/* Specify the memory areas */
MEMORY
{
FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 1024K
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
CCMRAM (rw) : ORIGIN = 0x10000000, LENGTH = 64K
FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 1024K
}
/* Define output sections */
@@ -115,7 +115,7 @@ SECTIONS
_sidata = LOADADDR(.data);
/* Initialized data sections goes into RAM, load LMA copy after code */
.data :
.data :
{
. = ALIGN(4);
_sdata = .; /* create a global symbol at data start */
@@ -128,11 +128,11 @@ SECTIONS
_siccmram = LOADADDR(.ccmram);
/* CCM-RAM section
*
* IMPORTANT NOTE!
/* CCM-RAM section
*
* IMPORTANT NOTE!
* If initialized variables will be placed in this section,
* the startup code needs to be modified to copy the init-values.
* the startup code needs to be modified to copy the init-values.
*/
.ccmram :
{
@@ -140,12 +140,12 @@ SECTIONS
_sccmram = .; /* create a global symbol at ccmram start */
*(.ccmram)
*(.ccmram*)
. = ALIGN(4);
_eccmram = .; /* create a global symbol at ccmram end */
} >CCMRAM AT> FLASH
/* Uninitialized data section */
. = ALIGN(4);
.bss :
@@ -165,15 +165,15 @@ SECTIONS
/* User_heap_stack section, used to check that there is enough RAM left */
._user_heap_stack :
{
. = ALIGN(4);
. = ALIGN(8);
PROVIDE ( end = . );
PROVIDE ( _end = . );
. = . + _Min_Heap_Size;
. = . + _Min_Stack_Size;
. = ALIGN(4);
. = ALIGN(8);
} >RAM
/* Remove information from the standard libraries */
/DISCARD/ :
@@ -185,3 +185,5 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
}
+4 -4
View File
@@ -14,14 +14,14 @@ LD_FILE = hw/bsp/stm32f407g_disc1/STM32F407VGTx_FLASH.ld
LDFLAGS += -mthumb -mcpu=cortex-m4
SRC_C += \
hw/mcu/st/stm32f4/Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c
hw/mcu/st/system-init/system_stm32f4xx.c
SRC_S += \
hw/mcu/st/stm32f4/Device/ST/STM32F4xx/Source/Templates/gcc/startup_stm32f407xx.s
hw/mcu/st/startup/stm32f4/startup_stm32f407xx.s
INC += \
-I$(TOP)/hw/mcu/st/stm32f4/Device/ST/STM32F4xx/Include \
-I$(TOP)/hw/mcu/st/stm32f4/Include
-I$(TOP)/hw/mcu/st/stm32lib/CMSIS/STM32F4xx/Include \
-I$(TOP)/hw/mcu/st/cmsis
VENDOR = st
CHIP_FAMILY = stm32f4
@@ -131,3 +131,10 @@ void HardFault_Handler (void)
{
asm("bkpt");
}
// Required by __libc_init_array in startup code if we are compiling using
// -nostdlib/-nostartfiles.
void _init(void)
{
}