mirror of https://github.com/ARMmbed/mbed-os.git
STM32F756 / STM32F746 alignment
parent
1a8844e8ed
commit
5ae13f9c7b
|
@ -51,7 +51,7 @@
|
|||
#define MBED_RAM0_START (MBED_CRASH_REPORT_RAM_START + MBED_CRASH_REPORT_RAM_SIZE)
|
||||
#define MBED_RAM0_SIZE (MBED_RAM_SIZE - MBED_VECTTABLE_RAM_SIZE - MBED_CRASH_REPORT_RAM_SIZE)
|
||||
|
||||
; STM32F746NG: 1024 KB FLASH (0x100000) + 320 KB SRAM (0x50000)
|
||||
; STM32F746xG: 1024 KB FLASH (0x100000) + 320 KB SRAM (0x50000)
|
||||
LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
|
||||
|
||||
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
|
||||
|
@ -59,7 +59,7 @@ LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
|
|||
*(InRoot$$Sections)
|
||||
.ANY (+RO)
|
||||
}
|
||||
|
||||
|
||||
RW_m_crash_data MBED_CRASH_REPORT_RAM_START EMPTY MBED_CRASH_REPORT_RAM_SIZE { ; RW data
|
||||
}
|
||||
|
||||
|
|
|
@ -93,7 +93,7 @@ SECTIONS
|
|||
|
||||
__etext = .;
|
||||
_sidata = .;
|
||||
|
||||
|
||||
.crash_data_ram :
|
||||
{
|
||||
. = ALIGN(8);
|
||||
|
@ -104,7 +104,7 @@ SECTIONS
|
|||
. += M_CRASH_DATA_RAM_SIZE;
|
||||
. = ALIGN(8);
|
||||
__CRASH_DATA_RAM_END__ = .; /* Define a global symbol at data end */
|
||||
} > RAM
|
||||
} > RAM
|
||||
|
||||
.data : AT (__etext)
|
||||
{
|
||||
|
|
|
@ -235,12 +235,12 @@ g_pfnVectors:
|
|||
.word UART7_IRQHandler /* UART7 */
|
||||
.word UART8_IRQHandler /* UART8 */
|
||||
.word SPI4_IRQHandler /* SPI4 */
|
||||
.word SPI5_IRQHandler /* SPI5 */
|
||||
.word SPI6_IRQHandler /* SPI6 */
|
||||
.word SAI1_IRQHandler /* SAI1 */
|
||||
.word LTDC_IRQHandler /* LTDC */
|
||||
.word LTDC_ER_IRQHandler /* LTDC error */
|
||||
.word DMA2D_IRQHandler /* DMA2D */
|
||||
.word SPI5_IRQHandler /* SPI5 */
|
||||
.word SPI6_IRQHandler /* SPI6 */
|
||||
.word SAI1_IRQHandler /* SAI1 */
|
||||
.word LTDC_IRQHandler /* LTDC */
|
||||
.word LTDC_ER_IRQHandler /* LTDC error */
|
||||
.word DMA2D_IRQHandler /* DMA2D */
|
||||
.word SAI2_IRQHandler /* SAI2 */
|
||||
.word QUADSPI_IRQHandler /* QUADSPI */
|
||||
.word LPTIM1_IRQHandler /* LPTIM1 */
|
||||
|
@ -577,5 +577,5 @@ g_pfnVectors:
|
|||
.weak SPDIF_RX_IRQHandler
|
||||
.thumb_set SPDIF_RX_IRQHandler,Default_Handler
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
// CORE: 16 vectors = 64 bytes from 0x00 to 0x3F
|
||||
// MCU Peripherals: 98 vectors = 392 bytes from 0x40 to 0x1C7
|
||||
// Total: 114 vectors = 456 bytes (0x1C8) to be reserved in RAM
|
||||
#define NVIC_NUM_VECTORS 114
|
||||
#define NVIC_NUM_VECTORS 114
|
||||
#define NVIC_RAM_VECTOR_ADDRESS 0x20000000 // Vectors positioned at start of RAM
|
||||
|
||||
#endif
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
**/
|
||||
|
||||
#include "stm32f7xx.h"
|
||||
#include "nvic_addr.h"
|
||||
#include "mbed_error.h"
|
||||
|
||||
/*!< Uncomment the following line if you need to relocate your vector Table in
|
||||
|
@ -92,7 +93,7 @@ void SystemInit(void)
|
|||
#ifdef VECT_TAB_SRAM
|
||||
SCB->VTOR = RAMDTCM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */
|
||||
#else
|
||||
SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */
|
||||
SCB->VTOR = NVIC_FLASH_VECTOR_ADDRESS; /* Vector Table Relocation in Internal FLASH */
|
||||
#endif
|
||||
|
||||
}
|
||||
|
@ -208,14 +209,14 @@ uint8_t SetSysClock_PLL_HSI(void)
|
|||
__PWR_CLK_ENABLE();
|
||||
|
||||
// Enable HSI oscillator and activate PLL with HSI as source
|
||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI | RCC_OSCILLATORTYPE_HSE;
|
||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
|
||||
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
|
||||
RCC_OscInitStruct.HSEState = RCC_HSE_OFF;
|
||||
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
|
||||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
|
||||
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
|
||||
RCC_OscInitStruct.PLL.PLLM = 8; // VCO input clock = 1 MHz (16 MHz / 16)
|
||||
RCC_OscInitStruct.PLL.PLLN = 216; // VCO output clock = 432 MHz (1 MHz * 432)
|
||||
RCC_OscInitStruct.PLL.PLLM = 8; // VCO input clock = 2 MHz (16 MHz / 8)
|
||||
RCC_OscInitStruct.PLL.PLLN = 216; // VCO output clock = 432 MHz (2 MHz * 216)
|
||||
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; // PLLCLK = 216 MHz (432 MHz / 2)
|
||||
RCC_OscInitStruct.PLL.PLLQ = 9;
|
||||
|
||||
|
|
|
@ -28,27 +28,47 @@
|
|||
; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
#if !defined(MBED_APP_START)
|
||||
#define MBED_APP_START 0x08000000
|
||||
#endif
|
||||
|
||||
#if !defined(MBED_APP_SIZE)
|
||||
#define MBED_APP_SIZE 0x100000
|
||||
#endif
|
||||
|
||||
#if !defined(MBED_BOOT_STACK_SIZE)
|
||||
#define MBED_BOOT_STACK_SIZE 0x400
|
||||
#endif
|
||||
|
||||
#define Stack_Size MBED_BOOT_STACK_SIZE
|
||||
|
||||
; STM32F756ZG: 1024 KB FLASH (0x100000) + 320 KB SRAM (0x50000)
|
||||
LR_IROM1 0x08000000 0x100000 { ; load region size_region
|
||||
#define MBED_RAM_START 0x20000000
|
||||
#define MBED_RAM_SIZE 0x50000
|
||||
#define MBED_VECTTABLE_RAM_START (MBED_RAM_START)
|
||||
#define MBED_VECTTABLE_RAM_SIZE 0x1C8
|
||||
#define MBED_CRASH_REPORT_RAM_START (MBED_VECTTABLE_RAM_START + MBED_VECTTABLE_RAM_SIZE)
|
||||
#define MBED_CRASH_REPORT_RAM_SIZE 0x100
|
||||
#define MBED_RAM0_START (MBED_CRASH_REPORT_RAM_START + MBED_CRASH_REPORT_RAM_SIZE)
|
||||
#define MBED_RAM0_SIZE (MBED_RAM_SIZE - MBED_VECTTABLE_RAM_SIZE - MBED_CRASH_REPORT_RAM_SIZE)
|
||||
|
||||
ER_IROM1 0x08000000 0x100000 { ; load address = execution address
|
||||
; STM32F746xG: 1024 KB FLASH (0x100000) + 320 KB SRAM (0x50000)
|
||||
LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
|
||||
|
||||
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
|
||||
*.o (RESET, +First)
|
||||
*(InRoot$$Sections)
|
||||
.ANY (+RO)
|
||||
}
|
||||
|
||||
RW_m_crash_data MBED_CRASH_REPORT_RAM_START EMPTY MBED_CRASH_REPORT_RAM_SIZE { ; RW data
|
||||
}
|
||||
|
||||
; Total: 114 vectors = 456 bytes (0x1C8) to be reserved in RAM
|
||||
RW_IRAM1 (0x20000000+0x1C8) (0x50000-0x1C8-Stack_Size) { ; RW data
|
||||
RW_IRAM1 (MBED_RAM0_START) (MBED_RAM0_SIZE-Stack_Size) { ; RW data
|
||||
.ANY (+RW +ZI)
|
||||
}
|
||||
|
||||
ARM_LIB_STACK (0x20000000+0x50000) EMPTY -Stack_Size { ; stack
|
||||
ARM_LIB_STACK (MBED_RAM0_START+MBED_RAM0_SIZE) EMPTY -Stack_Size { ; stack
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -6,9 +6,19 @@
|
|||
|
||||
STACK_SIZE = MBED_BOOT_STACK_SIZE;
|
||||
|
||||
#if !defined(MBED_APP_START)
|
||||
#define MBED_APP_START 0x08000000
|
||||
#endif
|
||||
|
||||
#if !defined(MBED_APP_SIZE)
|
||||
#define MBED_APP_SIZE 1024K
|
||||
#endif
|
||||
|
||||
M_CRASH_DATA_RAM_SIZE = 0x100;
|
||||
|
||||
MEMORY
|
||||
{
|
||||
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K
|
||||
FLASH (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
|
||||
RAM (rwx) : ORIGIN = 0x200001C8, LENGTH = 320K - 0x1C8
|
||||
}
|
||||
|
||||
|
@ -84,6 +94,18 @@ SECTIONS
|
|||
__etext = .;
|
||||
_sidata = .;
|
||||
|
||||
.crash_data_ram :
|
||||
{
|
||||
. = ALIGN(8);
|
||||
__CRASH_DATA_RAM__ = .;
|
||||
__CRASH_DATA_RAM_START__ = .; /* Create a global symbol at data start */
|
||||
KEEP(*(.keep.crash_data_ram))
|
||||
*(.m_crash_data_ram) /* This is a user defined section */
|
||||
. += M_CRASH_DATA_RAM_SIZE;
|
||||
. = ALIGN(8);
|
||||
__CRASH_DATA_RAM_END__ = .; /* Define a global symbol at data end */
|
||||
} > RAM
|
||||
|
||||
.data : AT (__etext)
|
||||
{
|
||||
__data_start__ = .;
|
||||
|
|
|
@ -1,12 +1,17 @@
|
|||
if (!isdefinedsymbol(MBED_APP_START)) { define symbol MBED_APP_START = 0x08000000; }
|
||||
if (!isdefinedsymbol(MBED_APP_SIZE)) { define symbol MBED_APP_SIZE = 0x100000; }
|
||||
|
||||
/* [ROM = 1024kb = 0x100000] */
|
||||
define symbol __intvec_start__ = 0x08000000;
|
||||
define symbol __region_ROM_start__ = 0x08000000;
|
||||
define symbol __region_ROM_end__ = 0x080FFFFF;
|
||||
define symbol __intvec_start__ = MBED_APP_START;
|
||||
define symbol __region_ROM_start__ = MBED_APP_START;
|
||||
define symbol __region_ROM_end__ = MBED_APP_START + MBED_APP_SIZE - 1;
|
||||
|
||||
/* [RAM = 320kb = 0x50000] Vector table dynamic copy: 114 vectors = 456 bytes (0x1C8) to be reserved in RAM */
|
||||
define symbol __NVIC_start__ = 0x20000000;
|
||||
define symbol __NVIC_end__ = 0x200001C7; /* Aligned on 8 bytes */
|
||||
define symbol __region_RAM_start__ = 0x200001C8;
|
||||
define symbol __region_CRASH_DATA_RAM_start__ = 0x200001C8;
|
||||
define symbol __region_CRASH_DATA_RAM_end__ = 0x200002C7;
|
||||
define symbol __region_RAM_start__ = 0x200002C8;
|
||||
define symbol __region_RAM_end__ = 0x2004FFFF;
|
||||
|
||||
define symbol __region_ITCMRAM_start__ = 0x00000000;
|
||||
|
@ -16,14 +21,19 @@ define symbol __region_ITCMRAM_end__ = 0x00003FFF;
|
|||
define memory mem with size = 4G;
|
||||
define region ROM_region = mem:[from __region_ROM_start__ to __region_ROM_end__];
|
||||
define region RAM_region = mem:[from __region_RAM_start__ to __region_RAM_end__];
|
||||
define region CRASH_DATA_RAM_region = mem:[from __region_CRASH_DATA_RAM_start__ to __region_CRASH_DATA_RAM_end__];
|
||||
define region ITCMRAM_region = mem:[from __region_ITCMRAM_start__ to __region_ITCMRAM_end__];
|
||||
|
||||
/* Define Crash Data Symbols */
|
||||
define exported symbol __CRASH_DATA_RAM_START__ = __region_CRASH_DATA_RAM_start__;
|
||||
define exported symbol __CRASH_DATA_RAM_END__ = __region_CRASH_DATA_RAM_end__;
|
||||
|
||||
/* Stack and Heap */
|
||||
if (!isdefinedsymbol(MBED_BOOT_STACK_SIZE)) {
|
||||
define symbol MBED_BOOT_STACK_SIZE = 0x400;
|
||||
}
|
||||
define symbol __size_cstack__ = MBED_BOOT_STACK_SIZE;
|
||||
define symbol __size_heap__ = 0x10000;
|
||||
define symbol __size_heap__ = 0x13000;
|
||||
define block CSTACK with alignment = 8, size = __size_cstack__ { };
|
||||
define block HEAP with alignment = 8, size = __size_heap__ { };
|
||||
define block STACKHEAP with fixed order { block HEAP, block CSTACK };
|
||||
|
|
|
@ -58,6 +58,16 @@ struct trng_s {
|
|||
RNG_HandleTypeDef handle;
|
||||
};
|
||||
|
||||
struct qspi_s {
|
||||
QSPI_HandleTypeDef handle;
|
||||
PinName io0;
|
||||
PinName io1;
|
||||
PinName io2;
|
||||
PinName io3;
|
||||
PinName sclk;
|
||||
PinName ssel;
|
||||
};
|
||||
|
||||
#include "common_objects.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
Loading…
Reference in New Issue