*.ld: set flash and RAM size for STM32F401xC
This commit is contained in:
parent
a4b5f95b07
commit
e58614002c
|
@ -1,28 +1,16 @@
|
||||||
/* linker script for application running on STM32F103x8 micro-controller
|
/* linker script for application running on STM32F401xC micro-controller
|
||||||
* the STM32F103x8 has 64 KB of flash starting at 0x0800 0000, and 20 KB of RAM starting at 0x2000 0000
|
* the STM32F401xC has 256 KB of flash starting at 0x0800 0000, and 64 KB of RAM starting at 0x2000 0000
|
||||||
* the STM32F103xB has 128 KB of flash starting at 0x0800 0000, and 20 KB of RAM starting at 0x2000 0000
|
* the USB DFU bootloader will use the first sector, which is 16 KB large.
|
||||||
* STM32F103x8 most often have if fact 128 KB, instead of the specified and advertised 64 KB, like the STM32F103xB
|
* this is followed by the application.
|
||||||
* you can define the desired flash size here.
|
|
||||||
* 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)
|
* the first 4 bytes of the RAM is reserved for the DFU magic word (DFU! to start DFU bootloader)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* define memory regions. */
|
/* define memory regions. */
|
||||||
MEMORY
|
MEMORY
|
||||||
{
|
{
|
||||||
rom (rx) : ORIGIN = 0x08000000 + 8K, LENGTH = 64K - 8K
|
rom (rx) : ORIGIN = 0x08000000 + 16K, LENGTH = 256K - 16K
|
||||||
ram (rwx) : ORIGIN = 0x20000000 + 4, LENGTH = 20K - 4
|
ram (rwx) : ORIGIN = 0x20000000 + 4, LENGTH = 64K - 4
|
||||||
}
|
}
|
||||||
PROVIDE(__application_beginning = ORIGIN(rom));
|
|
||||||
/* if you want the firmware to use the flash size advertised by the micro-controller itself, use the following:
|
|
||||||
PROVIDE(__application_end = 0);
|
|
||||||
PROVIDE(__flash_end = 0);
|
|
||||||
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));
|
|
||||||
*/
|
|
||||||
PROVIDE(__application_end = 0);
|
|
||||||
PROVIDE(__flash_end = 0);
|
|
||||||
/* RAM location reserved so application can talk to bootloader and tell to start DFU */
|
/* RAM location reserved so application can talk to bootloader and tell to start DFU */
|
||||||
PROVIDE(__dfu_magic = ORIGIN(ram) - 4);
|
PROVIDE(__dfu_magic = ORIGIN(ram) - 4);
|
||||||
|
|
||||||
|
|
|
@ -1,28 +1,18 @@
|
||||||
/* linker script for application running on STM32F103x8 micro-controller
|
/* linker script for application running on STM32F401xC micro-controller
|
||||||
* the STM32F103x8 has 64 KB of flash starting at 0x0800 0000, and 20 KB of RAM starting at 0x2000 0000
|
* the STM32F401xC has 256 KB of flash starting at 0x0800 0000, and 64 KB of RAM starting at 0x2000 0000
|
||||||
* the STM32F103xB has 128 KB of flash starting at 0x0800 0000, and 20 KB of RAM starting at 0x2000 0000
|
* the USB DFU bootloader will use the first sector, which is 16 KB large.
|
||||||
* STM32F103x8 most often have if fact 128 KB, instead of the specified and advertised 64 KB, like the STM32F103xB
|
* this is followed by the application.
|
||||||
* you can define the desired flash size here.
|
|
||||||
* 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)
|
* the first 4 bytes of the RAM is reserved for the DFU magic word (DFU! to start DFU bootloader)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* define memory regions. */
|
/* define memory regions. */
|
||||||
MEMORY
|
MEMORY
|
||||||
{
|
{
|
||||||
rom (rx) : ORIGIN = 0x08000000, LENGTH = 8K
|
rom (rx) : ORIGIN = 0x08000000, LENGTH = 16K
|
||||||
ram (rwx) : ORIGIN = 0x20000000 + 4, LENGTH = 20K - 4
|
ram (rwx) : ORIGIN = 0x20000000 + 4, LENGTH = 64K - 4
|
||||||
}
|
}
|
||||||
|
/* where the main application starts */
|
||||||
PROVIDE(__application_beginning = ORIGIN(rom) + LENGTH(rom));
|
PROVIDE(__application_beginning = ORIGIN(rom) + LENGTH(rom));
|
||||||
/* if you want the firmware to use the flash size advertised by the micro-controller itself, use the following:
|
|
||||||
PROVIDE(__application_end = 0);
|
|
||||||
PROVIDE(__flash_end = 0);
|
|
||||||
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));
|
|
||||||
*/
|
|
||||||
PROVIDE(__application_end = 0);
|
|
||||||
PROVIDE(__flash_end = 0);
|
|
||||||
/* RAM location reserved so application can talk to bootloader and tell to start DFU */
|
/* RAM location reserved so application can talk to bootloader and tell to start DFU */
|
||||||
PROVIDE(__dfu_magic = ORIGIN(ram) - 4);
|
PROVIDE(__dfu_magic = ORIGIN(ram) - 4);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue