stm32f1/application.ld

29 lines
1.3 KiB
Plaintext

/* linker script for application running on STM32F103x8 micro-controller
* the STM32F103xC has 256 KB of flash starting at 0x0800 0000, and 48 KB of SRAM starting at 0x2000 0000 (exception for STM32F103RC in WLCSP64 package: 64 KB of SRAM)
* the USB DFU bootloader will take the first 8 KB of flash, followed by the application
* the first 4 bytes of the RAM is reserved for the DFU magic word (DFU! to start DFU bootloader)
*/
/* define memory regions. */
MEMORY
{
rom (rx) : ORIGIN = 0x08000000 + 8K, LENGTH = 256K - 8K
ram (rwx) : ORIGIN = 0x20000000 + 4, LENGTH = 48K - 4
}
PROVIDE(__application_beginning = ORIGIN(rom));
/* only provide application_end and/or flash_end if you want to force a flash size
i.e. STM32F103xC most often have if fact 512 KB instead of the specified and advertised 256 KB
PROVIDE(__application_end = __application_beginning + 512K - 8K);
PROVIDE(__flash_end = __application_beginning + 512K - 8K);
else
PROVIDE(__application_end = 0);
PROVIDE(__flash_end = 0);
*/
PROVIDE(__application_end = 0);
PROVIDE(__flash_end = 0);
/* RAM location reserved so application can talk to bootloader and tell to start DFU */
PROVIDE(__dfu_magic = ORIGIN(ram) - 4);
/* include rest of the definitions for the ARM Cortex-M, including STM32F1 family */
INCLUDE cortex-m-generic.ld