off ttopic remider STM Cube MS FLASH & RAM

Post Reply
comarius
Posts: 16
Joined: Thu Nov 07, 2019 3:32 am

off ttopic remider STM Cube MS FLASH & RAM

Post by comarius » Wed Jan 08, 2020 3:05 am

  • Section at the end or RAM
LINKER FILE

Code: Select all

AUXLEN = 2K;
/* Specify the memory areas */
MEMORY
{
RAM   (xrw)     : ORIGIN  = 0x20000000,  LENGTH = 160K-AUXLEN    /* was 160  now is - 4K mco-mco*/
FLASH (rx)      : ORIGIN  = 0x8000000,   LENGTH = 512K
AUX   (xrw)     : ORIGIN = ORIGIN(RAM) + LENGTH(RAM) LENGTH = AUXLEN    /* mco-mco use 2 K */
}

.but_ram : {
	KEEP(*(.but_ram))
} > AUX
	
C FILE

Code: Select all

uint8_t ram_end[2048] __attribute__((section (".but_ram"))) ;
static void* __attribute__((optimize("O0"))) _ram_storage(void)
{
	void* ptr = (void*)ram_end;
	return ptr;
}
FLASH PROGRAM ADDRESS

LINKER FILE

Code: Select all

APPSTART_OFF = 16K;

MEMORY
{
RAM   (xrw)     : ORIGIN  = 0x20000000,  LENGTH = 160K
FLASH (rx)      : ORIGIN  = 0x8000000+APPSTART_OFF,   LENGTH = 512K - APPSTART_OFF
}


system_stm32***.c (aka system_stm32l4xx.c) file

Code: Select all


/*!< Uncomment the following line if you need to relocate your vector Table in
     Internal SRAM. */
/* #define VECT_TAB_SRAM */
#define VECT_TAB_OFFSET  16384 //  mco-mco was  0x00 /*!< Vector Table base offset field. = APPSTART_OFF
                               //    This value must be a multiple of 0x200. */

[code]

Post Reply