2017-04-15 13:51:24 +02:00
|
|
|
/* linker script for application running on STM32F103x8 micro-controller
|
2020-01-10 12:02:11 +01:00
|
|
|
* the STM32F103x8 has 64 KB of flash starting at 0x0800 0000, and 20 KB of RAM starting at 0x2000 0000
|
2018-02-18 15:28:00 +01:00
|
|
|
* the STM32F103xB has 128 KB of flash starting at 0x0800 0000, and 20 KB of RAM starting at 0x2000 0000
|
2020-01-10 12:02:11 +01:00
|
|
|
* STM32F103x8 most often have if fact 128 KB, instead of the specified and advertised 64 KB, like the STM32F103xB
|
|
|
|
* you can define the desired flash size here.
|
2018-02-18 15:21:18 +01:00
|
|
|
* the USB DFU bootloader will take the first 8 KB of flash, followed by the application
|
2019-12-21 19:48:00 +01:00
|
|
|
* the first 4 bytes of the RAM is reserved for the DFU magic word (DFU! to start DFU bootloader)
|
2017-04-15 13:51:24 +02:00
|
|
|
*/
|
|
|
|
|
2020-01-10 11:02:22 +01:00
|
|
|
/* define memory regions. */
|
2017-04-15 13:51:24 +02:00
|
|
|
MEMORY
|
|
|
|
{
|
2017-08-06 09:53:46 +02:00
|
|
|
rom (rx) : ORIGIN = 0x08000000, LENGTH = 8K
|
2019-12-21 19:48:00 +01:00
|
|
|
ram (rwx) : ORIGIN = 0x20000000 + 4, LENGTH = 20K - 4
|
2017-04-15 13:51:24 +02:00
|
|
|
}
|
|
|
|
PROVIDE(__application_beginning = ORIGIN(rom) + LENGTH(rom));
|
2020-01-10 12:02:11 +01:00
|
|
|
/* if you want the firmware to use the flash size advertised by the micro-controller itself, use the following:
|
2018-04-06 19:55:52 +02:00
|
|
|
PROVIDE(__application_end = 0);
|
|
|
|
PROVIDE(__flash_end = 0);
|
2020-01-10 12:02:11 +01:00
|
|
|
if you want to enforce a flash size, because there is more flash than advertized by the micro-controller, use to following:
|
|
|
|
PROVIDE(__application_end = ORIGIN(rom) + LENGTH(rom));
|
|
|
|
PROVIDE(__flash_end = ORIGIN(rom) + LENGTH(rom));
|
2018-02-18 15:21:18 +01:00
|
|
|
*/
|
2020-01-10 11:02:22 +01:00
|
|
|
PROVIDE(__application_end = 0);
|
|
|
|
PROVIDE(__flash_end = 0);
|
|
|
|
/* RAM location reserved so application can talk to bootloader and tell to start DFU */
|
2019-12-21 19:48:00 +01:00
|
|
|
PROVIDE(__dfu_magic = ORIGIN(ram) - 4);
|
|
|
|
|
2020-01-12 15:52:27 +01:00
|
|
|
/* include rest of the definitions for the ARM Cortex-M, including STM32F1 family */
|
|
|
|
INCLUDE cortex-m-generic.ld
|